Misc. silk/ cleanups: static inline things which are only used in one file.
authorGregory Maxwell <greg@xiph.org>
Wed, 28 Sep 2011 19:44:53 +0000 (15:44 -0400)
committerGregory Maxwell <greg@xiph.org>
Wed, 28 Sep 2011 20:28:18 +0000 (16:28 -0400)
silk/NLSF_decode.c
silk/PLC.c
silk/PLC.h
silk/SigProc_FIX.h
silk/VAD.c
silk/float/LPC_analysis_filter_FLP.c
silk/float/encode_frame_FLP.c
silk/float/main_FLP.h
silk/float/solve_LS_FLP.c
silk/main.h
silk/resampler.c

index b6588c1..43f4f9f 100644 (file)
@@ -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 ]          */
index d4029fb..50e0dda 100644 (file)
@@ -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 */
index ea6266f..4d985a6 100644 (file)
@@ -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               */
index 619f173..a65ac13 100644 (file)
@@ -58,13 +58,6 @@ opus_int silk_resampler_init(
 );
 
 /*!
- * 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
  */
 opus_int silk_resampler(
index 377b405..5b13b90 100644 (file)
@@ -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                   */
 )
index 6691153..c91ef0b 100644 (file)
@@ -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                            */
index 053bcae..4d156a0 100644 (file)
@@ -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                            */
index b81c7dc..605fd38 100644 (file)
@@ -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                       */
index 8baf2c6..c04cb59 100644 (file)
@@ -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 */
index c3178ba..c30c63f 100644 (file)
@@ -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                               */
index 377ef27..3102d42 100644 (file)
@@ -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             */