shithub: opus

Download patch

ref: fe40ddd99992902760ce765e33364a8f695e4d37
parent: 949f18010fdb720a79dfa926bb581622267360b1
author: Timothy B. Terriberry <[email protected]>
date: Thu Dec 30 03:43:42 EST 2010

Update the maximum fine bits everywhere.

cf874373 raised the limit from 7 to 8 for N>1 bands in
 interp_bits2pulses(), but did not raise the corresponding limits
 for N=1 bands, or for [un]quant_energy_finalise().
This commit raises all of the limits to the same value, 8.

--- a/libcelt/quant_bands.c
+++ b/libcelt/quant_bands.c
@@ -453,7 +453,7 @@
    {
       for (i=start;i<end && bits_left>=C ;i++)
       {
-         if (fine_quant[i] >= 7 || fine_priority[i]!=prio)
+         if (fine_quant[i] >= 8 || fine_priority[i]!=prio)
             continue;
          c=0;
          do {
--- a/libcelt/rate.c
+++ b/libcelt/rate.c
@@ -334,7 +334,7 @@
 
       } else {
          /* For N=1, all bits go to fine energy except for a single sign bit */
-         ebits[j] = IMIN(IMAX(0,(bits[j] >> stereo >> BITRES)-1),7);
+         ebits[j] = IMIN(IMAX(0,(bits[j] >> stereo >> BITRES)-1),8);
          fine_priority[j] = (ebits[j]+1)*C<<BITRES >= (bits[j]-balance);
          /* N=1 bands can't take advantage of the re-balancing in
              quant_all_bands() because they don't have shape, only fine energy.