OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 | 114 |
115 #define ST_MEM_L_TBL 85 | 115 #define ST_MEM_L_TBL 85 |
116 #define MEM_LF_TBL 147 | 116 #define MEM_LF_TBL 147 |
117 | 117 |
118 | 118 |
119 /* Struct for the bits */ | 119 /* Struct for the bits */ |
120 typedef struct iLBC_bits_t_ { | 120 typedef struct iLBC_bits_t_ { |
121 int16_t lsf[LSF_NSPLIT*LPC_N_MAX]; | 121 int16_t lsf[LSF_NSPLIT*LPC_N_MAX]; |
122 int16_t cb_index[CB_NSTAGES*(NASUB_MAX+1)]; /* First CB_NSTAGES values contai
ns extra CB index */ | 122 int16_t cb_index[CB_NSTAGES*(NASUB_MAX+1)]; /* First CB_NSTAGES values contai
ns extra CB index */ |
123 int16_t gain_index[CB_NSTAGES*(NASUB_MAX+1)]; /* First CB_NSTAGES values conta
ins extra CB gain */ | 123 int16_t gain_index[CB_NSTAGES*(NASUB_MAX+1)]; /* First CB_NSTAGES values conta
ins extra CB gain */ |
124 int16_t idxForMax; | 124 size_t idxForMax; |
125 int16_t state_first; | 125 int16_t state_first; |
126 int16_t idxVec[STATE_SHORT_LEN_30MS]; | 126 int16_t idxVec[STATE_SHORT_LEN_30MS]; |
127 int16_t firstbits; | 127 int16_t firstbits; |
128 int16_t startIdx; | 128 size_t startIdx; |
129 } iLBC_bits; | 129 } iLBC_bits; |
130 | 130 |
131 /* type definition encoder instance */ | 131 /* type definition encoder instance */ |
132 typedef struct IlbcEncoder_ { | 132 typedef struct IlbcEncoder_ { |
133 | 133 |
134 /* flag for frame size mode */ | 134 /* flag for frame size mode */ |
135 int16_t mode; | 135 int16_t mode; |
136 | 136 |
137 /* basic parameters for different frame sizes */ | 137 /* basic parameters for different frame sizes */ |
138 int16_t blockl; | 138 size_t blockl; |
139 int16_t nsub; | 139 size_t nsub; |
140 int16_t nasub; | 140 int16_t nasub; |
141 int16_t no_of_bytes, no_of_words; | 141 size_t no_of_bytes, no_of_words; |
142 int16_t lpc_n; | 142 int16_t lpc_n; |
143 int16_t state_short_len; | 143 size_t state_short_len; |
144 | 144 |
145 /* analysis filter state */ | 145 /* analysis filter state */ |
146 int16_t anaMem[LPC_FILTERORDER]; | 146 int16_t anaMem[LPC_FILTERORDER]; |
147 | 147 |
148 /* Fix-point old lsf parameters for interpolation */ | 148 /* Fix-point old lsf parameters for interpolation */ |
149 int16_t lsfold[LPC_FILTERORDER]; | 149 int16_t lsfold[LPC_FILTERORDER]; |
150 int16_t lsfdeqold[LPC_FILTERORDER]; | 150 int16_t lsfdeqold[LPC_FILTERORDER]; |
151 | 151 |
152 /* signal buffer for LP analysis */ | 152 /* signal buffer for LP analysis */ |
153 int16_t lpc_buffer[LPC_LOOKBACK + BLOCKL_MAX]; | 153 int16_t lpc_buffer[LPC_LOOKBACK + BLOCKL_MAX]; |
154 | 154 |
155 /* state of input HP filter */ | 155 /* state of input HP filter */ |
156 int16_t hpimemx[2]; | 156 int16_t hpimemx[2]; |
157 int16_t hpimemy[4]; | 157 int16_t hpimemy[4]; |
158 | 158 |
159 #ifdef SPLIT_10MS | 159 #ifdef SPLIT_10MS |
160 int16_t weightdenumbuf[66]; | 160 int16_t weightdenumbuf[66]; |
161 int16_t past_samples[160]; | 161 int16_t past_samples[160]; |
162 uint16_t bytes[25]; | 162 uint16_t bytes[25]; |
163 int16_t section; | 163 int16_t section; |
164 int16_t Nfor_flag; | 164 int16_t Nfor_flag; |
165 int16_t Nback_flag; | 165 int16_t Nback_flag; |
166 int16_t start_pos; | 166 int16_t start_pos; |
167 int16_t diff; | 167 size_t diff; |
168 #endif | 168 #endif |
169 | 169 |
170 } IlbcEncoder; | 170 } IlbcEncoder; |
171 | 171 |
172 /* type definition decoder instance */ | 172 /* type definition decoder instance */ |
173 typedef struct IlbcDecoder_ { | 173 typedef struct IlbcDecoder_ { |
174 | 174 |
175 /* flag for frame size mode */ | 175 /* flag for frame size mode */ |
176 int16_t mode; | 176 int16_t mode; |
177 | 177 |
178 /* basic parameters for different frame sizes */ | 178 /* basic parameters for different frame sizes */ |
179 int16_t blockl; | 179 size_t blockl; |
180 int16_t nsub; | 180 size_t nsub; |
181 int16_t nasub; | 181 int16_t nasub; |
182 int16_t no_of_bytes, no_of_words; | 182 size_t no_of_bytes, no_of_words; |
183 int16_t lpc_n; | 183 int16_t lpc_n; |
184 int16_t state_short_len; | 184 size_t state_short_len; |
185 | 185 |
186 /* synthesis filter state */ | 186 /* synthesis filter state */ |
187 int16_t syntMem[LPC_FILTERORDER]; | 187 int16_t syntMem[LPC_FILTERORDER]; |
188 | 188 |
189 /* old LSF for interpolation */ | 189 /* old LSF for interpolation */ |
190 int16_t lsfdeqold[LPC_FILTERORDER]; | 190 int16_t lsfdeqold[LPC_FILTERORDER]; |
191 | 191 |
192 /* pitch lag estimated in enhancer and used in PLC */ | 192 /* pitch lag estimated in enhancer and used in PLC */ |
193 int last_lag; | 193 size_t last_lag; |
194 | 194 |
195 /* PLC state information */ | 195 /* PLC state information */ |
196 int consPLICount, prev_enh_pl; | 196 int consPLICount, prev_enh_pl; |
197 int16_t perSquare; | 197 int16_t perSquare; |
198 | 198 |
199 int16_t prevScale, prevPLI; | 199 int16_t prevScale, prevPLI; |
200 int16_t prevLag, prevLpc[LPC_FILTERORDER+1]; | 200 size_t prevLag; |
| 201 int16_t prevLpc[LPC_FILTERORDER+1]; |
201 int16_t prevResidual[NSUB_MAX*SUBL]; | 202 int16_t prevResidual[NSUB_MAX*SUBL]; |
202 int16_t seed; | 203 int16_t seed; |
203 | 204 |
204 /* previous synthesis filter parameters */ | 205 /* previous synthesis filter parameters */ |
205 | 206 |
206 int16_t old_syntdenum[(LPC_FILTERORDER + 1)*NSUB_MAX]; | 207 int16_t old_syntdenum[(LPC_FILTERORDER + 1)*NSUB_MAX]; |
207 | 208 |
208 /* state of output HP filter */ | 209 /* state of output HP filter */ |
209 int16_t hpimemx[2]; | 210 int16_t hpimemx[2]; |
210 int16_t hpimemy[4]; | 211 int16_t hpimemy[4]; |
211 | 212 |
212 /* enhancer state information */ | 213 /* enhancer state information */ |
213 int use_enhancer; | 214 int use_enhancer; |
214 int16_t enh_buf[ENH_BUFL+ENH_BUFL_FILTEROVERHEAD]; | 215 int16_t enh_buf[ENH_BUFL+ENH_BUFL_FILTEROVERHEAD]; |
215 int16_t enh_period[ENH_NBLOCKS_TOT]; | 216 int16_t enh_period[ENH_NBLOCKS_TOT]; |
216 | 217 |
217 } IlbcDecoder; | 218 } IlbcDecoder; |
218 | 219 |
219 #endif | 220 #endif |
OLD | NEW |