Clean up: replace tabs by spaces
authorKoen Vos <koenvos@users.noreply.github.com>
Sun, 21 Feb 2016 08:21:03 +0000 (16:21 +0800)
committerJean-Marc Valin <jmvalin@jmvalin.ca>
Sun, 17 Jul 2016 19:05:55 +0000 (15:05 -0400)
23 files changed:
silk/A2NLSF.c
silk/LPC_fit.c
silk/LPC_inv_pred_gain.c
silk/NSQ.c
silk/NSQ_del_dec.c
silk/SigProc_FIX.h
silk/VQ_WMat_EC.c
silk/fixed/corrMatrix_FIX.c
silk/fixed/find_LTP_FIX.c
silk/fixed/find_pred_coefs_FIX.c
silk/fixed/main_FIX.h
silk/fixed/pitch_analysis_core_FIX.c
silk/fixed/structs_FIX.h
silk/float/energy_FLP.c
silk/float/find_LTP_FLP.c
silk/float/find_pred_coefs_FLP.c
silk/float/k2a_FLP.c
silk/float/main_FLP.h
silk/float/noise_shape_analysis_FLP.c
silk/float/wrappers_FLP.c
silk/main.h
silk/quant_LTP_gains.c
silk/tuning_parameters.h

index 165049a..b487686 100644 (file)
@@ -245,7 +245,7 @@ void silk_A2NLSF(
                 }
 
                 /* Error: Apply progressively more bandwidth expansion and run again */
                 }
 
                 /* Error: Apply progressively more bandwidth expansion and run again */
-                               silk_bwexpander_32( a_Q16, d, 65536 - silk_LSHIFT( 1, i ) );
+                silk_bwexpander_32( a_Q16, d, 65536 - silk_LSHIFT( 1, i ) );
 
                 silk_A2NLSF_init( a_Q16, P, Q, dd );
                 p = P;                            /* Pointer to polynomial */
 
                 silk_A2NLSF_init( a_Q16, P, Q, dd );
                 p = P;                            /* Pointer to polynomial */
index 69ff395..cdea4f3 100644 (file)
@@ -34,14 +34,14 @@ POSSIBILITY OF SUCH DAMAGE.
 /* Convert int32 coefficients to int16 coefs and make sure there's no wrap-around */
 void silk_LPC_fit(
     opus_int16                  *a_QOUT,            /* O    Output signal                                               */
 /* Convert int32 coefficients to int16 coefs and make sure there's no wrap-around */
 void silk_LPC_fit(
     opus_int16                  *a_QOUT,            /* O    Output signal                                               */
-    opus_int32                         *a_QIN,             /* I/O  Input signal                                                */
+    opus_int32                    *a_QIN,             /* I/O  Input signal                                                */
     const opus_int              QOUT,               /* I    Input Q domain                                              */
     const opus_int              QIN,                /* I    Input Q domain                                              */
     const opus_int              d                   /* I    Filter order                                                */
 )
 {
     const opus_int              QOUT,               /* I    Input Q domain                                              */
     const opus_int              QIN,                /* I    Input Q domain                                              */
     const opus_int              d                   /* I    Filter order                                                */
 )
 {
-       opus_int        i, k, idx = 0;
-       opus_int32      maxabs, absval, chirp_Q16;
+    opus_int    i, k, idx = 0;
+    opus_int32    maxabs, absval, chirp_Q16;
 
     /* Limit the maximum absolute value of the prediction coefficients, so that they'll fit in int16 */
     for( i = 0; i < 10; i++ ) {
 
     /* Limit the maximum absolute value of the prediction coefficients, so that they'll fit in int16 */
     for( i = 0; i < 10; i++ ) {
index cb9983f..257b28f 100644 (file)
@@ -79,7 +79,7 @@ static opus_int32 LPC_inverse_pred_gain_QA(                 /* O   Returns inver
         for( n = 0; n < (k + 1) >> 1; n++ ) {
             tmp1 = A_QA[ n ];
             tmp2 = A_QA[ k - n - 1 ];
         for( n = 0; n < (k + 1) >> 1; n++ ) {
             tmp1 = A_QA[ n ];
             tmp2 = A_QA[ k - n - 1 ];
-            A_QA[ n ] =                        MUL32_FRAC_Q( tmp1 - MUL32_FRAC_Q( tmp2, rc_Q31, 31 ), rc_mult2, mult2Q );
+            A_QA[ n ] =            MUL32_FRAC_Q( tmp1 - MUL32_FRAC_Q( tmp2, rc_Q31, 31 ), rc_mult2, mult2Q );
             A_QA[ k - n - 1 ] = MUL32_FRAC_Q( tmp2 - MUL32_FRAC_Q( tmp1, rc_Q31, 31 ), rc_mult2, mult2Q );
         }
     }
             A_QA[ k - n - 1 ] = MUL32_FRAC_Q( tmp2 - MUL32_FRAC_Q( tmp1, rc_Q31, 31 ), rc_mult2, mult2Q );
         }
     }
index 0f49c0d..9fb05a8 100644 (file)
@@ -78,7 +78,7 @@ void silk_NSQ_c
     const silk_encoder_state    *psEncC,                                    /* I/O  Encoder State                   */
     silk_nsq_state              *NSQ,                                       /* I/O  NSQ state                       */
     SideInfoIndices             *psIndices,                                 /* I/O  Quantization Indices            */
     const silk_encoder_state    *psEncC,                                    /* I/O  Encoder State                   */
     silk_nsq_state              *NSQ,                                       /* I/O  NSQ state                       */
     SideInfoIndices             *psIndices,                                 /* I/O  Quantization Indices            */
-    const opus_int16            x16[],                                                                         /* I    Input                           */
+    const opus_int16            x16[],                                        /* I    Input                           */
     opus_int8                   pulses[],                                   /* O    Quantized pulse signal          */
     const opus_int16            PredCoef_Q12[ 2 * MAX_LPC_ORDER ],          /* I    Short term prediction coefs     */
     const opus_int16            LTPCoef_Q14[ LTP_ORDER * MAX_NB_SUBFR ],    /* I    Long term prediction coefs      */
     opus_int8                   pulses[],                                   /* O    Quantized pulse signal          */
     const opus_int16            PredCoef_Q12[ 2 * MAX_LPC_ORDER ],          /* I    Short term prediction coefs     */
     const opus_int16            LTPCoef_Q14[ LTP_ORDER * MAX_NB_SUBFR ],    /* I    Long term prediction coefs      */
@@ -436,7 +436,7 @@ static OPUS_INLINE void silk_nsq_scale_states(
             NSQ->sAR2_Q14[ i ] = silk_SMULWW( gain_adj_Q16, NSQ->sAR2_Q14[ i ] );
         }
 
             NSQ->sAR2_Q14[ i ] = silk_SMULWW( gain_adj_Q16, NSQ->sAR2_Q14[ i ] );
         }
 
-               /* Save inverse gain */
+        /* Save inverse gain */
         NSQ->prev_gain_Q16 = Gains_Q16[ subfr ];
     }
 }
         NSQ->prev_gain_Q16 = Gains_Q16[ subfr ];
     }
 }
