michael@0: /*********************************************************************** michael@0: Copyright (c) 2006-2011, Skype Limited. All rights reserved. michael@0: Redistribution and use in source and binary forms, with or without michael@0: modification, are permitted provided that the following conditions michael@0: are met: michael@0: - Redistributions of source code must retain the above copyright notice, michael@0: this list of conditions and the following disclaimer. michael@0: - Redistributions in binary form must reproduce the above copyright michael@0: notice, this list of conditions and the following disclaimer in the michael@0: documentation and/or other materials provided with the distribution. michael@0: - Neither the name of Internet Society, IETF or IETF Trust, nor the michael@0: names of specific contributors, may be used to endorse or promote michael@0: products derived from this software without specific prior written michael@0: permission. michael@0: THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" michael@0: AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE michael@0: IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE michael@0: ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE michael@0: LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR michael@0: CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF michael@0: SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS michael@0: INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN michael@0: CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) michael@0: ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE michael@0: POSSIBILITY OF SUCH DAMAGE. michael@0: ***********************************************************************/ michael@0: michael@0: #ifndef SILK_STRUCTS_FLP_H michael@0: #define SILK_STRUCTS_FLP_H michael@0: michael@0: #include "typedef.h" michael@0: #include "main.h" michael@0: #include "structs.h" michael@0: michael@0: #ifdef __cplusplus michael@0: extern "C" michael@0: { michael@0: #endif michael@0: michael@0: /********************************/ michael@0: /* Noise shaping analysis state */ michael@0: /********************************/ michael@0: typedef struct { michael@0: opus_int8 LastGainIndex; michael@0: silk_float HarmBoost_smth; michael@0: silk_float HarmShapeGain_smth; michael@0: silk_float Tilt_smth; michael@0: } silk_shape_state_FLP; michael@0: michael@0: /********************************/ michael@0: /* Prefilter state */ michael@0: /********************************/ michael@0: typedef struct { michael@0: silk_float sLTP_shp[ LTP_BUF_LENGTH ]; michael@0: silk_float sAR_shp[ MAX_SHAPE_LPC_ORDER + 1 ]; michael@0: opus_int sLTP_shp_buf_idx; michael@0: silk_float sLF_AR_shp; michael@0: silk_float sLF_MA_shp; michael@0: silk_float sHarmHP; michael@0: opus_int32 rand_seed; michael@0: opus_int lagPrev; michael@0: } silk_prefilter_state_FLP; michael@0: michael@0: /********************************/ michael@0: /* Encoder state FLP */ michael@0: /********************************/ michael@0: typedef struct { michael@0: silk_encoder_state sCmn; /* Common struct, shared with fixed-point code */ michael@0: silk_shape_state_FLP sShape; /* Noise shaping state */ michael@0: silk_prefilter_state_FLP sPrefilt; /* Prefilter State */ michael@0: michael@0: /* Buffer for find pitch and noise shape analysis */ michael@0: silk_float x_buf[ 2 * MAX_FRAME_LENGTH + LA_SHAPE_MAX ];/* Buffer for find pitch and noise shape analysis */ michael@0: silk_float LTPCorr; /* Normalized correlation from pitch lag estimator */ michael@0: } silk_encoder_state_FLP; michael@0: michael@0: /************************/ michael@0: /* Encoder control FLP */ michael@0: /************************/ michael@0: typedef struct { michael@0: /* Prediction and coding parameters */ michael@0: silk_float Gains[ MAX_NB_SUBFR ]; michael@0: silk_float PredCoef[ 2 ][ MAX_LPC_ORDER ]; /* holds interpolated and final coefficients */ michael@0: silk_float LTPCoef[LTP_ORDER * MAX_NB_SUBFR]; michael@0: silk_float LTP_scale; michael@0: opus_int pitchL[ MAX_NB_SUBFR ]; michael@0: michael@0: /* Noise shaping parameters */ michael@0: silk_float AR1[ MAX_NB_SUBFR * MAX_SHAPE_LPC_ORDER ]; michael@0: silk_float AR2[ MAX_NB_SUBFR * MAX_SHAPE_LPC_ORDER ]; michael@0: silk_float LF_MA_shp[ MAX_NB_SUBFR ]; michael@0: silk_float LF_AR_shp[ MAX_NB_SUBFR ]; michael@0: silk_float GainsPre[ MAX_NB_SUBFR ]; michael@0: silk_float HarmBoost[ MAX_NB_SUBFR ]; michael@0: silk_float Tilt[ MAX_NB_SUBFR ]; michael@0: silk_float HarmShapeGain[ MAX_NB_SUBFR ]; michael@0: silk_float Lambda; michael@0: silk_float input_quality; michael@0: silk_float coding_quality; michael@0: michael@0: /* Measures */ michael@0: silk_float sparseness; michael@0: silk_float predGain; michael@0: silk_float LTPredCodGain; michael@0: silk_float ResNrg[ MAX_NB_SUBFR ]; /* Residual energy per subframe */ michael@0: michael@0: /* Parameters for CBR mode */ michael@0: opus_int32 GainsUnq_Q16[ MAX_NB_SUBFR ]; michael@0: opus_int8 lastGainIndexPrev; michael@0: } silk_encoder_control_FLP; michael@0: michael@0: /************************/ michael@0: /* Encoder Super Struct */ michael@0: /************************/ michael@0: typedef struct { michael@0: silk_encoder_state_FLP state_Fxx[ ENCODER_NUM_CHANNELS ]; michael@0: stereo_enc_state sStereo; michael@0: opus_int32 nBitsExceeded; michael@0: opus_int nChannelsAPI; michael@0: opus_int nChannelsInternal; michael@0: opus_int nPrevChannelsInternal; michael@0: opus_int timeSinceSwitchAllowed_ms; michael@0: opus_int allowBandwidthSwitch; michael@0: opus_int prev_decode_only_middle; michael@0: } silk_encoder; michael@0: michael@0: #ifdef __cplusplus michael@0: } michael@0: #endif michael@0: michael@0: #endif