Attempt to have at least two bands that are coded
authorJean-Marc Valin <jmvalin@jmvalin.ca>
Fri, 19 Oct 2012 23:57:19 +0000 (19:57 -0400)
committerJean-Marc Valin <jmvalin@jmvalin.ca>
Fri, 19 Oct 2012 23:57:19 +0000 (19:57 -0400)
This fixes a SWB hybrid issue where band 18 isn't folded and cannot even
be folded because it's wider than band 17. This was causing noise to
be injected instead.

celt/rate.c

index 249e3f0..4e96787 100644 (file)
@@ -353,7 +353,7 @@ static inline int interp_bits2pulses(const CELTMode *m, int start, int end, int
 #ifdef FUZZING
             if ((rand()&0x1) == 0)
 #else
-            if (band_bits > ((j<prev?7:9)*band_width<<LM<<BITRES)>>4)
+            if (codedBands<=start+2 || band_bits > ((j<prev?7:9)*band_width<<LM<<BITRES)>>4)
 #endif
             {
                ec_enc_bit_logp(ec, 1, 1);