Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Mark Harris
Opus
Commits
445720f9
Commit
445720f9
authored
Jun 02, 2009
by
Jean-Marc Valin
Browse files
It is no longer necessary to have a minimum of one bit for fine energy
allocation
parent
527db5c4
Changes
1
Hide whitespace changes
Inline
Side-by-side
libcelt/rate.c
View file @
445720f9
...
...
@@ -115,15 +115,12 @@ static void interp_bits2pulses(const CELTMode *m, int *bits1, int *bits2, int to
{
int
N
,
d
;
int
offset
;
int
min_bits
=
0
;
if
(
bits
[
j
]
>=
C
<<
BITRES
)
min_bits
=
1
;
N
=
m
->
eBands
[
j
+
1
]
-
m
->
eBands
[
j
];
d
=
C
*
N
<<
BITRES
;
offset
=
50
-
log2_frac
(
N
,
4
);
/* Offset for the number of fine bits compared to their "fair share" of total/N */
ebits
[
j
]
=
IMAX
(
min_bits
,
(
bits
[
j
]
-
offset
*
N
*
C
+
(
d
>>
1
))
/
d
)
;
ebits
[
j
]
=
(
bits
[
j
]
-
offset
*
N
*
C
+
(
d
>>
1
))
/
d
;
/* Make sure not to bust */
if
(
C
*
ebits
[
j
]
>
(
bits
[
j
]
>>
BITRES
))
...
...
Write
Preview
Markdown
is supported
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