OLD | NEW |
1 /*********************************************************************** | 1 /*********************************************************************** |
2 Copyright (c) 2006-2011, Skype Limited. All rights reserved. | 2 Copyright (c) 2006-2011, Skype Limited. All rights reserved. |
3 Redistribution and use in source and binary forms, with or without | 3 Redistribution and use in source and binary forms, with or without |
4 modification, are permitted provided that the following conditions | 4 modification, are permitted provided that the following conditions |
5 are met: | 5 are met: |
6 - Redistributions of source code must retain the above copyright notice, | 6 - Redistributions of source code must retain the above copyright notice, |
7 this list of conditions and the following disclaimer. | 7 this list of conditions and the following disclaimer. |
8 - Redistributions in binary form must reproduce the above copyright | 8 - Redistributions in binary form must reproduce the above copyright |
9 notice, this list of conditions and the following disclaimer in the | 9 notice, this list of conditions and the following disclaimer in the |
10 documentation and/or other materials provided with the distribution. | 10 documentation and/or other materials provided with the distribution. |
(...skipping 20 matching lines...) Expand all Loading... |
31 #include "SigProc_FIX.h" | 31 #include "SigProc_FIX.h" |
32 #include "define.h" | 32 #include "define.h" |
33 #include "structs.h" | 33 #include "structs.h" |
34 #include "tables.h" | 34 #include "tables.h" |
35 #include "PLC.h" | 35 #include "PLC.h" |
36 #include "control.h" | 36 #include "control.h" |
37 #include "debug.h" | 37 #include "debug.h" |
38 #include "entenc.h" | 38 #include "entenc.h" |
39 #include "entdec.h" | 39 #include "entdec.h" |
40 | 40 |
| 41 #if defined(OPUS_X86_MAY_HAVE_SSE4_1) |
| 42 #include "x86/main_sse.h" |
| 43 #endif |
| 44 |
41 /* Convert Left/Right stereo signal to adaptive Mid/Side representation */ | 45 /* Convert Left/Right stereo signal to adaptive Mid/Side representation */ |
42 void silk_stereo_LR_to_MS( | 46 void silk_stereo_LR_to_MS( |
43 stereo_enc_state *state, /* I/O State
*/ | 47 stereo_enc_state *state, /* I/O State
*/ |
44 opus_int16 x1[], /* I/O Left inp
ut signal, becomes mid signal */ | 48 opus_int16 x1[], /* I/O Left inp
ut signal, becomes mid signal */ |
45 opus_int16 x2[], /* I/O Right in
put signal, becomes side signal */ | 49 opus_int16 x2[], /* I/O Right in
put signal, becomes side signal */ |
46 opus_int8 ix[ 2 ][ 3 ], /* O Quantiza
tion indices */ | 50 opus_int8 ix[ 2 ][ 3 ], /* O Quantiza
tion indices */ |
47 opus_int8 *mid_only_flag, /* O Flag: on
ly mid signal coded */ | 51 opus_int8 *mid_only_flag, /* O Flag: on
ly mid signal coded */ |
48 opus_int32 mid_side_rates_bps[], /* O Bitrates
for mid and side signals */ | 52 opus_int32 mid_side_rates_bps[], /* O Bitrates
for mid and side signals */ |
49 opus_int32 total_rate_bps, /* I Total bi
trate */ | 53 opus_int32 total_rate_bps, /* I Total bi
trate */ |
50 opus_int prev_speech_act_Q8, /* I Speech a
ctivity level in previous frame */ | 54 opus_int prev_speech_act_Q8, /* I Speech a
ctivity level in previous frame */ |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 const opus_int8 pulses[], /* I puls
e signal */ | 113 const opus_int8 pulses[], /* I puls
e signal */ |
110 opus_int length, /* I leng
th of input */ | 114 opus_int length, /* I leng
th of input */ |
111 const opus_int signalType, /* I Sign
al type */ | 115 const opus_int signalType, /* I Sign
al type */ |
112 const opus_int quantOffsetType, /* I Quan
tization offset type */ | 116 const opus_int quantOffsetType, /* I Quan
tization offset type */ |
113 const opus_int sum_pulses[ MAX_NB_SHELL_BLOCKS ] /* I Sum
of absolute pulses per block */ | 117 const opus_int sum_pulses[ MAX_NB_SHELL_BLOCKS ] /* I Sum
of absolute pulses per block */ |
114 ); | 118 ); |
115 | 119 |
116 /* Decodes signs of excitation */ | 120 /* Decodes signs of excitation */ |
117 void silk_decode_signs( | 121 void silk_decode_signs( |
118 ec_dec *psRangeDec, /* I/O Comp
ressor data structure */ | 122 ec_dec *psRangeDec, /* I/O Comp
ressor data structure */ |
119 opus_int pulses[], /* I/O puls
e signal */ | 123 opus_int16 pulses[], /* I/O puls
e signal */ |
120 opus_int length, /* I leng
th of input */ | 124 opus_int length, /* I leng
th of input */ |
121 const opus_int signalType, /* I Sign
al type */ | 125 const opus_int signalType, /* I Sign
al type */ |
122 const opus_int quantOffsetType, /* I Quan
tization offset type */ | 126 const opus_int quantOffsetType, /* I Quan
tization offset type */ |
123 const opus_int sum_pulses[ MAX_NB_SHELL_BLOCKS ] /* I Sum
of absolute pulses per block */ | 127 const opus_int sum_pulses[ MAX_NB_SHELL_BLOCKS ] /* I Sum
of absolute pulses per block */ |
124 ); | 128 ); |
125 | 129 |
126 /* Check encoder control struct */ | 130 /* Check encoder control struct */ |
127 opus_int check_control_input( | 131 opus_int check_control_input( |
128 silk_EncControlStruct *encControl /* I Control
structure */ | 132 silk_EncControlStruct *encControl /* I Control
structure */ |
129 ); | 133 ); |
(...skipping 24 matching lines...) Expand all Loading... |
154 ); | 158 ); |
155 | 159 |
156 /* Shell encoder, operates on one shell code frame of 16 pulses */ | 160 /* Shell encoder, operates on one shell code frame of 16 pulses */ |
157 void silk_shell_encoder( | 161 void silk_shell_encoder( |
158 ec_enc *psRangeEnc, /* I/O compress
or data structure */ | 162 ec_enc *psRangeEnc, /* I/O compress
or data structure */ |
159 const opus_int *pulses0 /* I data: no
nnegative pulse amplitudes */ | 163 const opus_int *pulses0 /* I data: no
nnegative pulse amplitudes */ |
160 ); | 164 ); |
161 | 165 |
162 /* Shell decoder, operates on one shell code frame of 16 pulses */ | 166 /* Shell decoder, operates on one shell code frame of 16 pulses */ |
163 void silk_shell_decoder( | 167 void silk_shell_decoder( |
164 opus_int *pulses0, /* O data: no
nnegative pulse amplitudes */ | 168 opus_int16 *pulses0, /* O data: no
nnegative pulse amplitudes */ |
165 ec_dec *psRangeDec, /* I/O Compress
or data structure */ | 169 ec_dec *psRangeDec, /* I/O Compress
or data structure */ |
166 const opus_int pulses4 /* I number o
f pulses per pulse-subframe */ | 170 const opus_int pulses4 /* I number o
f pulses per pulse-subframe */ |
167 ); | 171 ); |
168 | 172 |
169 /* Gain scalar quantization with hysteresis, uniform on log scale */ | 173 /* Gain scalar quantization with hysteresis, uniform on log scale */ |
170 void silk_gains_quant( | 174 void silk_gains_quant( |
171 opus_int8 ind[ MAX_NB_SUBFR ], /* O gain ind
ices */ | 175 opus_int8 ind[ MAX_NB_SUBFR ], /* O gain ind
ices */ |
172 opus_int32 gain_Q16[ MAX_NB_SUBFR ], /* I/O gains (q
uantized out) */ | 176 opus_int32 gain_Q16[ MAX_NB_SUBFR ], /* I/O gains (q
uantized out) */ |
173 opus_int8 *prev_ind, /* I/O last ind
ex in previous frame */ | 177 opus_int8 *prev_ind, /* I/O last ind
ex in previous frame */ |
174 const opus_int conditional, /* I first ga
in is delta coded if 1 */ | 178 const opus_int conditional, /* I first ga
in is delta coded if 1 */ |
(...skipping 22 matching lines...) Expand all Loading... |
197 const opus_int16 x1[ MAX_LPC_ORDER ], /* I second v
ector */ | 201 const opus_int16 x1[ MAX_LPC_ORDER ], /* I second v
ector */ |
198 const opus_int ifact_Q2, /* I interp.
factor, weight on 2nd vector */ | 202 const opus_int ifact_Q2, /* I interp.
factor, weight on 2nd vector */ |
199 const opus_int d /* I number o
f parameters */ | 203 const opus_int d /* I number o
f parameters */ |
200 ); | 204 ); |
201 | 205 |
202 /* LTP tap quantizer */ | 206 /* LTP tap quantizer */ |
203 void silk_quant_LTP_gains( | 207 void silk_quant_LTP_gains( |
204 opus_int16 B_Q14[ MAX_NB_SUBFR * LTP_ORDER ], /* I
/O (un)quantized LTP gains */ | 208 opus_int16 B_Q14[ MAX_NB_SUBFR * LTP_ORDER ], /* I
/O (un)quantized LTP gains */ |
205 opus_int8 cbk_index[ MAX_NB_SUBFR ], /* O
Codebook Index */ | 209 opus_int8 cbk_index[ MAX_NB_SUBFR ], /* O
Codebook Index */ |
206 opus_int8 *periodicity_index, /* O
Periodicity Index */ | 210 opus_int8 *periodicity_index, /* O
Periodicity Index */ |
207 » opus_int32» » » » » *sum_gain_dB_Q7,»
» » » » » » /* I/O Cumulative max predictio
n gain */ | 211 opus_int32 *sum_gain_dB_Q7, /* I
/O Cumulative max prediction gain */ |
208 const opus_int32 W_Q18[ MAX_NB_SUBFR*LTP_ORDER*LTP_ORDER ], /* I
Error Weights in Q18 */ | 212 const opus_int32 W_Q18[ MAX_NB_SUBFR*LTP_ORDER*LTP_ORDER ], /* I
Error Weights in Q18 */ |
209 opus_int mu_Q9, /* I
Mu value (R/D tradeoff) */ | 213 opus_int mu_Q9, /* I
Mu value (R/D tradeoff) */ |
210 opus_int lowComplexity, /* I
Flag for low complexity */ | 214 opus_int lowComplexity, /* I
Flag for low complexity */ |
211 const opus_int nb_subfr /* I
number of subframes */ | 215 const opus_int nb_subfr, /* I
number of subframes */ |
| 216 int arch /* I
Run-time architecture */ |
212 ); | 217 ); |
213 | 218 |
214 /* Entropy constrained matrix-weighted VQ, for a single input data vector */ | 219 /* Entropy constrained matrix-weighted VQ, for a single input data vector */ |
215 void silk_VQ_WMat_EC( | 220 void silk_VQ_WMat_EC_c( |
216 opus_int8 *ind, /* O index of
best codebook vector */ | 221 opus_int8 *ind, /* O index of
best codebook vector */ |
217 opus_int32 *rate_dist_Q14, /* O best wei
ghted quant error + mu * rate */ | 222 opus_int32 *rate_dist_Q14, /* O best wei
ghted quant error + mu * rate */ |
218 opus_int *gain_Q7, /* O sum of a
bsolute LTP coefficients */ | 223 opus_int *gain_Q7, /* O sum of a
bsolute LTP coefficients */ |
219 const opus_int16 *in_Q14, /* I input ve
ctor to be quantized */ | 224 const opus_int16 *in_Q14, /* I input ve
ctor to be quantized */ |
220 const opus_int32 *W_Q18, /* I weightin
g matrix */ | 225 const opus_int32 *W_Q18, /* I weightin
g matrix */ |
221 const opus_int8 *cb_Q7, /* I codebook
*/ | 226 const opus_int8 *cb_Q7, /* I codebook
*/ |
222 const opus_uint8 *cb_gain_Q7, /* I codebook
effective gain */ | 227 const opus_uint8 *cb_gain_Q7, /* I codebook
effective gain */ |
223 const opus_uint8 *cl_Q5, /* I code len
gth for each codebook vector */ | 228 const opus_uint8 *cl_Q5, /* I code len
gth for each codebook vector */ |
224 const opus_int mu_Q9, /* I tradeoff
betw. weighted error and rate */ | 229 const opus_int mu_Q9, /* I tradeoff
betw. weighted error and rate */ |
225 const opus_int32 max_gain_Q7, /* I maximum
sum of absolute LTP coefficients */ | 230 const opus_int32 max_gain_Q7, /* I maximum
sum of absolute LTP coefficients */ |
226 opus_int L /* I number o
f vectors in codebook */ | 231 opus_int L /* I number o
f vectors in codebook */ |
227 ); | 232 ); |
228 | 233 |
| 234 #if !defined(OVERRIDE_silk_VQ_WMat_EC) |
| 235 #define silk_VQ_WMat_EC(ind, rate_dist_Q14, gain_Q7, in_Q14, W_Q18, cb_Q7, cb_ga
in_Q7, cl_Q5, \ |
| 236 mu_Q9, max_gain_Q7, L, arch) \ |
| 237 ((void)(arch),silk_VQ_WMat_EC_c(ind, rate_dist_Q14, gain_Q7, in_Q14, W_Q18,
cb_Q7, cb_gain_Q7, cl_Q5, \ |
| 238 mu_Q9, max_gain_Q7, L)) |
| 239 #endif |
| 240 |
229 /************************************/ | 241 /************************************/ |
230 /* Noise shaping quantization (NSQ) */ | 242 /* Noise shaping quantization (NSQ) */ |
231 /************************************/ | 243 /************************************/ |
232 void silk_NSQ( | 244 |
| 245 void silk_NSQ_c( |
233 const silk_encoder_state *psEncC, /* I
/O Encoder State */ | 246 const silk_encoder_state *psEncC, /* I
/O Encoder State */ |
234 silk_nsq_state *NSQ, /* I
/O NSQ state */ | 247 silk_nsq_state *NSQ, /* I
/O NSQ state */ |
235 SideInfoIndices *psIndices, /* I
/O Quantization Indices */ | 248 SideInfoIndices *psIndices, /* I
/O Quantization Indices */ |
236 const opus_int32 x_Q3[], /* I
Prefiltered input signal */ | 249 const opus_int32 x_Q3[], /* I
Prefiltered input signal */ |
237 opus_int8 pulses[], /* O
Quantized pulse signal */ | 250 opus_int8 pulses[], /* O
Quantized pulse signal */ |
238 const opus_int16 PredCoef_Q12[ 2 * MAX_LPC_ORDER ], /* I
Short term prediction coefs */ | 251 const opus_int16 PredCoef_Q12[ 2 * MAX_LPC_ORDER ], /* I
Short term prediction coefs */ |
239 const opus_int16 LTPCoef_Q14[ LTP_ORDER * MAX_NB_SUBFR ], /* I
Long term prediction coefs */ | 252 const opus_int16 LTPCoef_Q14[ LTP_ORDER * MAX_NB_SUBFR ], /* I
Long term prediction coefs */ |
240 const opus_int16 AR2_Q13[ MAX_NB_SUBFR * MAX_SHAPE_LPC_ORDER ], /
* I Noise shaping coefs */ | 253 const opus_int16 AR2_Q13[ MAX_NB_SUBFR * MAX_SHAPE_LPC_ORDER ], /
* I Noise shaping coefs */ |
241 const opus_int HarmShapeGain_Q14[ MAX_NB_SUBFR ], /* I
Long term shaping coefs */ | 254 const opus_int HarmShapeGain_Q14[ MAX_NB_SUBFR ], /* I
Long term shaping coefs */ |
242 const opus_int Tilt_Q14[ MAX_NB_SUBFR ], /* I
Spectral tilt */ | 255 const opus_int Tilt_Q14[ MAX_NB_SUBFR ], /* I
Spectral tilt */ |
243 const opus_int32 LF_shp_Q14[ MAX_NB_SUBFR ], /* I
Low frequency shaping coefs */ | 256 const opus_int32 LF_shp_Q14[ MAX_NB_SUBFR ], /* I
Low frequency shaping coefs */ |
244 const opus_int32 Gains_Q16[ MAX_NB_SUBFR ], /* I
Quantization step sizes */ | 257 const opus_int32 Gains_Q16[ MAX_NB_SUBFR ], /* I
Quantization step sizes */ |
245 const opus_int pitchL[ MAX_NB_SUBFR ], /* I
Pitch lags */ | 258 const opus_int pitchL[ MAX_NB_SUBFR ], /* I
Pitch lags */ |
246 const opus_int Lambda_Q10, /* I
Rate/distortion tradeoff */ | 259 const opus_int Lambda_Q10, /* I
Rate/distortion tradeoff */ |
247 const opus_int LTP_scale_Q14 /* I
LTP state scaling */ | 260 const opus_int LTP_scale_Q14 /* I
LTP state scaling */ |
248 ); | 261 ); |
249 | 262 |
| 263 #if !defined(OVERRIDE_silk_NSQ) |
| 264 #define silk_NSQ(psEncC, NSQ, psIndices, x_Q3, pulses, PredCoef_Q12, LTPCoef_Q14
, AR2_Q13, \ |
| 265 HarmShapeGain_Q14, Tilt_Q14, LF_shp_Q14, Gains_Q16, pitchL, L
ambda_Q10, LTP_scale_Q14, arch) \ |
| 266 ((void)(arch),silk_NSQ_c(psEncC, NSQ, psIndices, x_Q3, pulses, PredCoef_Q12,
LTPCoef_Q14, AR2_Q13, \ |
| 267 HarmShapeGain_Q14, Tilt_Q14, LF_shp_Q14, Gains_Q16, pitchL, L
ambda_Q10, LTP_scale_Q14)) |
| 268 #endif |
| 269 |
250 /* Noise shaping using delayed decision */ | 270 /* Noise shaping using delayed decision */ |
251 void silk_NSQ_del_dec( | 271 void silk_NSQ_del_dec_c( |
252 const silk_encoder_state *psEncC, /* I
/O Encoder State */ | 272 const silk_encoder_state *psEncC, /* I
/O Encoder State */ |
253 silk_nsq_state *NSQ, /* I
/O NSQ state */ | 273 silk_nsq_state *NSQ, /* I
/O NSQ state */ |
254 SideInfoIndices *psIndices, /* I
/O Quantization Indices */ | 274 SideInfoIndices *psIndices, /* I
/O Quantization Indices */ |
255 const opus_int32 x_Q3[], /* I
Prefiltered input signal */ | 275 const opus_int32 x_Q3[], /* I
Prefiltered input signal */ |
256 opus_int8 pulses[], /* O
Quantized pulse signal */ | 276 opus_int8 pulses[], /* O
Quantized pulse signal */ |
257 const opus_int16 PredCoef_Q12[ 2 * MAX_LPC_ORDER ], /* I
Short term prediction coefs */ | 277 const opus_int16 PredCoef_Q12[ 2 * MAX_LPC_ORDER ], /* I
Short term prediction coefs */ |
258 const opus_int16 LTPCoef_Q14[ LTP_ORDER * MAX_NB_SUBFR ], /* I
Long term prediction coefs */ | 278 const opus_int16 LTPCoef_Q14[ LTP_ORDER * MAX_NB_SUBFR ], /* I
Long term prediction coefs */ |
259 const opus_int16 AR2_Q13[ MAX_NB_SUBFR * MAX_SHAPE_LPC_ORDER ], /
* I Noise shaping coefs */ | 279 const opus_int16 AR2_Q13[ MAX_NB_SUBFR * MAX_SHAPE_LPC_ORDER ], /
* I Noise shaping coefs */ |
260 const opus_int HarmShapeGain_Q14[ MAX_NB_SUBFR ], /* I
Long term shaping coefs */ | 280 const opus_int HarmShapeGain_Q14[ MAX_NB_SUBFR ], /* I
Long term shaping coefs */ |
261 const opus_int Tilt_Q14[ MAX_NB_SUBFR ], /* I
Spectral tilt */ | 281 const opus_int Tilt_Q14[ MAX_NB_SUBFR ], /* I
Spectral tilt */ |
262 const opus_int32 LF_shp_Q14[ MAX_NB_SUBFR ], /* I
Low frequency shaping coefs */ | 282 const opus_int32 LF_shp_Q14[ MAX_NB_SUBFR ], /* I
Low frequency shaping coefs */ |
263 const opus_int32 Gains_Q16[ MAX_NB_SUBFR ], /* I
Quantization step sizes */ | 283 const opus_int32 Gains_Q16[ MAX_NB_SUBFR ], /* I
Quantization step sizes */ |
264 const opus_int pitchL[ MAX_NB_SUBFR ], /* I
Pitch lags */ | 284 const opus_int pitchL[ MAX_NB_SUBFR ], /* I
Pitch lags */ |
265 const opus_int Lambda_Q10, /* I
Rate/distortion tradeoff */ | 285 const opus_int Lambda_Q10, /* I
Rate/distortion tradeoff */ |
266 const opus_int LTP_scale_Q14 /* I
LTP state scaling */ | 286 const opus_int LTP_scale_Q14 /* I
LTP state scaling */ |
267 ); | 287 ); |
268 | 288 |
| 289 #if !defined(OVERRIDE_silk_NSQ_del_dec) |
| 290 #define silk_NSQ_del_dec(psEncC, NSQ, psIndices, x_Q3, pulses, PredCoef_Q12, LTP
Coef_Q14, AR2_Q13, \ |
| 291 HarmShapeGain_Q14, Tilt_Q14, LF_shp_Q14, Gains_Q16, p
itchL, Lambda_Q10, LTP_scale_Q14, arch) \ |
| 292 ((void)(arch),silk_NSQ_del_dec_c(psEncC, NSQ, psIndices, x_Q3, pulses, PredC
oef_Q12, LTPCoef_Q14, AR2_Q13, \ |
| 293 HarmShapeGain_Q14, Tilt_Q14, LF_shp_Q14, Gains_Q16, p
itchL, Lambda_Q10, LTP_scale_Q14)) |
| 294 #endif |
| 295 |
269 /************/ | 296 /************/ |
270 /* Silk VAD */ | 297 /* Silk VAD */ |
271 /************/ | 298 /************/ |
272 /* Initialize the Silk VAD */ | 299 /* Initialize the Silk VAD */ |
273 opus_int silk_VAD_Init( /* O Return v
alue, 0 if success */ | 300 opus_int silk_VAD_Init( /* O Return v
alue, 0 if success */ |
274 silk_VAD_state *psSilk_VAD /* I/O Pointer
to Silk VAD state */ | 301 silk_VAD_state *psSilk_VAD /* I/O Pointer
to Silk VAD state */ |
275 ); | 302 ); |
276 | 303 |
277 /* Get speech activity level in Q8 */ | 304 /* Get speech activity level in Q8 */ |
278 opus_int silk_VAD_GetSA_Q8( /* O Return v
alue, 0 if success */ | 305 opus_int silk_VAD_GetSA_Q8_c( /* O Return v
alue, 0 if success */ |
279 silk_encoder_state *psEncC, /* I/O Encoder
state */ | 306 silk_encoder_state *psEncC, /* I/O Encoder
state */ |
280 const opus_int16 pIn[] /* I PCM inpu
t */ | 307 const opus_int16 pIn[] /* I PCM inpu
t */ |
281 ); | 308 ); |
282 | 309 |
| 310 #if !defined(OVERRIDE_silk_VAD_GetSA_Q8) |
| 311 #define silk_VAD_GetSA_Q8(psEnC, pIn, arch) ((void)(arch),silk_VAD_GetSA_Q8_c(ps
EnC, pIn)) |
| 312 #endif |
| 313 |
283 /* Low-pass filter with variable cutoff frequency based on */ | 314 /* Low-pass filter with variable cutoff frequency based on */ |
284 /* piece-wise linear interpolation between elliptic filters */ | 315 /* piece-wise linear interpolation between elliptic filters */ |
285 /* Start by setting transition_frame_no = 1; */ | 316 /* Start by setting transition_frame_no = 1; */ |
286 void silk_LP_variable_cutoff( | 317 void silk_LP_variable_cutoff( |
287 silk_LP_state *psLP, /* I/O LP filte
r state */ | 318 silk_LP_state *psLP, /* I/O LP filte
r state */ |
288 opus_int16 *frame, /* I/O Low-pass
filtered output signal */ | 319 opus_int16 *frame, /* I/O Low-pass
filtered output signal */ |
289 const opus_int frame_length /* I Frame le
ngth */ | 320 const opus_int frame_length /* I Frame le
ngth */ |
290 ); | 321 ); |
291 | 322 |
292 /******************/ | 323 /******************/ |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
366 | 397 |
367 /****************/ | 398 /****************/ |
368 /* Decode frame */ | 399 /* Decode frame */ |
369 /****************/ | 400 /****************/ |
370 opus_int silk_decode_frame( | 401 opus_int silk_decode_frame( |
371 silk_decoder_state *psDec, /* I/O Pointer
to Silk decoder state */ | 402 silk_decoder_state *psDec, /* I/O Pointer
to Silk decoder state */ |
372 ec_dec *psRangeDec, /* I/O Compress
or data structure */ | 403 ec_dec *psRangeDec, /* I/O Compress
or data structure */ |
373 opus_int16 pOut[], /* O Pointer
to output speech frame */ | 404 opus_int16 pOut[], /* O Pointer
to output speech frame */ |
374 opus_int32 *pN, /* O Pointer
to size of output frame */ | 405 opus_int32 *pN, /* O Pointer
to size of output frame */ |
375 opus_int lostFlag, /* I 0: no lo
ss, 1 loss, 2 decode fec */ | 406 opus_int lostFlag, /* I 0: no lo
ss, 1 loss, 2 decode fec */ |
376 opus_int condCoding /* I The type
of conditional coding to use */ | 407 opus_int condCoding, /* I The type
of conditional coding to use */ |
| 408 int arch /* I Run-time
architecture */ |
377 ); | 409 ); |
378 | 410 |
379 /* Decode indices from bitstream */ | 411 /* Decode indices from bitstream */ |
380 void silk_decode_indices( | 412 void silk_decode_indices( |
381 silk_decoder_state *psDec, /* I/O State
*/ | 413 silk_decoder_state *psDec, /* I/O State
*/ |
382 ec_dec *psRangeDec, /* I/O Compress
or data structure */ | 414 ec_dec *psRangeDec, /* I/O Compress
or data structure */ |
383 opus_int FrameIndex, /* I Frame nu
mber */ | 415 opus_int FrameIndex, /* I Frame nu
mber */ |
384 opus_int decode_LBRR, /* I Flag ind
icating LBRR data is being decoded */ | 416 opus_int decode_LBRR, /* I Flag ind
icating LBRR data is being decoded */ |
385 opus_int condCoding /* I The type
of conditional coding to use */ | 417 opus_int condCoding /* I The type
of conditional coding to use */ |
386 ); | 418 ); |
387 | 419 |
388 /* Decode parameters from payload */ | 420 /* Decode parameters from payload */ |
389 void silk_decode_parameters( | 421 void silk_decode_parameters( |
390 silk_decoder_state *psDec, /* I/O State
*/ | 422 silk_decoder_state *psDec, /* I/O State
*/ |
391 silk_decoder_control *psDecCtrl, /* I/O Decoder
control */ | 423 silk_decoder_control *psDecCtrl, /* I/O Decoder
control */ |
392 opus_int condCoding /* I The type
of conditional coding to use */ | 424 opus_int condCoding /* I The type
of conditional coding to use */ |
393 ); | 425 ); |
394 | 426 |
395 /* Core decoder. Performs inverse NSQ operation LTP + LPC */ | 427 /* Core decoder. Performs inverse NSQ operation LTP + LPC */ |
396 void silk_decode_core( | 428 void silk_decode_core( |
397 silk_decoder_state *psDec, /* I/O Decoder
state */ | 429 silk_decoder_state *psDec, /* I/O Decoder
state */ |
398 silk_decoder_control *psDecCtrl, /* I Decoder
control */ | 430 silk_decoder_control *psDecCtrl, /* I Decoder
control */ |
399 opus_int16 xq[], /* O Decoded
speech */ | 431 opus_int16 xq[], /* O Decoded
speech */ |
400 const opus_int pulses[ MAX_FRAME_LENGTH ] /* I Pulse si
gnal */ | 432 const opus_int16 pulses[ MAX_FRAME_LENGTH ], /* I Pulse si
gnal */ |
| 433 int arch /* I Run-time
architecture */ |
401 ); | 434 ); |
402 | 435 |
403 /* Decode quantization indices of excitation (Shell coding) */ | 436 /* Decode quantization indices of excitation (Shell coding) */ |
404 void silk_decode_pulses( | 437 void silk_decode_pulses( |
405 ec_dec *psRangeDec, /* I/O Compress
or data structure */ | 438 ec_dec *psRangeDec, /* I/O Compress
or data structure */ |
406 opus_int pulses[], /* O Excitati
on signal */ | 439 opus_int16 pulses[], /* O Excitati
on signal */ |
407 const opus_int signalType, /* I Sigtype
*/ | 440 const opus_int signalType, /* I Sigtype
*/ |
408 const opus_int quantOffsetType, /* I quantOff
setType */ | 441 const opus_int quantOffsetType, /* I quantOff
setType */ |
409 const opus_int frame_length /* I Frame le
ngth */ | 442 const opus_int frame_length /* I Frame le
ngth */ |
410 ); | 443 ); |
411 | 444 |
412 /******************/ | 445 /******************/ |
413 /* CNG */ | 446 /* CNG */ |
414 /******************/ | 447 /******************/ |
415 | 448 |
416 /* Reset CNG */ | 449 /* Reset CNG */ |
(...skipping 11 matching lines...) Expand all Loading... |
428 | 461 |
429 /* Encoding of various parameters */ | 462 /* Encoding of various parameters */ |
430 void silk_encode_indices( | 463 void silk_encode_indices( |
431 silk_encoder_state *psEncC, /* I/O Encoder
state */ | 464 silk_encoder_state *psEncC, /* I/O Encoder
state */ |
432 ec_enc *psRangeEnc, /* I/O Compress
or data structure */ | 465 ec_enc *psRangeEnc, /* I/O Compress
or data structure */ |
433 opus_int FrameIndex, /* I Frame nu
mber */ | 466 opus_int FrameIndex, /* I Frame nu
mber */ |
434 opus_int encode_LBRR, /* I Flag ind
icating LBRR data is being encoded */ | 467 opus_int encode_LBRR, /* I Flag ind
icating LBRR data is being encoded */ |
435 opus_int condCoding /* I The type
of conditional coding to use */ | 468 opus_int condCoding /* I The type
of conditional coding to use */ |
436 ); | 469 ); |
437 | 470 |
| 471 void silk_warped_LPC_analysis_filter_FIX_c( |
| 472 opus_int32 state[], /* I/O State [order
+ 1] */ |
| 473 opus_int32 res_Q2[], /* O Residual sig
nal [length] */ |
| 474 const opus_int16 coef_Q13[], /* I Coefficients
[order] */ |
| 475 const opus_int16 input[], /* I Input signal
[length] */ |
| 476 const opus_int16 lambda_Q16, /* I Warping fact
or */ |
| 477 const opus_int length, /* I Length of in
put signal */ |
| 478 const opus_int order /* I Filter order
(even) */ |
| 479 ); |
| 480 |
| 481 #if !defined(OVERRIDE_silk_warped_LPC_analysis_filter_FIX) |
| 482 #define silk_warped_LPC_analysis_filter_FIX(state, res_Q2, coef_Q13, input, lamb
da_Q16, length, order, arch) \ |
| 483 ((void)(arch),silk_warped_LPC_analysis_filter_FIX_c(state, res_Q2, coef_Q13,
input, lambda_Q16, length, order)) |
438 #endif | 484 #endif |
| 485 |
| 486 #if !defined(OPUS_X86_MAY_HAVE_SSE4_1) |
| 487 |
| 488 #endif |
| 489 |
| 490 #endif |
OLD | NEW |