Update SILK code using the CELT range coder
[opus.git] / src_common / SKP_Silk_LP_variable_cutoff.c
similarity index 94%
rename from src/SKP_Silk_LP_variable_cutoff.c
rename to src_common/SKP_Silk_LP_variable_cutoff.c
index 87feef5..3f40356 100644 (file)
@@ -119,8 +119,8 @@ void SKP_Silk_LP_variable_cutoff(
     const SKP_int                   frame_length    /* I    Frame length                        */\r
 )\r
 {\r
-    SKP_int32   B_Q28[ TRANSITION_NB ], A_Q28[ TRANSITION_NA ];\r
-    SKP_int     fac_Q16 = 0, ind = 0;\r
+    SKP_int32   B_Q28[ TRANSITION_NB ], A_Q28[ TRANSITION_NA ], fac_Q16 = 0;\r
+    SKP_int     ind = 0;\r
 \r
     SKP_assert( psLP->transition_frame_no >= 0 );\r
     SKP_assert( ( ( ( psLP->transition_frame_no <= TRANSITION_FRAMES_DOWN ) && ( psLP->mode == 0 ) ) || \r
@@ -148,11 +148,13 @@ void SKP_Silk_LP_variable_cutoff(
                 /* Increment transition frame number for next frame */\r
                 psLP->transition_frame_no++;\r
 \r
-            } else if( psLP->transition_frame_no == TRANSITION_FRAMES_DOWN ) {\r
+            } else {\r
+                SKP_assert( psLP->transition_frame_no == TRANSITION_FRAMES_DOWN );\r
                 /* End of transition phase */\r
                 SKP_Silk_LP_interpolate_filter_taps( B_Q28, A_Q28, TRANSITION_INT_NUM - 1, 0 );\r
             }\r
-        } else if( psLP->mode == 1 ) {\r
+        } else {\r
+            SKP_assert( psLP->mode == 1 );\r
             if( psLP->transition_frame_no < TRANSITION_FRAMES_UP ) {\r
                 /* Calculate index and interpolation factor for interpolation */\r
 #if( TRANSITION_INT_STEPS_UP == 64 )\r
@@ -172,7 +174,8 @@ void SKP_Silk_LP_variable_cutoff(
                 /* Increment transition frame number for next frame */\r
                 psLP->transition_frame_no++;\r
             \r
-            } else if( psLP->transition_frame_no == TRANSITION_FRAMES_UP ) {\r
+            } else {\r
+                SKP_assert( psLP->transition_frame_no == TRANSITION_FRAMES_UP );\r
                 /* End of transition phase */\r
                 SKP_Silk_LP_interpolate_filter_taps( B_Q28, A_Q28, 0, 0 );\r
             }\r