shithub: opus

Download patch

ref: e45ccb1693c6e230043eda49cb271b824e6fcf11
parent: 3a0bc3d95c8a844d4f39e793a93567b02131d4a7
author: Jean-Marc Valin <[email protected]>
date: Mon Mar 1 02:07:28 EST 2010

Fix quant_bands() for start != 0

--- a/libcelt/bands.c
+++ b/libcelt/bands.c
@@ -472,7 +472,7 @@
          tell = ec_enc_tell(enc_dec, BITRES);
       else
          tell = ec_dec_tell(enc_dec, BITRES);
-      if (i != 0)
+      if (i != start)
          balance -= tell;
       remaining_bits = (total_bits<<BITRES)-tell-1;
       curr_balance = (m->nbEBands-i);
@@ -546,7 +546,7 @@
 
       N = eBands[i+1]-eBands[i];
       tell = ec_enc_tell(enc, BITRES);
-      if (i != 0)
+      if (i != start)
          balance -= tell;
       remaining_bits = (total_bits<<BITRES)-tell-1;
       curr_balance = (m->nbEBands-i);
@@ -778,7 +778,7 @@
 
       N = eBands[i+1]-eBands[i];
       tell = ec_dec_tell(dec, BITRES);
-      if (i != 0)
+      if (i != start)
          balance -= tell;
       remaining_bits = (total_bits<<BITRES)-tell-1;
       curr_balance = (m->nbEBands-i);