Renamed SKP_[u]int* to opus_[u]int*
[opus.git] / silk / silk_burg_modified.c
index c4f330e..8295c7f 100644 (file)
@@ -37,26 +37,26 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 \r
 /* Compute reflection coefficients from input signal */\r
 void silk_burg_modified(\r
-    SKP_int32       *res_nrg,           /* O    residual energy                                                 */\r
-    SKP_int         *res_nrg_Q,         /* O    residual energy Q value                                         */\r
-    SKP_int32       A_Q16[],            /* O    prediction coefficients (length order)                          */\r
-    const SKP_int16 x[],                /* I    input signal, length: nb_subfr * ( D + subfr_length )           */\r
-    const SKP_int   subfr_length,       /* I    input signal subframe length (including D preceeding samples)   */\r
-    const SKP_int   nb_subfr,           /* I    number of subframes stacked in x                                */\r
-    const SKP_int32 WhiteNoiseFrac_Q32, /* I    fraction added to zero-lag autocorrelation                      */\r
-    const SKP_int   D                   /* I    order                                                           */\r
+    opus_int32       *res_nrg,           /* O    residual energy                                                 */\r
+    opus_int         *res_nrg_Q,         /* O    residual energy Q value                                         */\r
+    opus_int32       A_Q16[],            /* O    prediction coefficients (length order)                          */\r
+    const opus_int16 x[],                /* I    input signal, length: nb_subfr * ( D + subfr_length )           */\r
+    const opus_int   subfr_length,       /* I    input signal subframe length (including D preceeding samples)   */\r
+    const opus_int   nb_subfr,           /* I    number of subframes stacked in x                                */\r
+    const opus_int32 WhiteNoiseFrac_Q32, /* I    fraction added to zero-lag autocorrelation                      */\r
+    const opus_int   D                   /* I    order                                                           */\r
 )\r
 {\r
-    SKP_int         k, n, s, lz, rshifts, rshifts_extra;\r
-    SKP_int32       C0, num, nrg, rc_Q31, Atmp_QA, Atmp1, tmp1, tmp2, x1, x2;\r
-    const SKP_int16 *x_ptr;\r
+    opus_int         k, n, s, lz, rshifts, rshifts_extra;\r
+    opus_int32       C0, num, nrg, rc_Q31, Atmp_QA, Atmp1, tmp1, tmp2, x1, x2;\r
+    const opus_int16 *x_ptr;\r
 \r
-    SKP_int32       C_first_row[ SILK_MAX_ORDER_LPC ];\r
-    SKP_int32       C_last_row[  SILK_MAX_ORDER_LPC ];\r
-    SKP_int32       Af_QA[       SILK_MAX_ORDER_LPC ];\r
+    opus_int32       C_first_row[ SILK_MAX_ORDER_LPC ];\r
+    opus_int32       C_last_row[  SILK_MAX_ORDER_LPC ];\r
+    opus_int32       Af_QA[       SILK_MAX_ORDER_LPC ];\r
 \r
-    SKP_int32       CAf[ SILK_MAX_ORDER_LPC + 1 ];\r
-    SKP_int32       CAb[ SILK_MAX_ORDER_LPC + 1 ];\r
+    opus_int32       CAf[ SILK_MAX_ORDER_LPC + 1 ];\r
+    opus_int32       CAb[ SILK_MAX_ORDER_LPC + 1 ];\r
 \r
     SKP_assert( subfr_length * nb_subfr <= MAX_FRAME_SIZE );\r
     SKP_assert( nb_subfr <= MAX_NB_SUBFR );\r
@@ -80,12 +80,12 @@ void silk_burg_modified(
         }\r
         rshifts += rshifts_extra;\r
     }\r
-    SKP_memset( C_first_row, 0, SILK_MAX_ORDER_LPC * sizeof( SKP_int32 ) );\r
+    SKP_memset( C_first_row, 0, SILK_MAX_ORDER_LPC * sizeof( opus_int32 ) );\r
     if( rshifts > 0 ) {\r
         for( s = 0; s < nb_subfr; s++ ) {\r
             x_ptr = x + s * subfr_length;\r
             for( n = 1; n < D + 1; n++ ) {\r
-                C_first_row[ n - 1 ] += (SKP_int32)SKP_RSHIFT64( \r
+                C_first_row[ n - 1 ] += (opus_int32)SKP_RSHIFT64( \r
                     silk_inner_prod16_aligned_64( x_ptr, x_ptr + n, subfr_length - n ), rshifts );\r
             }\r
         }\r
@@ -98,7 +98,7 @@ void silk_burg_modified(
             }\r
         }\r
     }\r
-    SKP_memcpy( C_last_row, C_first_row, SILK_MAX_ORDER_LPC * sizeof( SKP_int32 ) );\r
+    SKP_memcpy( C_last_row, C_first_row, SILK_MAX_ORDER_LPC * sizeof( opus_int32 ) );\r
     \r
     /* Initialize */\r
     CAb[ 0 ] = CAf[ 0 ] = C0 + SKP_SMMUL( WhiteNoiseFrac_Q32, C0 ) + 1;         // Q(-rshifts)\r
