webkit  2cdf99a9e3038c7e01b3c37e8ad903ecbe5eecf1
https://github.com/WebKit/webkit
structs_FLP.h
Go to the documentation of this file.
1 /***********************************************************************
2 Copyright (c) 2006-2011, Skype Limited. All rights reserved.
3 Redistribution and use in source and binary forms, with or without
4 modification, are permitted provided that the following conditions
5 are met:
6 - Redistributions of source code must retain the above copyright notice,
7 this list of conditions and the following disclaimer.
8 - Redistributions in binary form must reproduce the above copyright
9 notice, this list of conditions and the following disclaimer in the
10 documentation and/or other materials provided with the distribution.
11 - Neither the name of Internet Society, IETF or IETF Trust, nor the
12 names of specific contributors, may be used to endorse or promote
13 products derived from this software without specific prior written
14 permission.
15 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
16 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18 ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
19 LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
20 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
21 SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
22 INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
23 CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
24 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
25 POSSIBILITY OF SUCH DAMAGE.
26 ***********************************************************************/
27 
28 #ifndef SILK_STRUCTS_FLP_H
29 #define SILK_STRUCTS_FLP_H
30 
31 #include "typedef.h"
32 #include "main.h"
33 #include "structs.h"
34 
35 #ifdef __cplusplus
36 extern "C"
37 {
38 #endif
39 
40 /********************************/
41 /* Noise shaping analysis state */
42 /********************************/
43 typedef struct {
49 
50 /********************************/
51 /* Prefilter state */
52 /********************************/
53 typedef struct {
63 
64 /********************************/
65 /* Encoder state FLP */
66 /********************************/
67 typedef struct {
68  silk_encoder_state sCmn; /* Common struct, shared with fixed-point code */
69  silk_shape_state_FLP sShape; /* Noise shaping state */
70  silk_prefilter_state_FLP sPrefilt; /* Prefilter State */
71 
72  /* Buffer for find pitch and noise shape analysis */
73  silk_float x_buf[ 2 * MAX_FRAME_LENGTH + LA_SHAPE_MAX ];/* Buffer for find pitch and noise shape analysis */
74  silk_float LTPCorr; /* Normalized correlation from pitch lag estimator */
76 
77 /************************/
78 /* Encoder control FLP */
79 /************************/
80 typedef struct {
81  /* Prediction and coding parameters */
83  silk_float PredCoef[ 2 ][ MAX_LPC_ORDER ]; /* holds interpolated and final coefficients */
87 
88  /* Noise shaping parameters */
91  silk_float LF_MA_shp[ MAX_NB_SUBFR ];
92  silk_float LF_AR_shp[ MAX_NB_SUBFR ];
93  silk_float GainsPre[ MAX_NB_SUBFR ];
94  silk_float HarmBoost[ MAX_NB_SUBFR ];
96  silk_float HarmShapeGain[ MAX_NB_SUBFR ];
100 
101  /* Measures */
105  silk_float ResNrg[ MAX_NB_SUBFR ]; /* Residual energy per subframe */
106 
107  /* Parameters for CBR mode */
108  opus_int32 GainsUnq_Q16[ MAX_NB_SUBFR ];
111 
112 /************************/
113 /* Encoder Super Struct */
114 /************************/
115 typedef struct {
117  stereo_enc_state sStereo;
118  opus_int32 nBitsUsedLBRR;
119  opus_int32 nBitsExceeded;
120  opus_int nChannelsAPI;
121  opus_int nChannelsInternal;
122  opus_int nPrevChannelsInternal;
123  opus_int timeSinceSwitchAllowed_ms;
124  opus_int allowBandwidthSwitch;
125  opus_int prev_decode_only_middle;
126 } silk_encoder;
127 
128 #ifdef __cplusplus
129 }
130 #endif
131 
132 #endif
opus_int8 LastGainIndex
Definition: structs_FLP.h:44
silk_float Lambda
Definition: structs_FLP.h:97
silk_float HarmShapeGain_smth
Definition: structs_FLP.h:46
opus_int8 lastGainIndexPrev
Definition: structs_FLP.h:109
#define ENCODER_NUM_CHANNELS
Definition: define.h:40
Definition: structs_FLP.h:43
#define MAX_FRAME_LENGTH
Definition: define.h:92
#define opus_int
Definition: opus_types.h:151
silk_encoder_state sCmn
Definition: structs_FLP.h:68
#define opus_int8
Definition: opus_types.h:153
Definition: structs_FLP.h:53
silk_float LTPCorr
Definition: structs_FLP.h:74
opus_int lagPrev
Definition: structs_FLP.h:61
silk_float sparseness
Definition: structs_FLP.h:102
silk_float input_quality
Definition: structs_FLP.h:98
Definition: structs_FLP.h:80
#define silk_float
Definition: typedef.h:36
#define LA_SHAPE_MAX
Definition: define.h:108
silk_float HarmBoost_smth
Definition: structs_FLP.h:45
#define LTP_ORDER
Definition: define.h:141
#define LTP_BUF_LENGTH
Definition: define.h:157
Definition: structs_FLP.h:67
int opus_int32
Definition: opus_types.h:146
silk_float predGain
Definition: structs_FLP.h:103
Definition: structs_FIX.h:116
opus_int32 rand_seed
Definition: structs_FLP.h:60
opus_int sLTP_shp_buf_idx
Definition: structs_FLP.h:56
silk_float coding_quality
Definition: structs_FLP.h:99
silk_float sLF_AR_shp
Definition: structs_FLP.h:57
silk_float Tilt_smth
Definition: structs_FLP.h:47
silk_float sHarmHP
Definition: structs_FLP.h:59
Definition: structs.h:97
silk_prefilter_state_FLP sPrefilt
Definition: structs_FLP.h:70
silk_shape_state_FLP sShape
Definition: structs_FLP.h:69
silk_float LTPredCodGain
Definition: structs_FLP.h:104
#define MAX_SHAPE_LPC_ORDER
Definition: define.h:150
Definition: structs.h:132
#define MAX_LPC_ORDER
Definition: define.h:137
#define MAX_NB_SUBFR
Definition: define.h:85
silk_float sLF_MA_shp
Definition: structs_FLP.h:58
silk_float LTP_scale
Definition: structs_FLP.h:85