Harden SILK x86 code
authorJean-Marc Valin <jmvalin@jmvalin.ca>
Mon, 26 Mar 2018 16:54:38 +0000 (12:54 -0400)
committerJean-Marc Valin <jmvalin@jmvalin.ca>
Tue, 27 Mar 2018 19:13:27 +0000 (15:13 -0400)
silk/fixed/x86/burg_modified_FIX_sse4_1.c
silk/fixed/x86/prefilter_FIX_sse.c
silk/x86/NSQ_del_dec_sse4_1.c
silk/x86/NSQ_sse4_1.c
silk/x86/VAD_sse4_1.c

index 3c3583c..bbb1ce0 100644 (file)
@@ -72,7 +72,7 @@ void silk_burg_modified_sse4_1(
     __m128i FIRST_3210, LAST_3210, ATMP_3210, TMP1_3210, TMP2_3210, T1_3210, T2_3210, PTR_3210, SUBFR_3210, X1_3210, X2_3210;
     __m128i CONST1 = _mm_set1_epi32(1);
 
-    silk_assert( subfr_length * nb_subfr <= MAX_FRAME_SIZE );
+    celt_assert( subfr_length * nb_subfr <= MAX_FRAME_SIZE );
 
     /* Compute autocorrelations, added over subframes */
     silk_sum_sqr_shift( &C0, &rshifts, x, nb_subfr * subfr_length );
index d8c9c2f..555432c 100644 (file)
@@ -49,7 +49,7 @@ void silk_warped_LPC_analysis_filter_FIX_sse4_1(
     opus_int32   acc_Q11, tmp1, tmp2;
 
     /* Order must be even */
-    silk_assert( ( order & 1 ) == 0 );
+    celt_assert( ( order & 1 ) == 0 );
 
     if (order == 10)
     {
@@ -65,7 +65,7 @@ void silk_warped_LPC_analysis_filter_FIX_sse4_1(
             register opus_int32 state_8, state_9, state_a;
             register opus_int64 coef_Q13_8, coef_Q13_9;
 
-            silk_assert( length > 0 );
+            celt_assert( length > 0 );
 
             coef_Q13_3210 = OP_CVTEPI16_EPI32_M64( &coef_Q13[ 0 ] );
             coef_Q13_7654 = OP_CVTEPI16_EPI32_M64( &coef_Q13[ 4 ] );
index c5212be..2c75ede 100644 (file)
@@ -247,7 +247,7 @@ void silk_NSQ_del_dec_sse4_1(
 
                 /* Rewhiten with new A coefs */
                 start_idx = psEncC->ltp_mem_length - lag - psEncC->predictLPCOrder - LTP_ORDER / 2;
-                silk_assert( start_idx > 0 );
+                celt_assert( start_idx > 0 );
 
                 silk_LPC_analysis_filter( &sLTP[ start_idx ], &NSQ->xq[ start_idx + k * psEncC->subfr_length ],
                     A_Q12, psEncC->ltp_mem_length - start_idx, psEncC->predictLPCOrder, psEncC->arch );
@@ -353,7 +353,7 @@ static OPUS_INLINE void silk_noise_shape_quantizer_del_dec_sse4_1(
     __m128i b_Q12_0123, b_sr_Q12_0123;
     SAVE_STACK;
 
-    silk_assert( nStatesDelayedDecision > 0 );
+    celt_assert( nStatesDelayedDecision > 0 );
     ALLOC( psSampleState, nStatesDelayedDecision, NSQ_sample_pair );
 
     shp_lag_ptr  = &NSQ->sLTP_shp_Q14[ NSQ->sLTP_shp_buf_idx - lag + HARM_SHAPE_FIR_TAPS / 2 ];
index 6a9e6e9..b0315e3 100644 (file)
@@ -199,7 +199,7 @@ void silk_NSQ_sse4_1(
             if( ( k & ( 3 - silk_LSHIFT( LSF_interpolation_flag, 1 ) ) ) == 0 ) {
                 /* Rewhiten with new A coefs */
                 start_idx = psEncC->ltp_mem_length - lag - psEncC->predictLPCOrder - LTP_ORDER / 2;
-                silk_assert( start_idx > 0 );
+                celt_assert( start_idx > 0 );
 
                 silk_LPC_analysis_filter( &sLTP[ start_idx ], &NSQ->xq[ start_idx + k * psEncC->subfr_length ],
                     A_Q12, psEncC->ltp_mem_length - start_idx, psEncC->predictLPCOrder, psEncC->arch );
index 4e90f44..d02ddf4 100644 (file)
@@ -65,9 +65,9 @@ opus_int silk_VAD_GetSA_Q8_sse4_1(                  /* O    Return value, 0 if s
 
     /* Safety checks */
     silk_assert( VAD_N_BANDS == 4 );
-    silk_assert( MAX_FRAME_LENGTH >= psEncC->frame_length );
-    silk_assert( psEncC->frame_length <= 512 );
-    silk_assert( psEncC->frame_length == 8 * silk_RSHIFT( psEncC->frame_length, 3 ) );
+    celt_assert( MAX_FRAME_LENGTH >= psEncC->frame_length );
+    celt_assert( psEncC->frame_length <= 512 );
+    celt_assert( psEncC->frame_length == 8 * silk_RSHIFT( psEncC->frame_length, 3 ) );
 
     /***********************/
     /* Filter and Decimate */