Skip to content
GitLab
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
0734cad5
Commit
0734cad5
authored
May 03, 2011
by
Jean-Marc Valin
Browse files
Fixes bandwidth decision when reducing the bit-rate
parent
ecb2ff7d
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/opus_encoder.c
View file @
0734cad5
...
...
@@ -166,9 +166,9 @@ int opus_encode(OpusEncoder *st, const short *pcm, int frame_size,
{
if
(
mono_rate
>
35000
||
(
mono_rate
>
28000
&&
st
->
bandwidth
==
BANDWIDTH_FULLBAND
))
st
->
bandwidth
=
BANDWIDTH_FULLBAND
;
else
if
(
mono_rate
>
28000
||
(
mono_rate
>
24000
&&
st
->
bandwidth
=
=
BANDWIDTH_SUPERWIDEBAND
))
else
if
(
mono_rate
>
28000
||
(
mono_rate
>
24000
&&
st
->
bandwidth
>
=
BANDWIDTH_SUPERWIDEBAND
))
st
->
bandwidth
=
BANDWIDTH_SUPERWIDEBAND
;
else
if
(
mono_rate
>
24000
||
(
mono_rate
>
18000
&&
st
->
bandwidth
=
=
BANDWIDTH_WIDEBAND
))
else
if
(
mono_rate
>
24000
||
(
mono_rate
>
18000
&&
st
->
bandwidth
>
=
BANDWIDTH_WIDEBAND
))
st
->
bandwidth
=
BANDWIDTH_WIDEBAND
;
else
st
->
bandwidth
=
BANDWIDTH_NARROWBAND
;
...
...
@@ -176,11 +176,11 @@ int opus_encode(OpusEncoder *st, const short *pcm, int frame_size,
{
if
(
mono_rate
>
30000
||
(
mono_rate
>
26000
&&
st
->
bandwidth
==
BANDWIDTH_FULLBAND
))
st
->
bandwidth
=
BANDWIDTH_FULLBAND
;
else
if
(
mono_rate
>
22000
||
(
mono_rate
>
18000
&&
st
->
bandwidth
=
=
BANDWIDTH_SUPERWIDEBAND
))
else
if
(
mono_rate
>
22000
||
(
mono_rate
>
18000
&&
st
->
bandwidth
>
=
BANDWIDTH_SUPERWIDEBAND
))
st
->
bandwidth
=
BANDWIDTH_SUPERWIDEBAND
;
else
if
(
mono_rate
>
16000
||
(
mono_rate
>
13000
&&
st
->
bandwidth
=
=
BANDWIDTH_WIDEBAND
))
else
if
(
mono_rate
>
16000
||
(
mono_rate
>
13000
&&
st
->
bandwidth
>
=
BANDWIDTH_WIDEBAND
))
st
->
bandwidth
=
BANDWIDTH_WIDEBAND
;
else
if
(
mono_rate
>
13000
||
(
mono_rate
>
10000
&&
st
->
bandwidth
=
=
BANDWIDTH_MEDIUMBAND
))
else
if
(
mono_rate
>
13000
||
(
mono_rate
>
10000
&&
st
->
bandwidth
>
=
BANDWIDTH_MEDIUMBAND
))
st
->
bandwidth
=
BANDWIDTH_MEDIUMBAND
;
else
st
->
bandwidth
=
BANDWIDTH_NARROWBAND
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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