Renamed SKP_[u]int* to opus_[u]int*
[opus.git] / silk / fixed / silk_main_FIX.h
index cc3be26..fb31ae6 100644 (file)
@@ -53,13 +53,13 @@ extern "C"
 /* High-pass filter with cutoff frequency adaptation based on pitch lag statistics */\r
 void silk_HP_variable_cutoff(\r
     silk_encoder_state_Fxx          state_Fxx[],    /* I/O  Encoder states                              */\r
-    const SKP_int                   nChannels       /* I    Number of channels                          */\r
+    const opus_int                   nChannels       /* I    Number of channels                          */\r
 );\r
 \r
 /* Encoder main function */\r
-SKP_int silk_encode_frame_FIX( \r
+opus_int silk_encode_frame_FIX( \r
     silk_encoder_state_FIX          *psEnc,             /* I/O  Pointer to Silk FIX encoder state       */\r
-    SKP_int32                       *pnBytesOut,        /*   O  Pointer to number of payload bytes;     */\r
+    opus_int32                       *pnBytesOut,        /*   O  Pointer to number of payload bytes;     */\r
     ec_enc                          *psRangeEnc         /* I/O  compressor data structure               */\r
 );\r
 \r
@@ -67,21 +67,21 @@ SKP_int silk_encode_frame_FIX(
 void silk_LBRR_encode_FIX(\r
     silk_encoder_state_FIX          *psEnc,             /* I/O  Pointer to Silk FIX encoder state           */\r
     silk_encoder_control_FIX        *psEncCtrl,         /* I/O  Pointer to Silk FIX encoder control struct  */\r
-    const SKP_int16                 xfw[]               /* I    Input signal                                */\r
+    const opus_int16                 xfw[]               /* I    Input signal                                */\r
 );\r
 \r
 /* Initializes the Silk encoder state */\r
-SKP_int silk_init_encoder(\r
+opus_int silk_init_encoder(\r
     silk_encoder_state_FIX          *psEnc              /* I/O  Pointer to Silk FIX encoder state           */\r
 );\r
 \r
 /* Control the Silk encoder */\r
-SKP_int silk_control_encoder( \r
+opus_int silk_control_encoder( \r
     silk_encoder_state_FIX          *psEnc,             /* I/O  Pointer to Silk encoder state           */\r
     silk_EncControlStruct           *encControl,        /* I:   Control structure                       */\r
-    const SKP_int32                 TargetRate_bps,     /* I    Target max bitrate (bps)                */\r
-    const SKP_int                   allow_bw_switch,    /* I    Flag to allow switching audio bandwidth */\r
-    const SKP_int                   channelNb           /* I    Channel number                          */\r
+    const opus_int32                 TargetRate_bps,     /* I    Target max bitrate (bps)                */\r
+    const opus_int                   allow_bw_switch,    /* I    Flag to allow switching audio bandwidth */\r
+    const opus_int                   channelNb           /* I    Channel number                          */\r
 );\r
 \r
 /****************/\r
@@ -90,8 +90,8 @@ SKP_int silk_control_encoder(
 void silk_prefilter_FIX(\r
     silk_encoder_state_FIX              *psEnc,         /* I/O  Encoder state                               */\r
     const silk_encoder_control_FIX      *psEncCtrl,     /* I    Encoder control                             */\r
-    SKP_int16                           xw[],           /* O    Weighted signal                             */\r
-    const SKP_int16                     x[]             /* I    Speech signal                               */\r
+    opus_int16                           xw[],           /* O    Weighted signal                             */\r
+    const opus_int16                     x[]             /* I    Speech signal                               */\r
 );\r
 \r
 /**************************/\r
@@ -101,18 +101,18 @@ void silk_prefilter_FIX(
 void silk_noise_shape_analysis_FIX(\r
     silk_encoder_state_FIX          *psEnc,         /* I/O  Encoder state FIX                           */\r
     silk_encoder_control_FIX        *psEncCtrl,     /* I/O  Encoder control FIX                         */\r
-    const SKP_int16                 *pitch_res,     /* I    LPC residual from pitch analysis            */\r
-    const SKP_int16                 *x              /* I    Input signal [ frame_length + la_shape ]    */\r
+    const opus_int16                 *pitch_res,     /* I    LPC residual from pitch analysis            */\r
+    const opus_int16                 *x              /* I    Input signal [ frame_length + la_shape ]    */\r
 );\r
 \r
 /* Autocorrelations for a warped frequency axis */\r
 void silk_warped_autocorrelation_FIX(\r
-          SKP_int32                 *corr,              /* O    Result [order + 1]                      */\r
-          SKP_int                   *scale,             /* O    Scaling of the correlation vector       */\r
-    const SKP_int16                 *input,             /* I    Input data to correlate                 */\r
-    const SKP_int                   warping_Q16,        /* I    Warping coefficient                     */\r
-    const SKP_int                   length,             /* I    Length of input                         */\r
-    const SKP_int                   order               /* I    Correlation order (even)                */\r
+          opus_int32                 *corr,              /* O    Result [order + 1]                      */\r
+          opus_int                   *scale,             /* O    Scaling of the correlation vector       */\r
+    const opus_int16                 *input,             /* I    Input data to correlate                 */\r
+    const opus_int                   warping_Q16,        /* I    Warping coefficient                     */\r
+    const opus_int                   length,             /* I    Length of input                         */\r
+    const opus_int                   order               /* I    Correlation order (even)                */\r
 );\r
 \r
 /* Calculation of LTP state scaling */\r
@@ -128,77 +128,77 @@ void silk_LTP_scale_ctrl_FIX(
 void silk_find_pitch_lags_FIX(\r
     silk_encoder_state_FIX          *psEnc,         /* I/O  encoder state                               */\r
     silk_encoder_control_FIX        *psEncCtrl,     /* I/O  encoder control                             */\r
-    SKP_int16                       res[],          /* O    residual                                    */\r
-    const SKP_int16                 x[]             /* I    Speech signal                               */\r
+    opus_int16                       res[],          /* O    residual                                    */\r
+    const opus_int16                 x[]             /* I    Speech signal                               */\r
 );\r
 \r
 /* Find LPC and LTP coefficients */\r
 void silk_find_pred_coefs_FIX(\r
     silk_encoder_state_FIX          *psEnc,         /* I/O  encoder state                               */\r
     silk_encoder_control_FIX        *psEncCtrl,     /* I/O  encoder control                             */\r
-    const SKP_int16                 res_pitch[],    /* I    Residual from pitch analysis                */\r
-    const SKP_int16                 x[]             /* I    Speech signal                               */\r
+    const opus_int16                 res_pitch[],    /* I    Residual from pitch analysis                */\r
+    const opus_int16                 x[]             /* I    Speech signal                               */\r
 );\r
 \r
 /* LPC analysis */\r
 void silk_find_LPC_FIX(\r
-    SKP_int16                       NLSF_Q15[],             /* O    NLSFs                                                           */\r
-    SKP_int8                        *interpIndex,           /* O    NLSF interpolation index, only used for NLSF interpolation      */\r
-    const SKP_int16                 prev_NLSFq_Q15[],       /* I    previous NLSFs, only used for NLSF interpolation                */\r
-    const SKP_int                   useInterpNLSFs,         /* I    Flag                                                            */\r
-    const SKP_int                   firstFrameAfterReset,   /* I    Flag                                                            */\r
-    const SKP_int                   LPC_order,              /* I    LPC order                                                       */\r
-    const SKP_int16                 x[],                    /* I    Input signal                                                    */\r
-    const SKP_int                   subfr_length,           /* I    Input signal subframe length including preceeding samples       */\r
-    const SKP_int                   nb_subfr                /* I:   Number of subframes                                             */\r
+    opus_int16                       NLSF_Q15[],             /* O    NLSFs                                                           */\r
+    opus_int8                        *interpIndex,           /* O    NLSF interpolation index, only used for NLSF interpolation      */\r
+    const opus_int16                 prev_NLSFq_Q15[],       /* I    previous NLSFs, only used for NLSF interpolation                */\r
+    const opus_int                   useInterpNLSFs,         /* I    Flag                                                            */\r
+    const opus_int                   firstFrameAfterReset,   /* I    Flag                                                            */\r
+    const opus_int                   LPC_order,              /* I    LPC order                                                       */\r
+    const opus_int16                 x[],                    /* I    Input signal                                                    */\r
+    const opus_int                   subfr_length,           /* I    Input signal subframe length including preceeding samples       */\r
+    const opus_int                   nb_subfr                /* I:   Number of subframes                                             */\r
 );\r
 \r
 /* LTP analysis */\r
 void silk_find_LTP_FIX(\r
-    SKP_int16           b_Q14[ MAX_NB_SUBFR * LTP_ORDER ],              /* O    LTP coefs                                                   */\r
-    SKP_int32           WLTP[ MAX_NB_SUBFR * LTP_ORDER * LTP_ORDER ],   /* O    Weight for LTP quantization                                 */\r
-    SKP_int             *LTPredCodGain_Q7,                              /* O    LTP coding gain                                             */\r
-    const SKP_int16     r_lpc[],                                        /* I    residual signal after LPC signal + state for first 10 ms    */\r
-    const SKP_int       lag[ MAX_NB_SUBFR ],                            /* I    LTP lags                                                    */\r
-    const SKP_int32     Wght_Q15[ MAX_NB_SUBFR ],                       /* I    weights                                                     */\r
-    const SKP_int       subfr_length,                                   /* I    subframe length                                             */\r
-    const SKP_int       nb_subfr,                                       /* I    number of subframes                                         */\r
-    const SKP_int       mem_offset,                                     /* I    number of samples in LTP memory                             */\r
-    SKP_int             corr_rshifts[ MAX_NB_SUBFR ]                    /* O    right shifts applied to correlations                        */\r
+    opus_int16           b_Q14[ MAX_NB_SUBFR * LTP_ORDER ],              /* O    LTP coefs                                                   */\r
+    opus_int32           WLTP[ MAX_NB_SUBFR * LTP_ORDER * LTP_ORDER ],   /* O    Weight for LTP quantization                                 */\r
+    opus_int             *LTPredCodGain_Q7,                              /* O    LTP coding gain                                             */\r
+    const opus_int16     r_lpc[],                                        /* I    residual signal after LPC signal + state for first 10 ms    */\r
+    const opus_int       lag[ MAX_NB_SUBFR ],                            /* I    LTP lags                                                    */\r
+    const opus_int32     Wght_Q15[ MAX_NB_SUBFR ],                       /* I    weights                                                     */\r
+    const opus_int       subfr_length,                                   /* I    subframe length                                             */\r
+    const opus_int       nb_subfr,                                       /* I    number of subframes                                         */\r
+    const opus_int       mem_offset,                                     /* I    number of samples in LTP memory                             */\r
+    opus_int             corr_rshifts[ MAX_NB_SUBFR ]                    /* O    right shifts applied to correlations                        */\r
 );\r
 \r
 void silk_LTP_analysis_filter_FIX(\r
-    SKP_int16           *LTP_res,                               /* O:   LTP residual signal of length MAX_NB_SUBFR * ( pre_length + subfr_length )  */\r
-    const SKP_int16     *x,                                     /* I:   Pointer to input signal with at least max( pitchL ) preceeding samples      */\r
-    const SKP_int16     LTPCoef_Q14[ LTP_ORDER * MAX_NB_SUBFR ],/* I:   LTP_ORDER LTP coefficients for each MAX_NB_SUBFR subframe                   */\r
-    const SKP_int       pitchL[ MAX_NB_SUBFR ],                 /* I:   Pitch lag, one for each subframe                                            */\r
-    const SKP_int32     invGains_Q16[ MAX_NB_SUBFR ],           /* I:   Inverse quantization gains, one for each subframe                           */\r
-    const SKP_int       subfr_length,                           /* I:   Length of each subframe                                                     */\r
-    const SKP_int       nb_subfr,                               /* I:   Number of subframes                                                         */\r
-    const SKP_int       pre_length                              /* I:   Length of the preceeding samples starting at &x[0] for each subframe        */\r
+    opus_int16           *LTP_res,                               /* O:   LTP residual signal of length MAX_NB_SUBFR * ( pre_length + subfr_length )  */\r
+    const opus_int16     *x,                                     /* I:   Pointer to input signal with at least max( pitchL ) preceeding samples      */\r
+    const opus_int16     LTPCoef_Q14[ LTP_ORDER * MAX_NB_SUBFR ],/* I:   LTP_ORDER LTP coefficients for each MAX_NB_SUBFR subframe                   */\r
+    const opus_int       pitchL[ MAX_NB_SUBFR ],                 /* I:   Pitch lag, one for each subframe                                            */\r
+    const opus_int32     invGains_Q16[ MAX_NB_SUBFR ],           /* I:   Inverse quantization gains, one for each subframe                           */\r
+    const opus_int       subfr_length,                           /* I:   Length of each subframe                                                     */\r
+    const opus_int       nb_subfr,                               /* I:   Number of subframes                                                         */\r
+    const opus_int       pre_length                              /* I:   Length of the preceeding samples starting at &x[0] for each subframe        */\r
 );\r
 \r
 /* Calculates residual energies of input subframes where all subframes have LPC_order   */\r
 /* of preceeding samples                                                                */\r
 void silk_residual_energy_FIX(\r
-          SKP_int32 nrgs[ MAX_NB_SUBFR ],           /* O    Residual energy per subframe    */\r
-          SKP_int   nrgsQ[ MAX_NB_SUBFR ],          /* O    Q value per subframe            */\r
-    const SKP_int16 x[],                            /* I    Input signal                    */\r
-          SKP_int16 a_Q12[ 2 ][ MAX_LPC_ORDER ],    /* I    AR coefs for each frame half    */\r
-    const SKP_int32 gains[ MAX_NB_SUBFR ],          /* I    Quantization gains              */\r
-    const SKP_int   subfr_length,                   /* I    Subframe length                 */\r
-    const SKP_int   nb_subfr,                       /* I    Number of subframes             */\r
-    const SKP_int   LPC_order                       /* I    LPC order                       */\r
+          opus_int32 nrgs[ MAX_NB_SUBFR ],           /* O    Residual energy per subframe    */\r
+          opus_int   nrgsQ[ MAX_NB_SUBFR ],          /* O    Q value per subframe            */\r
+    const opus_int16 x[],                            /* I    Input signal                    */\r
+          opus_int16 a_Q12[ 2 ][ MAX_LPC_ORDER ],    /* I    AR coefs for each frame half    */\r
+    const opus_int32 gains[ MAX_NB_SUBFR ],          /* I    Quantization gains              */\r
+    const opus_int   subfr_length,                   /* I    Subframe length                 */\r
+    const opus_int   nb_subfr,                       /* I    Number of subframes             */\r
+    const opus_int   LPC_order                       /* I    LPC order                       */\r
 );\r
 \r
 /* Residual energy: nrg = wxx - 2 * wXx * c + c' * wXX * c */\r
-SKP_int32 silk_residual_energy16_covar_FIX(\r
-    const SKP_int16                 *c,                 /* I    Prediction vector                           */\r
-    const SKP_int32                 *wXX,               /* I    Correlation matrix                          */\r
-    const SKP_int32                 *wXx,               /* I    Correlation vector                          */\r
-    SKP_int32                       wxx,                /* I    Signal energy                               */\r
-    SKP_int                         D,                  /* I    Dimension                                   */\r
-    SKP_int                         cQ                  /* I    Q value for c vector 0 - 15                 */\r
+opus_int32 silk_residual_energy16_covar_FIX(\r
+    const opus_int16                 *c,                 /* I    Prediction vector                           */\r
+    const opus_int32                 *wXX,               /* I    Correlation matrix                          */\r
+    const opus_int32                 *wXx,               /* I    Correlation vector                          */\r
+    opus_int32                       wxx,                /* I    Signal energy                               */\r
+    opus_int                         D,                  /* I    Dimension                                   */\r
+    opus_int                         cQ                  /* I    Q value for c vector 0 - 15                 */\r
 );\r
 \r
 /* Processing of gains */\r
@@ -212,38 +212,38 @@ void silk_process_gains_FIX(
 /******************/\r
 /* Calculates correlation matrix X'*X */\r
 void silk_corrMatrix_FIX(\r
-    const SKP_int16                 *x,         /* I    x vector [L + order - 1] used to form data matrix X */\r
-    const SKP_int                   L,          /* I    Length of vectors                                   */\r
-    const SKP_int                   order,      /* I    Max lag for correlation                             */\r
-    const SKP_int                   head_room,  /* I    Desired headroom                                    */\r
-    SKP_int32                       *XX,        /* O    Pointer to X'*X correlation matrix [ order x order ]*/\r
-    SKP_int                         *rshifts    /* I/O  Right shifts of correlations                        */\r
+    const opus_int16                 *x,         /* I    x vector [L + order - 1] used to form data matrix X */\r
+    const opus_int                   L,          /* I    Length of vectors                                   */\r
+    const opus_int                   order,      /* I    Max lag for correlation                             */\r
+    const opus_int                   head_room,  /* I    Desired headroom                                    */\r
+    opus_int32                       *XX,        /* O    Pointer to X'*X correlation matrix [ order x order ]*/\r
+    opus_int                         *rshifts    /* I/O  Right shifts of correlations                        */\r
 );\r
 \r
 /* Calculates correlation vector X'*t */\r
 void silk_corrVector_FIX(\r
-    const SKP_int16                 *x,         /* I    x vector [L + order - 1] used to form data matrix X */\r
-    const SKP_int16                 *t,         /* I    Target vector [L]                                   */\r
-    const SKP_int                   L,          /* I    Length of vectors                                   */\r
-    const SKP_int                   order,      /* I    Max lag for correlation                             */\r
-    SKP_int32                       *Xt,        /* O    Pointer to X'*t correlation vector [order]          */\r
-    const SKP_int                   rshifts     /* I    Right shifts of correlations                        */\r
+    const opus_int16                 *x,         /* I    x vector [L + order - 1] used to form data matrix X */\r
+    const opus_int16                 *t,         /* I    Target vector [L]                                   */\r
+    const opus_int                   L,          /* I    Length of vectors                                   */\r
+    const opus_int                   order,      /* I    Max lag for correlation                             */\r
+    opus_int32                       *Xt,        /* O    Pointer to X'*t correlation vector [order]          */\r
+    const opus_int                   rshifts     /* I    Right shifts of correlations                        */\r
 );\r
 \r
 /* Add noise to matrix diagonal */\r
 void silk_regularize_correlations_FIX(\r
-    SKP_int32                       *XX,                /* I/O  Correlation matrices                        */\r
-    SKP_int32                       *xx,                /* I/O  Correlation values                          */\r
-    SKP_int32                       noise,              /* I    Noise to add                                */\r
-    SKP_int                         D                   /* I    Dimension of XX                             */\r
+    opus_int32                       *XX,                /* I/O  Correlation matrices                        */\r
+    opus_int32                       *xx,                /* I/O  Correlation values                          */\r
+    opus_int32                       noise,              /* I    Noise to add                                */\r
+    opus_int                         D                   /* I    Dimension of XX                             */\r
 );\r
 \r
 /* Solves Ax = b, assuming A is symmetric */\r
 void silk_solve_LDL_FIX(\r
-    SKP_int32                       *A,                 /* I    Pointer to symetric square matrix A         */\r
-    SKP_int                         M,                  /* I    Size of matrix                              */\r
-    const SKP_int32                 *b,                 /* I    Pointer to b vector                         */\r
-    SKP_int32                       *x_Q16              /* O    Pointer to x solution vector                */\r
+    opus_int32                       *A,                 /* I    Pointer to symetric square matrix A         */\r
+    opus_int                         M,                  /* I    Size of matrix                              */\r
+    const opus_int32                 *b,                 /* I    Pointer to b vector                         */\r
+    opus_int32                       *x_Q16              /* O    Pointer to x solution vector                */\r
 );\r
 \r
 #ifndef FORCE_CPP_BUILD\r