Update SILK code using the CELT range coder
[opus.git] / src_common / SKP_Silk_decode_pulses.c
similarity index 92%
rename from src/SKP_Silk_decode_pulses.c
rename to src_common/SKP_Silk_decode_pulses.c
index 402228a..bdcd37c 100644 (file)
@@ -49,8 +49,12 @@ void SKP_Silk_decode_pulses(
             SKP_Silk_rate_levels_CDF[ psDecCtrl->sigtype ], SKP_Silk_rate_levels_CDF_offset );\r
 \r
     /* Calculate number of shell blocks */\r
-    iter = frame_length / SHELL_CODEC_FRAME_LENGTH;\r
-    \r
+    SKP_assert( 1 << LOG2_SHELL_CODEC_FRAME_LENGTH == SHELL_CODEC_FRAME_LENGTH );\r
+    iter = SKP_RSHIFT( frame_length, LOG2_SHELL_CODEC_FRAME_LENGTH );\r
+    if( iter * SHELL_CODEC_FRAME_LENGTH < frame_length ){\r
+        SKP_assert( frame_length == 12 * 10 ); /* Make sure only happens for 10 ms @ 12 kHz */\r
+        iter++;\r
+    }\r
     /***************************************************/\r
     /* Sum-Weighted-Pulses Decoding                    */\r
     /***************************************************/\r