diff --git a/silk/NLSF_decode.c b/silk/NLSF_decode.c index b6588c14d93b42f73e80908bcb26e683abe018bf..43f4f9fcef2a525bb172b7d545e3db8bef70cb60 100644 --- a/silk/NLSF_decode.c +++ b/silk/NLSF_decode.c @@ -32,7 +32,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "main.h" /* Predictive dequantizer for NLSF residuals */ -void silk_NLSF_residual_dequant( /* O Returns RD value in Q30 */ +static inline void silk_NLSF_residual_dequant( /* O Returns RD value in Q30 */ opus_int16 x_Q10[], /* O Output [ order ] */ const opus_int8 indices[], /* I Quantization indices [ order ] */ const opus_uint8 pred_coef_Q8[], /* I Backward predictor coefs [ order ] */ diff --git a/silk/PLC.c b/silk/PLC.c index d4029fb0d8e5ee39a51ceda166def841cb2fffc9..50e0ddae7231a9d643fc74a59fd7a9b55346054e 100644 --- a/silk/PLC.c +++ b/silk/PLC.c @@ -37,6 +37,18 @@ static const opus_int16 HARM_ATT_Q15[NB_ATT] = { 32440, 31130 }; /* static const opus_int16 PLC_RAND_ATTENUATE_V_Q15[NB_ATT] = { 31130, 26214 }; /* 0.95, 0.8 */ static const opus_int16 PLC_RAND_ATTENUATE_UV_Q15[NB_ATT] = { 32440, 29491 }; /* 0.99, 0.9 */ +static inline void silk_PLC_update( + silk_decoder_state *psDec, /* I/O Decoder state */ + silk_decoder_control *psDecCtrl /* I/O Decoder control */ +); + +static inline void silk_PLC_conceal( + silk_decoder_state *psDec, /* I/O Decoder state */ + silk_decoder_control *psDecCtrl, /* I/O Decoder control */ + opus_int16 signal[] /* O LPC residual signal */ +); + + void silk_PLC_Reset( silk_decoder_state *psDec /* I/O Decoder state */ ) @@ -75,7 +87,7 @@ void silk_PLC( /**************************************************/ /* Update state of PLC */ /**************************************************/ -void silk_PLC_update( +static inline void silk_PLC_update( silk_decoder_state *psDec, /* (I/O) Decoder state */ silk_decoder_control *psDecCtrl /* (I/O) Decoder control */ ) @@ -147,7 +159,7 @@ void silk_PLC_update( silk_memcpy( psPLC->prevGain_Q16, psDecCtrl->Gains_Q16, psDec->nb_subfr * sizeof( opus_int32 ) ); } -void silk_PLC_conceal( +static inline void silk_PLC_conceal( silk_decoder_state *psDec, /* I/O Decoder state */ silk_decoder_control *psDecCtrl, /* I/O Decoder control */ opus_int16 frame[] /* O concealed signal */ diff --git a/silk/PLC.h b/silk/PLC.h index ea6266f4d78cefee4945cba0ad8ffc4524e62f12..4d985a61f55ab0b25789fef14ef26f9380b26a1d 100644 --- a/silk/PLC.h +++ b/silk/PLC.h @@ -53,17 +53,6 @@ void silk_PLC( opus_int lost /* I Loss flag */ ); -void silk_PLC_update( - silk_decoder_state *psDec, /* I/O Decoder state */ - silk_decoder_control *psDecCtrl /* I/O Decoder control */ -); - -void silk_PLC_conceal( - silk_decoder_state *psDec, /* I/O Decoder state */ - silk_decoder_control *psDecCtrl, /* I/O Decoder control */ - opus_int16 signal[] /* O LPC residual signal */ -); - void silk_PLC_glue_frames( silk_decoder_state *psDec, /* I/O decoder state */ opus_int16 signal[], /* I/O signal */ diff --git a/silk/SigProc_FIX.h b/silk/SigProc_FIX.h index 619f1733d1070eed8cdab43e451b0dca2863a8bb..a65ac13f39e5c25168205660866686a7af810c38 100644 --- a/silk/SigProc_FIX.h +++ b/silk/SigProc_FIX.h @@ -57,13 +57,6 @@ opus_int silk_resampler_init( opus_int32 Fs_Hz_out /* I: Output sampling rate (Hz) */ ); -/*! - * Clear the states of all resampling filters, without resetting sampling rate ratio - */ -opus_int silk_resampler_clear( - silk_resampler_state_struct *S /* I/O: Resampler state */ -); - /*! * Resampler: convert from one sampling rate to another */ diff --git a/silk/VAD.c b/silk/VAD.c index 377b4058aa45d077e043a9c59641f2af0a800f0d..5b13b9038e8263466abb00379ca963ddfeba1853 100644 --- a/silk/VAD.c +++ b/silk/VAD.c @@ -32,6 +32,12 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include <stdlib.h> #include "main.h" +/* Silk VAD noise level estimation */ +static inline void silk_VAD_GetNoiseLevels( + const opus_int32 pX[ VAD_N_BANDS ], /* I subband energies */ + silk_VAD_state *psSilk_VAD /* I/O Pointer to Silk VAD state */ +); + /**********************************/ /* Initialization of the Silk VAD */ /**********************************/ @@ -264,7 +270,7 @@ opus_int silk_VAD_GetSA_Q8( /* O Return value, 0 if /**************************/ /* Noise level estimation */ /**************************/ -void silk_VAD_GetNoiseLevels( +static inline void silk_VAD_GetNoiseLevels( const opus_int32 pX[ VAD_N_BANDS ], /* I subband energies */ silk_VAD_state *psSilk_VAD /* I/O Pointer to Silk VAD state */ ) diff --git a/silk/float/LPC_analysis_filter_FLP.c b/silk/float/LPC_analysis_filter_FLP.c index 66911530f6df0bddcd13c84b30666b3a2dc05ab0..c91ef0ba729bdc597ad47ad190e05c2535a44bf6 100644 --- a/silk/float/LPC_analysis_filter_FLP.c +++ b/silk/float/LPC_analysis_filter_FLP.c @@ -40,7 +40,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. /************************************************/ /* 16th order LPC analysis filter, does not write first 16 samples */ -void silk_LPC_analysis_filter16_FLP( +static inline void silk_LPC_analysis_filter16_FLP( silk_float r_LPC[], /* O LPC residual signal */ const silk_float PredCoef[], /* I LPC coefficients */ const silk_float s[], /* I Input signal */ @@ -78,7 +78,7 @@ void silk_LPC_analysis_filter16_FLP( } /* 14th order LPC analysis filter, does not write first 14 samples */ -void silk_LPC_analysis_filter14_FLP( +static inline void silk_LPC_analysis_filter14_FLP( silk_float r_LPC[], /* O LPC residual signal */ const silk_float PredCoef[], /* I LPC coefficients */ const silk_float s[], /* I Input signal */ @@ -114,7 +114,7 @@ void silk_LPC_analysis_filter14_FLP( } /* 12th order LPC analysis filter, does not write first 12 samples */ -void silk_LPC_analysis_filter12_FLP( +static inline void silk_LPC_analysis_filter12_FLP( silk_float r_LPC[], /* O LPC residual signal */ const silk_float PredCoef[], /* I LPC coefficients */ const silk_float s[], /* I Input signal */ @@ -148,7 +148,7 @@ void silk_LPC_analysis_filter12_FLP( } /* 10th order LPC analysis filter, does not write first 10 samples */ -void silk_LPC_analysis_filter10_FLP( +static inline void silk_LPC_analysis_filter10_FLP( silk_float r_LPC[], /* O LPC residual signal */ const silk_float PredCoef[], /* I LPC coefficients */ const silk_float s[], /* I Input signal */ @@ -180,7 +180,7 @@ void silk_LPC_analysis_filter10_FLP( } /* 8th order LPC analysis filter, does not write first 8 samples */ -void silk_LPC_analysis_filter8_FLP( +static inline void silk_LPC_analysis_filter8_FLP( silk_float r_LPC[], /* O LPC residual signal */ const silk_float PredCoef[], /* I LPC coefficients */ const silk_float s[], /* I Input signal */ @@ -210,7 +210,7 @@ void silk_LPC_analysis_filter8_FLP( } /* 6th order LPC analysis filter, does not write first 6 samples */ -void silk_LPC_analysis_filter6_FLP( +static inline void silk_LPC_analysis_filter6_FLP( silk_float r_LPC[], /* O LPC residual signal */ const silk_float PredCoef[], /* I LPC coefficients */ const silk_float s[], /* I Input signal */ diff --git a/silk/float/encode_frame_FLP.c b/silk/float/encode_frame_FLP.c index 053bcae95c311074fe0ec96fdba0ca1483a6656d..4d156a03520aa94d4e35bdcacae67fb725a8cc79 100644 --- a/silk/float/encode_frame_FLP.c +++ b/silk/float/encode_frame_FLP.c @@ -32,6 +32,13 @@ 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 */ +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 */ +); + /****************/ /* Encode frame */ /****************/ @@ -212,7 +219,7 @@ TOC(ENCODE_FRAME) } /* Low-Bitrate Redundancy (LBRR) encoding. Reuse all parameters but encode excitation at lower bitrate */ -void silk_LBRR_encode_FLP( +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 */ diff --git a/silk/float/main_FLP.h b/silk/float/main_FLP.h index b81c7dcad77725653dba2765f5426a34a7b48414..605fd38468aea36ff774e07388c2f0ef0b9223b5 100644 --- a/silk/float/main_FLP.h +++ b/silk/float/main_FLP.h @@ -60,13 +60,6 @@ opus_int silk_encode_frame_FLP( ec_enc *psRangeEnc /* I/O compressor data structure */ ); -/* Low Bitrate Redundancy (LBRR) encoding. Reuse all parameters but encode with lower bitrate */ -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 */ -); - /* Initializes the Silk encoder state */ opus_int silk_init_encoder( silk_encoder_state_FLP *psEnc /* I/O Encoder state FLP */ diff --git a/silk/float/solve_LS_FLP.c b/silk/float/solve_LS_FLP.c index 8baf2c613b4ecea7a06667518ca163b18425c9d7..c04cb59d9f238a0ca90a03607c34e6a6df6bad78 100644 --- a/silk/float/solve_LS_FLP.c +++ b/silk/float/solve_LS_FLP.c @@ -37,7 +37,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * Matrix D (only the diagonal elements returned in a vector)such that * the symmetric matric A is given by A = L*D*L'. **********************************************************************/ -void silk_LDL_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 */ @@ -48,7 +48,7 @@ void silk_LDL_FLP( * Function to solve linear equation Ax = b, when A is a MxM lower * triangular matrix, with ones on the diagonal. **********************************************************************/ -void silk_SolveWithLowerTriangularWdiagOnes_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 */ @@ -59,7 +59,7 @@ void silk_SolveWithLowerTriangularWdiagOnes_FLP( * Function to solve linear equation (A^T)x = b, when A is a MxM lower * triangular, with ones on the diagonal. (ie then A^T is upper triangular) **********************************************************************/ -void silk_SolveWithUpperTriangularFromLowerWdiagOnes_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 */ @@ -109,7 +109,7 @@ void silk_solve_LDL_FLP( silk_SolveWithUpperTriangularFromLowerWdiagOnes_FLP( &L[ 0 ][ 0 ], M, T, x ); } -void silk_SolveWithUpperTriangularFromLowerWdiagOnes_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 */ @@ -131,7 +131,7 @@ void silk_SolveWithUpperTriangularFromLowerWdiagOnes_FLP( } } -void silk_SolveWithLowerTriangularWdiagOnes_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 */ @@ -153,7 +153,7 @@ void silk_SolveWithLowerTriangularWdiagOnes_FLP( } } -void silk_LDL_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 */ diff --git a/silk/main.h b/silk/main.h index c3178ba4f7ca8780db590f952868f5bfd6826aa2..c30c63ffd79a53b7ba202ed130f9a02974435c41 100644 --- a/silk/main.h +++ b/silk/main.h @@ -268,12 +268,6 @@ opus_int silk_VAD_Init( /* O Return value, 0 if silk_VAD_state *psSilk_VAD /* I/O Pointer to Silk VAD state */ ); -/* Silk VAD noise level estimation */ -void silk_VAD_GetNoiseLevels( - const opus_int32 pX[ VAD_N_BANDS ], /* I subband energies */ - silk_VAD_state *psSilk_VAD /* I/O Pointer to Silk VAD state */ -); - /* Get speech activity level in Q8 */ opus_int silk_VAD_GetSA_Q8( /* O Return value, 0 if success */ silk_encoder_state *psEncC, /* I/O Encoder state */ diff --git a/silk/resampler.c b/silk/resampler.c index 377ef2710369d1802920b4cdb72ed407c7d4bb0d..3102d42b24d5170cd037076984173cb368d0506f 100644 --- a/silk/resampler.c +++ b/silk/resampler.c @@ -141,18 +141,6 @@ opus_int silk_resampler_init( return 0; } -/* Clear the states of all resampling filters, without resetting sampling rate ratio */ -opus_int silk_resampler_clear( - silk_resampler_state_struct *S /* I/O: Resampler state */ -) -{ - /* Clear state */ - silk_memset( S->sDown2, 0, sizeof( S->sDown2 ) ); - silk_memset( S->sIIR, 0, sizeof( S->sIIR ) ); - silk_memset( S->sFIR, 0, sizeof( S->sFIR ) ); - return 0; -} - /* Resampler: convert from one sampling rate to another */ opus_int silk_resampler( silk_resampler_state_struct *S, /* I/O: Resampler state */