Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Mark Harris
Opus
Commits
ecd214d5
Commit
ecd214d5
authored
Mar 08, 2008
by
Jean-Marc Valin
Browse files
fixed-point: stereo_mix() converted.
parent
3dbc1d0d
Changes
1
Hide whitespace changes
Inline
Side-by-side
libcelt/bands.c
View file @
ecd214d5
...
...
@@ -416,19 +416,24 @@ void stereo_mix(const CELTMode *m, celt_norm_t *X, const celt_ener_t *bank, int
for
(
i
=
0
;
i
<
m
->
nbEBands
;
i
++
)
{
int
j
;
celt_
ener
_t
left
,
right
;
celt_
word16
_t
left
,
right
;
celt_word16_t
a1
,
a2
;
left
=
bank
[
i
*
C
];
right
=
bank
[
i
*
C
+
1
];
a1
=
Q15ONE
*
1
.
f
*
left
/
sqrt
(.
01
+
left
*
1
.
f
*
left
+
right
*
1
.
f
*
right
);
a2
=
Q15ONE
*
1
.
f
*
dir
*
right
/
sqrt
(.
01
+
left
*
1
.
f
*
left
+
right
*
1
.
f
*
right
);
celt_word16_t
norm
;
#ifdef FIXED_POINT
int
shift
=
celt_ilog2
(
MAX32
(
bank
[
i
*
C
],
bank
[
i
*
C
+
1
]))
-
13
;
#endif
left
=
VSHR32
(
bank
[
i
*
C
],
shift
);
right
=
VSHR32
(
bank
[
i
*
C
+
1
],
shift
);
norm
=
EPSILON
+
celt_sqrt
(
EPSILON
+
MULT16_16
(
left
,
left
)
+
MULT16_16
(
right
,
right
));
a1
=
DIV32_16
(
SHL32
(
EXTEND32
(
left
),
14
),
norm
);
a2
=
dir
*
DIV32_16
(
SHL32
(
EXTEND32
(
right
),
14
),
norm
);
for
(
j
=
B
*
eBands
[
i
];
j
<
B
*
eBands
[
i
+
1
];
j
++
)
{
celt_norm_t
r
,
l
;
l
=
X
[
j
*
C
];
r
=
X
[
j
*
C
+
1
];
X
[
j
*
C
]
=
MULT16_16_Q1
5
(
a1
,
l
)
+
MULT16_16_Q1
5
(
a2
,
r
);
X
[
j
*
C
+
1
]
=
MULT16_16_Q1
5
(
a1
,
r
)
-
MULT16_16_Q1
5
(
a2
,
l
);
X
[
j
*
C
]
=
MULT16_16_Q1
4
(
a1
,
l
)
+
MULT16_16_Q1
4
(
a2
,
r
);
X
[
j
*
C
+
1
]
=
MULT16_16_Q1
4
(
a1
,
r
)
-
MULT16_16_Q1
4
(
a2
,
l
);
}
}
for
(
i
=
B
*
C
*
eBands
[
m
->
nbEBands
];
i
<
B
*
C
*
eBands
[
m
->
nbEBands
+
1
];
i
++
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment