diff options
author | Koen Vos <koen.vos@skype.net> | 2011-10-28 19:44:26 -0400 |
---|---|---|
committer | Jean-Marc Valin <jmvalin@jmvalin.ca> | 2011-10-28 19:44:26 -0400 |
commit | acc7a6c78b266e3ef0e1f91ee405af92a0989dec (patch) | |
tree | d3e32cc66cf96fecdaffc924ff0d051028b72f31 /silk/float | |
parent | 2d4f61409186c7efa831387bf14e2164607a805a (diff) | |
download | opus-acc7a6c78b266e3ef0e1f91ee405af92a0989dec.tar.gz |
Reformatting changes with an update to the MSVC project files
Diffstat (limited to 'silk/float')
36 files changed, 824 insertions, 898 deletions
diff --git a/silk/float/LPC_analysis_filter_FLP.c b/silk/float/LPC_analysis_filter_FLP.c index c91ef0ba..1413ff5a 100644 --- a/silk/float/LPC_analysis_filter_FLP.c +++ b/silk/float/LPC_analysis_filter_FLP.c @@ -51,7 +51,7 @@ static inline void silk_LPC_analysis_filter16_FLP( silk_float LPC_pred; const silk_float *s_ptr; - for ( ix = 16; ix < length; ix++) { + for( ix = 16; ix < length; ix++ ) { s_ptr = &s[ix - 1]; /* short-term prediction */ @@ -89,7 +89,7 @@ static inline void silk_LPC_analysis_filter14_FLP( silk_float LPC_pred; const silk_float *s_ptr; - for ( ix = 14; ix < length; ix++) { + for( ix = 14; ix < length; ix++ ) { s_ptr = &s[ix - 1]; /* short-term prediction */ @@ -125,7 +125,7 @@ static inline void silk_LPC_analysis_filter12_FLP( silk_float LPC_pred; const silk_float *s_ptr; - for ( ix = 12; ix < length; ix++) { + for( ix = 12; ix < length; ix++ ) { s_ptr = &s[ix - 1]; /* short-term prediction */ @@ -159,7 +159,7 @@ static inline void silk_LPC_analysis_filter10_FLP( silk_float LPC_pred; const silk_float *s_ptr; - for ( ix = 10; ix < length; ix++) { + for( ix = 10; ix < length; ix++ ) { s_ptr = &s[ix - 1]; /* short-term prediction */ @@ -191,7 +191,7 @@ static inline void silk_LPC_analysis_filter8_FLP( silk_float LPC_pred; const silk_float *s_ptr; - for ( ix = 8; ix < length; ix++) { + for( ix = 8; ix < length; ix++ ) { s_ptr = &s[ix - 1]; /* short-term prediction */ @@ -221,7 +221,7 @@ static inline void silk_LPC_analysis_filter6_FLP( silk_float LPC_pred; const silk_float *s_ptr; - for ( ix = 6; ix < length; ix++) { + for( ix = 6; ix < length; ix++ ) { s_ptr = &s[ix - 1]; /* short-term prediction */ @@ -243,13 +243,12 @@ static inline void silk_LPC_analysis_filter6_FLP( /* filter always starts with zero state */ /* first Order output samples are set to zero */ /************************************************/ - void silk_LPC_analysis_filter_FLP( - silk_float r_LPC[], /* O LPC residual signal */ - const silk_float PredCoef[], /* I LPC coefficients */ - const silk_float s[], /* I Input signal */ - const opus_int length, /* I Length of input signal */ - const opus_int Order /* I LPC order */ + silk_float r_LPC[], /* O LPC residual signal */ + const silk_float PredCoef[], /* I LPC coefficients */ + const silk_float s[], /* I Input signal */ + const opus_int length, /* I Length of input signal */ + const opus_int Order /* I LPC order */ ) { silk_assert( Order <= length ); diff --git a/silk/float/LPC_inv_pred_gain_FLP.c b/silk/float/LPC_inv_pred_gain_FLP.c index a141d111..d7a5d87e 100644 --- a/silk/float/LPC_inv_pred_gain_FLP.c +++ b/silk/float/LPC_inv_pred_gain_FLP.c @@ -36,15 +36,15 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. /* compute inverse of LPC prediction gain, and */ /* test if LPC coefficients are stable (all poles within unit circle) */ -/* this code is based on silk_a2k_FLP() */ -opus_int silk_LPC_inverse_pred_gain_FLP( /* O: returns 1 if unstable, otherwise 0 */ - silk_float *invGain, /* O: inverse prediction gain, energy domain */ - const silk_float *A, /* I: prediction coefficients [order] */ - opus_int32 order /* I: prediction order */ +/* this code is based on silk_a2k_FLP() */ +opus_int silk_LPC_inverse_pred_gain_FLP( /* O returns 1 if unstable, otherwise 0 */ + silk_float *invGain, /* O inverse prediction gain, energy domain */ + const silk_float *A, /* I prediction coefficients [order] */ + opus_int32 order /* I prediction order */ ) { opus_int k, n; - double rc, rc_mult1, rc_mult2; + double rc, rc_mult1, rc_mult2; silk_float Atmp[ 2 ][ SILK_MAX_ORDER_LPC ]; silk_float *Aold, *Anew; @@ -54,7 +54,7 @@ opus_int silk_LPC_inverse_pred_gain_FLP( /* O: returns 1 if unstable, otherw *invGain = 1.0f; for( k = order - 1; k > 0; k-- ) { rc = -Anew[ k ]; - if (rc > RC_THRESHOLD || rc < -RC_THRESHOLD) { + if( rc > RC_THRESHOLD || rc < -RC_THRESHOLD ) { return 1; } rc_mult1 = 1.0f - rc * rc; @@ -68,7 +68,7 @@ opus_int silk_LPC_inverse_pred_gain_FLP( /* O: returns 1 if unstable, otherw } } rc = -Anew[ 0 ]; - if ( rc > RC_THRESHOLD || rc < -RC_THRESHOLD ) { + if( rc > RC_THRESHOLD || rc < -RC_THRESHOLD ) { return 1; } rc_mult1 = 1.0f - rc * rc; diff --git a/silk/float/LTP_analysis_filter_FLP.c b/silk/float/LTP_analysis_filter_FLP.c index 030aea11..7d2db93b 100644 --- a/silk/float/LTP_analysis_filter_FLP.c +++ b/silk/float/LTP_analysis_filter_FLP.c @@ -32,14 +32,14 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "main_FLP.h" void silk_LTP_analysis_filter_FLP( - silk_float *LTP_res, /* O LTP res MAX_NB_SUBFR*(pre_lgth+subfr_lngth) */ - const silk_float *x, /* I Input signal, with preceeding samples */ - const silk_float B[ LTP_ORDER * MAX_NB_SUBFR ], /* I LTP coefficients for each subframe */ - const opus_int pitchL[ MAX_NB_SUBFR ], /* I Pitch lags */ - const silk_float invGains[ MAX_NB_SUBFR ], /* I Inverse quantization gains */ - const opus_int subfr_length, /* I Length of each subframe */ - const opus_int nb_subfr, /* I number of subframes */ - const opus_int pre_length /* I Preceeding samples for each subframe */ + silk_float *LTP_res, /* O LTP res MAX_NB_SUBFR*(pre_lgth+subfr_lngth) */ + const silk_float *x, /* I Input signal, with preceeding samples */ + const silk_float B[ LTP_ORDER * MAX_NB_SUBFR ], /* I LTP coefficients for each subframe */ + const opus_int pitchL[ MAX_NB_SUBFR ], /* I Pitch lags */ + const silk_float invGains[ MAX_NB_SUBFR ], /* I Inverse quantization gains */ + const opus_int subfr_length, /* I Length of each subframe */ + const opus_int nb_subfr, /* I number of subframes */ + const opus_int pre_length /* I Preceeding samples for each subframe */ ) { const silk_float *x_ptr, *x_lag_ptr; diff --git a/silk/float/LTP_scale_ctrl_FLP.c b/silk/float/LTP_scale_ctrl_FLP.c index cbac1005..ebfdbf49 100644 --- a/silk/float/LTP_scale_ctrl_FLP.c +++ b/silk/float/LTP_scale_ctrl_FLP.c @@ -32,9 +32,9 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "main_FLP.h" void silk_LTP_scale_ctrl_FLP( - silk_encoder_state_FLP *psEnc, /* I/O Encoder state FLP */ - silk_encoder_control_FLP *psEncCtrl, /* I/O Encoder control FLP */ - opus_int condCoding /* I The type of conditional coding to use */ + silk_encoder_state_FLP *psEnc, /* I/O Encoder state FLP */ + silk_encoder_control_FLP *psEncCtrl, /* I/O Encoder control FLP */ + opus_int condCoding /* I The type of conditional coding to use */ ) { opus_int round_loss; diff --git a/silk/float/SigProc_FLP.h b/silk/float/SigProc_FLP.h index b11c396d..bf1d8ee5 100644 --- a/silk/float/SigProc_FLP.h +++ b/silk/float/SigProc_FLP.h @@ -42,132 +42,127 @@ extern "C" /* Chirp (bw expand) LP AR filter */ void silk_bwexpander_FLP( - silk_float *ar, /* io AR filter to be expanded (without leading 1) */ - const opus_int d, /* i length of ar */ - const silk_float chirp /* i chirp factor (typically in range (0..1) ) */ + silk_float *ar, /* I/O AR filter to be expanded (without leading 1) */ + const opus_int d, /* I length of ar */ + const silk_float chirp /* I chirp factor (typically in range (0..1) ) */ ); -/* compute inverse of LPC prediction gain, and */ -/* test if LPC coefficients are stable (all poles within unit circle) */ -/* this code is based on silk_FLP_a2k() */ -opus_int silk_LPC_inverse_pred_gain_FLP( /* O: returns 1 if unstable, otherwise 0 */ - silk_float *invGain, /* O: inverse prediction gain, energy domain */ - const silk_float *A, /* I: prediction coefficients [order] */ - opus_int32 order /* I: prediction order */ +/* compute inverse of LPC prediction gain, and */ +/* test if LPC coefficients are stable (all poles within unit circle) */ +/* this code is based on silk_FLP_a2k() */ +opus_int silk_LPC_inverse_pred_gain_FLP( /* O returns 1 if unstable, otherwise 0 */ + silk_float *invGain, /* O inverse prediction gain, energy domain */ + const silk_float *A, /* I prediction coefficients [order] */ + opus_int32 order /* I prediction order */ ); -silk_float silk_schur_FLP( /* O returns residual energy */ - silk_float refl_coef[], /* O reflection coefficients (length order) */ - const silk_float auto_corr[], /* I autocorrelation sequence (length order+1) */ - opus_int order /* I order */ +silk_float silk_schur_FLP( /* O returns residual energy */ + silk_float refl_coef[], /* O reflection coefficients (length order) */ + const silk_float auto_corr[], /* I autocorrelation sequence (length order+1) */ + opus_int order /* I order */ ); void silk_k2a_FLP( - silk_float *A, /* O: prediction coefficients [order] */ - const silk_float *rc, /* I: reflection coefficients [order] */ - opus_int32 order /* I: prediction order */ + silk_float *A, /* O prediction coefficients [order] */ + const silk_float *rc, /* I reflection coefficients [order] */ + opus_int32 order /* I prediction order */ ); /* Solve the normal equations using the Levinson-Durbin recursion */ -silk_float silk_levinsondurbin_FLP( /* O prediction error energy */ - silk_float A[], /* O prediction coefficients [order] */ - const silk_float corr[], /* I input auto-correlations [order + 1] */ - const opus_int order /* I prediction order */ +silk_float silk_levinsondurbin_FLP( /* O prediction error energy */ + silk_float A[], /* O prediction coefficients [order] */ + const silk_float corr[], /* I input auto-correlations [order + 1] */ + const opus_int order /* I prediction order */ ); /* compute autocorrelation */ void silk_autocorrelation_FLP( - silk_float *results, /* o result (length correlationCount) */ - const silk_float *inputData, /* i input data to correlate */ - opus_int inputDataSize, /* i length of input */ - opus_int correlationCount /* i number of correlation taps to compute */ + silk_float *results, /* O result (length correlationCount) */ + const silk_float *inputData, /* I input data to correlate */ + opus_int inputDataSize, /* I length of input */ + opus_int correlationCount /* I number of correlation taps to compute */ ); -/* Pitch estimator */ -#define SigProc_PE_MIN_COMPLEX 0 -#define SigProc_PE_MID_COMPLEX 1 -#define SigProc_PE_MAX_COMPLEX 2 - -opus_int silk_pitch_analysis_core_FLP( /* O voicing estimate: 0 voiced, 1 unvoiced */ - const silk_float *signal, /* I signal of length PE_FRAME_LENGTH_MS*Fs_kHz */ - opus_int *pitch_out, /* O 4 pitch lag values */ - opus_int16 *lagIndex, /* O lag Index */ - opus_int8 *contourIndex, /* O pitch contour Index */ - silk_float *LTPCorr, /* I/O normalized correlation; input: value from previous frame */ - opus_int prevLag, /* I last lag of previous frame; set to zero is unvoiced */ - const silk_float search_thres1, /* I first stage threshold for lag candidates 0 - 1 */ - const silk_float search_thres2, /* I final threshold for lag candidates 0 - 1 */ - const opus_int Fs_kHz, /* I sample frequency (kHz) */ - const opus_int complexity, /* I Complexity setting, 0-2, where 2 is highest */ - const opus_int nb_subfr /* I number of 5 ms subframes */ +opus_int silk_pitch_analysis_core_FLP( /* O Voicing estimate: 0 voiced, 1 unvoiced */ + const silk_float *frame, /* I Signal of length PE_FRAME_LENGTH_MS*Fs_kHz */ + opus_int *pitch_out, /* O Pitch lag values [nb_subfr] */ + opus_int16 *lagIndex, /* O Lag Index */ + opus_int8 *contourIndex, /* O Pitch contour Index */ + silk_float *LTPCorr, /* I/O Normalized correlation; input: value from previous frame */ + opus_int prevLag, /* I Last lag of previous frame; set to zero is unvoiced */ + const silk_float search_thres1, /* I First stage threshold for lag candidates 0 - 1 */ + const silk_float search_thres2, /* I Final threshold for lag candidates 0 - 1 */ + const opus_int Fs_kHz, /* I sample frequency (kHz) */ + const opus_int complexity, /* I Complexity setting, 0-2, where 2 is highest */ + const opus_int nb_subfr /* I Number of 5 ms subframes */ ); -#define PI (3.1415926536f) - void silk_insertion_sort_decreasing_FLP( - silk_float *a, /* I/O: Unsorted / Sorted vector */ - opus_int *idx, /* O: Index vector for the sorted elements */ - const opus_int L, /* I: Vector length */ - const opus_int K /* I: Number of correctly sorted positions */ + silk_float *a, /* I/O Unsorted / Sorted vector */ + opus_int *idx, /* O Index vector for the sorted elements */ + const opus_int L, /* I Vector length */ + const opus_int K /* I Number of correctly sorted positions */ ); /* Compute reflection coefficients from input signal */ -silk_float silk_burg_modified_FLP( /* O returns residual energy */ - silk_float A[], /* O prediction coefficients (length order) */ - const silk_float x[], /* I input signal, length: nb_subfr*(D+L_sub) */ - const opus_int subfr_length, /* I input signal subframe length (including D preceeding samples) */ - const opus_int nb_subfr, /* I number of subframes stacked in x */ - const silk_float WhiteNoiseFrac, /* I fraction added to zero-lag autocorrelation */ - const opus_int D /* I order */ +silk_float silk_burg_modified_FLP( /* O returns residual energy */ + silk_float A[], /* O prediction coefficients (length order) */ + const silk_float x[], /* I input signal, length: nb_subfr*(D+L_sub) */ + const opus_int subfr_length, /* I input signal subframe length (incl. D preceeding samples) */ + const opus_int nb_subfr, /* I number of subframes stacked in x */ + const silk_float WhiteNoiseFrac, /* I fraction added to zero-lag autocorrelation */ + const opus_int D /* I order */ ); /* multiply a vector by a constant */ void silk_scale_vector_FLP( - silk_float *data1, - silk_float gain, - opus_int dataSize + silk_float *data1, + silk_float gain, + opus_int dataSize ); /* copy and multiply a vector by a constant */ void silk_scale_copy_vector_FLP( - silk_float *data_out, - const silk_float *data_in, - silk_float gain, - opus_int dataSize + silk_float *data_out, + const silk_float *data_in, + silk_float gain, + opus_int dataSize ); /* inner product of two silk_float arrays, with result as double */ double silk_inner_product_FLP( - const silk_float *data1, - const silk_float *data2, - opus_int dataSize + const silk_float *data1, + const silk_float *data2, + opus_int dataSize ); /* sum of squares of a silk_float array, with result as double */ double silk_energy_FLP( - const silk_float *data, - opus_int dataSize + const silk_float *data, + opus_int dataSize ); /********************************************************************/ -/* MACROS */ +/* MACROS */ /********************************************************************/ -#define silk_min_float(a, b) (((a) < (b)) ? (a) : (b)) -#define silk_max_float(a, b) (((a) > (b)) ? (a) : (b)) -#define silk_abs_float(a) ((silk_float)fabs(a)) +#define PI (3.1415926536f) + +#define silk_min_float( a, b ) (((a) < (b)) ? (a) : (b)) +#define silk_max_float( a, b ) (((a) > (b)) ? (a) : (b)) +#define silk_abs_float( a ) ((silk_float)fabs(a)) -#define silk_LIMIT_float( a, limit1, limit2) ((limit1) > (limit2) ? ((a) > (limit1) ? (limit1) : ((a) < (limit2) ? (limit2) : (a))) \ - : ((a) > (limit2) ? (limit2) : ((a) < (limit1) ? (limit1) : (a)))) +#define silk_LIMIT_float( a, limit1, limit2 ) ((limit1) > (limit2) ? ((a) > (limit1) ? (limit1) : ((a) < (limit2) ? (limit2) : (a))) \ + : ((a) > (limit2) ? (limit2) : ((a) < (limit1) ? (limit1) : (a)))) /* sigmoid function */ -static inline silk_float silk_sigmoid(silk_float x) +static inline silk_float silk_sigmoid( silk_float x ) { return (silk_float)(1.0 / (1.0 + exp(-x))); } /* floating-point to integer conversion (rounding) */ -static inline opus_int32 silk_float2int(double x) +static inline opus_int32 silk_float2int( double x ) { #ifdef _WIN32 double t = x + 6755399441055744.0; @@ -185,7 +180,7 @@ static inline void silk_float2short_array( ) { opus_int32 k; - for (k = length-1; k >= 0; k--) { + for( k = length - 1; k >= 0; k-- ) { #ifdef _WIN32 double t = in[k] + 6755399441055744.0; out[k] = (opus_int16)silk_SAT16(*(( opus_int32 * )( &t ))); @@ -204,13 +199,16 @@ static inline void silk_short2float_array( ) { opus_int32 k; - for (k = length-1; k >= 0; k--) { + for( k = length - 1; k >= 0; k-- ) { out[k] = (silk_float)in[k]; } } /* using log2() helps the fixed-point conversion */ -static inline silk_float silk_log2( double x ) { return ( silk_float )( 3.32192809488736 * log10( x ) ); } +static inline silk_float silk_log2( double x ) +{ + return ( silk_float )( 3.32192809488736 * log10( x ) ); +} #ifdef __cplusplus } diff --git a/silk/float/apply_sine_window_FLP.c b/silk/float/apply_sine_window_FLP.c index 4de05dd7..d334e9d9 100644 --- a/silk/float/apply_sine_window_FLP.c +++ b/silk/float/apply_sine_window_FLP.c @@ -31,15 +31,15 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "main_FLP.h" -/* Apply sine window to signal vector. */ -/* Window types: */ -/* 1 -> sine window from 0 to pi/2 */ -/* 2 -> sine window from pi/2 to pi */ +/* Apply sine window to signal vector */ +/* Window types: */ +/* 1 -> sine window from 0 to pi/2 */ +/* 2 -> sine window from pi/2 to pi */ void silk_apply_sine_window_FLP( - silk_float px_win[], /* O Pointer to windowed signal */ - const silk_float px[], /* I Pointer to input signal */ - const opus_int win_type, /* I Selects a window type */ - const opus_int length /* I Window length, multiple of 4 */ + silk_float px_win[], /* O Pointer to windowed signal */ + const silk_float px[], /* I Pointer to input signal */ + const opus_int win_type, /* I Selects a window type */ + const opus_int length /* I Window length, multiple of 4 */ ) { opus_int k; diff --git a/silk/float/autocorrelation_FLP.c b/silk/float/autocorrelation_FLP.c index 89c016df..8d388115 100644 --- a/silk/float/autocorrelation_FLP.c +++ b/silk/float/autocorrelation_FLP.c @@ -34,15 +34,15 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. /* compute autocorrelation */ void silk_autocorrelation_FLP( - silk_float *results, /* O result (length correlationCount) */ - const silk_float *inputData, /* I input data to correlate */ - opus_int inputDataSize, /* I length of input */ - opus_int correlationCount /* I number of correlation taps to compute */ + silk_float *results, /* O result (length correlationCount) */ + const silk_float *inputData, /* I input data to correlate */ + opus_int inputDataSize, /* I length of input */ + opus_int correlationCount /* I number of correlation taps to compute */ ) { opus_int i; - if ( correlationCount > inputDataSize ) { + if( correlationCount > inputDataSize ) { correlationCount = inputDataSize; } diff --git a/silk/float/burg_modified_FLP.c b/silk/float/burg_modified_FLP.c index afda4501..b5862a54 100644 --- a/silk/float/burg_modified_FLP.c +++ b/silk/float/burg_modified_FLP.c @@ -35,13 +35,13 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #define MAX_NB_SUBFR 4 /* Compute reflection coefficients from input signal */ -silk_float silk_burg_modified_FLP( /* O returns residual energy */ - silk_float A[], /* O prediction coefficients (length order) */ - const silk_float x[], /* I input signal, length: nb_subfr*(D+L_sub) */ - const opus_int subfr_length, /* I input signal subframe length (including D preceeding samples) */ - const opus_int nb_subfr, /* I number of subframes stacked in x */ - const silk_float WhiteNoiseFrac, /* I fraction added to zero-lag autocorrelation */ - const opus_int D /* I order */ +silk_float silk_burg_modified_FLP( /* O returns residual energy */ + silk_float A[], /* O prediction coefficients (length order) */ + const silk_float x[], /* I input signal, length: nb_subfr*(D+L_sub) */ + const opus_int subfr_length, /* I input signal subframe length (incl. D preceeding samples) */ + const opus_int nb_subfr, /* I number of subframes stacked in x */ + const silk_float WhiteNoiseFrac, /* I fraction added to zero-lag autocorrelation */ + const opus_int D /* I order */ ) { opus_int k, n, s; diff --git a/silk/float/bwexpander_FLP.c b/silk/float/bwexpander_FLP.c index 6b6acf08..1642b4b9 100644 --- a/silk/float/bwexpander_FLP.c +++ b/silk/float/bwexpander_FLP.c @@ -31,12 +31,11 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "SigProc_FLP.h" - /* Chirp (bw expand) LP AR filter */ void silk_bwexpander_FLP( - silk_float *ar, /* I/O AR filter to be expanded (without leading 1) */ - const opus_int d, /* I length of ar */ - const silk_float chirp /* I chirp factor (typically in range (0..1) ) */ + silk_float *ar, /* I/O AR filter to be expanded (without leading 1) */ + const opus_int d, /* I length of ar */ + const silk_float chirp /* I chirp factor (typically in range (0..1) ) */ ) { opus_int i; diff --git a/silk/float/corrMatrix_FLP.c b/silk/float/corrMatrix_FLP.c index 56ea1cd0..9de00d32 100644 --- a/silk/float/corrMatrix_FLP.c +++ b/silk/float/corrMatrix_FLP.c @@ -37,11 +37,11 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. /* Calculates correlation vector X'*t */ void silk_corrVector_FLP( - const silk_float *x, /* I x vector [L+order-1] used to create X */ - const silk_float *t, /* I Target vector [L] */ - const opus_int L, /* I Length of vecors */ - const opus_int Order, /* I Max lag for correlation */ - silk_float *Xt /* O X'*t correlation vector [order] */ + const silk_float *x, /* I x vector [L+order-1] used to create X */ + const silk_float *t, /* I Target vector [L] */ + const opus_int L, /* I Length of vecors */ + const opus_int Order, /* I Max lag for correlation */ + silk_float *Xt /* O X'*t correlation vector [order] */ ) { opus_int lag; @@ -57,10 +57,10 @@ void silk_corrVector_FLP( /* Calculates correlation matrix X'*X */ void silk_corrMatrix_FLP( - const silk_float *x, /* I x vector [ L+order-1 ] used to create X */ - const opus_int L, /* I Length of vectors */ - const opus_int Order, /* I Max lag for correlation */ - silk_float *XX /* O X'*X correlation matrix [order x order] */ + const silk_float *x, /* I x vector [ L+order-1 ] used to create X */ + const opus_int L, /* I Length of vectors */ + const opus_int Order, /* I Max lag for correlation */ + silk_float *XX /* O X'*X correlation matrix [order x order] */ ) { opus_int j, lag; diff --git a/silk/float/encode_frame_FLP.c b/silk/float/encode_frame_FLP.c index 717b1e0a..08f3aa80 100644 --- a/silk/float/encode_frame_FLP.c +++ b/silk/float/encode_frame_FLP.c @@ -32,24 +32,22 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "main_FLP.h" #include "tuning_parameters.h" -/* Low Bitrate Redundancy (LBRR) encoding. Reuse all parameters but encode with lower bitrate */ +/* Low Bitrate Redundancy (LBRR) encoding. Reuse all parameters but encode with lower bitrate */ static inline void silk_LBRR_encode_FLP( - silk_encoder_state_FLP *psEnc, /* I/O Encoder state FLP */ - silk_encoder_control_FLP *psEncCtrl, /* I/O Encoder control FLP */ - const silk_float xfw[], /* I Input signal */ - opus_int condCoding /* I The type of conditional coding used so far for this frame */ + silk_encoder_state_FLP *psEnc, /* I/O Encoder state FLP */ + silk_encoder_control_FLP *psEncCtrl, /* I/O Encoder control FLP */ + const silk_float xfw[], /* I Input signal */ + opus_int condCoding /* I The type of conditional coding used so far for this frame */ ); void silk_encode_do_VAD_FLP( - silk_encoder_state_FLP *psEnc /* I/O Encoder state FLP */ + silk_encoder_state_FLP *psEnc /* I/O Encoder state FLP */ ) { /****************************/ /* Voice Activity Detection */ /****************************/ -TIC(VAD) silk_VAD_GetSA_Q8( &psEnc->sCmn, psEnc->sCmn.inputBuf + 1 ); -TOC(VAD) /**************************************************/ /* Convert speech activity into VAD and DTX flags */ @@ -79,12 +77,12 @@ TOC(VAD) /* Encode frame */ /****************/ opus_int silk_encode_frame_FLP( - silk_encoder_state_FLP *psEnc, /* I/O Encoder state FLP */ - opus_int32 *pnBytesOut, /* O Number of payload bytes */ - ec_enc *psRangeEnc, /* I/O compressor data structure */ - opus_int condCoding, /* I The type of conditional coding to use */ - opus_int maxBits, /* I If > 0: maximum number of output bits */ - opus_int useCBR /* I Flag to force constant-bitrate operation */ + silk_encoder_state_FLP *psEnc, /* I/O Encoder state FLP */ + opus_int32 *pnBytesOut, /* O Number of payload bytes; */ + ec_enc *psRangeEnc, /* I/O compressor data structure */ + opus_int condCoding, /* I The type of conditional coding to use */ + opus_int maxBits, /* I If > 0: maximum number of output bits */ + opus_int useCBR /* I Flag to force constant-bitrate operation */ ) { silk_encoder_control_FLP sEncCtrl; @@ -103,10 +101,7 @@ opus_int silk_encode_frame_FLP( opus_int32 pGains_Q16[ MAX_NB_SUBFR ]; opus_uint8 ec_buf_copy[ 1275 ]; -TIC(ENCODE_FRAME) - - /* This is totally unnecessary but many compilers (including gcc) are too dumb - to realise it */ + /* This is totally unnecessary but many compilers (including gcc) are too dumb to realise it */ LastGainIndex_copy2 = nBits_lower = nBits_upper = gainMult_lower = gainMult_upper = 0; psEnc->sCmn.indices.Seed = psEnc->sCmn.frameCounter++ & 3; @@ -136,50 +131,35 @@ TIC(ENCODE_FRAME) /*****************************************/ /* Find pitch lags, initial LPC analysis */ /*****************************************/ -TIC(FIND_PITCH) silk_find_pitch_lags_FLP( psEnc, &sEncCtrl, res_pitch, x_frame ); -TOC(FIND_PITCH) /************************/ /* Noise shape analysis */ /************************/ -TIC(NOISE_SHAPE_ANALYSIS) silk_noise_shape_analysis_FLP( psEnc, &sEncCtrl, res_pitch_frame, x_frame ); -TOC(NOISE_SHAPE_ANALYSIS) /***************************************************/ /* Find linear prediction coefficients (LPC + LTP) */ /***************************************************/ -TIC(FIND_PRED_COEF) silk_find_pred_coefs_FLP( psEnc, &sEncCtrl, res_pitch, x_frame, condCoding ); -TOC(FIND_PRED_COEF) /****************************************/ /* Process gains */ /****************************************/ -TIC(PROCESS_GAINS) silk_process_gains_FLP( psEnc, &sEncCtrl, condCoding ); -TOC(PROCESS_GAINS) /*****************************************/ /* Prefiltering for noise shaper */ /*****************************************/ -TIC(PREFILTER) silk_prefilter_FLP( psEnc, &sEncCtrl, xfw, x_frame ); -TOC(PREFILTER) /****************************************/ /* Low Bitrate Redundant Encoding */ /****************************************/ -TIC(LBRR) silk_LBRR_encode_FLP( psEnc, &sEncCtrl, xfw, condCoding ); -TOC(LBRR) - if ( psEnc->sCmn.prefillFlag ) - { -TIC(NSQ) + if( psEnc->sCmn.prefillFlag ) { silk_NSQ_wrapper_FLP( psEnc, &sEncCtrl, &psEnc->sCmn.indices, &psEnc->sCmn.sNSQ, psEnc->sCmn.pulses, xfw ); -TOC(NSQ) } else { /* Loop over quantizer and entroy coding to control bitrate */ maxIter = 5; @@ -213,24 +193,18 @@ TOC(NSQ) /*****************************************/ /* Noise shaping quantization */ /*****************************************/ -TIC(NSQ) silk_NSQ_wrapper_FLP( psEnc, &sEncCtrl, &psEnc->sCmn.indices, &psEnc->sCmn.sNSQ, psEnc->sCmn.pulses, xfw ); -TOC(NSQ) /****************************************/ /* Encode Parameters */ /****************************************/ -TIC(ENCODE_PARAMS) silk_encode_indices( &psEnc->sCmn, psRangeEnc, psEnc->sCmn.nFramesEncoded, 0, condCoding ); -TOC(ENCODE_PARAMS) /****************************************/ /* Encode Excitation Signal */ /****************************************/ -TIC(ENCODE_PULSES) silk_encode_pulses( psRangeEnc, psEnc->sCmn.indices.signalType, psEnc->sCmn.indices.quantOffsetType, psEnc->sCmn.pulses, psEnc->sCmn.frame_length ); -TOC(ENCODE_PULSES) nBits = ec_tell( psRangeEnc ); @@ -343,32 +317,15 @@ TOC(ENCODE_PULSES) /* Payload size */ *pnBytesOut = silk_RSHIFT( ec_tell( psRangeEnc ) + 7, 3 ); -TOC(ENCODE_FRAME) - -#ifdef SAVE_ALL_INTERNAL_DATA - DEBUG_STORE_DATA( pitchL.dat, sEncCtrl.pitchL, MAX_NB_SUBFR * sizeof( opus_int ) ); - DEBUG_STORE_DATA( pitchG_quantized.dat, sEncCtrl.LTPCoef, psEnc->sCmn.nb_subfr * LTP_ORDER * sizeof( silk_float ) ); - DEBUG_STORE_DATA( LTPcorr.dat, &psEnc->LTPCorr, sizeof( silk_float ) ); - DEBUG_STORE_DATA( gains.dat, sEncCtrl.Gains, psEnc->sCmn.nb_subfr * sizeof( silk_float ) ); - DEBUG_STORE_DATA( gains_indices.dat, &psEnc->sCmn.indices.GainsIndices, psEnc->sCmn.nb_subfr * sizeof( opus_int8 ) ); - DEBUG_STORE_DATA( quantOffsetType.dat, &psEnc->sCmn.indices.quantOffsetType, sizeof( opus_int8 ) ); - DEBUG_STORE_DATA( speech_activity_q8.dat, &psEnc->sCmn.speech_activity_Q8, sizeof( opus_int ) ); - DEBUG_STORE_DATA( signalType.dat, &psEnc->sCmn.indices.signalType, sizeof( opus_int8 ) ); - DEBUG_STORE_DATA( lag_index.dat, &psEnc->sCmn.indices.lagIndex, sizeof( opus_int16 ) ); - DEBUG_STORE_DATA( contour_index.dat, &psEnc->sCmn.indices.contourIndex, sizeof( opus_int8 ) ); - DEBUG_STORE_DATA( per_index.dat, &psEnc->sCmn.indices.PERIndex, sizeof( opus_int8 ) ); - DEBUG_STORE_DATA( PredCoef.dat, &sEncCtrl.PredCoef[ 1 ], psEnc->sCmn.predictLPCOrder * sizeof( silk_float ) ); - DEBUG_STORE_DATA( ltp_scale_idx.dat, &psEnc->sCmn.indices.LTP_scaleIndex, sizeof( opus_int8 ) ); -#endif return ret; } /* Low-Bitrate Redundancy (LBRR) encoding. Reuse all parameters but encode excitation at lower bitrate */ static inline void silk_LBRR_encode_FLP( - silk_encoder_state_FLP *psEnc, /* I/O Encoder state FLP */ - silk_encoder_control_FLP *psEncCtrl, /* I/O Encoder control FLP */ - const silk_float xfw[], /* I Input signal */ - opus_int condCoding /* I The type of conditional coding used so far for this frame */ + silk_encoder_state_FLP *psEnc, /* I/O Encoder state FLP */ + silk_encoder_control_FLP *psEncCtrl, /* I/O Encoder control FLP */ + const silk_float xfw[], /* I Input signal */ + opus_int condCoding /* I The type of conditional coding used so far for this frame */ ) { opus_int k; diff --git a/silk/float/energy_FLP.c b/silk/float/energy_FLP.c index f43143d5..19f902ce 100644 --- a/silk/float/energy_FLP.c +++ b/silk/float/energy_FLP.c @@ -33,8 +33,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. /* sum of squares of a silk_float array, with result as double */ double silk_energy_FLP( - const silk_float *data, - opus_int dataSize + const silk_float *data, + opus_int dataSize ) { opus_int i, dataSize4; diff --git a/silk/float/find_LPC_FLP.c b/silk/float/find_LPC_FLP.c index 18373fbf..23de2e73 100644 --- a/silk/float/find_LPC_FLP.c +++ b/silk/float/find_LPC_FLP.c @@ -33,15 +33,15 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "tuning_parameters.h" void silk_find_LPC_FLP( - opus_int16 NLSF_Q15[], /* O NLSFs */ - opus_int8 *interpIndex, /* O NLSF interp. index for NLSF interp. */ - const opus_int16 prev_NLSFq_Q15[], /* I Previous NLSFs, for NLSF interpolation */ - const opus_int useInterpNLSFs, /* I Flag */ - const opus_int firstFrameAfterReset, /* I Flag */ - const opus_int LPC_order, /* I LPC order */ - const silk_float x[], /* I Input signal */ - const opus_int subfr_length, /* I Subframe length incl preceeding samples */ - const opus_int nb_subfr /* I: Number of subframes */ + opus_int16 NLSF_Q15[], /* O NLSFs */ + opus_int8 *interpIndex, /* O NLSF interp. index for NLSF interp. */ + const opus_int16 prev_NLSFq_Q15[], /* I Previous NLSFs, for NLSF interpolation */ + const opus_int useInterpNLSFs, /* I Flag */ + const opus_int firstFrameAfterReset, /* I Flag */ + const opus_int LPC_order, /* I LPC order */ + const silk_float x[], /* I Input signal */ + const opus_int subfr_length, /* I Subframe length incl preceeding samples */ + const opus_int nb_subfr /* I Number of subframes */ ) { opus_int k; diff --git a/silk/float/find_LTP_FLP.c b/silk/float/find_LTP_FLP.c index a95f5646..4caf4d24 100644 --- a/silk/float/find_LTP_FLP.c +++ b/silk/float/find_LTP_FLP.c @@ -33,15 +33,15 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "tuning_parameters.h" void silk_find_LTP_FLP( - silk_float b[ MAX_NB_SUBFR * LTP_ORDER ], /* O LTP coefs */ - silk_float WLTP[ MAX_NB_SUBFR * LTP_ORDER * LTP_ORDER ], /* O Weight for LTP quantization */ - silk_float *LTPredCodGain, /* O LTP coding gain */ - const silk_float r_lpc[], /* I LPC residual */ - const opus_int lag[ MAX_NB_SUBFR ], /* I LTP lags */ - const silk_float Wght[ MAX_NB_SUBFR ], /* I Weights */ - const opus_int subfr_length, /* I Subframe length */ - const opus_int nb_subfr, /* I number of subframes */ - const opus_int mem_offset /* I Number of samples in LTP memory */ + silk_float b[ MAX_NB_SUBFR * LTP_ORDER ], /* O LTP coefs */ + silk_float WLTP[ MAX_NB_SUBFR * LTP_ORDER * LTP_ORDER ], /* O Weight for LTP quantization */ + silk_float *LTPredCodGain, /* O LTP coding gain */ + const silk_float r_lpc[], /* I LPC residual */ + const opus_int lag[ MAX_NB_SUBFR ], /* I LTP lags */ + const silk_float Wght[ MAX_NB_SUBFR ], /* I Weights */ + const opus_int subfr_length, /* I Subframe length */ + const opus_int nb_subfr, /* I number of subframes */ + const opus_int mem_offset /* I Number of samples in LTP memory */ ) { opus_int i, k; diff --git a/silk/float/find_pitch_lags_FLP.c b/silk/float/find_pitch_lags_FLP.c index b37c0ff0..43f7ff94 100644 --- a/silk/float/find_pitch_lags_FLP.c +++ b/silk/float/find_pitch_lags_FLP.c @@ -34,10 +34,10 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "tuning_parameters.h" void silk_find_pitch_lags_FLP( - silk_encoder_state_FLP *psEnc, /* I/O Encoder state FLP */ - silk_encoder_control_FLP *psEncCtrl, /* I/O Encoder control FLP */ - silk_float res[], /* O Residual */ - const silk_float x[] /* I Speech signal */ + silk_encoder_state_FLP *psEnc, /* I/O Encoder state FLP */ + silk_encoder_control_FLP *psEncCtrl, /* I/O Encoder control FLP */ + silk_float res[], /* O Residual */ + const silk_float x[] /* I Speech signal */ ) { opus_int buf_len; diff --git a/silk/float/find_pred_coefs_FLP.c b/silk/float/find_pred_coefs_FLP.c index 90a4e467..03500c2c 100644 --- a/silk/float/find_pred_coefs_FLP.c +++ b/silk/float/find_pred_coefs_FLP.c @@ -31,13 +31,13 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "main_FLP.h" - +/* Find LPC and LTP coefficients */ void silk_find_pred_coefs_FLP( - silk_encoder_state_FLP *psEnc, /* I/O Encoder state FLP */ - silk_encoder_control_FLP *psEncCtrl, /* I/O Encoder control FLP */ - const silk_float res_pitch[], /* I Residual from pitch analysis */ - const silk_float x[], /* I Speech signal */ - opus_int condCoding /* I The type of conditional coding to use */ + silk_encoder_state_FLP *psEnc, /* I/O Encoder state FLP */ + silk_encoder_control_FLP *psEncCtrl, /* I/O Encoder control FLP */ + const silk_float res_pitch[], /* I Residual from pitch analysis */ + const silk_float x[], /* I Speech signal */ + opus_int condCoding /* I The type of conditional coding to use */ ) { opus_int i; @@ -64,11 +64,6 @@ void silk_find_pred_coefs_FLP( silk_find_LTP_FLP( psEncCtrl->LTPCoef, WLTP, &psEncCtrl->LTPredCodGain, res_pitch, psEncCtrl->pitchL, Wght, psEnc->sCmn.subfr_length, psEnc->sCmn.nb_subfr, psEnc->sCmn.ltp_mem_length ); -#ifdef SAVE_ALL_INTERNAL_DATA - DEBUG_STORE_DATA( ltp_gains.dat, psEncCtrl->LTPCoef, sizeof( psEncCtrl->LTPCoef ) ); - DEBUG_STORE_DATA( ltp_weights.dat, WLTP, sizeof( WLTP ) ); -#endif - /* Quantize LTP gain parameters */ silk_quant_LTP_gains_FLP( psEncCtrl->LTPCoef, psEnc->sCmn.indices.LTPIndex, &psEnc->sCmn.indices.PERIndex, WLTP, psEnc->sCmn.mu_LTP_Q9, psEnc->sCmn.LTPQuantLowComplexity, psEnc->sCmn.nb_subfr ); @@ -104,9 +99,7 @@ void silk_find_pred_coefs_FLP( LPC_in_pre, psEnc->sCmn.subfr_length + psEnc->sCmn.predictLPCOrder, psEnc->sCmn.nb_subfr ); /* Quantize LSFs */ -TIC(LSF_quant); silk_process_NLSFs_FLP( &psEnc->sCmn, psEncCtrl->PredCoef, NLSF_Q15, psEnc->sCmn.prev_NLSFq_Q15 ); -TOC(LSF_quant); /* Calculate residual energy using quantized LPC coefficients */ silk_residual_energy_FLP( psEncCtrl->ResNrg, LPC_in_pre, psEncCtrl->PredCoef, psEncCtrl->Gains, diff --git a/silk/float/inner_product_FLP.c b/silk/float/inner_product_FLP.c index a8f04d73..0e4ebb21 100644 --- a/silk/float/inner_product_FLP.c +++ b/silk/float/inner_product_FLP.c @@ -31,11 +31,11 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "SigProc_FLP.h" -/* inner product of two silk_float arrays, with result as double */ -double silk_inner_product_FLP( /* O result */ - const silk_float *data1, /* I vector 1 */ - const silk_float *data2, /* I vector 2 */ - opus_int dataSize /* I length of vectors */ +/* inner product of two silk_float arrays, with result as double */ +double silk_inner_product_FLP( + const silk_float *data1, + const silk_float *data2, + opus_int dataSize ) { opus_int i, dataSize4; diff --git a/silk/float/k2a_FLP.c b/silk/float/k2a_FLP.c index 8884b8dc..8702bc79 100644 --- a/silk/float/k2a_FLP.c +++ b/silk/float/k2a_FLP.c @@ -33,16 +33,16 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. /* step up function, converts reflection coefficients to prediction coefficients */ void silk_k2a_FLP( - silk_float *A, /* O: prediction coefficients [order] */ - const silk_float *rc, /* I: reflection coefficients [order] */ - opus_int32 order /* I: prediction order */ + silk_float *A, /* O prediction coefficients [order] */ + const silk_float *rc, /* I reflection coefficients [order] */ + opus_int32 order /* I prediction order */ ) { opus_int k, n; silk_float Atmp[ SILK_MAX_ORDER_LPC ]; - for( k = 0; k < order; k++ ){ - for( n = 0; n < k; n++ ){ + for( k = 0; k < order; k++ ) { + for( n = 0; n < k; n++ ) { Atmp[ n ] = A[ n ]; } for( n = 0; n < k; n++ ) { diff --git a/silk/float/levinsondurbin_FLP.c b/silk/float/levinsondurbin_FLP.c index 813b1175..a6bb59aa 100644 --- a/silk/float/levinsondurbin_FLP.c +++ b/silk/float/levinsondurbin_FLP.c @@ -32,10 +32,10 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "SigProc_FLP.h" /* Solve the normal equations using the Levinson-Durbin recursion */ -silk_float silk_levinsondurbin_FLP( /* O prediction error energy */ - silk_float A[], /* O prediction coefficients [order] */ - const silk_float corr[], /* I input auto-correlations [order + 1] */ - const opus_int order /* I prediction order */ +silk_float silk_levinsondurbin_FLP( /* O prediction error energy */ + silk_float A[], /* O prediction coefficients [order] */ + const silk_float corr[], /* I input auto-correlations [order + 1] */ + const opus_int order /* I prediction order */ ) { opus_int i, mHalf, m; diff --git a/silk/float/main_FLP.h b/silk/float/main_FLP.h index 07e31ab6..d2889009 100644 --- a/silk/float/main_FLP.h +++ b/silk/float/main_FLP.h @@ -51,47 +51,47 @@ extern "C" /* High-pass filter with cutoff frequency adaptation based on pitch lag statistics */ void silk_HP_variable_cutoff( - silk_encoder_state_Fxx state_Fxx[] /* I/O Encoder states */ + silk_encoder_state_Fxx state_Fxx[] /* I/O Encoder states */ ); /* Encoder main function */ void silk_encode_do_VAD_FLP( - silk_encoder_state_FLP *psEnc /* I/O Encoder state FLP */ + silk_encoder_state_FLP *psEnc /* I/O Encoder state FLP */ ); /* Encoder main function */ opus_int silk_encode_frame_FLP( - silk_encoder_state_FLP *psEnc, /* I/O Encoder state FLP */ - opus_int32 *pnBytesOut, /* O Number of payload bytes; */ - ec_enc *psRangeEnc, /* I/O compressor data structure */ - opus_int condCoding, /* I The type of conditional coding to use */ - opus_int maxBits, /* I If > 0: maximum number of output bits */ - opus_int useCBR /* I Flag to force constant-bitrate operation */ + silk_encoder_state_FLP *psEnc, /* I/O Encoder state FLP */ + opus_int32 *pnBytesOut, /* O Number of payload bytes; */ + ec_enc *psRangeEnc, /* I/O compressor data structure */ + opus_int condCoding, /* I The type of conditional coding to use */ + opus_int maxBits, /* I If > 0: maximum number of output bits */ + opus_int useCBR /* I Flag to force constant-bitrate operation */ ); /* Initializes the Silk encoder state */ opus_int silk_init_encoder( - silk_encoder_state_FLP *psEnc /* I/O Encoder state FLP */ + silk_encoder_state_FLP *psEnc /* I/O Encoder state FLP */ ); /* Control the Silk encoder */ opus_int silk_control_encoder( - silk_encoder_state_FLP *psEnc, /* I/O Pointer to Silk encoder state FLP */ - silk_EncControlStruct *encControl, /* I: Control structure */ - const opus_int32 TargetRate_bps, /* I Target max bitrate (bps) */ - const opus_int allow_bw_switch, /* I Flag to allow switching audio bandwidth */ - const opus_int channelNb, /* I Channel number */ - const opus_int force_fs_kHz + silk_encoder_state_FLP *psEnc, /* I/O Pointer to Silk encoder state FLP */ + silk_EncControlStruct *encControl, /* I Control structure */ + const opus_int32 TargetRate_bps, /* I Target max bitrate (bps) */ + const opus_int allow_bw_switch, /* I Flag to allow switching audio bandwidth */ + const opus_int channelNb, /* I Channel number */ + const opus_int force_fs_kHz ); /****************/ /* Prefiltering */ /****************/ void silk_prefilter_FLP( - silk_encoder_state_FLP *psEnc, /* I/O Encoder state FLP */ - const silk_encoder_control_FLP *psEncCtrl, /* I Encoder control FLP */ - silk_float xw[], /* O Weighted signal */ - const silk_float x[] /* I Speech signal */ + silk_encoder_state_FLP *psEnc, /* I/O Encoder state FLP */ + const silk_encoder_control_FLP *psEncCtrl, /* I Encoder control FLP */ + silk_float xw[], /* O Weighted signal */ + const silk_float x[] /* I Speech signal */ ); /**************************/ @@ -99,26 +99,26 @@ void silk_prefilter_FLP( /**************************/ /* Compute noise shaping coefficients and initial gain values */ void silk_noise_shape_analysis_FLP( - silk_encoder_state_FLP *psEnc, /* I/O Encoder state FLP */ - silk_encoder_control_FLP *psEncCtrl, /* I/O Encoder control FLP */ - const silk_float *pitch_res, /* I LPC residual from pitch analysis */ - const silk_float *x /* I Input signal [frame_length + la_shape] */ + silk_encoder_state_FLP *psEnc, /* I/O Encoder state FLP */ + silk_encoder_control_FLP *psEncCtrl, /* I/O Encoder control FLP */ + const silk_float *pitch_res, /* I LPC residual from pitch analysis */ + const silk_float *x /* I Input signal [frame_length + la_shape] */ ); /* Autocorrelations for a warped frequency axis */ void silk_warped_autocorrelation_FLP( - silk_float *corr, /* O Result [order + 1] */ - const silk_float *input, /* I Input data to correlate */ - const silk_float warping, /* I Warping coefficient */ - const opus_int length, /* I Length of input */ - const opus_int order /* I Correlation order (even) */ + silk_float *corr, /* O Result [order + 1] */ + const silk_float *input, /* I Input data to correlate */ + const silk_float warping, /* I Warping coefficient */ + const opus_int length, /* I Length of input */ + const opus_int order /* I Correlation order (even) */ ); /* Calculation of LTP state scaling */ void silk_LTP_scale_ctrl_FLP( - silk_encoder_state_FLP *psEnc, /* I/O Encoder state FLP */ - silk_encoder_control_FLP *psEncCtrl, /* I/O Encoder control FLP */ - opus_int condCoding /* I The type of conditional coding to use */ + silk_encoder_state_FLP *psEnc, /* I/O Encoder state FLP */ + silk_encoder_control_FLP *psEncCtrl, /* I/O Encoder control FLP */ + opus_int condCoding /* I The type of conditional coding to use */ ); /**********************************************/ @@ -126,127 +126,104 @@ void silk_LTP_scale_ctrl_FLP( /**********************************************/ /* Find pitch lags */ void silk_find_pitch_lags_FLP( - silk_encoder_state_FLP *psEnc, /* I/O Encoder state FLP */ - silk_encoder_control_FLP *psEncCtrl, /* I/O Encoder control FLP */ - silk_float res[], /* O Residual */ - const silk_float x[] /* I Speech signal */ + silk_encoder_state_FLP *psEnc, /* I/O Encoder state FLP */ + silk_encoder_control_FLP *psEncCtrl, /* I/O Encoder control FLP */ + silk_float res[], /* O Residual */ + const silk_float x[] /* I Speech signal */ ); /* Find LPC and LTP coefficients */ void silk_find_pred_coefs_FLP( - silk_encoder_state_FLP *psEnc, /* I/O Encoder state FLP */ - silk_encoder_control_FLP *psEncCtrl, /* I/O Encoder control FLP */ - const silk_float res_pitch[], /* I Residual from pitch analysis */ - const silk_float x[], /* I Speech signal */ - opus_int condCoding /* I The type of conditional coding to use */ + silk_encoder_state_FLP *psEnc, /* I/O Encoder state FLP */ + silk_encoder_control_FLP *psEncCtrl, /* I/O Encoder control FLP */ + const silk_float res_pitch[], /* I Residual from pitch analysis */ + const silk_float x[], /* I Speech signal */ + opus_int condCoding /* I The type of conditional coding to use */ ); /* LPC analysis */ void silk_find_LPC_FLP( - opus_int16 NLSF_Q15[], /* O NLSFs */ - opus_int8 *interpIndex, /* O NLSF interp. index for NLSF interp. */ - const opus_int16 prev_NLSFq_Q15[], /* I Previous NLSFs, for NLSF interpolation */ - const opus_int useInterpNLSFs, /* I Flag */ - const opus_int firstFrameAfterReset, /* I Flag */ - const opus_int LPC_order, /* I LPC order */ - const silk_float x[], /* I Input signal */ - const opus_int subfr_length, /* I Subframe length incl preceeding samples */ - const opus_int nb_subfr /* I: Number of subframes */ + opus_int16 NLSF_Q15[], /* O NLSFs */ + opus_int8 *interpIndex, /* O NLSF interp. index for NLSF interp. */ + const opus_int16 prev_NLSFq_Q15[], /* I Previous NLSFs, for NLSF interpolation */ + const opus_int useInterpNLSFs, /* I Flag */ + const opus_int firstFrameAfterReset, /* I Flag */ + const opus_int LPC_order, /* I LPC order */ + const silk_float x[], /* I Input signal */ + const opus_int subfr_length, /* I Subframe length incl preceeding samples */ + const opus_int nb_subfr /* I Number of subframes */ ); /* LTP analysis */ void silk_find_LTP_FLP( - silk_float b[ MAX_NB_SUBFR * LTP_ORDER ], /* O LTP coefs */ - silk_float WLTP[ MAX_NB_SUBFR * LTP_ORDER * LTP_ORDER ], /* O Weight for LTP quantization */ - silk_float *LTPredCodGain, /* O LTP coding gain */ - const silk_float r_lpc[], /* I LPC residual */ - const opus_int lag[ MAX_NB_SUBFR ], /* I LTP lags */ - const silk_float Wght[ MAX_NB_SUBFR ], /* I Weights */ - const opus_int subfr_length, /* I Subframe length */ - const opus_int nb_subfr, /* I number of subframes */ - const opus_int mem_offset /* I Number of samples in LTP memory */ + silk_float b[ MAX_NB_SUBFR * LTP_ORDER ], /* O LTP coefs */ + silk_float WLTP[ MAX_NB_SUBFR * LTP_ORDER * LTP_ORDER ], /* O Weight for LTP quantization */ + silk_float *LTPredCodGain, /* O LTP coding gain */ + const silk_float r_lpc[], /* I LPC residual */ + const opus_int lag[ MAX_NB_SUBFR ], /* I LTP lags */ + const silk_float Wght[ MAX_NB_SUBFR ], /* I Weights */ + const opus_int subfr_length, /* I Subframe length */ + const opus_int nb_subfr, /* I number of subframes */ + const opus_int mem_offset /* I Number of samples in LTP memory */ ); void silk_LTP_analysis_filter_FLP( - silk_float *LTP_res, /* O LTP res MAX_NB_SUBFR*(pre_lgth+subfr_lngth) */ - const silk_float *x, /* I Input signal, with preceeding samples */ - const silk_float B[ LTP_ORDER * MAX_NB_SUBFR ], /* I LTP coefficients for each subframe */ - const opus_int pitchL[ MAX_NB_SUBFR ], /* I Pitch lags */ - const silk_float invGains[ MAX_NB_SUBFR ], /* I Inverse quantization gains */ - const opus_int subfr_length, /* I Length of each subframe */ - const opus_int nb_subfr, /* I number of subframes */ - const opus_int pre_length /* I Preceeding samples for each subframe */ + silk_float *LTP_res, /* O LTP res MAX_NB_SUBFR*(pre_lgth+subfr_lngth) */ + const silk_float *x, /* I Input signal, with preceeding samples */ + const silk_float B[ LTP_ORDER * MAX_NB_SUBFR ], /* I LTP coefficients for each subframe */ + const opus_int pitchL[ MAX_NB_SUBFR ], /* I Pitch lags */ + const silk_float invGains[ MAX_NB_SUBFR ], /* I Inverse quantization gains */ + const opus_int subfr_length, /* I Length of each subframe */ + const opus_int nb_subfr, /* I number of subframes */ + const opus_int pre_length /* I Preceeding samples for each subframe */ ); /* Calculates residual energies of input subframes where all subframes have LPC_order */ /* of preceeding samples */ void silk_residual_energy_FLP( - silk_float nrgs[ MAX_NB_SUBFR ], /* O Residual energy per subframe */ - const silk_float x[], /* I Input signal */ - silk_float a[ 2 ][ MAX_LPC_ORDER ],/* I AR coefs for each frame half */ - const silk_float gains[], /* I Quantization gains */ - const opus_int subfr_length, /* I Subframe length */ - const opus_int nb_subfr, /* I number of subframes */ - const opus_int LPC_order /* I LPC order */ + silk_float nrgs[ MAX_NB_SUBFR ], /* O Residual energy per subframe */ + const silk_float x[], /* I Input signal */ + silk_float a[ 2 ][ MAX_LPC_ORDER ], /* I AR coefs for each frame half */ + const silk_float gains[], /* I Quantization gains */ + const opus_int subfr_length, /* I Subframe length */ + const opus_int nb_subfr, /* I number of subframes */ + const opus_int LPC_order /* I LPC order */ ); /* 16th order LPC analysis filter */ void silk_LPC_analysis_filter_FLP( - silk_float r_LPC[], /* O LPC residual signal */ - const silk_float PredCoef[], /* I LPC coefficients */ - const silk_float s[], /* I Input signal */ - const opus_int length, /* I Length of input signal */ - const opus_int Order /* I LPC order */ + silk_float r_LPC[], /* O LPC residual signal */ + const silk_float PredCoef[], /* I LPC coefficients */ + const silk_float s[], /* I Input signal */ + const opus_int length, /* I Length of input signal */ + const opus_int Order /* I LPC order */ ); /* LTP tap quantizer */ void silk_quant_LTP_gains_FLP( - silk_float B[ MAX_NB_SUBFR * LTP_ORDER ], /* I/O (Un-)quantized LTP gains */ - opus_int8 cbk_index[ MAX_NB_SUBFR ], /* O Codebook index */ - opus_int8 *periodicity_index, /* O Periodicity index */ - const silk_float W[ MAX_NB_SUBFR * LTP_ORDER * LTP_ORDER ], /* I Error weights */ - const opus_int mu_Q10, /* I Mu value (R/D tradeoff) */ - const opus_int lowComplexity, /* I Flag for low complexity */ - const opus_int nb_subfr /* I number of subframes */ -); - -/******************/ -/* NLSF Quantizer */ -/******************/ -/* Limit, stabilize, and quantize NLSFs */ -void silk_process_NLSFs_FLP( - silk_encoder_state *psEncC, /* I/O Encoder state */ - silk_float PredCoef[ 2 ][ MAX_LPC_ORDER ], /* O Prediction coefficients */ - opus_int16 NLSF_Q15[ MAX_LPC_ORDER ], /* I/O Normalized LSFs (quant out) (0 - (2^15-1)) */ - const opus_int16 prev_NLSF_Q15[ MAX_LPC_ORDER ] /* I Previous Normalized LSFs (0 - (2^15-1)) */ + silk_float B[ MAX_NB_SUBFR * LTP_ORDER ], /* I/O (Un-)quantized LTP gains */ + opus_int8 cbk_index[ MAX_NB_SUBFR ], /* O Codebook index */ + opus_int8 *periodicity_index, /* O Periodicity index */ + const silk_float W[ MAX_NB_SUBFR * LTP_ORDER * LTP_ORDER ], /* I Error weights */ + const opus_int mu_Q10, /* I Mu value (R/D tradeoff) */ + const opus_int lowComplexity, /* I Flag for low complexity */ + const opus_int nb_subfr /* I number of subframes */ ); /* Residual energy: nrg = wxx - 2 * wXx * c + c' * wXX * c */ -silk_float silk_residual_energy_covar_FLP( /* O Weighted residual energy */ - const silk_float *c, /* I Filter coefficients */ - silk_float *wXX, /* I/O Weighted correlation matrix, reg. out */ - const silk_float *wXx, /* I Weighted correlation vector */ - const silk_float wxx, /* I Weighted correlation value */ - const opus_int D /* I Dimension */ -); - -/* Entropy constrained MATRIX-weighted VQ, for a single input data vector */ -void silk_VQ_WMat_EC_FLP( - opus_int *ind, /* O Index of best codebook vector */ - silk_float *rate_dist, /* O Best weighted quant. error + mu * rate */ - const silk_float *in, /* I Input vector to be quantized */ - const silk_float *W, /* I Weighting matrix */ - const opus_int16 *cb, /* I Codebook */ - const opus_int16 *cl_Q6, /* I Code length for each codebook vector */ - const silk_float mu, /* I Tradeoff between WSSE and rate */ - const opus_int L /* I Number of vectors in codebook */ +silk_float silk_residual_energy_covar_FLP( /* O Weighted residual energy */ + const silk_float *c, /* I Filter coefficients */ + silk_float *wXX, /* I/O Weighted correlation matrix, reg. out */ + const silk_float *wXx, /* I Weighted correlation vector */ + const silk_float wxx, /* I Weighted correlation value */ + const opus_int D /* I Dimension */ ); /* Processing of gains */ void silk_process_gains_FLP( - silk_encoder_state_FLP *psEnc, /* I/O Encoder state FLP */ - silk_encoder_control_FLP *psEncCtrl, /* I/O Encoder control FLP */ - opus_int condCoding /* I The type of conditional coding to use */ + silk_encoder_state_FLP *psEnc, /* I/O Encoder state FLP */ + silk_encoder_control_FLP *psEncCtrl, /* I/O Encoder control FLP */ + opus_int condCoding /* I The type of conditional coding to use */ ); /******************/ @@ -254,74 +231,80 @@ void silk_process_gains_FLP( /******************/ /* Calculates correlation matrix X'*X */ void silk_corrMatrix_FLP( - const silk_float *x, /* I x vector [ L+order-1 ] used to create X */ - const opus_int L, /* I Length of vectors */ - const opus_int Order, /* I Max lag for correlation */ - silk_float *XX /* O X'*X correlation matrix [order x order] */ + const silk_float *x, /* I x vector [ L+order-1 ] used to create X */ + const opus_int L, /* I Length of vectors */ + const opus_int Order, /* I Max lag for correlation */ + silk_float *XX /* O X'*X correlation matrix [order x order] */ ); /* Calculates correlation vector X'*t */ void silk_corrVector_FLP( - const silk_float *x, /* I x vector [L+order-1] used to create X */ - const silk_float *t, /* I Target vector [L] */ - const opus_int L, /* I Length of vecors */ - const opus_int Order, /* I Max lag for correlation */ - silk_float *Xt /* O X'*t correlation vector [order] */ + const silk_float *x, /* I x vector [L+order-1] used to create X */ + const silk_float *t, /* I Target vector [L] */ + const opus_int L, /* I Length of vecors */ + const opus_int Order, /* I Max lag for correlation */ + silk_float *Xt /* O X'*t correlation vector [order] */ ); /* Add noise to matrix diagonal */ void silk_regularize_correlations_FLP( - silk_float *XX, /* I/O Correlation matrices */ - silk_float *xx, /* I/O Correlation values */ - const silk_float noise, /* I Noise energy to add */ - const opus_int D /* I Dimension of XX */ + silk_float *XX, /* I/O Correlation matrices */ + silk_float *xx, /* I/O Correlation values */ + const silk_float noise, /* I Noise energy to add */ + const opus_int D /* I Dimension of XX */ ); /* Function to solve linear equation Ax = b, where A is an MxM symmetric matrix */ void silk_solve_LDL_FLP( - silk_float *A, /* I/O Symmetric square matrix, out: reg. */ - const opus_int M, /* I Size of matrix */ - const silk_float *b, /* I Pointer to b vector */ - silk_float *x /* O Pointer to x solution vector */ + silk_float *A, /* I/O Symmetric square matrix, out: reg. */ + const opus_int M, /* I Size of matrix */ + const silk_float *b, /* I Pointer to b vector */ + silk_float *x /* O Pointer to x solution vector */ ); -/* Apply sine window to signal vector. */ -/* Window types: */ -/* 1 -> sine window from 0 to pi/2 */ -/* 2 -> sine window from pi/2 to pi */ +/* Apply sine window to signal vector. */ +/* Window types: */ +/* 1 -> sine window from 0 to pi/2 */ +/* 2 -> sine window from pi/2 to pi */ void silk_apply_sine_window_FLP( - silk_float px_win[], /* O Pointer to windowed signal */ - const silk_float px[], /* I Pointer to input signal */ - const opus_int win_type, /* I Selects a window type */ - const opus_int length /* I Window length, multiple of 4 */ + silk_float px_win[], /* O Pointer to windowed signal */ + const silk_float px[], /* I Pointer to input signal */ + const opus_int win_type, /* I Selects a window type */ + const opus_int length /* I Window length, multiple of 4 */ ); /* Wrapper functions. Call flp / fix code */ /* Convert AR filter coefficients to NLSF parameters */ void silk_A2NLSF_FLP( - opus_int16 *NLSF_Q15, /* O NLSF vector [ LPC_order ] */ - const silk_float *pAR, /* I LPC coefficients [ LPC_order ] */ - const opus_int LPC_order /* I LPC order */ + opus_int16 *NLSF_Q15, /* O NLSF vector [ LPC_order ] */ + const silk_float *pAR, /* I LPC coefficients [ LPC_order ] */ + const opus_int LPC_order /* I LPC order */ ); /* Convert NLSF parameters to AR prediction filter coefficients */ void silk_NLSF2A_FLP( - silk_float *pAR, /* O LPC coefficients [ LPC_order ] */ - const opus_int16 *NLSF_Q15, /* I NLSF vector [ LPC_order ] */ - const opus_int LPC_order /* I LPC order */ + silk_float *pAR, /* O LPC coefficients [ LPC_order ] */ + const opus_int16 *NLSF_Q15, /* I NLSF vector [ LPC_order ] */ + const opus_int LPC_order /* I LPC order */ +); + +/* Limit, stabilize, and quantize NLSFs */ +void silk_process_NLSFs_FLP( + silk_encoder_state *psEncC, /* I/O Encoder state */ + silk_float PredCoef[ 2 ][ MAX_LPC_ORDER ], /* O Prediction coefficients */ + opus_int16 NLSF_Q15[ MAX_LPC_ORDER ], /* I/O Normalized LSFs (quant out) (0 - (2^15-1)) */ + const opus_int16 prev_NLSF_Q15[ MAX_LPC_ORDER ] /* I Previous Normalized LSFs (0 - (2^15-1)) */ ); -/****************************************/ /* Floating-point Silk NSQ wrapper */ -/****************************************/ void silk_NSQ_wrapper_FLP( - silk_encoder_state_FLP *psEnc, /* I/O Encoder state FLP */ - silk_encoder_control_FLP *psEncCtrl, /* I/O Encoder control FLP */ - SideInfoIndices *psIndices, /* I/O Quantization indices */ - silk_nsq_state *psNSQ, /* I/O Noise Shaping Quantzation state */ - opus_int8 pulses[], /* O Quantized pulse signal */ - const silk_float x[] /* I Prefiltered input signal */ + silk_encoder_state_FLP *psEnc, /* I/O Encoder state FLP */ + silk_encoder_control_FLP *psEncCtrl, /* I/O Encoder control FLP */ + SideInfoIndices *psIndices, /* I/O Quantization indices */ + silk_nsq_state *psNSQ, /* I/O Noise Shaping Quantzation state */ + opus_int8 pulses[], /* O Quantized pulse signal */ + const silk_float x[] /* I Prefiltered input signal */ ); #ifdef __cplusplus diff --git a/silk/float/noise_shape_analysis_FLP.c b/silk/float/noise_shape_analysis_FLP.c index 4d82858b..e19ff70a 100644 --- a/silk/float/noise_shape_analysis_FLP.c +++ b/silk/float/noise_shape_analysis_FLP.c @@ -124,10 +124,10 @@ static inline void warped_true2monic_coefs( /* Compute noise shaping coefficients and initial gain values */ void silk_noise_shape_analysis_FLP( - silk_encoder_state_FLP *psEnc, /* I/O Encoder state FLP */ - silk_encoder_control_FLP *psEncCtrl, /* I/O Encoder control FLP */ - const silk_float *pitch_res, /* I LPC residual from pitch analysis */ - const silk_float *x /* I Input signal [frame_length + la_shape] */ + silk_encoder_state_FLP *psEnc, /* I/O Encoder state FLP */ + silk_encoder_control_FLP *psEncCtrl, /* I/O Encoder control FLP */ + const silk_float *pitch_res, /* I LPC residual from pitch analysis */ + const silk_float *x /* I Input signal [frame_length + la_shape] */ ) { silk_shape_state_FLP *psShapeSt = &psEnc->sShape; diff --git a/silk/float/pitch_analysis_core_FLP.c b/silk/float/pitch_analysis_core_FLP.c index 4108d63d..a4d39a71 100644 --- a/silk/float/pitch_analysis_core_FLP.c +++ b/silk/float/pitch_analysis_core_FLP.c @@ -30,59 +30,51 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #endif /***************************************************************************** -* * Pitch analyser function -* ******************************************************************************/ #include "SigProc_FLP.h" #include "SigProc_FIX.h" #include "pitch_est_defines.h" -#define SCRATCH_SIZE 22 - -/************************************************************/ -/* Definitions */ -/************************************************************/ -#define eps 1.192092896e-07f +#define SCRATCH_SIZE 22 +#define eps 1.192092896e-07f /************************************************************/ /* Internally used functions */ /************************************************************/ static void silk_P_Ana_calc_corr_st3( silk_float cross_corr_st3[ PE_MAX_NB_SUBFR ][ PE_NB_CBKS_STAGE3_MAX ][ PE_NB_STAGE3_LAGS ], /* O 3 DIM correlation array */ - const silk_float frame[], /* I vector to correlate */ - opus_int start_lag, /* I start lag */ - opus_int sf_length, /* I sub frame length */ - opus_int nb_subfr, /* I number of subframes */ - opus_int complexity /* I Complexity setting */ + const silk_float frame[], /* I vector to correlate */ + opus_int start_lag, /* I start lag */ + opus_int sf_length, /* I sub frame length */ + opus_int nb_subfr, /* I number of subframes */ + opus_int complexity /* I Complexity setting */ ); static void silk_P_Ana_calc_energy_st3( silk_float energies_st3[ PE_MAX_NB_SUBFR ][ PE_NB_CBKS_STAGE3_MAX ][ PE_NB_STAGE3_LAGS ], /* O 3 DIM correlation array */ - const silk_float frame[], /* I vector to correlate */ - opus_int start_lag, /* I start lag */ - opus_int sf_length, /* I sub frame length */ - opus_int nb_subfr, /* I number of subframes */ - opus_int complexity /* I Complexity setting */ + const silk_float frame[], /* I vector to correlate */ + opus_int start_lag, /* I start lag */ + opus_int sf_length, /* I sub frame length */ + opus_int nb_subfr, /* I number of subframes */ + opus_int complexity /* I Complexity setting */ ); -/* -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% CORE PITCH ANALYSIS FUNCTION % -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -*/ -opus_int silk_pitch_analysis_core_FLP( /* O voicing estimate: 0 voiced, 1 unvoiced */ - const silk_float *frame, /* I signal of length PE_FRAME_LENGTH_MS*Fs_kHz */ - opus_int *pitch_out, /* O 4 pitch lag values */ - opus_int16 *lagIndex, /* O lag Index */ - opus_int8 *contourIndex, /* O pitch contour Index */ - silk_float *LTPCorr, /* I/O normalized correlation; input: value from previous frame */ - opus_int prevLag, /* I last lag of previous frame; set to zero is unvoiced */ - const silk_float search_thres1, /* I first stage threshold for lag candidates 0 - 1 */ - const silk_float search_thres2, /* I final threshold for lag candidates 0 - 1 */ - const opus_int Fs_kHz, /* I sample frequency (kHz) */ - const opus_int complexity, /* I Complexity setting, 0-2, where 2 is highest */ - const opus_int nb_subfr /* I number of 5 ms subframes */ +/************************************************************/ +/* CORE PITCH ANALYSIS FUNCTION */ +/************************************************************/ +opus_int silk_pitch_analysis_core_FLP( /* O Voicing estimate: 0 voiced, 1 unvoiced */ + const silk_float *frame, /* I Signal of length PE_FRAME_LENGTH_MS*Fs_kHz */ + opus_int *pitch_out, /* O Pitch lag values [nb_subfr] */ + opus_int16 *lagIndex, /* O Lag Index */ + opus_int8 *contourIndex, /* O Pitch contour Index */ + silk_float *LTPCorr, /* I/O Normalized correlation; input: value from previous frame */ + opus_int prevLag, /* I Last lag of previous frame; set to zero is unvoiced */ + const silk_float search_thres1, /* I First stage threshold for lag candidates 0 - 1 */ + const silk_float search_thres2, /* I Final threshold for lag candidates 0 - 1 */ + const opus_int Fs_kHz, /* I sample frequency (kHz) */ + const opus_int complexity, /* I Complexity setting, 0-2, where 2 is highest */ + const opus_int nb_subfr /* I Number of 5 ms subframes */ ) { opus_int i, k, d, j; @@ -117,8 +109,8 @@ opus_int silk_pitch_analysis_core_FLP( /* O voicing estimate: 0 voiced, 1 unvoic silk_assert( Fs_kHz == 8 || Fs_kHz == 12 || Fs_kHz == 16 ); /* Check for valid complexity setting */ - silk_assert( complexity >= SigProc_PE_MIN_COMPLEX ); - silk_assert( complexity <= SigProc_PE_MAX_COMPLEX ); + silk_assert( complexity >= SILK_PE_MIN_COMPLEX ); + silk_assert( complexity <= SILK_PE_MAX_COMPLEX ); silk_assert( search_thres1 >= 0.0f && search_thres1 <= 1.0f ); silk_assert( search_thres2 >= 0.0f && search_thres2 <= 1.0f ); @@ -301,7 +293,7 @@ opus_int silk_pitch_analysis_core_FLP( /* O voicing estimate: 0 voiced, 1 unvoic basis_ptr = target_ptr - d; cross_corr = silk_inner_product_FLP( basis_ptr, target_ptr, sf_length_8kHz ); energy = silk_energy_FLP( basis_ptr, sf_length_8kHz ); - if (cross_corr > 0.0f) { + if( cross_corr > 0.0f ) { C[ k ][ d ] = (silk_float)(cross_corr * cross_corr / (energy * energy_tmp + eps)); } else { C[ k ][ d ] = 0.0f; @@ -334,7 +326,7 @@ opus_int silk_pitch_analysis_core_FLP( /* O voicing estimate: 0 voiced, 1 unvoic if( nb_subfr == PE_MAX_NB_SUBFR ) { cbk_size = PE_NB_CBKS_STAGE2_EXT; Lag_CB_ptr = &silk_CB_lags_stage2[ 0 ][ 0 ]; - if( Fs_kHz == 8 && complexity > SigProc_PE_MIN_COMPLEX ) { + if( Fs_kHz == 8 && complexity > SILK_PE_MIN_COMPLEX ) { /* If input is 8 khz use a larger codebook here because it is last stage */ nb_cbk_search = PE_NB_CBKS_STAGE2_EXT; } else { @@ -372,16 +364,16 @@ opus_int silk_pitch_analysis_core_FLP( /* O voicing estimate: 0 voiced, 1 unvoic CCmax_new_b -= PE_SHORTLAG_BIAS * nb_subfr * lag_log2; /* Bias towards previous lag */ - if ( prevLag > 0 ) { + if( prevLag > 0 ) { delta_lag_log2_sqr = lag_log2 - prevLag_log2; delta_lag_log2_sqr *= delta_lag_log2_sqr; CCmax_new_b -= PE_PREVLAG_BIAS * nb_subfr * (*LTPCorr) * delta_lag_log2_sqr / (delta_lag_log2_sqr + 0.5f); } - if ( CCmax_new_b > CCmax_b && /* Find maximum biased correlation */ - CCmax_new > nb_subfr * search_thres2 * search_thres2 && /* Correlation needs to be high enough to be voiced */ - silk_CB_lags_stage2[ 0 ][ CBimax_new ] <= min_lag_8kHz /* Lag must be in range */ - ) { + if( CCmax_new_b > CCmax_b && /* Find maximum biased correlation */ + CCmax_new > nb_subfr * search_thres2 * search_thres2 && /* Correlation needs to be high enough to be voiced */ + silk_CB_lags_stage2[ 0 ][ CBimax_new ] <= min_lag_8kHz /* Lag must be in range */ + ) { CCmax_b = CCmax_new_b; CCmax = CCmax_new; lag = d; @@ -415,7 +407,7 @@ opus_int silk_pitch_analysis_core_FLP( /* O voicing estimate: 0 voiced, 1 unvoic lag_new = lag; /* to avoid undefined lag */ CBimax = 0; /* to avoid undefined lag */ silk_assert( CCmax >= 0.0f ); - *LTPCorr = (silk_float)sqrt( CCmax / nb_subfr ); /* Output normalized correlation */ + *LTPCorr = (silk_float)sqrt( CCmax / nb_subfr ); /* Output normalized correlation */ CCmax = -1000.0f; @@ -489,11 +481,11 @@ opus_int silk_pitch_analysis_core_FLP( /* O voicing estimate: 0 voiced, 1 unvoic static void silk_P_Ana_calc_corr_st3( silk_float cross_corr_st3[ PE_MAX_NB_SUBFR ][ PE_NB_CBKS_STAGE3_MAX ][ PE_NB_STAGE3_LAGS ], /* O 3 DIM correlation array */ - const silk_float frame[], /* I vector to correlate */ - opus_int start_lag, /* I start lag */ - opus_int sf_length, /* I sub frame length */ - opus_int nb_subfr, /* I number of subframes */ - opus_int complexity /* I Complexity setting */ + const silk_float frame[], /* I vector to correlate */ + opus_int start_lag, /* I start lag */ + opus_int sf_length, /* I sub frame length */ + opus_int nb_subfr, /* I number of subframes */ + opus_int complexity /* I Complexity setting */ ) /*********************************************************************** Calculates the correlations used in stage 3 search. In order to cover @@ -515,10 +507,10 @@ static void silk_P_Ana_calc_corr_st3( silk_float scratch_mem[ SCRATCH_SIZE ]; const opus_int8 *Lag_range_ptr, *Lag_CB_ptr; - silk_assert( complexity >= SigProc_PE_MIN_COMPLEX ); - silk_assert( complexity <= SigProc_PE_MAX_COMPLEX ); + silk_assert( complexity >= SILK_PE_MIN_COMPLEX ); + silk_assert( complexity <= SILK_PE_MAX_COMPLEX ); - if( nb_subfr == PE_MAX_NB_SUBFR ){ + if( nb_subfr == PE_MAX_NB_SUBFR ) { Lag_range_ptr = &silk_Lag_range_stage3[ complexity ][ 0 ][ 0 ]; Lag_CB_ptr = &silk_CB_lags_stage3[ 0 ][ 0 ]; nb_cbk_search = silk_nb_cbk_searchs_stage3[ complexity ]; @@ -562,11 +554,11 @@ static void silk_P_Ana_calc_corr_st3( static void silk_P_Ana_calc_energy_st3( silk_float energies_st3[ PE_MAX_NB_SUBFR ][ PE_NB_CBKS_STAGE3_MAX ][ PE_NB_STAGE3_LAGS ], /* O 3 DIM correlation array */ - const silk_float frame[], /* I vector to correlate */ - opus_int start_lag, /* I start lag */ - opus_int sf_length, /* I sub frame length */ - opus_int nb_subfr, /* I number of subframes */ - opus_int complexity /* I Complexity setting */ + const silk_float frame[], /* I vector to correlate */ + opus_int start_lag, /* I start lag */ + opus_int sf_length, /* I sub frame length */ + opus_int nb_subfr, /* I number of subframes */ + opus_int complexity /* I Complexity setting */ ) /**************************************************************** Calculate the energies for first two subframes. The energies are @@ -580,10 +572,10 @@ calculated recursively. silk_float scratch_mem[ SCRATCH_SIZE ]; const opus_int8 *Lag_range_ptr, *Lag_CB_ptr; - silk_assert( complexity >= SigProc_PE_MIN_COMPLEX ); - silk_assert( complexity <= SigProc_PE_MAX_COMPLEX ); + silk_assert( complexity >= SILK_PE_MIN_COMPLEX ); + silk_assert( complexity <= SILK_PE_MAX_COMPLEX ); - if( nb_subfr == PE_MAX_NB_SUBFR ){ + if( nb_subfr == PE_MAX_NB_SUBFR ) { Lag_range_ptr = &silk_Lag_range_stage3[ complexity ][ 0 ][ 0 ]; Lag_CB_ptr = &silk_CB_lags_stage3[ 0 ][ 0 ]; nb_cbk_search = silk_nb_cbk_searchs_stage3[ complexity ]; diff --git a/silk/float/prefilter_FLP.c b/silk/float/prefilter_FLP.c index 9f16e2dd..3dcf7b53 100644 --- a/silk/float/prefilter_FLP.c +++ b/silk/float/prefilter_FLP.c @@ -33,18 +33,18 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "tuning_parameters.h" /* -* silk_prefilter. Prefilter for finding Quantizer input signal +* Prefilter for finding Quantizer input signal */ static inline void silk_prefilt_FLP( - silk_prefilter_state_FLP *P,/* I/O state */ - silk_float st_res[], /* I */ - silk_float xw[], /* O */ - silk_float *HarmShapeFIR, /* I */ - silk_float Tilt, /* I */ - silk_float LF_MA_shp, /* I */ - silk_float LF_AR_shp, /* I */ - opus_int lag, /* I */ - opus_int length /* I */ + silk_prefilter_state_FLP *P, /* I/O state */ + silk_float st_res[], /* I */ + silk_float xw[], /* O */ + silk_float *HarmShapeFIR, /* I */ + silk_float Tilt, /* I */ + silk_float LF_MA_shp, /* I */ + silk_float LF_AR_shp, /* I */ + opus_int lag, /* I */ + opus_int length /* I */ ); void silk_warped_LPC_analysis_filter_FLP( @@ -92,10 +92,10 @@ void silk_warped_LPC_analysis_filter_FLP( * silk_prefilter. Main prefilter function */ void silk_prefilter_FLP( - silk_encoder_state_FLP *psEnc, /* I/O Encoder state FLP */ - const silk_encoder_control_FLP *psEncCtrl, /* I Encoder control FLP */ - silk_float xw[], /* O Weighted signal */ - const silk_float x[] /* I Speech signal */ + silk_encoder_state_FLP *psEnc, /* I/O Encoder state FLP */ + const silk_encoder_control_FLP *psEncCtrl, /* I Encoder control FLP */ + silk_float xw[], /* O Weighted signal */ + const silk_float x[] /* I Speech signal */ ) { silk_prefilter_state_FLP *P = &psEnc->sPrefilt; @@ -154,15 +154,15 @@ void silk_prefilter_FLP( * Prefilter for finding Quantizer input signal */ static inline void silk_prefilt_FLP( - silk_prefilter_state_FLP *P,/* I/O state */ - silk_float st_res[], /* I */ - silk_float xw[], /* O */ - silk_float *HarmShapeFIR, /* I */ - silk_float Tilt, /* I */ - silk_float LF_MA_shp, /* I */ - silk_float LF_AR_shp, /* I */ - opus_int lag, /* I */ - opus_int length /* I */ + silk_prefilter_state_FLP *P, /* I/O state */ + silk_float st_res[], /* I */ + silk_float xw[], /* O */ + silk_float *HarmShapeFIR, /* I */ + silk_float Tilt, /* I */ + silk_float LF_MA_shp, /* I */ + silk_float LF_AR_shp, /* I */ + opus_int lag, /* I */ + opus_int length /* I */ ) { opus_int i; diff --git a/silk/float/process_gains_FLP.c b/silk/float/process_gains_FLP.c index f9b57f46..020f847b 100644 --- a/silk/float/process_gains_FLP.c +++ b/silk/float/process_gains_FLP.c @@ -34,9 +34,9 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. /* Processing of gains */ void silk_process_gains_FLP( - silk_encoder_state_FLP *psEnc, /* I/O Encoder state FLP */ - silk_encoder_control_FLP *psEncCtrl, /* I/O Encoder control FLP */ - opus_int condCoding /* I The type of conditional coding to use */ + silk_encoder_state_FLP *psEnc, /* I/O Encoder state FLP */ + silk_encoder_control_FLP *psEncCtrl, /* I/O Encoder control FLP */ + opus_int condCoding /* I The type of conditional coding to use */ ) { silk_shape_state_FLP *psShapeSt = &psEnc->sShape; diff --git a/silk/float/regularize_correlations_FLP.c b/silk/float/regularize_correlations_FLP.c index 0876e6a9..79447809 100644 --- a/silk/float/regularize_correlations_FLP.c +++ b/silk/float/regularize_correlations_FLP.c @@ -31,11 +31,12 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "main_FLP.h" +/* Add noise to matrix diagonal */ void silk_regularize_correlations_FLP( - silk_float *XX, /* I/O Correlation matrices */ - silk_float *xx, /* I/O Correlation values */ - const silk_float noise, /* I Noise energy to add */ - const opus_int D /* I Dimension of XX */ + silk_float *XX, /* I/O Correlation matrices */ + silk_float *xx, /* I/O Correlation values */ + const silk_float noise, /* I Noise energy to add */ + const opus_int D /* I Dimension of XX */ ) { opus_int i; diff --git a/silk/float/residual_energy_FLP.c b/silk/float/residual_energy_FLP.c index da3b841d..03604bd1 100644 --- a/silk/float/residual_energy_FLP.c +++ b/silk/float/residual_energy_FLP.c @@ -35,12 +35,12 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #define REGULARIZATION_FACTOR 1e-8f /* Residual energy: nrg = wxx - 2 * wXx * c + c' * wXX * c */ -silk_float silk_residual_energy_covar_FLP( /* O Weighted residual energy */ - const silk_float *c, /* I Filter coefficients */ - silk_float *wXX, /* I/O Weighted correlation matrix, reg. out */ - const silk_float *wXx, /* I Weighted correlation vector */ - const silk_float wxx, /* I Weighted correlation value */ - const opus_int D /* I Dimension */ +silk_float silk_residual_energy_covar_FLP( /* O Weighted residual energy */ + const silk_float *c, /* I Filter coefficients */ + silk_float *wXX, /* I/O Weighted correlation matrix, reg. out */ + const silk_float *wXx, /* I Weighted correlation vector */ + const silk_float wxx, /* I Weighted correlation value */ + const opus_int D /* I Dimension */ ) { opus_int i, j, k; @@ -89,13 +89,13 @@ silk_float silk_residual_energy_covar_FLP( /* O Weighted residual e /* Calculates residual energies of input subframes where all subframes have LPC_order */ /* of preceeding samples */ void silk_residual_energy_FLP( - silk_float nrgs[ MAX_NB_SUBFR ], /* O Residual energy per subframe */ - const silk_float x[], /* I Input signal */ - silk_float a[ 2 ][ MAX_LPC_ORDER ], /* I AR coefs for each frame half */ - const silk_float gains[], /* I Quantization gains */ - const opus_int subfr_length, /* I Subframe length */ - const opus_int nb_subfr, /* I number of subframes */ - const opus_int LPC_order /* I LPC order */ + silk_float nrgs[ MAX_NB_SUBFR ], /* O Residual energy per subframe */ + const silk_float x[], /* I Input signal */ + silk_float a[ 2 ][ MAX_LPC_ORDER ], /* I AR coefs for each frame half */ + const silk_float gains[], /* I Quantization gains */ + const opus_int subfr_length, /* I Subframe length */ + const opus_int nb_subfr, /* I number of subframes */ + const opus_int LPC_order /* I LPC order */ ) { opus_int shift; diff --git a/silk/float/scale_copy_vector_FLP.c b/silk/float/scale_copy_vector_FLP.c index 689134f4..efc922fc 100644 --- a/silk/float/scale_copy_vector_FLP.c +++ b/silk/float/scale_copy_vector_FLP.c @@ -33,10 +33,10 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. /* copy and multiply a vector by a constant */ void silk_scale_copy_vector_FLP( - silk_float *data_out, - const silk_float *data_in, - silk_float gain, - opus_int dataSize + silk_float *data_out, + const silk_float *data_in, + silk_float gain, + opus_int dataSize ) { opus_int i, dataSize4; diff --git a/silk/float/scale_vector_FLP.c b/silk/float/scale_vector_FLP.c index 656061e4..09feeacf 100644 --- a/silk/float/scale_vector_FLP.c +++ b/silk/float/scale_vector_FLP.c @@ -33,9 +33,9 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. /* multiply a vector by a constant */ void silk_scale_vector_FLP( - silk_float *data1, - silk_float gain, - opus_int dataSize + silk_float *data1, + silk_float gain, + opus_int dataSize ) { opus_int i, dataSize4; diff --git a/silk/float/schur_FLP.c b/silk/float/schur_FLP.c index 59921bb7..205f8d4d 100644 --- a/silk/float/schur_FLP.c +++ b/silk/float/schur_FLP.c @@ -31,10 +31,10 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "SigProc_FLP.h" -silk_float silk_schur_FLP( /* O returns residual energy */ - silk_float refl_coef[], /* O reflection coefficients (length order) */ - const silk_float auto_corr[], /* I autotcorrelation sequence (length order+1) */ - opus_int order /* I order */ +silk_float silk_schur_FLP( /* O returns residual energy */ + silk_float refl_coef[], /* O reflection coefficients (length order) */ + const silk_float auto_corr[], /* I autocorrelation sequence (length order+1) */ + opus_int order /* I order */ ) { opus_int k, n; @@ -56,7 +56,7 @@ silk_float silk_schur_FLP( /* O returns residual energy refl_coef[ k ] = rc_tmp; /* Update correlations */ - for( n = 0; n < order - k; n++ ){ + for( n = 0; n < order - k; n++ ) { Ctmp1 = C[ n + k + 1 ][ 0 ]; Ctmp2 = C[ n ][ 1 ]; C[ n + k + 1 ][ 0 ] = Ctmp1 + Ctmp2 * rc_tmp; diff --git a/silk/float/silk_float.vcxproj b/silk/float/silk_float.vcxproj index 44539478..9a428055 100644 --- a/silk/float/silk_float.vcxproj +++ b/silk/float/silk_float.vcxproj @@ -1,130 +1,131 @@ -<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <ItemGroup Label="ProjectConfigurations">
- <ProjectConfiguration Include="Debug|Win32">
- <Configuration>Debug</Configuration>
- <Platform>Win32</Platform>
- </ProjectConfiguration>
- <ProjectConfiguration Include="Release|Win32">
- <Configuration>Release</Configuration>
- <Platform>Win32</Platform>
- </ProjectConfiguration>
- </ItemGroup>
- <PropertyGroup Label="Globals">
- <ProjectGuid>{9C4961D2-5DDB-40C7-9BE8-CA918DC4E782}</ProjectGuid>
- <Keyword>Win32Proj</Keyword>
- <RootNamespace>src_FLP</RootNamespace>
- <ProjectName>silk_float</ProjectName>
- </PropertyGroup>
- <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
- <ConfigurationType>StaticLibrary</ConfigurationType>
- <UseDebugLibraries>true</UseDebugLibraries>
- <CharacterSet>Unicode</CharacterSet>
- </PropertyGroup>
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
- <ConfigurationType>StaticLibrary</ConfigurationType>
- <UseDebugLibraries>false</UseDebugLibraries>
- <WholeProgramOptimization>true</WholeProgramOptimization>
- <CharacterSet>Unicode</CharacterSet>
- </PropertyGroup>
- <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
- <ImportGroup Label="ExtensionSettings">
- </ImportGroup>
- <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
- </ImportGroup>
- <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
- </ImportGroup>
- <PropertyGroup Label="UserMacros" />
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
- <TargetName>$(ProjectName)</TargetName>
- </PropertyGroup>
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
- <TargetName>$(ProjectName)</TargetName>
- </PropertyGroup>
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
- <ClCompile>
- <PrecompiledHeader>
- </PrecompiledHeader>
- <WarningLevel>Level3</WarningLevel>
- <Optimization>Disabled</Optimization>
- <PreprocessorDefinitions>HAVE_CONFIG_H;WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <AdditionalIncludeDirectories>../;../fixed;../../win32;../../celt</AdditionalIncludeDirectories>
- </ClCompile>
- <Link>
- <SubSystem>Windows</SubSystem>
- <GenerateDebugInformation>true</GenerateDebugInformation>
- </Link>
- <Lib>
- <OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
- </Lib>
- </ItemDefinitionGroup>
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
- <ClCompile>
- <WarningLevel>Level3</WarningLevel>
- <PrecompiledHeader>
- </PrecompiledHeader>
- <Optimization>MaxSpeed</Optimization>
- <FunctionLevelLinking>true</FunctionLevelLinking>
- <IntrinsicFunctions>true</IntrinsicFunctions>
- <PreprocessorDefinitions>HAVE_CONFIG_H;WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <AdditionalIncludeDirectories>../;../fixed;../../win32;../../celt</AdditionalIncludeDirectories>
- </ClCompile>
- <Link>
- <SubSystem>Windows</SubSystem>
- <GenerateDebugInformation>true</GenerateDebugInformation>
- <EnableCOMDATFolding>true</EnableCOMDATFolding>
- <OptimizeReferences>true</OptimizeReferences>
- </Link>
- <Lib>
- <OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
- </Lib>
- </ItemDefinitionGroup>
- <ItemGroup>
- <None Include="ReadMe.txt" />
- </ItemGroup>
- <ItemGroup>
- <ClCompile Include="apply_sine_window_FLP.c" />
- <ClCompile Include="autocorrelation_FLP.c" />
- <ClCompile Include="burg_modified_FLP.c" />
- <ClCompile Include="bwexpander_FLP.c" />
- <ClCompile Include="corrMatrix_FLP.c" />
- <ClCompile Include="encode_frame_FLP.c" />
- <ClCompile Include="energy_FLP.c" />
- <ClCompile Include="find_LPC_FLP.c" />
- <ClCompile Include="find_LTP_FLP.c" />
- <ClCompile Include="find_pitch_lags_FLP.c" />
- <ClCompile Include="find_pred_coefs_FLP.c" />
- <ClCompile Include="inner_product_FLP.c" />
- <ClCompile Include="k2a_FLP.c" />
- <ClCompile Include="levinsondurbin_FLP.c" />
- <ClCompile Include="LPC_analysis_filter_FLP.c" />
- <ClCompile Include="LPC_inv_pred_gain_FLP.c" />
- <ClCompile Include="LTP_analysis_filter_FLP.c" />
- <ClCompile Include="LTP_scale_ctrl_FLP.c" />
- <ClCompile Include="noise_shape_analysis_FLP.c" />
- <ClCompile Include="pitch_analysis_core_FLP.c" />
- <ClCompile Include="prefilter_FLP.c" />
- <ClCompile Include="process_gains_FLP.c" />
- <ClCompile Include="regularize_correlations_FLP.c" />
- <ClCompile Include="residual_energy_FLP.c" />
- <ClCompile Include="scale_copy_vector_FLP.c" />
- <ClCompile Include="scale_vector_FLP.c" />
- <ClCompile Include="schur_FLP.c" />
- <ClCompile Include="solve_LS_FLP.c" />
- <ClCompile Include="sort_FLP.c" />
- <ClCompile Include="warped_autocorrelation_FLP.c" />
- <ClCompile Include="wrappers_FLP.c" />
- </ItemGroup>
- <ItemGroup>
- <ClInclude Include="..\..\win32\config.h" />
- <ClInclude Include="main_FLP.h" />
- <ClInclude Include="SigProc_FLP.h" />
- <ClInclude Include="structs_FLP.h" />
- </ItemGroup>
- <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
- <ImportGroup Label="ExtensionTargets">
- </ImportGroup>
+<?xml version="1.0" encoding="utf-8"?> +<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <ItemGroup Label="ProjectConfigurations"> + <ProjectConfiguration Include="Debug|Win32"> + <Configuration>Debug</Configuration> + <Platform>Win32</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Release|Win32"> + <Configuration>Release</Configuration> + <Platform>Win32</Platform> + </ProjectConfiguration> + </ItemGroup> + <PropertyGroup Label="Globals"> + <ProjectGuid>{9C4961D2-5DDB-40C7-9BE8-CA918DC4E782}</ProjectGuid> + <Keyword>Win32Proj</Keyword> + <RootNamespace>src_FLP</RootNamespace> + <ProjectName>silk_float</ProjectName> + </PropertyGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> + <ConfigurationType>StaticLibrary</ConfigurationType> + <UseDebugLibraries>true</UseDebugLibraries> + <CharacterSet>Unicode</CharacterSet> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> + <ConfigurationType>StaticLibrary</ConfigurationType> + <UseDebugLibraries>false</UseDebugLibraries> + <WholeProgramOptimization>true</WholeProgramOptimization> + <CharacterSet>Unicode</CharacterSet> + </PropertyGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> + <ImportGroup Label="ExtensionSettings"> + </ImportGroup> + <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + </ImportGroup> + <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + </ImportGroup> + <PropertyGroup Label="UserMacros" /> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> + <TargetName>$(ProjectName)</TargetName> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> + <TargetName>$(ProjectName)</TargetName> + </PropertyGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> + <ClCompile> + <PrecompiledHeader> + </PrecompiledHeader> + <WarningLevel>Level3</WarningLevel> + <Optimization>Disabled</Optimization> + <PreprocessorDefinitions>HAVE_CONFIG_H;WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <AdditionalIncludeDirectories>../;../fixed;../../win32;../../celt;../../include</AdditionalIncludeDirectories> + </ClCompile> + <Link> + <SubSystem>Windows</SubSystem> + <GenerateDebugInformation>true</GenerateDebugInformation> + </Link> + <Lib> + <OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile> + </Lib> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> + <ClCompile> + <WarningLevel>Level3</WarningLevel> + <PrecompiledHeader> + </PrecompiledHeader> + <Optimization>MaxSpeed</Optimization> + <FunctionLevelLinking>true</FunctionLevelLinking> + <IntrinsicFunctions>true</IntrinsicFunctions> + <PreprocessorDefinitions>HAVE_CONFIG_H;WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <AdditionalIncludeDirectories>../;../fixed;../../win32;../../celt;../../include</AdditionalIncludeDirectories> + </ClCompile> + <Link> + <SubSystem>Windows</SubSystem> + <GenerateDebugInformation>true</GenerateDebugInformation> + <EnableCOMDATFolding>true</EnableCOMDATFolding> + <OptimizeReferences>true</OptimizeReferences> + </Link> + <Lib> + <OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile> + </Lib> + </ItemDefinitionGroup> + <ItemGroup> + <None Include="ReadMe.txt" /> + </ItemGroup> + <ItemGroup> + <ClCompile Include="apply_sine_window_FLP.c" /> + <ClCompile Include="autocorrelation_FLP.c" /> + <ClCompile Include="burg_modified_FLP.c" /> + <ClCompile Include="bwexpander_FLP.c" /> + <ClCompile Include="corrMatrix_FLP.c" /> + <ClCompile Include="encode_frame_FLP.c" /> + <ClCompile Include="energy_FLP.c" /> + <ClCompile Include="find_LPC_FLP.c" /> + <ClCompile Include="find_LTP_FLP.c" /> + <ClCompile Include="find_pitch_lags_FLP.c" /> + <ClCompile Include="find_pred_coefs_FLP.c" /> + <ClCompile Include="inner_product_FLP.c" /> + <ClCompile Include="k2a_FLP.c" /> + <ClCompile Include="levinsondurbin_FLP.c" /> + <ClCompile Include="LPC_analysis_filter_FLP.c" /> + <ClCompile Include="LPC_inv_pred_gain_FLP.c" /> + <ClCompile Include="LTP_analysis_filter_FLP.c" /> + <ClCompile Include="LTP_scale_ctrl_FLP.c" /> + <ClCompile Include="noise_shape_analysis_FLP.c" /> + <ClCompile Include="pitch_analysis_core_FLP.c" /> + <ClCompile Include="prefilter_FLP.c" /> + <ClCompile Include="process_gains_FLP.c" /> + <ClCompile Include="regularize_correlations_FLP.c" /> + <ClCompile Include="residual_energy_FLP.c" /> + <ClCompile Include="scale_copy_vector_FLP.c" /> + <ClCompile Include="scale_vector_FLP.c" /> + <ClCompile Include="schur_FLP.c" /> + <ClCompile Include="solve_LS_FLP.c" /> + <ClCompile Include="sort_FLP.c" /> + <ClCompile Include="warped_autocorrelation_FLP.c" /> + <ClCompile Include="wrappers_FLP.c" /> + </ItemGroup> + <ItemGroup> + <ClInclude Include="..\..\include\opus_types.h" /> + <ClInclude Include="..\..\win32\config.h" /> + <ClInclude Include="main_FLP.h" /> + <ClInclude Include="SigProc_FLP.h" /> + <ClInclude Include="structs_FLP.h" /> + </ItemGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> + <ImportGroup Label="ExtensionTargets"> + </ImportGroup> </Project>
\ No newline at end of file diff --git a/silk/float/silk_float.vcxproj.filters b/silk/float/silk_float.vcxproj.filters index bf29bbe1..a4f075b6 100644 --- a/silk/float/silk_float.vcxproj.filters +++ b/silk/float/silk_float.vcxproj.filters @@ -1,129 +1,132 @@ -<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <ItemGroup>
- <Filter Include="Source Files">
- <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
- <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
- </Filter>
- <Filter Include="Header Files">
- <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
- <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
- </Filter>
- <Filter Include="Resource Files">
- <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
- <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
- </Filter>
- </ItemGroup>
- <ItemGroup>
- <None Include="ReadMe.txt" />
- </ItemGroup>
- <ItemGroup>
- <ClCompile Include="apply_sine_window_FLP.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="autocorrelation_FLP.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="burg_modified_FLP.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="bwexpander_FLP.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="corrMatrix_FLP.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="encode_frame_FLP.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="energy_FLP.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="find_LPC_FLP.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="find_LTP_FLP.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="find_pitch_lags_FLP.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="find_pred_coefs_FLP.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="inner_product_FLP.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="k2a_FLP.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="levinsondurbin_FLP.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="LPC_analysis_filter_FLP.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="LPC_inv_pred_gain_FLP.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="LTP_analysis_filter_FLP.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="LTP_scale_ctrl_FLP.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="noise_shape_analysis_FLP.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="pitch_analysis_core_FLP.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="prefilter_FLP.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="process_gains_FLP.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="regularize_correlations_FLP.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="residual_energy_FLP.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="scale_copy_vector_FLP.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="scale_vector_FLP.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="schur_FLP.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="solve_LS_FLP.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="sort_FLP.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="warped_autocorrelation_FLP.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="wrappers_FLP.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- </ItemGroup>
- <ItemGroup>
- <ClInclude Include="..\..\win32\config.h">
- <Filter>Header Files</Filter>
- </ClInclude>
- <ClInclude Include="main_FLP.h">
- <Filter>Header Files</Filter>
- </ClInclude>
- <ClInclude Include="SigProc_FLP.h">
- <Filter>Header Files</Filter>
- </ClInclude>
- <ClInclude Include="structs_FLP.h">
- <Filter>Header Files</Filter>
- </ClInclude>
- </ItemGroup>
+<?xml version="1.0" encoding="utf-8"?> +<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <ItemGroup> + <Filter Include="Source Files"> + <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier> + <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions> + </Filter> + <Filter Include="Header Files"> + <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier> + <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions> + </Filter> + <Filter Include="Resource Files"> + <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier> + <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions> + </Filter> + </ItemGroup> + <ItemGroup> + <None Include="ReadMe.txt" /> + </ItemGroup> + <ItemGroup> + <ClCompile Include="apply_sine_window_FLP.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="autocorrelation_FLP.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="burg_modified_FLP.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="bwexpander_FLP.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="corrMatrix_FLP.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="encode_frame_FLP.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="energy_FLP.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="find_LPC_FLP.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="find_LTP_FLP.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="find_pitch_lags_FLP.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="find_pred_coefs_FLP.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="inner_product_FLP.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="k2a_FLP.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="levinsondurbin_FLP.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="LPC_analysis_filter_FLP.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="LPC_inv_pred_gain_FLP.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="LTP_analysis_filter_FLP.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="LTP_scale_ctrl_FLP.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="noise_shape_analysis_FLP.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="pitch_analysis_core_FLP.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="prefilter_FLP.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="process_gains_FLP.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="regularize_correlations_FLP.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="residual_energy_FLP.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="scale_copy_vector_FLP.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="scale_vector_FLP.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="schur_FLP.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="solve_LS_FLP.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="sort_FLP.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="warped_autocorrelation_FLP.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="wrappers_FLP.c"> + <Filter>Source Files</Filter> + </ClCompile> + </ItemGroup> + <ItemGroup> + <ClInclude Include="..\..\win32\config.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="main_FLP.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="SigProc_FLP.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="structs_FLP.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\..\include\opus_types.h"> + <Filter>Header Files</Filter> + </ClInclude> + </ItemGroup> </Project>
\ No newline at end of file diff --git a/silk/float/solve_LS_FLP.c b/silk/float/solve_LS_FLP.c index c04cb59d..dd3775a9 100644 --- a/silk/float/solve_LS_FLP.c +++ b/silk/float/solve_LS_FLP.c @@ -38,10 +38,10 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * the symmetric matric A is given by A = L*D*L'. **********************************************************************/ static inline void silk_LDL_FLP( - silk_float *A, /* (I/O) Pointer to Symetric Square Matrix */ - opus_int M, /* (I) Size of Matrix */ - silk_float *L, /* (I/O) Pointer to Square Upper triangular Matrix */ - silk_float *Dinv /* (I/O) Pointer to vector holding the inverse diagonal elements of D */ + silk_float *A, /* I/O Pointer to Symetric Square Matrix */ + opus_int M, /* I Size of Matrix */ + silk_float *L, /* I/O Pointer to Square Upper triangular Matrix */ + silk_float *Dinv /* I/O Pointer to vector holding the inverse diagonal elements of D */ ); /********************************************************************** @@ -49,10 +49,10 @@ static inline void silk_LDL_FLP( * triangular matrix, with ones on the diagonal. **********************************************************************/ static inline void silk_SolveWithLowerTriangularWdiagOnes_FLP( - const silk_float *L, /* (I) Pointer to Lower Triangular Matrix */ - opus_int M, /* (I) Dim of Matrix equation */ - const silk_float *b, /* (I) b Vector */ - silk_float *x /* (O) x Vector */ + const silk_float *L, /* I Pointer to Lower Triangular Matrix */ + opus_int M, /* I Dim of Matrix equation */ + const silk_float *b, /* I b Vector */ + silk_float *x /* O x Vector */ ); /********************************************************************** @@ -60,10 +60,10 @@ static inline void silk_SolveWithLowerTriangularWdiagOnes_FLP( * triangular, with ones on the diagonal. (ie then A^T is upper triangular) **********************************************************************/ static inline void silk_SolveWithUpperTriangularFromLowerWdiagOnes_FLP( - const silk_float *L, /* (I) Pointer to Lower Triangular Matrix */ - opus_int M, /* (I) Dim of Matrix equation */ - const silk_float *b, /* (I) b Vector */ - silk_float *x /* (O) x Vector */ + const silk_float *L, /* I Pointer to Lower Triangular Matrix */ + opus_int M, /* I Dim of Matrix equation */ + const silk_float *b, /* I b Vector */ + silk_float *x /* O x Vector */ ); /********************************************************************** @@ -71,10 +71,10 @@ static inline void silk_SolveWithUpperTriangularFromLowerWdiagOnes_FLP( * symmetric square matrix - using LDL factorisation **********************************************************************/ void silk_solve_LDL_FLP( - silk_float *A, /* I/O Symmetric square matrix, out: reg. */ - const opus_int M, /* I Size of matrix */ - const silk_float *b, /* I Pointer to b vector */ - silk_float *x /* O Pointer to x solution vector */ + silk_float *A, /* I/O Symmetric square matrix, out: reg. */ + const opus_int M, /* I Size of matrix */ + const silk_float *b, /* I Pointer to b vector */ + silk_float *x /* O Pointer to x solution vector */ ) { opus_int i; @@ -110,10 +110,10 @@ void silk_solve_LDL_FLP( } static inline void silk_SolveWithUpperTriangularFromLowerWdiagOnes_FLP( - const silk_float *L, /* (I) Pointer to Lower Triangular Matrix */ - opus_int M, /* (I) Dim of Matrix equation */ - const silk_float *b, /* (I) b Vector */ - silk_float *x /* (O) x Vector */ + const silk_float *L, /* I Pointer to Lower Triangular Matrix */ + opus_int M, /* I Dim of Matrix equation */ + const silk_float *b, /* I b Vector */ + silk_float *x /* O x Vector */ ) { opus_int i, j; @@ -132,10 +132,10 @@ static inline void silk_SolveWithUpperTriangularFromLowerWdiagOnes_FLP( } static inline void silk_SolveWithLowerTriangularWdiagOnes_FLP( - const silk_float *L, /* (I) Pointer to Lower Triangular Matrix */ - opus_int M, /* (I) Dim of Matrix equation */ - const silk_float *b, /* (I) b Vector */ - silk_float *x /* (O) x Vector */ + const silk_float *L, /* I Pointer to Lower Triangular Matrix */ + opus_int M, /* I Dim of Matrix equation */ + const silk_float *b, /* I b Vector */ + silk_float *x /* O x Vector */ ) { opus_int i, j; @@ -154,10 +154,10 @@ static inline void silk_SolveWithLowerTriangularWdiagOnes_FLP( } static inline void silk_LDL_FLP( - silk_float *A, /* (I/O) Pointer to Symetric Square Matrix */ - opus_int M, /* (I) Size of Matrix */ - silk_float *L, /* (I/O) Pointer to Square Upper triangular Matrix */ - silk_float *Dinv /* (I/O) Pointer to vector holding the inverse diagonal elements of D */ + silk_float *A, /* I/O Pointer to Symetric Square Matrix */ + opus_int M, /* I Size of Matrix */ + silk_float *L, /* I/O Pointer to Square Upper triangular Matrix */ + silk_float *Dinv /* I/O Pointer to vector holding the inverse diagonal elements of D */ ) { opus_int i, j, k, loop_count, err = 1; diff --git a/silk/float/sort_FLP.c b/silk/float/sort_FLP.c index 19860db9..2b0a1d1a 100644 --- a/silk/float/sort_FLP.c +++ b/silk/float/sort_FLP.c @@ -37,10 +37,10 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "SigProc_FLP.h" void silk_insertion_sort_decreasing_FLP( - silk_float *a, /* I/O: Unsorted / Sorted vector */ - opus_int *idx, /* O: Index vector for the sorted elements */ - const opus_int L, /* I: Vector length */ - const opus_int K /* I: Number of correctly sorted positions */ + silk_float *a, /* I/O Unsorted / Sorted vector */ + opus_int *idx, /* O Index vector for the sorted elements */ + const opus_int L, /* I Vector length */ + const opus_int K /* I Number of correctly sorted positions */ ) { silk_float value; diff --git a/silk/float/structs_FLP.h b/silk/float/structs_FLP.h index dd776b5c..f56a972a 100644 --- a/silk/float/structs_FLP.h +++ b/silk/float/structs_FLP.h @@ -41,41 +41,41 @@ extern "C" /* Noise shaping analysis state */ /********************************/ typedef struct { - opus_int8 LastGainIndex; - silk_float HarmBoost_smth; - silk_float HarmShapeGain_smth; - silk_float Tilt_smth; + opus_int8 LastGainIndex; + silk_float HarmBoost_smth; + silk_float HarmShapeGain_smth; + silk_float Tilt_smth; } silk_shape_state_FLP; /********************************/ /* Prefilter state */ /********************************/ typedef struct { - silk_float sLTP_shp[ LTP_BUF_LENGTH ]; - silk_float sAR_shp[ MAX_SHAPE_LPC_ORDER + 1 ]; - opus_int sLTP_shp_buf_idx; - silk_float sLF_AR_shp; - silk_float sLF_MA_shp; - silk_float sHarmHP; - opus_int32 rand_seed; - opus_int lagPrev; + silk_float sLTP_shp[ LTP_BUF_LENGTH ]; + silk_float sAR_shp[ MAX_SHAPE_LPC_ORDER + 1 ]; + opus_int sLTP_shp_buf_idx; + silk_float sLF_AR_shp; + silk_float sLF_MA_shp; + silk_float sHarmHP; + opus_int32 rand_seed; + opus_int lagPrev; } silk_prefilter_state_FLP; /********************************/ /* Encoder state FLP */ /********************************/ typedef struct { - silk_encoder_state sCmn; /* Common struct, shared with fixed-point code */ - silk_shape_state_FLP sShape; /* Noise shaping state */ - silk_prefilter_state_FLP sPrefilt; /* Prefilter State */ + silk_encoder_state sCmn; /* Common struct, shared with fixed-point code */ + silk_shape_state_FLP sShape; /* Noise shaping state */ + silk_prefilter_state_FLP sPrefilt; /* Prefilter State */ /* Buffer for find pitch and noise shape analysis */ - silk_float x_buf[ 2 * MAX_FRAME_LENGTH + LA_SHAPE_MAX ];/* Buffer for find pitch and noise shape analysis */ - silk_float LTPCorr; /* Normalized correlation from pitch lag estimator */ + silk_float x_buf[ 2 * MAX_FRAME_LENGTH + LA_SHAPE_MAX ];/* Buffer for find pitch and noise shape analysis */ + silk_float LTPCorr; /* Normalized correlation from pitch lag estimator */ /* Parameters for LTP scaling control */ - silk_float prevLTPredCodGain; - silk_float HPLTPredCodGain; + silk_float prevLTPredCodGain; + silk_float HPLTPredCodGain; } silk_encoder_state_FLP; /************************/ @@ -83,34 +83,34 @@ typedef struct { /************************/ typedef struct { /* Prediction and coding parameters */ - silk_float Gains[ MAX_NB_SUBFR ]; - silk_float PredCoef[ 2 ][ MAX_LPC_ORDER ]; /* holds interpolated and final coefficients */ - silk_float LTPCoef[LTP_ORDER * MAX_NB_SUBFR]; - silk_float LTP_scale; - opus_int pitchL[ MAX_NB_SUBFR ]; + silk_float Gains[ MAX_NB_SUBFR ]; + silk_float PredCoef[ 2 ][ MAX_LPC_ORDER ]; /* holds interpolated and final coefficients */ + silk_float LTPCoef[LTP_ORDER * MAX_NB_SUBFR]; + silk_float LTP_scale; + opus_int pitchL[ MAX_NB_SUBFR ]; /* Noise shaping parameters */ - silk_float AR1[ MAX_NB_SUBFR * MAX_SHAPE_LPC_ORDER ]; - silk_float AR2[ MAX_NB_SUBFR * MAX_SHAPE_LPC_ORDER ]; - silk_float LF_MA_shp[ MAX_NB_SUBFR ]; - silk_float LF_AR_shp[ MAX_NB_SUBFR ]; - silk_float GainsPre[ MAX_NB_SUBFR ]; - silk_float HarmBoost[ MAX_NB_SUBFR ]; - silk_float Tilt[ MAX_NB_SUBFR ]; - silk_float HarmShapeGain[ MAX_NB_SUBFR ]; - silk_float Lambda; - silk_float input_quality; - silk_float coding_quality; + silk_float AR1[ MAX_NB_SUBFR * MAX_SHAPE_LPC_ORDER ]; + silk_float AR2[ MAX_NB_SUBFR * MAX_SHAPE_LPC_ORDER ]; + silk_float LF_MA_shp[ MAX_NB_SUBFR ]; + silk_float LF_AR_shp[ MAX_NB_SUBFR ]; + silk_float GainsPre[ MAX_NB_SUBFR ]; + silk_float HarmBoost[ MAX_NB_SUBFR ]; + silk_float Tilt[ MAX_NB_SUBFR ]; + silk_float HarmShapeGain[ MAX_NB_SUBFR ]; + silk_float Lambda; + silk_float input_quality; + silk_float coding_quality; /* Measures */ - silk_float sparseness; - silk_float predGain; - silk_float LTPredCodGain; - silk_float ResNrg[ MAX_NB_SUBFR ]; /* Residual energy per subframe */ + silk_float sparseness; + silk_float predGain; + silk_float LTPredCodGain; + silk_float ResNrg[ MAX_NB_SUBFR ]; /* Residual energy per subframe */ /* Parameters for CBR mode */ - opus_int32 GainsUnq_Q16[ MAX_NB_SUBFR ]; - opus_int8 lastGainIndexPrev; + opus_int32 GainsUnq_Q16[ MAX_NB_SUBFR ]; + opus_int8 lastGainIndexPrev; } silk_encoder_control_FLP; /************************/ @@ -119,13 +119,13 @@ typedef struct { typedef struct { silk_encoder_state_FLP state_Fxx[ ENCODER_NUM_CHANNELS ]; stereo_enc_state sStereo; - opus_int32 nBitsExceeded; - opus_int nChannelsAPI; - opus_int nChannelsInternal; - opus_int nPrevChannelsInternal; - opus_int timeSinceSwitchAllowed_ms; - opus_int allowBandwidthSwitch; - opus_int prev_decode_only_middle; + opus_int32 nBitsExceeded; + opus_int nChannelsAPI; + opus_int nChannelsInternal; + opus_int nPrevChannelsInternal; + opus_int timeSinceSwitchAllowed_ms; + opus_int allowBandwidthSwitch; + opus_int prev_decode_only_middle; } silk_encoder; #ifdef __cplusplus diff --git a/silk/float/warped_autocorrelation_FLP.c b/silk/float/warped_autocorrelation_FLP.c index 2f15fa52..4bbfabea 100644 --- a/silk/float/warped_autocorrelation_FLP.c +++ b/silk/float/warped_autocorrelation_FLP.c @@ -33,17 +33,17 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. /* Autocorrelations for a warped frequency axis */ void silk_warped_autocorrelation_FLP( - silk_float *corr, /* O Result [order + 1] */ - const silk_float *input, /* I Input data to correlate */ - const silk_float warping, /* I Warping coefficient */ - const opus_int length, /* I Length of input */ - const opus_int order /* I Correlation order (even) */ + silk_float *corr, /* O Result [order + 1] */ + const silk_float *input, /* I Input data to correlate */ + const silk_float warping, /* I Warping coefficient */ + const opus_int length, /* I Length of input */ + const opus_int order /* I Correlation order (even) */ ) { - opus_int n, i; - double tmp1, tmp2; - double state[ MAX_SHAPE_LPC_ORDER + 1 ] = { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 }; - double C[ MAX_SHAPE_LPC_ORDER + 1 ] = { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 }; + opus_int n, i; + double tmp1, tmp2; + double state[ MAX_SHAPE_LPC_ORDER + 1 ] = { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 }; + double C[ MAX_SHAPE_LPC_ORDER + 1 ] = { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 }; /* Order must be even */ silk_assert( ( order & 1 ) == 0 ); diff --git a/silk/float/wrappers_FLP.c b/silk/float/wrappers_FLP.c index f4c046a6..9fd91477 100644 --- a/silk/float/wrappers_FLP.c +++ b/silk/float/wrappers_FLP.c @@ -35,9 +35,9 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. /* Convert AR filter coefficients to NLSF parameters */ void silk_A2NLSF_FLP( - opus_int16 *NLSF_Q15, /* O NLSF vector [ LPC_order ] */ - const silk_float *pAR, /* I LPC coefficients [ LPC_order ] */ - const opus_int LPC_order /* I LPC order */ + opus_int16 *NLSF_Q15, /* O NLSF vector [ LPC_order ] */ + const silk_float *pAR, /* I LPC coefficients [ LPC_order ] */ + const opus_int LPC_order /* I LPC order */ ) { opus_int i; @@ -52,9 +52,9 @@ void silk_A2NLSF_FLP( /* Convert LSF parameters to AR prediction filter coefficients */ void silk_NLSF2A_FLP( - silk_float *pAR, /* O LPC coefficients [ LPC_order ] */ - const opus_int16 *NLSF_Q15, /* I NLSF vector [ LPC_order ] */ - const opus_int LPC_order /* I LPC order */ + silk_float *pAR, /* O LPC coefficients [ LPC_order ] */ + const opus_int16 *NLSF_Q15, /* I NLSF vector [ LPC_order ] */ + const opus_int LPC_order /* I LPC order */ ) { opus_int i; @@ -72,9 +72,9 @@ void silk_NLSF2A_FLP( /******************************************/ void silk_process_NLSFs_FLP( silk_encoder_state *psEncC, /* I/O Encoder state */ - silk_float PredCoef[ 2 ][ MAX_LPC_ORDER ], /* O Prediction coefficients */ - opus_int16 NLSF_Q15[ MAX_LPC_ORDER ], /* I/O Normalized LSFs (quant out) (0 - (2^15-1)) */ - const opus_int16 prev_NLSF_Q15[ MAX_LPC_ORDER ] /* I Previous Normalized LSFs (0 - (2^15-1)) */ + silk_float PredCoef[ 2 ][ MAX_LPC_ORDER ], /* O Prediction coefficients */ + opus_int16 NLSF_Q15[ MAX_LPC_ORDER ], /* I/O Normalized LSFs (quant out) (0 - (2^15-1)) */ + const opus_int16 prev_NLSF_Q15[ MAX_LPC_ORDER ] /* I Previous Normalized LSFs (0 - (2^15-1)) */ ) { opus_int i, j; @@ -93,12 +93,12 @@ void silk_process_NLSFs_FLP( /* Floating-point Silk NSQ wrapper */ /****************************************/ void silk_NSQ_wrapper_FLP( - silk_encoder_state_FLP *psEnc, /* I/O Encoder state FLP */ - silk_encoder_control_FLP *psEncCtrl, /* I/O Encoder control FLP */ - SideInfoIndices *psIndices, /* I/O Quantization indices */ - silk_nsq_state *psNSQ, /* I/O Noise Shaping Quantzation state */ - opus_int8 pulses[], /* O Quantized pulse signal */ - const silk_float x[] /* I Prefiltered input signal */ + silk_encoder_state_FLP *psEnc, /* I/O Encoder state FLP */ + silk_encoder_control_FLP *psEncCtrl, /* I/O Encoder control FLP */ + SideInfoIndices *psIndices, /* I/O Quantization indices */ + silk_nsq_state *psNSQ, /* I/O Noise Shaping Quantzation state */ + opus_int8 pulses[], /* O Quantized pulse signal */ + const silk_float x[] /* I Prefiltered input signal */ ) { opus_int i, j; @@ -170,13 +170,13 @@ void silk_NSQ_wrapper_FLP( /* Floating-point Silk LTP quantiation wrapper */ /***********************************************/ void silk_quant_LTP_gains_FLP( - silk_float B[ MAX_NB_SUBFR * LTP_ORDER ], /* I/O (Un-)quantized LTP gains */ - opus_int8 cbk_index[ MAX_NB_SUBFR ], /* O Codebook index */ - opus_int8 *periodicity_index, /* O Periodicity index */ - const silk_float W[ MAX_NB_SUBFR * LTP_ORDER * LTP_ORDER ], /* I Error weights */ - const opus_int mu_Q10, /* I Mu value (R/D tradeoff) */ - const opus_int lowComplexity, /* I Flag for low complexity */ - const opus_int nb_subfr /* I number of subframes */ + silk_float B[ MAX_NB_SUBFR * LTP_ORDER ], /* I/O (Un-)quantized LTP gains */ + opus_int8 cbk_index[ MAX_NB_SUBFR ], /* O Codebook index */ + opus_int8 *periodicity_index, /* O Periodicity index */ + const silk_float W[ MAX_NB_SUBFR * LTP_ORDER * LTP_ORDER ], /* I Error weights */ + const opus_int mu_Q10, /* I Mu value (R/D tradeoff) */ + const opus_int lowComplexity, /* I Flag for low complexity */ + const opus_int nb_subfr /* I number of subframes */ ) { opus_int i; |