Prevents more than 10 LSBs from being decoded
authorJean-Marc Valin <jean-marc.valin@usherbrooke.ca>
Mon, 25 Jul 2011 14:45:23 +0000 (10:45 -0400)
committerJean-Marc Valin <jean-marc.valin@usherbrooke.ca>
Mon, 25 Jul 2011 14:45:23 +0000 (10:45 -0400)
silk/silk_decode_pulses.c

index 9c0aa94..eb99f61 100644 (file)
@@ -67,7 +67,9 @@ void silk_decode_pulses(
         /* LSB indication */\r
         while( sum_pulses[ i ] == MAX_PULSES + 1 ) {\r
             nLshifts[ i ]++;\r
-            sum_pulses[ i ] = ec_dec_icdf( psRangeDec, silk_pulses_per_block_iCDF[ N_RATE_LEVELS - 1 ], 8 );\r
+            /* When we've already got 10 LSBs, we shift the table to not allow (MAX_PULSES + 1) */\r
+            sum_pulses[ i ] = ec_dec_icdf( psRangeDec,\r
+                       silk_pulses_per_block_iCDF[ N_RATE_LEVELS - 1] + (nLshifts[ i ]==10), 8 );\r
         }\r
     }\r
     \r