Makes surround bandwidth decision based on the number of channels (duh!)
authorJean-Marc Valin <jmvalin@jmvalin.ca>
Sat, 9 Nov 2013 00:53:27 +0000 (19:53 -0500)
committerJean-Marc Valin <jmvalin@jmvalin.ca>
Sat, 9 Nov 2013 00:53:27 +0000 (19:53 -0500)
src/opus_multistream_encoder.c

index f283228..b6c5db9 100644 (file)
@@ -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));