Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Mark Harris
Opus
Commits
b370a938
Commit
b370a938
authored
Jun 17, 2016
by
Jean-Marc Valin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixes an overflow in the constrained VBR code for bitrate>64000
parent
5ead149c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
3 deletions
+6
-3
celt/celt_encoder.c
celt/celt_encoder.c
+6
-3
No files found.
celt/celt_encoder.c
View file @
b370a938
...
...
@@ -1281,12 +1281,15 @@ static int compute_vbr(const CELTMode *mode, AnalysisInfo *analysis, opus_int32
if
((
!
has_surround_mask
||
lfe
)
&&
(
constrained_vbr
||
bitrate
<
64000
))
{
opus_val16
rate_factor
;
opus_val16
rate_factor
=
Q15ONE
;
if
(
bitrate
<
64000
)
{
#ifdef FIXED_POINT
rate_factor
=
MAX16
(
0
,(
bitrate
-
32000
));
rate_factor
=
MAX16
(
0
,(
bitrate
-
32000
));
#else
rate_factor
=
MAX16
(
0
,(
1
.
f
/
32768
)
*
(
bitrate
-
32000
));
rate_factor
=
MAX16
(
0
,(
1
.
f
/
32768
)
*
(
bitrate
-
32000
));
#endif
}
if
(
constrained_vbr
)
rate_factor
=
MIN16
(
rate_factor
,
QCONST16
(
0
.
67
f
,
15
));
target
=
base_target
+
(
opus_int32
)
MULT16_32_Q15
(
rate_factor
,
target
-
base_target
);
...
...
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