1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/media/libopus/silk/fixed/structs_FIX.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,133 @@ 1.4 +/*********************************************************************** 1.5 +Copyright (c) 2006-2011, Skype Limited. All rights reserved. 1.6 +Redistribution and use in source and binary forms, with or without 1.7 +modification, are permitted provided that the following conditions 1.8 +are met: 1.9 +- Redistributions of source code must retain the above copyright notice, 1.10 +this list of conditions and the following disclaimer. 1.11 +- Redistributions in binary form must reproduce the above copyright 1.12 +notice, this list of conditions and the following disclaimer in the 1.13 +documentation and/or other materials provided with the distribution. 1.14 +- Neither the name of Internet Society, IETF or IETF Trust, nor the 1.15 +names of specific contributors, may be used to endorse or promote 1.16 +products derived from this software without specific prior written 1.17 +permission. 1.18 +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 1.19 +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 1.20 +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 1.21 +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 1.22 +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 1.23 +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 1.24 +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 1.25 +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 1.26 +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 1.27 +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 1.28 +POSSIBILITY OF SUCH DAMAGE. 1.29 +***********************************************************************/ 1.30 + 1.31 +#ifndef SILK_STRUCTS_FIX_H 1.32 +#define SILK_STRUCTS_FIX_H 1.33 + 1.34 +#include "typedef.h" 1.35 +#include "main.h" 1.36 +#include "structs.h" 1.37 + 1.38 +#ifdef __cplusplus 1.39 +extern "C" 1.40 +{ 1.41 +#endif 1.42 + 1.43 +/********************************/ 1.44 +/* Noise shaping analysis state */ 1.45 +/********************************/ 1.46 +typedef struct { 1.47 + opus_int8 LastGainIndex; 1.48 + opus_int32 HarmBoost_smth_Q16; 1.49 + opus_int32 HarmShapeGain_smth_Q16; 1.50 + opus_int32 Tilt_smth_Q16; 1.51 +} silk_shape_state_FIX; 1.52 + 1.53 +/********************************/ 1.54 +/* Prefilter state */ 1.55 +/********************************/ 1.56 +typedef struct { 1.57 + opus_int16 sLTP_shp[ LTP_BUF_LENGTH ]; 1.58 + opus_int32 sAR_shp[ MAX_SHAPE_LPC_ORDER + 1 ]; 1.59 + opus_int sLTP_shp_buf_idx; 1.60 + opus_int32 sLF_AR_shp_Q12; 1.61 + opus_int32 sLF_MA_shp_Q12; 1.62 + opus_int32 sHarmHP_Q2; 1.63 + opus_int32 rand_seed; 1.64 + opus_int lagPrev; 1.65 +} silk_prefilter_state_FIX; 1.66 + 1.67 +/********************************/ 1.68 +/* Encoder state FIX */ 1.69 +/********************************/ 1.70 +typedef struct { 1.71 + silk_encoder_state sCmn; /* Common struct, shared with floating-point code */ 1.72 + silk_shape_state_FIX sShape; /* Shape state */ 1.73 + silk_prefilter_state_FIX sPrefilt; /* Prefilter State */ 1.74 + 1.75 + /* Buffer for find pitch and noise shape analysis */ 1.76 + silk_DWORD_ALIGN opus_int16 x_buf[ 2 * MAX_FRAME_LENGTH + LA_SHAPE_MAX ];/* Buffer for find pitch and noise shape analysis */ 1.77 + opus_int LTPCorr_Q15; /* Normalized correlation from pitch lag estimator */ 1.78 +} silk_encoder_state_FIX; 1.79 + 1.80 +/************************/ 1.81 +/* Encoder control FIX */ 1.82 +/************************/ 1.83 +typedef struct { 1.84 + /* Prediction and coding parameters */ 1.85 + opus_int32 Gains_Q16[ MAX_NB_SUBFR ]; 1.86 + silk_DWORD_ALIGN opus_int16 PredCoef_Q12[ 2 ][ MAX_LPC_ORDER ]; 1.87 + opus_int16 LTPCoef_Q14[ LTP_ORDER * MAX_NB_SUBFR ]; 1.88 + opus_int LTP_scale_Q14; 1.89 + opus_int pitchL[ MAX_NB_SUBFR ]; 1.90 + 1.91 + /* Noise shaping parameters */ 1.92 + /* Testing */ 1.93 + silk_DWORD_ALIGN opus_int16 AR1_Q13[ MAX_NB_SUBFR * MAX_SHAPE_LPC_ORDER ]; 1.94 + silk_DWORD_ALIGN opus_int16 AR2_Q13[ MAX_NB_SUBFR * MAX_SHAPE_LPC_ORDER ]; 1.95 + opus_int32 LF_shp_Q14[ MAX_NB_SUBFR ]; /* Packs two int16 coefficients per int32 value */ 1.96 + opus_int GainsPre_Q14[ MAX_NB_SUBFR ]; 1.97 + opus_int HarmBoost_Q14[ MAX_NB_SUBFR ]; 1.98 + opus_int Tilt_Q14[ MAX_NB_SUBFR ]; 1.99 + opus_int HarmShapeGain_Q14[ MAX_NB_SUBFR ]; 1.100 + opus_int Lambda_Q10; 1.101 + opus_int input_quality_Q14; 1.102 + opus_int coding_quality_Q14; 1.103 + 1.104 + /* measures */ 1.105 + opus_int sparseness_Q8; 1.106 + opus_int32 predGain_Q16; 1.107 + opus_int LTPredCodGain_Q7; 1.108 + opus_int32 ResNrg[ MAX_NB_SUBFR ]; /* Residual energy per subframe */ 1.109 + opus_int ResNrgQ[ MAX_NB_SUBFR ]; /* Q domain for the residual energy > 0 */ 1.110 + 1.111 + /* Parameters for CBR mode */ 1.112 + opus_int32 GainsUnq_Q16[ MAX_NB_SUBFR ]; 1.113 + opus_int8 lastGainIndexPrev; 1.114 +} silk_encoder_control_FIX; 1.115 + 1.116 +/************************/ 1.117 +/* Encoder Super Struct */ 1.118 +/************************/ 1.119 +typedef struct { 1.120 + silk_encoder_state_FIX state_Fxx[ ENCODER_NUM_CHANNELS ]; 1.121 + stereo_enc_state sStereo; 1.122 + opus_int32 nBitsExceeded; 1.123 + opus_int nChannelsAPI; 1.124 + opus_int nChannelsInternal; 1.125 + opus_int nPrevChannelsInternal; 1.126 + opus_int timeSinceSwitchAllowed_ms; 1.127 + opus_int allowBandwidthSwitch; 1.128 + opus_int prev_decode_only_middle; 1.129 +} silk_encoder; 1.130 + 1.131 + 1.132 +#ifdef __cplusplus 1.133 +} 1.134 +#endif 1.135 + 1.136 +#endif