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
185cabfa
Commit
185cabfa
authored
Oct 04, 2009
by
Jean-Marc Valin
Browse files
stereo allocator tuning
parent
39f68ac9
Changes
1
Hide whitespace changes
Inline
Side-by-side
libcelt/rate.c
View file @
185cabfa
...
@@ -145,10 +145,14 @@ static void interp_bits2pulses(const CELTMode *m, int *bits1, int *bits2, int to
...
@@ -145,10 +145,14 @@ static void interp_bits2pulses(const CELTMode *m, int *bits1, int *bits2, int to
int
offset
;
int
offset
;
N
=
m
->
eBands
[
j
+
1
]
-
m
->
eBands
[
j
];
N
=
m
->
eBands
[
j
+
1
]
-
m
->
eBands
[
j
];
d
=
C
*
N
<<
BITRES
;
/* Compensate for the extra DoF in stereo */
d
=
(
C
*
N
+
((
C
==
2
&&
N
>
2
)
?
1
:
0
))
<<
BITRES
;
offset
=
FINE_OFFSET
-
log2_frac
(
N
,
BITRES
);
offset
=
FINE_OFFSET
-
log2_frac
(
N
,
BITRES
);
/* Offset for the number of fine bits compared to their "fair share" of total/N */
/* Offset for the number of fine bits compared to their "fair share" of total/N */
offset
=
bits
[
j
]
-
offset
*
N
*
C
;
offset
=
bits
[
j
]
-
offset
*
N
*
C
;
/* Compensate for the prediction gain in stereo */
if
(
C
==
2
)
offset
-=
1
<<
BITRES
;
if
(
offset
<
0
)
if
(
offset
<
0
)
offset
=
0
;
offset
=
0
;
ebits
[
j
]
=
(
2
*
offset
+
d
)
/
(
2
*
d
);
ebits
[
j
]
=
(
2
*
offset
+
d
)
/
(
2
*
d
);
...
...
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