shithub: opus

Download patch

ref: 5d7b03669cb067c8848dfad642357c86e46e806a
parent: 59a93ab190b4afda2e74a03fd272116b56671038
author: Jean-Marc Valin <[email protected]>
date: Mon Jul 25 06:45:23 EDT 2011

Prevents more than 10 LSBs from being decoded

--- a/silk/silk_decode_pulses.c
+++ b/silk/silk_decode_pulses.c
@@ -67,7 +67,9 @@
         /* LSB indication */
         while( sum_pulses[ i ] == MAX_PULSES + 1 ) {
             nLshifts[ i ]++;
-            sum_pulses[ i ] = ec_dec_icdf( psRangeDec, silk_pulses_per_block_iCDF[ N_RATE_LEVELS - 1 ], 8 );
+            /* When we've already got 10 LSBs, we shift the table to not allow (MAX_PULSES + 1) */
+            sum_pulses[ i ] = ec_dec_icdf( psRangeDec,
+            		silk_pulses_per_block_iCDF[ N_RATE_LEVELS - 1] + (nLshifts[ i ]==10), 8 );
         }
     }