Merge branch 'surround'
authorJean-Marc Valin <jmvalin@jmvalin.ca>
Fri, 17 May 2013 18:31:36 +0000 (14:31 -0400)
committerJean-Marc Valin <jmvalin@jmvalin.ca>
Fri, 17 May 2013 18:31:36 +0000 (14:31 -0400)
1  2 
celt/celt.h
celt/celt_encoder.c
src/opus_encoder.c

diff --cc celt/celt.h
Simple merge
@@@ -1736,21 -1793,10 +1793,23 @@@ int celt_encode_with_ec(CELTEncoder * O
     signalBandwidth = st->end-1;
  #ifndef FIXED_POINT
     if (st->analysis.valid)
 -      signalBandwidth = st->analysis.bandwidth;
 +   {
 +      int min_bandwidth;
 +      if (st->bitrate < (opus_int32)32000*C)
 +         min_bandwidth = 13;
 +      else if (st->bitrate < (opus_int32)48000*C)
 +         min_bandwidth = 16;
 +      else if (st->bitrate < (opus_int32)60000*C)
 +         min_bandwidth = 18;
 +      else  if (st->bitrate < (opus_int32)80000*C)
 +         min_bandwidth = 19;
 +      else
 +         min_bandwidth = 20;
 +      signalBandwidth = IMAX(st->analysis.bandwidth, min_bandwidth);
 +   }
  #endif
+    if (st->lfe)
+       signalBandwidth = 1;
     codedBands = compute_allocation(mode, st->start, st->end, offsets, cap,
           alloc_trim, &st->intensity, &dual_stereo, bits, &balance, pulses,
           fine_quant, fine_priority, C, LM, enc, 1, st->lastCodedBands, signalBandwidth);
Simple merge