index e23205b..709dc85 100644 (file)
@@ -118,7 +118,7 @@ void silk_NSQ_del_dec_c(
     const silk_encoder_state    *psEncC,                                    /* I/O  Encoder State                   */
     silk_nsq_state              *NSQ,                                       /* I/O  NSQ state                       */
     SideInfoIndices             *psIndices,                                 /* I/O  Quantization Indices            */
     const silk_encoder_state    *psEncC,                                    /* I/O  Encoder State                   */
     silk_nsq_state              *NSQ,                                       /* I/O  NSQ state                       */
     SideInfoIndices             *psIndices,                                 /* I/O  Quantization Indices            */
-    const opus_int16            x16[],                                                                         /* I    Input                           */
+    const opus_int16            x16[],                                        /* I    Input                           */
     opus_int8                   pulses[],                                   /* O    Quantized pulse signal          */
     const opus_int16            PredCoef_Q12[ 2 * MAX_LPC_ORDER ],          /* I    Short term prediction coefs     */
     const opus_int16            LTPCoef_Q14[ LTP_ORDER * MAX_NB_SUBFR ],    /* I    Long term prediction coefs      */
     opus_int8                   pulses[],                                   /* O    Quantized pulse signal          */
     const opus_int16            PredCoef_Q12[ 2 * MAX_LPC_ORDER ],          /* I    Short term prediction coefs     */
     const opus_int16            LTPCoef_Q14[ LTP_ORDER * MAX_NB_SUBFR ],    /* I    Long term prediction coefs      */
index 4d0e7df..c45d187 100644 (file)
@@ -277,7 +277,7 @@ void silk_NLSF2A(
 /* Convert int32 coefficients to int16 coefs and make sure there's no wrap-around */
 void silk_LPC_fit(
     opus_int16                  *a_QOUT,            /* O    Output signal                                               */
 /* Convert int32 coefficients to int16 coefs and make sure there's no wrap-around */
 void silk_LPC_fit(
     opus_int16                  *a_QOUT,            /* O    Output signal                                               */
-    opus_int32                         *a_QIN,             /* I/O  Input signal                                                */
+    opus_int32                    *a_QIN,             /* I/O  Input signal                                                */
     const opus_int              QOUT,               /* I    Input Q domain                                              */
     const opus_int              QIN,                /* I    Input Q domain                                              */
     const opus_int              d                   /* I    Filter order                                                */
     const opus_int              QOUT,               /* I    Input Q domain                                              */
     const opus_int              QIN,                /* I    Input Q domain                                              */
     const opus_int              d                   /* I    Filter order                                                */
index d33da26..67e6341 100644 (file)
@@ -34,38 +34,38 @@ POSSIBILITY OF SUCH DAMAGE.
 /* Entropy constrained matrix-weighted VQ, hard-coded to 5-element vectors, for a single input data vector */
 void silk_VQ_WMat_EC_c(
     opus_int8                   *ind,                           /* O    index of best codebook vector               */
 /* Entropy constrained matrix-weighted VQ, hard-coded to 5-element vectors, for a single input data vector */
 void silk_VQ_WMat_EC_c(
     opus_int8                   *ind,                           /* O    index of best codebook vector               */
-    opus_int32                  *res_nrg_Q15,                                  /* O    best residual energy                                            */
-    opus_int32                  *rate_dist_Q8,                  /* O    best total bitrate                                                     */
-    const opus_int32            *XX_Q17,                                               /* I    correlation matrix                          */
-    const opus_int32            *xX_Q17,                                               /* I    correlation vector                                                      */
+    opus_int32                  *res_nrg_Q15,                    /* O    best residual energy                        */
+    opus_int32                  *rate_dist_Q8,                  /* O    best total bitrate                            */
+    const opus_int32            *XX_Q17,                        /* I    correlation matrix                          */
+    const opus_int32            *xX_Q17,                        /* I    correlation vector                            */
     const opus_int8             *cb_Q7,                         /* I    codebook                                    */
     const opus_uint8            *cl_Q5,                         /* I    code length for each codebook vector        */
     const opus_int8             *cb_Q7,                         /* I    codebook                                    */
     const opus_uint8            *cl_Q5,                         /* I    code length for each codebook vector        */
-    const opus_int              subfr_len,                                             /* I    number of samples per subframe                          */
+    const opus_int              subfr_len,                        /* I    number of samples per subframe                */
     const opus_int              L                               /* I    number of vectors in codebook               */
 )
 {
     opus_int   k;
     const opus_int8 *cb_row_Q7;
     const opus_int              L                               /* I    number of vectors in codebook               */
 )
 {
     opus_int   k;
     const opus_int8 *cb_row_Q7;
-       opus_int32 neg_xX_Q24[ 5 ];
+    opus_int32 neg_xX_Q24[ 5 ];
     opus_int32 sum1_Q15, sum2_Q24, sum1_best_Q15;
     opus_int32 sum1_Q15, sum2_Q24, sum1_best_Q15;
-       opus_int32 bits_res_Q8, bits_tot_Q8;
+    opus_int32 bits_res_Q8, bits_tot_Q8;
 
 
-       /* Negate and convert to new Q domain */
-       neg_xX_Q24[ 0 ] = -silk_LSHIFT32( xX_Q17[ 0 ], 7 );
-       neg_xX_Q24[ 1 ] = -silk_LSHIFT32( xX_Q17[ 1 ], 7 );
-       neg_xX_Q24[ 2 ] = -silk_LSHIFT32( xX_Q17[ 2 ], 7 );
-       neg_xX_Q24[ 3 ] = -silk_LSHIFT32( xX_Q17[ 3 ], 7 );
-       neg_xX_Q24[ 4 ] = -silk_LSHIFT32( xX_Q17[ 4 ], 7 );
+    /* Negate and convert to new Q domain */
+    neg_xX_Q24[ 0 ] = -silk_LSHIFT32( xX_Q17[ 0 ], 7 );
+    neg_xX_Q24[ 1 ] = -silk_LSHIFT32( xX_Q17[ 1 ], 7 );
+    neg_xX_Q24[ 2 ] = -silk_LSHIFT32( xX_Q17[ 2 ], 7 );
+    neg_xX_Q24[ 3 ] = -silk_LSHIFT32( xX_Q17[ 3 ], 7 );
+    neg_xX_Q24[ 4 ] = -silk_LSHIFT32( xX_Q17[ 4 ], 7 );
 
     /* Loop over codebook */
     *rate_dist_Q8 = silk_int32_MAX;
 
     /* Loop over codebook */
     *rate_dist_Q8 = silk_int32_MAX;
-       *res_nrg_Q15 = silk_int32_MAX;
-       sum1_best_Q15 = silk_int32_MAX;
+    *res_nrg_Q15 = silk_int32_MAX;
+    sum1_best_Q15 = silk_int32_MAX;
     cb_row_Q7 = cb_Q7;
     for( k = 0; k < L; k++ ) {
         /* Weighted rate */
     cb_row_Q7 = cb_Q7;
     for( k = 0; k < L; k++ ) {
         /* Weighted rate */
-               /* Quantization error: 1 - 2* xX * cb + cb' * XX * cb */
-               sum1_Q15 = SILK_FIX_CONST( 1.0001, 15 );
+        /* Quantization error: 1 - 2* xX * cb + cb' * XX * cb */
+        sum1_Q15 = SILK_FIX_CONST( 1.0001, 15 );
 
         /* first row of XX_Q17 */
         sum2_Q24 = silk_MLA( neg_xX_Q24[ 0 ], XX_Q17[  1 ], cb_row_Q7[ 1 ] );
 
         /* first row of XX_Q17 */
         sum2_Q24 = silk_MLA( neg_xX_Q24[ 0 ], XX_Q17[  1 ], cb_row_Q7[ 1 ] );
@@ -98,25 +98,25 @@ void silk_VQ_WMat_EC_c(
         sum1_Q15 = silk_SMLAWB( sum1_Q15,        sum2_Q24,  cb_row_Q7[ 3 ] );
 
         /* last row of XX_Q17 */
         sum1_Q15 = silk_SMLAWB( sum1_Q15,        sum2_Q24,  cb_row_Q7[ 3 ] );
 
         /* last row of XX_Q17 */
-               sum2_Q24 = silk_LSHIFT32( neg_xX_Q24[ 4 ], 1 );
+        sum2_Q24 = silk_LSHIFT32( neg_xX_Q24[ 4 ], 1 );
         sum2_Q24 = silk_MLA( sum2_Q24,        XX_Q17[ 24 ], cb_row_Q7[ 4 ] );
         sum1_Q15 = silk_SMLAWB( sum1_Q15,        sum2_Q24,  cb_row_Q7[ 4 ] );
 
         sum2_Q24 = silk_MLA( sum2_Q24,        XX_Q17[ 24 ], cb_row_Q7[ 4 ] );
         sum1_Q15 = silk_SMLAWB( sum1_Q15,        sum2_Q24,  cb_row_Q7[ 4 ] );
 
-               /* If ever the following assert triggers, increase LTP_CORR_INV_MAX */
+        /* If ever the following assert triggers, increase LTP_CORR_INV_MAX */
         silk_assert( sum1_Q15 >= 0 );
 
         silk_assert( sum1_Q15 >= 0 );
 
-               /* find best */
-               if( sum1_Q15 <= sum1_best_Q15 ) {
-                       sum1_best_Q15 = sum1_Q15;
-                       /* Translate residual energy to bits using high-rate assumption (6 dB ==> 1 bit/sample) */
-                       bits_res_Q8 = silk_SMULBB( subfr_len, silk_lin2log( sum1_Q15 ) - (15 << 7) );
-                       bits_tot_Q8 = silk_ADD_LSHIFT32( bits_res_Q8, cl_Q5[ k ], 2 );
-                       if( bits_tot_Q8 <= *rate_dist_Q8 ) {
-                               *rate_dist_Q8 = bits_tot_Q8;
-                               *res_nrg_Q15 = sum1_Q15;
-                               *ind = (opus_int8)k;
-                       }
-               }
+        /* find best */
+        if( sum1_Q15 <= sum1_best_Q15 ) {
+            sum1_best_Q15 = sum1_Q15;
+            /* Translate residual energy to bits using high-rate assumption (6 dB ==> 1 bit/sample) */
+            bits_res_Q8 = silk_SMULBB( subfr_len, silk_lin2log( sum1_Q15 ) - (15 << 7) );
+            bits_tot_Q8 = silk_ADD_LSHIFT32( bits_res_Q8, cl_Q5[ k ], 2 );
+            if( bits_tot_Q8 <= *rate_dist_Q8 ) {
+                *rate_dist_Q8 = bits_tot_Q8;
+                *res_nrg_Q15 = sum1_Q15;
+                *ind = (opus_int8)k;
+            }
+        }
 
         /* Go to next cbk vector */
         cb_row_Q7 += LTP_ORDER;
 
         /* Go to next cbk vector */
         cb_row_Q7 += LTP_ORDER;
index c011800..1b4a29c 100644 (file)
@@ -78,8 +78,8 @@ void silk_corrMatrix_FIX(
     const opus_int                  L,                                      /* I    Length of vectors                                                           */
     const opus_int                  order,                                  /* I    Max lag for correlation                                                     */
     opus_int32                      *XX,                                    /* O    Pointer to X'*X correlation matrix [ order x order ]                        */
     const opus_int                  L,                                      /* I    Length of vectors                                                           */
     const opus_int                  order,                                  /* I    Max lag for correlation                                                     */
     opus_int32                      *XX,                                    /* O    Pointer to X'*X correlation matrix [ order x order ]                        */
-       opus_int32                      *nrg,                                                                   /* O    Energy of x vector                                                                                                                      */
-    opus_int                        *rshifts,                               /* O       Right shifts of correlations and energy                                     */
+    opus_int32                      *nrg,                                    /* O    Energy of x vector                                                            */
+    opus_int                        *rshifts,                               /* O    Right shifts of correlations and energy                                     */
     int                             arch                                    /* I    Run-time architecture                                                       */
 )
 {
     int                             arch                                    /* I    Run-time architecture                                                       */
 )
 {
@@ -89,9 +89,9 @@ void silk_corrMatrix_FIX(
 
     /* Calculate energy to find shift used to fit in 32 bits */
     silk_sum_sqr_shift( nrg, rshifts, x, L + order - 1 );
 
     /* Calculate energy to find shift used to fit in 32 bits */
     silk_sum_sqr_shift( nrg, rshifts, x, L + order - 1 );
-       energy = *nrg;
+    energy = *nrg;
 
 
-       /* Calculate energy of first column (0) of X: X[:,0]'*X[:,0] */
+    /* Calculate energy of first column (0) of X: X[:,0]'*X[:,0] */
     /* Remove contribution of first order - 1 samples */
     for( i = 0; i < order - 1; i++ ) {
         energy -= silk_RSHIFT32( silk_SMULBB( x[ i ], x[ i ] ), *rshifts );
     /* Remove contribution of first order - 1 samples */
     for( i = 0; i < order - 1; i++ ) {
         energy -= silk_RSHIFT32( silk_SMULBB( x[ i ], x[ i ] ), *rshifts );
@@ -100,13 +100,13 @@ void silk_corrMatrix_FIX(
     /* Calculate energy of remaining columns of X: X[:,j]'*X[:,j] */
     /* Fill out the diagonal of the correlation matrix */
     matrix_ptr( XX, 0, 0, order ) = energy;
     /* Calculate energy of remaining columns of X: X[:,j]'*X[:,j] */
     /* Fill out the diagonal of the correlation matrix */
     matrix_ptr( XX, 0, 0, order ) = energy;
-       silk_assert( energy >= 0 );
+    silk_assert( energy >= 0 );
     ptr1 = &x[ order - 1 ]; /* First sample of column 0 of X */
     for( j = 1; j < order; j++ ) {
         energy = silk_SUB32( energy, silk_RSHIFT32( silk_SMULBB( ptr1[ L - j ], ptr1[ L - j ] ), *rshifts ) );
         energy = silk_ADD32( energy, silk_RSHIFT32( silk_SMULBB( ptr1[ -j ], ptr1[ -j ] ), *rshifts ) );
         matrix_ptr( XX, j, j, order ) = energy;
     ptr1 = &x[ order - 1 ]; /* First sample of column 0 of X */
     for( j = 1; j < order; j++ ) {
         energy = silk_SUB32( energy, silk_RSHIFT32( silk_SMULBB( ptr1[ L - j ], ptr1[ L - j ] ), *rshifts ) );
         energy = silk_ADD32( energy, silk_RSHIFT32( silk_SMULBB( ptr1[ -j ], ptr1[ -j ] ), *rshifts ) );
         matrix_ptr( XX, j, j, order ) = energy;
-               silk_assert( energy >= 0 );
+        silk_assert( energy >= 0 );
     }
 
     ptr2 = &x[ order - 2 ]; /* First sample of column 1 of X */
     }
 
     ptr2 = &x[ order - 2 ]; /* First sample of column 1 of X */
index 4eadd13..aea6fc0 100644 (file)
@@ -33,9 +33,9 @@ POSSIBILITY OF SUCH DAMAGE.
 #include "tuning_parameters.h"
 
 void silk_find_LTP_FIX(
 #include "tuning_parameters.h"
 
 void silk_find_LTP_FIX(
-    opus_int32                      XXLTP_Q17[ MAX_NB_SUBFR * LTP_ORDER * LTP_ORDER ], /* O    Correlation matrix                                                                                              */
-    opus_int32                      xXLTP_Q17[ MAX_NB_SUBFR * LTP_ORDER ],     /* O    Correlation vector                                                                                                                      */
-    const opus_int16                r_ptr[],                                /* I    Residual signal after LPC                                                                              */
+    opus_int32                      XXLTP_Q17[ MAX_NB_SUBFR * LTP_ORDER * LTP_ORDER ], /* O    Correlation matrix                                                */
+    opus_int32                      xXLTP_Q17[ MAX_NB_SUBFR * LTP_ORDER ],    /* O    Correlation vector                                                            */
+    const opus_int16                r_ptr[],                                /* I    Residual signal after LPC                                                    */
     const opus_int                  lag[ MAX_NB_SUBFR ],                    /* I    LTP lags                                                                    */
     const opus_int                  subfr_length,                           /* I    Subframe length                                                             */
     const opus_int                  nb_subfr,                               /* I    Number of subframes                                                         */
     const opus_int                  lag[ MAX_NB_SUBFR ],                    /* I    LTP lags                                                                    */
     const opus_int                  subfr_length,                           /* I    Subframe length                                                             */
     const opus_int                  nb_subfr,                               /* I    Number of subframes                                                         */
@@ -43,56 +43,56 @@ void silk_find_LTP_FIX(
 )
 {
     opus_int   i, k, extra_shifts;
 )
 {
     opus_int   i, k, extra_shifts;
-       opus_int   xx_shifts, xX_shifts, XX_shifts;
+    opus_int   xx_shifts, xX_shifts, XX_shifts;
     const opus_int16 *lag_ptr;
     opus_int32 *XXLTP_Q17_ptr, *xXLTP_Q17_ptr;
     const opus_int16 *lag_ptr;
     opus_int32 *XXLTP_Q17_ptr, *xXLTP_Q17_ptr;
-       opus_int32 xx, nrg, temp;
+    opus_int32 xx, nrg, temp;
 
     xXLTP_Q17_ptr = xXLTP_Q17;
     XXLTP_Q17_ptr = XXLTP_Q17;
     for( k = 0; k < nb_subfr; k++ ) {
         lag_ptr = r_ptr - ( lag[ k ] + LTP_ORDER / 2 );
 
 
     xXLTP_Q17_ptr = xXLTP_Q17;
     XXLTP_Q17_ptr = XXLTP_Q17;
     for( k = 0; k < nb_subfr; k++ ) {
         lag_ptr = r_ptr - ( lag[ k ] + LTP_ORDER / 2 );
 
-        silk_sum_sqr_shift( &xx, &xx_shifts, r_ptr, subfr_length );                                                                    /* xx in Q( -xx_shifts ) */
-        silk_corrMatrix_FIX( lag_ptr, subfr_length, LTP_ORDER, XXLTP_Q17_ptr, &nrg, &XX_shifts, arch );        /* XXLTP_Q17_ptr and nrg in Q( -XX_shifts ) */
-               extra_shifts = xx_shifts - XX_shifts;
-               if( extra_shifts > 0 ) {
-                       /* Shift XX */
-                       xX_shifts = xx_shifts;
-                       for( i = 0; i < LTP_ORDER * LTP_ORDER; i++ ) {
-                               XXLTP_Q17_ptr[ i ] = silk_RSHIFT32( XXLTP_Q17_ptr[ i ], extra_shifts );                         /* Q( -xX_shifts ) */
-                       }
-                       nrg = silk_RSHIFT32( nrg, extra_shifts );                                                                                               /* Q( -xX_shifts ) */
-               } else if( extra_shifts < 0 ) { 
-                       /* Shift xx */
-                       xX_shifts = XX_shifts;
-                       xx = silk_RSHIFT32( xx, -extra_shifts );                                                                                                /* Q( -xX_shifts ) */
-               } else {
-                       xX_shifts = xx_shifts;
-               }
-        silk_corrVector_FIX( lag_ptr, r_ptr, subfr_length, LTP_ORDER, xXLTP_Q17_ptr, xX_shifts, arch );        /* xXLTP_Q17_ptr in Q( -xX_shifts ) */
+        silk_sum_sqr_shift( &xx, &xx_shifts, r_ptr, subfr_length );                                    /* xx in Q( -xx_shifts ) */
+        silk_corrMatrix_FIX( lag_ptr, subfr_length, LTP_ORDER, XXLTP_Q17_ptr, &nrg, &XX_shifts, arch );    /* XXLTP_Q17_ptr and nrg in Q( -XX_shifts ) */
+        extra_shifts = xx_shifts - XX_shifts;
+        if( extra_shifts > 0 ) {
+            /* Shift XX */
+            xX_shifts = xx_shifts;
+            for( i = 0; i < LTP_ORDER * LTP_ORDER; i++ ) {
+                XXLTP_Q17_ptr[ i ] = silk_RSHIFT32( XXLTP_Q17_ptr[ i ], extra_shifts );                /* Q( -xX_shifts ) */
+            }
+            nrg = silk_RSHIFT32( nrg, extra_shifts );                                                /* Q( -xX_shifts ) */
+        } else if( extra_shifts < 0 ) { 
+            /* Shift xx */
+            xX_shifts = XX_shifts;
+            xx = silk_RSHIFT32( xx, -extra_shifts );                                                /* Q( -xX_shifts ) */
+        } else {
+            xX_shifts = xx_shifts;
+        }
+        silk_corrVector_FIX( lag_ptr, r_ptr, subfr_length, LTP_ORDER, xXLTP_Q17_ptr, xX_shifts, arch );    /* xXLTP_Q17_ptr in Q( -xX_shifts ) */
 
 
-               /* At this point all correlations are in Q(-xX_shifts) */
-               temp = silk_SMLAWB( 1, nrg, SILK_FIX_CONST( LTP_CORR_INV_MAX, 16 ) );
-               temp = silk_max( temp, xx );
+        /* At this point all correlations are in Q(-xX_shifts) */
+        temp = silk_SMLAWB( 1, nrg, SILK_FIX_CONST( LTP_CORR_INV_MAX, 16 ) );
+        temp = silk_max( temp, xx );
 TIC(div)
 #if 0
 TIC(div)
 #if 0
-               for( i = 0; i < LTP_ORDER * LTP_ORDER; i++ ) {
-                       XXLTP_Q17_ptr[ i ] = silk_DIV32_varQ( XXLTP_Q17_ptr[ i ], temp, 17 );
-               }
-               for( i = 0; i < LTP_ORDER; i++ ) {
-                       xXLTP_Q17_ptr[ i ] = silk_DIV32_varQ( xXLTP_Q17_ptr[ i ], temp, 17 );
-               }
+        for( i = 0; i < LTP_ORDER * LTP_ORDER; i++ ) {
+            XXLTP_Q17_ptr[ i ] = silk_DIV32_varQ( XXLTP_Q17_ptr[ i ], temp, 17 );
+        }
+        for( i = 0; i < LTP_ORDER; i++ ) {
+            xXLTP_Q17_ptr[ i ] = silk_DIV32_varQ( xXLTP_Q17_ptr[ i ], temp, 17 );
+        }
 #else
 #else
-               for( i = 0; i < LTP_ORDER * LTP_ORDER; i++ ) {
-                       XXLTP_Q17_ptr[ i ] = (opus_int32)( ( ((opus_int64)XXLTP_Q17_ptr[ i ]) << 17 ) / temp );
-               }
-               for( i = 0; i < LTP_ORDER; i++ ) {
-                       xXLTP_Q17_ptr[ i ] = (opus_int32)( ( ((opus_int64)xXLTP_Q17_ptr[ i ]) << 17 ) / temp );
-               }
+        for( i = 0; i < LTP_ORDER * LTP_ORDER; i++ ) {
+            XXLTP_Q17_ptr[ i ] = (opus_int32)( ( ((opus_int64)XXLTP_Q17_ptr[ i ]) << 17 ) / temp );
+        }
+        for( i = 0; i < LTP_ORDER; i++ ) {
+            xXLTP_Q17_ptr[ i ] = (opus_int32)( ( ((opus_int64)xXLTP_Q17_ptr[ i ]) << 17 ) / temp );
+        }
 #endif
 TOC(div)
 #endif
 TOC(div)
-               r_ptr         += subfr_length;
+        r_ptr         += subfr_length;
         XXLTP_Q17_ptr += LTP_ORDER * LTP_ORDER;
         xXLTP_Q17_ptr += LTP_ORDER;
     }
         XXLTP_Q17_ptr += LTP_ORDER * LTP_ORDER;
         xXLTP_Q17_ptr += LTP_ORDER;
     }
index 917dee0..2b286a6 100644 (file)
@@ -87,7 +87,7 @@ void silk_find_pred_coefs_FIX(
 
         /* LTP analysis */
         silk_find_LTP_FIX( XXLTP_Q17, xXLTP_Q17, res_pitch, 
 
         /* LTP analysis */
         silk_find_LTP_FIX( XXLTP_Q17, xXLTP_Q17, res_pitch, 
-                       psEncCtrl->pitchL, psEnc->sCmn.subfr_length, psEnc->sCmn.nb_subfr, psEnc->sCmn.arch );
+            psEncCtrl->pitchL, psEnc->sCmn.subfr_length, psEnc->sCmn.nb_subfr, psEnc->sCmn.arch );
 
         /* Quantize LTP gain parameters */
         silk_quant_LTP_gains( psEncCtrl->LTPCoef_Q14, psEnc->sCmn.indices.LTPIndex, &psEnc->sCmn.indices.PERIndex,
 
         /* Quantize LTP gain parameters */
         silk_quant_LTP_gains( psEncCtrl->LTPCoef_Q14, psEnc->sCmn.indices.LTPIndex, &psEnc->sCmn.indices.PERIndex,
index 4b7513b..992f3bf 100644 (file)
@@ -147,9 +147,9 @@ void silk_find_LPC_FIX(
 
 /* LTP analysis */
 void silk_find_LTP_FIX(
 
 /* LTP analysis */
 void silk_find_LTP_FIX(
-    opus_int32                      XXLTP_Q17[ MAX_NB_SUBFR * LTP_ORDER * LTP_ORDER ], /* O    Correlation matrix                                                                                              */
-    opus_int32                      xXLTP_Q17[ MAX_NB_SUBFR * LTP_ORDER ],     /* O    Correlation vector                                                                                                                      */
-    const opus_int16                r_lpc[],                                /* I    Residual signal after LPC                                                                              */
+    opus_int32                      XXLTP_Q17[ MAX_NB_SUBFR * LTP_ORDER * LTP_ORDER ], /* O    Correlation matrix                                                */
+    opus_int32                      xXLTP_Q17[ MAX_NB_SUBFR * LTP_ORDER ],    /* O    Correlation vector                                                            */
+    const opus_int16                r_lpc[],                                /* I    Residual signal after LPC                                                    */
     const opus_int                  lag[ MAX_NB_SUBFR ],                    /* I    LTP lags                                                                    */
     const opus_int                  subfr_length,                           /* I    Subframe length                                                             */
     const opus_int                  nb_subfr,                               /* I    Number of subframes                                                         */
     const opus_int                  lag[ MAX_NB_SUBFR ],                    /* I    LTP lags                                                                    */
     const opus_int                  subfr_length,                           /* I    Subframe length                                                             */
     const opus_int                  nb_subfr,                               /* I    Number of subframes                                                         */
@@ -207,7 +207,7 @@ void silk_corrMatrix_FIX(
     const opus_int                  L,                                      /* I    Length of vectors                                                           */
     const opus_int                  order,                                  /* I    Max lag for correlation                                                     */
     opus_int32                      *XX,                                    /* O    Pointer to X'*X correlation matrix [ order x order ]                        */
     const opus_int                  L,                                      /* I    Length of vectors                                                           */
     const opus_int                  order,                                  /* I    Max lag for correlation                                                     */
     opus_int32                      *XX,                                    /* O    Pointer to X'*X correlation matrix [ order x order ]                        */
-       opus_int32                      *nrg,                                                                   /* O    Energy of x vector                                                                                                                      */
+    opus_int32                      *nrg,                                    /* O    Energy of x vector                                                            */
     opus_int                        *rshifts,                               /* O    Right shifts of correlations                                                */
     int                              arch                                   /* I    Run-time architecture                                                       */
 );
     opus_int                        *rshifts,                               /* O    Right shifts of correlations                                                */
     int                              arch                                   /* I    Run-time architecture                                                       */
 );
index c3e98a6..7cd303d 100644 (file)
@@ -96,7 +96,7 @@ opus_int silk_pitch_analysis_core(                  /* O    Voicing estimate: 0
 {
     VARDECL( opus_int16, frame_8kHz_buf );
     VARDECL( opus_int16, frame_4kHz );
 {
     VARDECL( opus_int16, frame_8kHz_buf );
     VARDECL( opus_int16, frame_4kHz );
-       VARDECL( opus_int16, frame_scaled );
+    VARDECL( opus_int16, frame_scaled );
     opus_int32 filt_state[ 6 ];
     const opus_int16 *frame, *frame_8kHz;
     opus_int   i, k, d, j;
     opus_int32 filt_state[ 6 ];
     const opus_int16 *frame, *frame_8kHz;
     opus_int   i, k, d, j;
@@ -148,9 +148,9 @@ opus_int silk_pitch_analysis_core(                  /* O    Voicing estimate: 0
         for( i = 0; i < frame_length; i++ ) {
             frame_scaled[ i ] = silk_RSHIFT( frame_unscaled[ i ], shift );
         }
         for( i = 0; i < frame_length; i++ ) {
             frame_scaled[ i ] = silk_RSHIFT( frame_unscaled[ i ], shift );
         }
-               frame = frame_scaled;
-       } else {
-               frame = frame_unscaled;
+        frame = frame_scaled;
+    } else {
+        frame = frame_unscaled;
     }
 
     ALLOC( frame_8kHz_buf, ( Fs_kHz == 8 ) ? 1 : frame_length_8kHz, opus_int16 );
     }
 
     ALLOC( frame_8kHz_buf, ( Fs_kHz == 8 ) ? 1 : frame_length_8kHz, opus_int16 );
@@ -158,14 +158,14 @@ opus_int silk_pitch_analysis_core(                  /* O    Voicing estimate: 0
     if( Fs_kHz == 16 ) {
         silk_memset( filt_state, 0, 2 * sizeof( opus_int32 ) );
         silk_resampler_down2( filt_state, frame_8kHz_buf, frame, frame_length );
     if( Fs_kHz == 16 ) {
         silk_memset( filt_state, 0, 2 * sizeof( opus_int32 ) );
         silk_resampler_down2( filt_state, frame_8kHz_buf, frame, frame_length );
-               frame_8kHz = frame_8kHz_buf;
+        frame_8kHz = frame_8kHz_buf;
     } else if( Fs_kHz == 12 ) {
         silk_memset( filt_state, 0, 6 * sizeof( opus_int32 ) );
         silk_resampler_down2_3( filt_state, frame_8kHz_buf, frame, frame_length );
     } else if( Fs_kHz == 12 ) {
         silk_memset( filt_state, 0, 6 * sizeof( opus_int32 ) );
         silk_resampler_down2_3( filt_state, frame_8kHz_buf, frame, frame_length );
-               frame_8kHz = frame_8kHz_buf;
+        frame_8kHz = frame_8kHz_buf;
     } else {
         silk_assert( Fs_kHz == 8 );
     } else {
         silk_assert( Fs_kHz == 8 );
-               frame_8kHz = frame;
+        frame_8kHz = frame;
     }
 
     /* Decimate again to 4 kHz */
     }
 
     /* Decimate again to 4 kHz */
index 1694db8..2774a97 100644 (file)
@@ -57,7 +57,7 @@ typedef struct {
     /* Buffer for find pitch and noise shape analysis */
     silk_DWORD_ALIGN opus_int16 x_buf[ 2 * MAX_FRAME_LENGTH + LA_SHAPE_MAX ];/* Buffer for find pitch and noise shape analysis  */
     opus_int                    LTPCorr_Q15;                            /* Normalized correlation from pitch lag estimator      */
     /* Buffer for find pitch and noise shape analysis */
     silk_DWORD_ALIGN opus_int16 x_buf[ 2 * MAX_FRAME_LENGTH + LA_SHAPE_MAX ];/* Buffer for find pitch and noise shape analysis  */
     opus_int                    LTPCorr_Q15;                            /* Normalized correlation from pitch lag estimator      */
-       opus_int32                                      resNrgSmth;
+    opus_int32                    resNrgSmth;
 } silk_encoder_state_FIX;
 
 /************************/
 } silk_encoder_state_FIX;
 
 /************************/
index 8f24f93..7bc7173 100644 (file)
@@ -42,7 +42,7 @@ double silk_energy_FLP(
 
     /* 4x unrolled loop */
     result = 0.0;
 
     /* 4x unrolled loop */
     result = 0.0;
-       for( i = 0; i < dataSize - 3; i += 4 ) {
+    for( i = 0; i < dataSize - 3; i += 4 ) {
         result += data[ i + 0 ] * (double)data[ i + 0 ] +
                   data[ i + 1 ] * (double)data[ i + 1 ] +
                   data[ i + 2 ] * (double)data[ i + 2 ] +
         result += data[ i + 0 ] * (double)data[ i + 0 ] +
                   data[ i + 1 ] * (double)data[ i + 1 ] +
                   data[ i + 2 ] * (double)data[ i + 2 ] +
index 8bc10dd..2e1a0fe 100644 (file)
@@ -34,7 +34,7 @@ POSSIBILITY OF SUCH DAMAGE.
 
 void silk_find_LTP_FLP(
     silk_float                      XX[ MAX_NB_SUBFR * LTP_ORDER * LTP_ORDER ], /* O    Weight for LTP quantization       */
 
 void silk_find_LTP_FLP(
     silk_float                      XX[ MAX_NB_SUBFR * LTP_ORDER * LTP_ORDER ], /* O    Weight for LTP quantization       */
-    silk_float                      xX[ MAX_NB_SUBFR * LTP_ORDER ],            /* O    Weight for LTP quantization       */
+    silk_float                      xX[ MAX_NB_SUBFR * LTP_ORDER ],        /* O    Weight for LTP quantization       */
     const silk_float                r_ptr[],                            /* I    LPC residual                                */
     const opus_int                  lag[  MAX_NB_SUBFR ],               /* I    LTP lags                                    */
     const opus_int                  subfr_length,                       /* I    Subframe length                             */
     const silk_float                r_ptr[],                            /* I    LPC residual                                */
     const opus_int                  lag[  MAX_NB_SUBFR ],               /* I    LTP lags                                    */
     const opus_int                  subfr_length,                       /* I    Subframe length                             */
index 0c8a896..8679974 100644 (file)
@@ -61,12 +61,12 @@ void silk_find_pred_coefs_FLP(
         /**********/
         silk_assert( psEnc->sCmn.ltp_mem_length - psEnc->sCmn.predictLPCOrder >= psEncCtrl->pitchL[ 0 ] + LTP_ORDER / 2 );
 
         /**********/
         silk_assert( psEnc->sCmn.ltp_mem_length - psEnc->sCmn.predictLPCOrder >= psEncCtrl->pitchL[ 0 ] + LTP_ORDER / 2 );
 
-               /* LTP analysis */
+        /* LTP analysis */
         silk_find_LTP_FLP( XXLTP, xXLTP, res_pitch, psEncCtrl->pitchL, psEnc->sCmn.subfr_length, psEnc->sCmn.nb_subfr );
 
         /* Quantize LTP gain parameters */
         silk_quant_LTP_gains_FLP( psEncCtrl->LTPCoef, psEnc->sCmn.indices.LTPIndex, &psEnc->sCmn.indices.PERIndex,
         silk_find_LTP_FLP( XXLTP, xXLTP, res_pitch, psEncCtrl->pitchL, psEnc->sCmn.subfr_length, psEnc->sCmn.nb_subfr );
 
         /* Quantize LTP gain parameters */
         silk_quant_LTP_gains_FLP( psEncCtrl->LTPCoef, psEnc->sCmn.indices.LTPIndex, &psEnc->sCmn.indices.PERIndex,
-                       &psEncCtrl->LTPredCodGain, XXLTP, xXLTP, psEnc->sCmn.subfr_length, psEnc->sCmn.nb_subfr, psEnc->sCmn.arch );
+            &psEncCtrl->LTPredCodGain, XXLTP, xXLTP, psEnc->sCmn.subfr_length, psEnc->sCmn.nb_subfr, psEnc->sCmn.arch );
 
         /* Control LTP scaling */
         silk_LTP_scale_ctrl_FLP( psEnc, psEncCtrl, condCoding );
 
         /* Control LTP scaling */
         silk_LTP_scale_ctrl_FLP( psEnc, psEncCtrl, condCoding );
index 6eb0e89..1448008 100644 (file)
@@ -42,12 +42,12 @@ void silk_k2a_FLP(
     silk_float rck, tmp1, tmp2;
 
     for( k = 0; k < order; k++ ) {
     silk_float rck, tmp1, tmp2;
 
     for( k = 0; k < order; k++ ) {
-               rck = rc[ k ];
+        rck = rc[ k ];
         for( n = 0; n < (k + 1) >> 1; n++ ) {
         for( n = 0; n < (k + 1) >> 1; n++ ) {
-                       tmp1 = A[ n ];
-                       tmp2 = A[ k - n - 1 ];
+            tmp1 = A[ n ];
+            tmp2 = A[ k - n - 1 ];
             A[ n ]         = tmp1 + tmp2 * rck;
             A[ n ]         = tmp1 + tmp2 * rck;
-                       A[ k - n - 1 ] = tmp2 + tmp1 * rck;
+            A[ k - n - 1 ] = tmp2 + tmp1 * rck;
         }
         A[ k ] = -rck;
     }
         }
         A[ k ] = -rck;
     }
index fbd2f1a..343e6c1 100644 (file)
@@ -144,7 +144,7 @@ void silk_find_LPC_FLP(
 /* LTP analysis */
 void silk_find_LTP_FLP(
     silk_float                      XX[ MAX_NB_SUBFR * LTP_ORDER * LTP_ORDER ], /* O    Weight for LTP quantization       */
 /* LTP analysis */
 void silk_find_LTP_FLP(
     silk_float                      XX[ MAX_NB_SUBFR * LTP_ORDER * LTP_ORDER ], /* O    Weight for LTP quantization       */
-    silk_float                      xX[ MAX_NB_SUBFR * LTP_ORDER ],            /* O    Weight for LTP quantization       */
+    silk_float                      xX[ MAX_NB_SUBFR * LTP_ORDER ],        /* O    Weight for LTP quantization       */
     const silk_float                r_ptr[],                            /* I    LPC residual                                */
     const opus_int                  lag[  MAX_NB_SUBFR ],               /* I    LTP lags                                    */
     const opus_int                  subfr_length,                       /* I    Subframe length                             */
     const silk_float                r_ptr[],                            /* I    LPC residual                                */
     const opus_int                  lag[  MAX_NB_SUBFR ],               /* I    LTP lags                                    */
     const opus_int                  subfr_length,                       /* I    Subframe length                             */
@@ -185,14 +185,14 @@ void silk_LPC_analysis_filter_FLP(
 
 /* LTP tap quantizer */
 void silk_quant_LTP_gains_FLP(
 
 /* LTP tap quantizer */
 void silk_quant_LTP_gains_FLP(
-    silk_float                      B[ MAX_NB_SUBFR * LTP_ORDER ],      /* O    Quantized LTP gains                                                    */
+    silk_float                      B[ MAX_NB_SUBFR * LTP_ORDER ],      /* O    Quantized LTP gains                            */
     opus_int8                       cbk_index[ MAX_NB_SUBFR ],          /* O    Codebook index                              */
     opus_int8                       *periodicity_index,                 /* O    Periodicity index                           */
     opus_int8                       cbk_index[ MAX_NB_SUBFR ],          /* O    Codebook index                              */
     opus_int8                       *periodicity_index,                 /* O    Periodicity index                           */
-       silk_float                      *pred_gain_dB,                                          /* O    LTP prediction gain                                                     */
-    const silk_float                XX[ MAX_NB_SUBFR * LTP_ORDER * LTP_ORDER ], /* I    Correlation matrix                                     */
-    const silk_float                xX[ MAX_NB_SUBFR * LTP_ORDER ],            /* I    Correlation vector                                                      */
-    const opus_int                                     subfr_len,                                                      /* I    Number of samples per subframe                          */
-    const opus_int                                     nb_subfr,                           /* I    Number of subframes                                                 */
+    silk_float                      *pred_gain_dB,                        /* O    LTP prediction gain                            */
+    const silk_float                XX[ MAX_NB_SUBFR * LTP_ORDER * LTP_ORDER ], /* I    Correlation matrix                    */
+    const silk_float                xX[ MAX_NB_SUBFR * LTP_ORDER ],        /* I    Correlation vector                            */
+    const opus_int                    subfr_len,                            /* I    Number of samples per subframe                */
+    const opus_int                    nb_subfr,                           /* I    Number of subframes                            */
     int                             arch                                /* I    Run-time architecture                       */
 );
 
     int                             arch                                /* I    Run-time architecture                       */
 );
 
index 85dba00..cb3d8a5 100644 (file)
@@ -121,7 +121,7 @@ static OPUS_INLINE void limit_coefs(
     opus_int   i, iter, ind = 0;
     silk_float tmp, maxabs, chirp;
 
     opus_int   i, iter, ind = 0;
     silk_float tmp, maxabs, chirp;
 
-       for( iter = 0; iter < 10; iter++ ) {
+    for( iter = 0; iter < 10; iter++ ) {
         /* Find maximum absolute value */
         maxabs = -1.0f;
         for( i = 0; i < order; i++ ) {
         /* Find maximum absolute value */
         maxabs = -1.0f;
         for( i = 0; i < order; i++ ) {
index 9f03e57..81e0b66 100644 (file)
@@ -172,14 +172,14 @@ void silk_NSQ_wrapper_FLP(
 /* Floating-point Silk LTP quantiation wrapper */
 /***********************************************/
 void silk_quant_LTP_gains_FLP(
 /* Floating-point Silk LTP quantiation wrapper */
 /***********************************************/
 void silk_quant_LTP_gains_FLP(
-    silk_float                      B[ MAX_NB_SUBFR * LTP_ORDER ],      /* O    Quantized LTP gains                                                    */
+    silk_float                      B[ MAX_NB_SUBFR * LTP_ORDER ],      /* O    Quantized LTP gains                            */
     opus_int8                       cbk_index[ MAX_NB_SUBFR ],          /* O    Codebook index                              */
     opus_int8                       *periodicity_index,                 /* O    Periodicity index                           */
     opus_int8                       cbk_index[ MAX_NB_SUBFR ],          /* O    Codebook index                              */
     opus_int8                       *periodicity_index,                 /* O    Periodicity index                           */
-       silk_float                      *pred_gain_dB,                                          /* O    LTP prediction gain                                                     */
-    const silk_float                XX[ MAX_NB_SUBFR * LTP_ORDER * LTP_ORDER ], /* I    Correlation matrix                                     */
-    const silk_float                xX[ MAX_NB_SUBFR * LTP_ORDER ],            /* I    Correlation vector                                                      */
-    const opus_int                                     subfr_len,                                                      /* I    Number of samples per subframe                          */
-    const opus_int                                     nb_subfr,                           /* I    Number of subframes                                                 */
+    silk_float                      *pred_gain_dB,                        /* O    LTP prediction gain                            */
+    const silk_float                XX[ MAX_NB_SUBFR * LTP_ORDER * LTP_ORDER ], /* I    Correlation matrix                    */
+    const silk_float                xX[ MAX_NB_SUBFR * LTP_ORDER ],        /* I    Correlation vector                            */
+    const opus_int                    subfr_len,                            /* I    Number of samples per subframe                */
+    const opus_int                    nb_subfr,                           /* I    Number of subframes                            */
     int                             arch                                /* I    Run-time architecture                       */
 )
 {
     int                             arch                                /* I    Run-time architecture                       */
 )
 {
@@ -201,5 +201,5 @@ void silk_quant_LTP_gains_FLP(
         B[ i ] = (silk_float)B_Q14[ i ] * ( 1.0f / 16384.0f );
     }
 
         B[ i ] = (silk_float)B_Q14[ i ] * ( 1.0f / 16384.0f );
     }
 
-       *pred_gain_dB = (silk_float)pred_gain_dB_Q7 * ( 1.0f / 128.0f );
+    *pred_gain_dB = (silk_float)pred_gain_dB_Q7 * ( 1.0f / 128.0f );
 }
 }
index 6eacf69..38e1eab 100644 (file)
@@ -205,13 +205,13 @@ void silk_interpolate(
 
 /* LTP tap quantizer */
 void silk_quant_LTP_gains(
 
 /* LTP tap quantizer */
 void silk_quant_LTP_gains(
-    opus_int16                  B_Q14[ MAX_NB_SUBFR * LTP_ORDER ],          /* O       Quantized LTP gains                             */
+    opus_int16                  B_Q14[ MAX_NB_SUBFR * LTP_ORDER ],          /* O    Quantized LTP gains                */
     opus_int8                   cbk_index[ MAX_NB_SUBFR ],                  /* O    Codebook Index                  */
     opus_int8                   *periodicity_index,                         /* O    Periodicity Index               */
     opus_int8                   cbk_index[ MAX_NB_SUBFR ],                  /* O    Codebook Index                  */
     opus_int8                   *periodicity_index,                         /* O    Periodicity Index               */
-       opus_int                        *pred_gain_dB_Q7,                                                       /* O    LTP prediction gain                             */
+    opus_int                    *pred_gain_dB_Q7,                            /* O    LTP prediction gain                */
     const opus_int32            XX_Q17[ MAX_NB_SUBFR*LTP_ORDER*LTP_ORDER ], /* I    Correlation matrix in Q18       */
     const opus_int32            xX_Q17[ MAX_NB_SUBFR*LTP_ORDER*LTP_ORDER ], /* I    Correlation vector in Q18       */
     const opus_int32            XX_Q17[ MAX_NB_SUBFR*LTP_ORDER*LTP_ORDER ], /* I    Correlation matrix in Q18       */
     const opus_int32            xX_Q17[ MAX_NB_SUBFR*LTP_ORDER*LTP_ORDER ], /* I    Correlation vector in Q18       */
-    const opus_int              subfr_len,                                                                     /* I    Number of samples per subframe  */
+    const opus_int              subfr_len,                                    /* I    Number of samples per subframe  */
     const opus_int              nb_subfr,                                   /* I    Number of subframes             */
     int                         arch                                        /* I    Run-time architecture           */
 );
     const opus_int              nb_subfr,                                   /* I    Number of subframes             */
     int                         arch                                        /* I    Run-time architecture           */
 );
@@ -219,13 +219,13 @@ void silk_quant_LTP_gains(
 /* Entropy constrained matrix-weighted VQ, for a single input data vector */
 void silk_VQ_WMat_EC_c(
     opus_int8                   *ind,                           /* O    index of best codebook vector               */
 /* Entropy constrained matrix-weighted VQ, for a single input data vector */
 void silk_VQ_WMat_EC_c(
     opus_int8                   *ind,                           /* O    index of best codebook vector               */
-    opus_int32                  *res_nrg_Q15,                                  /* O    best residual energy                                            */
-    opus_int32                  *rate_dist_Q8,                  /* O    best total bitrate                                                     */
-    const opus_int32            *XX_Q17,                                               /* I    correlation matrix                          */
-    const opus_int32            *xX_Q17,                                               /* I    correlation vector                                                      */
+    opus_int32                  *res_nrg_Q15,                    /* O    best residual energy                        */
+    opus_int32                  *rate_dist_Q8,                  /* O    best total bitrate                            */
+    const opus_int32            *XX_Q17,                        /* I    correlation matrix                          */
+    const opus_int32            *xX_Q17,                        /* I    correlation vector                            */
     const opus_int8             *cb_Q7,                         /* I    codebook                                    */
     const opus_uint8            *cl_Q5,                         /* I    code length for each codebook vector        */
     const opus_int8             *cb_Q7,                         /* I    codebook                                    */
     const opus_uint8            *cl_Q5,                         /* I    code length for each codebook vector        */
-    const opus_int              subfr_len,                                             /* I    number of samples per subframe                          */
+    const opus_int              subfr_len,                        /* I    number of samples per subframe                */
     const opus_int              L                               /* I    number of vectors in codebook               */
 );
 
     const opus_int              L                               /* I    number of vectors in codebook               */
 );
 
@@ -242,7 +242,7 @@ void silk_NSQ_c(
     const silk_encoder_state    *psEncC,                                    /* I/O  Encoder State                   */
     silk_nsq_state              *NSQ,                                       /* I/O  NSQ state                       */
     SideInfoIndices             *psIndices,                                 /* I/O  Quantization Indices            */
     const silk_encoder_state    *psEncC,                                    /* I/O  Encoder State                   */
     silk_nsq_state              *NSQ,                                       /* I/O  NSQ state                       */
     SideInfoIndices             *psIndices,                                 /* I/O  Quantization Indices            */
-    const opus_int16            x16[],                                                                         /* I    Input                           */
+    const opus_int16            x16[],                                        /* I    Input                           */
     opus_int8                   pulses[],                                   /* O    Quantized pulse signal          */
     const opus_int16            PredCoef_Q12[ 2 * MAX_LPC_ORDER ],          /* I    Short term prediction coefs     */
     const opus_int16            LTPCoef_Q14[ LTP_ORDER * MAX_NB_SUBFR ],    /* I    Long term prediction coefs      */
     opus_int8                   pulses[],                                   /* O    Quantized pulse signal          */
     const opus_int16            PredCoef_Q12[ 2 * MAX_LPC_ORDER ],          /* I    Short term prediction coefs     */
     const opus_int16            LTPCoef_Q14[ LTP_ORDER * MAX_NB_SUBFR ],    /* I    Long term prediction coefs      */
@@ -268,7 +268,7 @@ void silk_NSQ_del_dec_c(
     const silk_encoder_state    *psEncC,                                    /* I/O  Encoder State                   */
     silk_nsq_state              *NSQ,                                       /* I/O  NSQ state                       */
     SideInfoIndices             *psIndices,                                 /* I/O  Quantization Indices            */
     const silk_encoder_state    *psEncC,                                    /* I/O  Encoder State                   */
     silk_nsq_state              *NSQ,                                       /* I/O  NSQ state                       */
     SideInfoIndices             *psIndices,                                 /* I/O  Quantization Indices            */
-    const opus_int16            x16[],                                                                         /* I    Input                           */
+    const opus_int16            x16[],                                        /* I    Input                           */
     opus_int8                   pulses[],                                   /* O    Quantized pulse signal          */
     const opus_int16            PredCoef_Q12[ 2 * MAX_LPC_ORDER ],          /* I    Short term prediction coefs     */
     const opus_int16            LTPCoef_Q14[ LTP_ORDER * MAX_NB_SUBFR ],    /* I    Long term prediction coefs      */
     opus_int8                   pulses[],                                   /* O    Quantized pulse signal          */
     const opus_int16            PredCoef_Q12[ 2 * MAX_LPC_ORDER ],          /* I    Short term prediction coefs     */
     const opus_int16            LTPCoef_Q14[ LTP_ORDER * MAX_NB_SUBFR ],    /* I    Long term prediction coefs      */
index 6849492..23f8569 100644 (file)
@@ -32,13 +32,13 @@ POSSIBILITY OF SUCH DAMAGE.
 #include "main.h"
 
 void silk_quant_LTP_gains(
 #include "main.h"
 
 void silk_quant_LTP_gains(
-    opus_int16                  B_Q14[ MAX_NB_SUBFR * LTP_ORDER ],          /* O       Quantized LTP gains                             */
+    opus_int16                  B_Q14[ MAX_NB_SUBFR * LTP_ORDER ],          /* O    Quantized LTP gains                */
     opus_int8                   cbk_index[ MAX_NB_SUBFR ],                  /* O    Codebook Index                  */
     opus_int8                   *periodicity_index,                         /* O    Periodicity Index               */
     opus_int8                   cbk_index[ MAX_NB_SUBFR ],                  /* O    Codebook Index                  */
     opus_int8                   *periodicity_index,                         /* O    Periodicity Index               */
-       opus_int                        *pred_gain_dB_Q7,                                                       /* O    LTP prediction gain                             */
+    opus_int                    *pred_gain_dB_Q7,                            /* O    LTP prediction gain                */
     const opus_int32            XX_Q17[ MAX_NB_SUBFR*LTP_ORDER*LTP_ORDER ], /* I    Correlation matrix in Q18       */
     const opus_int32            xX_Q17[ MAX_NB_SUBFR*LTP_ORDER*LTP_ORDER ], /* I    Correlation vector in Q18       */
     const opus_int32            XX_Q17[ MAX_NB_SUBFR*LTP_ORDER*LTP_ORDER ], /* I    Correlation matrix in Q18       */
     const opus_int32            xX_Q17[ MAX_NB_SUBFR*LTP_ORDER*LTP_ORDER ], /* I    Correlation vector in Q18       */
-    const opus_int              subfr_len,                                                                     /* I    Number of samples per subframe  */
+    const opus_int              subfr_len,                                    /* I    Number of samples per subframe  */
     const opus_int              nb_subfr,                                   /* I    Number of subframes             */
     int                         arch                                        /* I    Run-time architecture           */
 )
     const opus_int              nb_subfr,                                   /* I    Number of subframes             */
     int                         arch                                        /* I    Run-time architecture           */
 )
@@ -66,23 +66,23 @@ void silk_quant_LTP_gains(
         xX_Q17_ptr = xX_Q17;
         b_Q14_ptr  = B_Q14;
 
         xX_Q17_ptr = xX_Q17;
         b_Q14_ptr  = B_Q14;
 
-               res_nrg_Q15 = 0;
+        res_nrg_Q15 = 0;
         rate_dist_Q7 = 0;
         for( j = 0; j < nb_subfr; j++ ) {
             silk_VQ_WMat_EC(
                 &temp_idx[ j ],         /* O    index of best codebook vector                           */
         rate_dist_Q7 = 0;
         for( j = 0; j < nb_subfr; j++ ) {
             silk_VQ_WMat_EC(
                 &temp_idx[ j ],         /* O    index of best codebook vector                           */
-                               &res_nrg_Q15_subfr,             /* O    residual energy                                                                                 */
+                &res_nrg_Q15_subfr,        /* O    residual energy                                            */
                 &rate_dist_Q7_subfr,    /* O    best weighted quantization error + mu * rate            */
                 XX_Q17_ptr,             /* I    correlation matrix                                      */
                 &rate_dist_Q7_subfr,    /* O    best weighted quantization error + mu * rate            */
                 XX_Q17_ptr,             /* I    correlation matrix                                      */
-                xX_Q17_ptr,             /* I    correlation vector                                                                             */
+                xX_Q17_ptr,             /* I    correlation vector                                        */
                 cbk_ptr_Q7,             /* I    codebook                                                */
                 cl_ptr_Q5,              /* I    code length for each codebook vector                    */
                 cbk_ptr_Q7,             /* I    codebook                                                */
                 cl_ptr_Q5,              /* I    code length for each codebook vector                    */
-                subfr_len,              /* I    number of samples per subframe                                 */
+                subfr_len,              /* I    number of samples per subframe                            */
                 cbk_size,               /* I    number of vectors in codebook                           */
                 arch                    /* I    Run-time architecture                                   */
             );
 
                 cbk_size,               /* I    number of vectors in codebook                           */
                 arch                    /* I    Run-time architecture                                   */
             );
 
-                       res_nrg_Q15   = silk_ADD_POS_SAT32( res_nrg_Q15, res_nrg_Q15_subfr );
+            res_nrg_Q15   = silk_ADD_POS_SAT32( res_nrg_Q15, res_nrg_Q15_subfr );
             rate_dist_Q7 = silk_ADD_POS_SAT32( rate_dist_Q7, rate_dist_Q7_subfr );
 
             b_Q14_ptr  += LTP_ORDER;
             rate_dist_Q7 = silk_ADD_POS_SAT32( rate_dist_Q7, rate_dist_Q7_subfr );
 
             b_Q14_ptr  += LTP_ORDER;
@@ -104,12 +104,12 @@ void silk_quant_LTP_gains(
         }
     }
 
         }
     }
 
-       if( nb_subfr == 2 ) {
-               res_nrg_Q15 = silk_RSHIFT32( res_nrg_Q15, 1 );
-       } else {
-               res_nrg_Q15 = silk_RSHIFT32( res_nrg_Q15, 2 );
-       }
+    if( nb_subfr == 2 ) {
+        res_nrg_Q15 = silk_RSHIFT32( res_nrg_Q15, 1 );
+    } else {
+        res_nrg_Q15 = silk_RSHIFT32( res_nrg_Q15, 2 );
+    }
 
 
-       *pred_gain_dB_Q7 = (opus_int)silk_SMULBB( -3, silk_lin2log( res_nrg_Q15 ) - ( 15 << 7 ) );
+    *pred_gain_dB_Q7 = (opus_int)silk_SMULBB( -3, silk_lin2log( res_nrg_Q15 ) - ( 15 << 7 ) );
 }
 
 }
 
index 977e8ab..128f1a9 100644 (file)
@@ -54,7 +54,7 @@ extern "C"
 #define FIND_LPC_COND_FAC                               1e-5f
 
 /* LTP analysis defines */
 #define FIND_LPC_COND_FAC                               1e-5f
 
 /* LTP analysis defines */
-#define LTP_CORR_INV_MAX                                                               0.02f
+#define LTP_CORR_INV_MAX                                0.02f
 
 /***********************/
 /* High pass filtering */
 
 /***********************/
 /* High pass filtering */