ref: 90f8c5ef4d882dac72a6d42b5e3ee21d8593cdc5
parent: 6e40eb5d75cbaccae9da2667549c4de8c347ffd1
author: Koen Vos <koenvos@users.noreply.github.com>
date: Sun Feb 21 11:21:03 EST 2016
Clean up: replace tabs by spaces
--- a/silk/A2NLSF.c
+++ b/silk/A2NLSF.c
@@ -245,7 +245,7 @@
}
/* 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 */
--- a/silk/LPC_fit.c
+++ b/silk/LPC_fit.c
@@ -34,14 +34,14 @@
/* 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 */
)
{
- 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++ ) {
--- a/silk/LPC_inv_pred_gain.c
+++ b/silk/LPC_inv_pred_gain.c
@@ -79,7 +79,7 @@
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/silk/NSQ.c
+++ b/silk/NSQ.c
@@ -78,7 +78,7 @@
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 */
@@ -436,7 +436,7 @@
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 ];
}
}
--- a/silk/NSQ_del_dec.c
+++ b/silk/NSQ_del_dec.c
@@ -118,7 +118,7 @@
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 */
--- a/silk/SigProc_FIX.h
+++ b/silk/SigProc_FIX.h
@@ -277,7 +277,7 @@
/* 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 */
--- a/silk/VQ_WMat_EC.c
+++ b/silk/VQ_WMat_EC.c
@@ -34,38 +34,38 @@
/* 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_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;
- opus_int32 neg_xX_Q24[ 5 ];
+ opus_int32 neg_xX_Q24[ 5 ];
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;
- *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 */
- /* 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 ] );
@@ -98,25 +98,25 @@
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 ] );
- /* 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 );
- /* 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;
--- a/silk/fixed/corrMatrix_FIX.c
+++ b/silk/fixed/corrMatrix_FIX.c
@@ -78,8 +78,8 @@
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 */
)
{
@@ -89,9 +89,9 @@
/* 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 );
@@ -100,13 +100,13 @@
/* 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;
- silk_assert( energy >= 0 );
+ silk_assert( energy >= 0 );
}
ptr2 = &x[ order - 2 ]; /* First sample of column 1 of X */
--- a/silk/fixed/find_LTP_FIX.c
+++ b/silk/fixed/find_LTP_FIX.c
@@ -33,9 +33,9 @@
#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 */
@@ -43,10 +43,10 @@
)
{
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;
- opus_int32 xx, nrg, temp;
+ opus_int32 xx, nrg, temp;
xXLTP_Q17_ptr = xXLTP_Q17;
XXLTP_Q17_ptr = XXLTP_Q17;
@@ -53,46 +53,46 @@
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
- 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
- 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)
- r_ptr += subfr_length;
+ r_ptr += subfr_length;
XXLTP_Q17_ptr += LTP_ORDER * LTP_ORDER;
xXLTP_Q17_ptr += LTP_ORDER;
}
--- a/silk/fixed/find_pred_coefs_FIX.c
+++ b/silk/fixed/find_pred_coefs_FIX.c
@@ -87,7 +87,7 @@
/* 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,
--- a/silk/fixed/main_FIX.h
+++ b/silk/fixed/main_FIX.h
@@ -147,9 +147,9 @@
/* 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 */
@@ -207,7 +207,7 @@
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 */
);
--- a/silk/fixed/pitch_analysis_core_FIX.c
+++ b/silk/fixed/pitch_analysis_core_FIX.c
@@ -96,7 +96,7 @@
{
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;
@@ -148,9 +148,9 @@
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 );
@@ -158,14 +158,14 @@
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 );
- frame_8kHz = frame_8kHz_buf;
+ frame_8kHz = frame_8kHz_buf;
} else {
silk_assert( Fs_kHz == 8 );
- frame_8kHz = frame;
+ frame_8kHz = frame;
}
/* Decimate again to 4 kHz */
--- a/silk/fixed/structs_FIX.h
+++ b/silk/fixed/structs_FIX.h
@@ -57,7 +57,7 @@
/* 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;
/************************/
--- a/silk/float/energy_FLP.c
+++ b/silk/float/energy_FLP.c
@@ -42,7 +42,7 @@
/* 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 ] +
--- a/silk/float/find_LTP_FLP.c
+++ b/silk/float/find_LTP_FLP.c
@@ -34,7 +34,7 @@
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 */
--- a/silk/float/find_pred_coefs_FLP.c
+++ b/silk/float/find_pred_coefs_FLP.c
@@ -61,12 +61,12 @@
/**********/
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,
- &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 );
--- a/silk/float/k2a_FLP.c
+++ b/silk/float/k2a_FLP.c
@@ -42,12 +42,12 @@
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++ ) {
- tmp1 = A[ n ];
- tmp2 = A[ k - n - 1 ];
+ tmp1 = A[ n ];
+ tmp2 = A[ k - n - 1 ];
A[ n ] = tmp1 + tmp2 * rck;
- A[ k - n - 1 ] = tmp2 + tmp1 * rck;
+ A[ k - n - 1 ] = tmp2 + tmp1 * rck;
}
A[ k ] = -rck;
}
--- a/silk/float/main_FLP.h
+++ b/silk/float/main_FLP.h
@@ -144,7 +144,7 @@
/* 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 */
@@ -185,14 +185,14 @@
/* 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 */
- 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 */
);
--- a/silk/float/noise_shape_analysis_FLP.c
+++ b/silk/float/noise_shape_analysis_FLP.c
@@ -121,7 +121,7 @@
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++ ) {
--- a/silk/float/wrappers_FLP.c
+++ b/silk/float/wrappers_FLP.c
@@ -172,14 +172,14 @@
/* 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 */
- 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 */
)
{
@@ -201,5 +201,5 @@
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 );
}
--- a/silk/main.h
+++ b/silk/main.h
@@ -205,13 +205,13 @@
/* 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_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_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 */
);
@@ -219,13 +219,13 @@
/* 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_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 */
);
@@ -242,7 +242,7 @@
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 */
@@ -268,7 +268,7 @@
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 */
--- a/silk/quant_LTP_gains.c
+++ b/silk/quant_LTP_gains.c
@@ -32,13 +32,13 @@
#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_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_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 */
)
@@ -66,23 +66,23 @@
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 */
- &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 */
- 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 */
- 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 */
);
- 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;
@@ -104,12 +104,12 @@
}
}
- 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 ) );
}
--- a/silk/tuning_parameters.h
+++ b/silk/tuning_parameters.h
@@ -54,7 +54,7 @@
#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 */