aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJean-Marc Valin <jmvalin@jmvalin.ca>2013-11-08 19:53:27 -0500
committerJean-Marc Valin <jmvalin@jmvalin.ca>2013-11-08 19:53:27 -0500
commit420231ab1956ba64191ae4b6c46462060048ed52 (patch)
tree176076b2d20daa00539d682b63ebbe6056e244a7 /src
parentc1959e7dc346fac747ca29efa63ff2a6ddb44f44 (diff)
downloadlibopus-420231ab1956ba64191ae4b6c46462060048ed52.tar.gz
Makes surround bandwidth decision based on the number of channels (duh!)
Diffstat (limited to 'src')
-rw-r--r--src/opus_multistream_encoder.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/opus_multistream_encoder.c b/src/opus_multistream_encoder.c
index f2832280..b6c5db96 100644
--- a/src/opus_multistream_encoder.c
+++ b/src/opus_multistream_encoder.c
@@ -774,11 +774,11 @@ static int opus_multistream_encode_native
equiv_rate = st->bitrate_bps;
if (frame_size*50 < Fs)
equiv_rate -= 60*(Fs/frame_size - 50)*st->layout.nb_channels;
- if (equiv_rate > 112000)
+ if (equiv_rate > 16000*st->layout.nb_channels)
opus_encoder_ctl(enc, OPUS_SET_BANDWIDTH(OPUS_BANDWIDTH_FULLBAND));
- else if (equiv_rate > 76000)
+ else if (equiv_rate > 12000*st->layout.nb_channels)
opus_encoder_ctl(enc, OPUS_SET_BANDWIDTH(OPUS_BANDWIDTH_SUPERWIDEBAND));
- else if (equiv_rate > 48000)
+ else if (equiv_rate > 8000*st->layout.nb_channels)
opus_encoder_ctl(enc, OPUS_SET_BANDWIDTH(OPUS_BANDWIDTH_WIDEBAND));
else
opus_encoder_ctl(enc, OPUS_SET_BANDWIDTH(OPUS_BANDWIDTH_NARROWBAND));