@@ -111,10 +111,10 @@ void silk_burg_modified(
         if( rshifts > -2 ) {\r
             for( s = 0; s < nb_subfr; s++ ) {\r
                 x_ptr = x + s * subfr_length;\r
-                x1  = -SKP_LSHIFT32( (SKP_int32)x_ptr[ n ],                    16 - rshifts );      // Q(16-rshifts)\r
-                x2  = -SKP_LSHIFT32( (SKP_int32)x_ptr[ subfr_length - n - 1 ], 16 - rshifts );      // Q(16-rshifts)\r
-                tmp1 = SKP_LSHIFT32( (SKP_int32)x_ptr[ n ],                    QA - 16 );           // Q(QA-16)\r
-                tmp2 = SKP_LSHIFT32( (SKP_int32)x_ptr[ subfr_length - n - 1 ], QA - 16 );           // Q(QA-16)\r
+                x1  = -SKP_LSHIFT32( (opus_int32)x_ptr[ n ],                    16 - rshifts );      // Q(16-rshifts)\r
+                x2  = -SKP_LSHIFT32( (opus_int32)x_ptr[ subfr_length - n - 1 ], 16 - rshifts );      // Q(16-rshifts)\r
+                tmp1 = SKP_LSHIFT32( (opus_int32)x_ptr[ n ],                    QA - 16 );           // Q(QA-16)\r
+                tmp2 = SKP_LSHIFT32( (opus_int32)x_ptr[ subfr_length - n - 1 ], QA - 16 );           // Q(QA-16)\r
                 for( k = 0; k < n; k++ ) {\r
                     C_first_row[ k ] = SKP_SMLAWB( C_first_row[ k ], x1, x_ptr[ n - k - 1 ]            ); // Q( -rshifts )\r
                     C_last_row[ k ]  = SKP_SMLAWB( C_last_row[ k ],  x2, x_ptr[ subfr_length - n + k ] ); // Q( -rshifts )\r
@@ -132,10 +132,10 @@ void silk_burg_modified(
         } else {\r
             for( s = 0; s < nb_subfr; s++ ) {\r
                 x_ptr = x + s * subfr_length;\r
-                x1  = -SKP_LSHIFT32( (SKP_int32)x_ptr[ n ],                    -rshifts );          // Q( -rshifts )\r
-                x2  = -SKP_LSHIFT32( (SKP_int32)x_ptr[ subfr_length - n - 1 ], -rshifts );          // Q( -rshifts )\r
-                tmp1 = SKP_LSHIFT32( (SKP_int32)x_ptr[ n ],                    17 );                // Q17\r
-                tmp2 = SKP_LSHIFT32( (SKP_int32)x_ptr[ subfr_length - n - 1 ], 17 );                // Q17\r
+                x1  = -SKP_LSHIFT32( (opus_int32)x_ptr[ n ],                    -rshifts );          // Q( -rshifts )\r
+                x2  = -SKP_LSHIFT32( (opus_int32)x_ptr[ subfr_length - n - 1 ], -rshifts );          // Q( -rshifts )\r
+                tmp1 = SKP_LSHIFT32( (opus_int32)x_ptr[ n ],                    17 );                // Q17\r
+                tmp2 = SKP_LSHIFT32( (opus_int32)x_ptr[ subfr_length - n - 1 ], 17 );                // Q17\r
                 for( k = 0; k < n; k++ ) {\r
                     C_first_row[ k ] = SKP_MLA( C_first_row[ k ], x1, x_ptr[ n - k - 1 ]            ); // Q( -rshifts )\r
                     C_last_row[ k ]  = SKP_MLA( C_last_row[ k ],  x2, x_ptr[ subfr_length - n + k ] ); // Q( -rshifts )\r
@@ -147,9 +147,9 @@ void silk_burg_modified(
                 tmp2 = -tmp2;                                                                       // Q17\r
                 for( k = 0; k <= n; k++ ) {\r
                     CAf[ k ] = SKP_SMLAWW( CAf[ k ], tmp1, \r
-                        SKP_LSHIFT32( (SKP_int32)x_ptr[ n - k ], -rshifts - 1 ) );                  // Q( -rshift )\r
+                        SKP_LSHIFT32( (opus_int32)x_ptr[ n - k ], -rshifts - 1 ) );                  // Q( -rshift )\r
                     CAb[ k ] = SKP_SMLAWW( CAb[ k ], tmp2, \r
-                        SKP_LSHIFT32( (SKP_int32)x_ptr[ subfr_length - n + k - 1 ], -rshifts - 1 ) );// Q( -rshift )\r
+                        SKP_LSHIFT32( (opus_int32)x_ptr[ subfr_length - n + k - 1 ], -rshifts - 1 ) );// Q( -rshift )\r
                 }\r
             }\r
         }\r
@@ -181,7 +181,7 @@ void silk_burg_modified(
             rc_Q31 = silk_DIV32_varQ( num, nrg, 31 );\r
         } else {\r
             /* Negative energy or ratio too high; set remaining coefficients to zero and exit loop */\r
-            SKP_memset( &Af_QA[ n ], 0, ( D - n ) * sizeof( SKP_int32 ) );\r
+            SKP_memset( &Af_QA[ n ], 0, ( D - n ) * sizeof( opus_int32 ) );\r
             SKP_assert( 0 );\r
             break;\r
         }\r