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 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 void silk_find_LTP_FIX( | 159 void silk_find_LTP_FIX( |
160 opus_int16 b_Q14[ MAX_NB_SUBFR * LTP_ORDER ], /* O
LTP coefs
*/ | 160 opus_int16 b_Q14[ MAX_NB_SUBFR * LTP_ORDER ], /* O
LTP coefs
*/ |
161 opus_int32 WLTP[ MAX_NB_SUBFR * LTP_ORDER * LTP_ORDER ]
, /* O Weight for LTP quantization
*/ | 161 opus_int32 WLTP[ MAX_NB_SUBFR * LTP_ORDER * LTP_ORDER ]
, /* O Weight for LTP quantization
*/ |
162 opus_int *LTPredCodGain_Q7, /* O
LTP coding gain
*/ | 162 opus_int *LTPredCodGain_Q7, /* O
LTP coding gain
*/ |
163 const opus_int16 r_lpc[], /* I
residual signal after LPC signal + state for first 10 ms
*/ | 163 const opus_int16 r_lpc[], /* I
residual signal after LPC signal + state for first 10 ms
*/ |
164 const opus_int lag[ MAX_NB_SUBFR ], /* I
LTP lags
*/ | 164 const opus_int lag[ MAX_NB_SUBFR ], /* I
LTP lags
*/ |
165 const opus_int32 Wght_Q15[ MAX_NB_SUBFR ], /* I
weights
*/ | 165 const opus_int32 Wght_Q15[ MAX_NB_SUBFR ], /* I
weights
*/ |
166 const opus_int subfr_length, /* I
subframe length
*/ | 166 const opus_int subfr_length, /* I
subframe length
*/ |
167 const opus_int nb_subfr, /* I
number of subframes
*/ | 167 const opus_int nb_subfr, /* I
number of subframes
*/ |
168 const opus_int mem_offset, /* I
number of samples in LTP memory
*/ | 168 const opus_int mem_offset, /* I
number of samples in LTP memory
*/ |
169 opus_int corr_rshifts[ MAX_NB_SUBFR ] /* O
right shifts applied to correlations
*/ | 169 opus_int corr_rshifts[ MAX_NB_SUBFR ], /* O
right shifts applied to correlations
*/ |
| 170 int arch /* I
Run-time architecture
*/ |
170 ); | 171 ); |
171 | 172 |
172 void silk_LTP_analysis_filter_FIX( | 173 void silk_LTP_analysis_filter_FIX( |
173 opus_int16 *LTP_res, /* O
LTP residual signal of length MAX_NB_SUBFR * ( pre_length + subfr_length )
*/ | 174 opus_int16 *LTP_res, /* O
LTP residual signal of length MAX_NB_SUBFR * ( pre_length + subfr_length )
*/ |
174 const opus_int16 *x, /* I
Pointer to input signal with at least max( pitchL ) preceding samples
*/ | 175 const opus_int16 *x, /* I
Pointer to input signal with at least max( pitchL ) preceding samples
*/ |
175 const opus_int16 LTPCoef_Q14[ LTP_ORDER * MAX_NB_SUBFR ],/* I
LTP_ORDER LTP coefficients for each MAX_NB_SUBFR subframe
*/ | 176 const opus_int16 LTPCoef_Q14[ LTP_ORDER * MAX_NB_SUBFR ],/* I
LTP_ORDER LTP coefficients for each MAX_NB_SUBFR subframe
*/ |
176 const opus_int pitchL[ MAX_NB_SUBFR ], /* I
Pitch lag, one for each subframe
*/ | 177 const opus_int pitchL[ MAX_NB_SUBFR ], /* I
Pitch lag, one for each subframe
*/ |
177 const opus_int32 invGains_Q16[ MAX_NB_SUBFR ], /* I
Inverse quantization gains, one for each subframe
*/ | 178 const opus_int32 invGains_Q16[ MAX_NB_SUBFR ], /* I
Inverse quantization gains, one for each subframe
*/ |
178 const opus_int subfr_length, /* I
Length of each subframe
*/ | 179 const opus_int subfr_length, /* I
Length of each subframe
*/ |
179 const opus_int nb_subfr, /* I
Number of subframes
*/ | 180 const opus_int nb_subfr, /* I
Number of subframes
*/ |
180 const opus_int pre_length /* I
Length of the preceding samples starting at &x[0] for each subframe
*/ | 181 const opus_int pre_length /* I
Length of the preceding samples starting at &x[0] for each subframe
*/ |
181 ); | 182 ); |
182 | 183 |
183 /* Calculates residual energies of input subframes where all subframes have LPC_
order */ | 184 /* Calculates residual energies of input subframes where all subframes have LPC_
order */ |
184 /* of preceding samples
*/ | 185 /* of preceding samples
*/ |
185 void silk_residual_energy_FIX( | 186 void silk_residual_energy_FIX( |
186 opus_int32 nrgs[ MAX_NB_SUBFR ], /* O
Residual energy per subframe
*/ | 187 opus_int32 nrgs[ MAX_NB_SUBFR ], /* O
Residual energy per subframe
*/ |
187 opus_int nrgsQ[ MAX_NB_SUBFR ], /* O
Q value per subframe
*/ | 188 opus_int nrgsQ[ MAX_NB_SUBFR ], /* O
Q value per subframe
*/ |
188 const opus_int16 x[], /* I
Input signal
*/ | 189 const opus_int16 x[], /* I
Input signal
*/ |
189 opus_int16 a_Q12[ 2 ][ MAX_LPC_ORDER ], /* I
AR coefs for each frame half
*/ | 190 opus_int16 a_Q12[ 2 ][ MAX_LPC_ORDER ], /* I
AR coefs for each frame half
*/ |
190 const opus_int32 gains[ MAX_NB_SUBFR ], /* I
Quantization gains
*/ | 191 const opus_int32 gains[ MAX_NB_SUBFR ], /* I
Quantization gains
*/ |
191 const opus_int subfr_length, /* I
Subframe length
*/ | 192 const opus_int subfr_length, /* I
Subframe length
*/ |
192 const opus_int nb_subfr, /* I
Number of subframes
*/ | 193 const opus_int nb_subfr, /* I
Number of subframes
*/ |
193 const opus_int LPC_order /* I
LPC order
*/ | 194 const opus_int LPC_order, /* I
LPC order
*/ |
| 195 int arch /* I
Run-time architecture
*/ |
194 ); | 196 ); |
195 | 197 |
196 /* Residual energy: nrg = wxx - 2 * wXx * c + c' * wXX * c */ | 198 /* Residual energy: nrg = wxx - 2 * wXx * c + c' * wXX * c */ |
197 opus_int32 silk_residual_energy16_covar_FIX( | 199 opus_int32 silk_residual_energy16_covar_FIX( |
198 const opus_int16 *c, /* I
Prediction vector
*/ | 200 const opus_int16 *c, /* I
Prediction vector
*/ |
199 const opus_int32 *wXX, /* I
Correlation matrix
*/ | 201 const opus_int32 *wXX, /* I
Correlation matrix
*/ |
200 const opus_int32 *wXx, /* I
Correlation vector
*/ | 202 const opus_int32 *wXx, /* I
Correlation vector
*/ |
201 opus_int32 wxx, /* I
Signal energy
*/ | 203 opus_int32 wxx, /* I
Signal energy
*/ |
202 opus_int D, /* I
Dimension
*/ | 204 opus_int D, /* I
Dimension
*/ |
203 opus_int cQ /* I
Q value for c vector 0 - 15
*/ | 205 opus_int cQ /* I
Q value for c vector 0 - 15
*/ |
204 ); | 206 ); |
205 | 207 |
206 /* Processing of gains */ | 208 /* Processing of gains */ |
207 void silk_process_gains_FIX( | 209 void silk_process_gains_FIX( |
208 silk_encoder_state_FIX *psEnc, /* I
/O Encoder state
*/ | 210 silk_encoder_state_FIX *psEnc, /* I
/O Encoder state
*/ |
209 silk_encoder_control_FIX *psEncCtrl, /* I
/O Encoder control
*/ | 211 silk_encoder_control_FIX *psEncCtrl, /* I
/O Encoder control
*/ |
210 opus_int condCoding /* I
The type of conditional coding to use
*/ | 212 opus_int condCoding /* I
The type of conditional coding to use
*/ |
211 ); | 213 ); |
212 | 214 |
213 /******************/ | 215 /******************/ |
214 /* Linear Algebra */ | 216 /* Linear Algebra */ |
215 /******************/ | 217 /******************/ |
216 /* Calculates correlation matrix X'*X */ | 218 /* Calculates correlation matrix X'*X */ |
217 void silk_corrMatrix_FIX( | 219 void silk_corrMatrix_FIX( |
218 const opus_int16 *x, /* I
x vector [L + order - 1] used to form data matrix X
*/ | 220 const opus_int16 *x, /* I
x vector [L + order - 1] used to form data matrix X
*/ |
219 const opus_int L, /* I
Length of vectors
*/ | 221 const opus_int L, /* I
Length of vectors
*/ |
220 const opus_int order, /* I
Max lag for correlation
*/ | 222 const opus_int order, /* I
Max lag for correlation
*/ |
221 const opus_int head_room, /* I
Desired headroom
*/ | 223 const opus_int head_room, /* I
Desired headroom
*/ |
222 opus_int32 *XX, /* O
Pointer to X'*X correlation matrix [ order x order ]
*/ | 224 opus_int32 *XX, /* O
Pointer to X'*X correlation matrix [ order x order ]
*/ |
223 opus_int *rshifts /* I
/O Right shifts of correlations
*/ | 225 opus_int *rshifts, /* I
/O Right shifts of correlations
*/ |
| 226 int arch /* I
Run-time architecture
*/ |
224 ); | 227 ); |
225 | 228 |
226 /* Calculates correlation vector X'*t */ | 229 /* Calculates correlation vector X'*t */ |
227 void silk_corrVector_FIX( | 230 void silk_corrVector_FIX( |
228 const opus_int16 *x, /* I
x vector [L + order - 1] used to form data matrix X
*/ | 231 const opus_int16 *x, /* I
x vector [L + order - 1] used to form data matrix X
*/ |
229 const opus_int16 *t, /* I
Target vector [L]
*/ | 232 const opus_int16 *t, /* I
Target vector [L]
*/ |
230 const opus_int L, /* I
Length of vectors
*/ | 233 const opus_int L, /* I
Length of vectors
*/ |
231 const opus_int order, /* I
Max lag for correlation
*/ | 234 const opus_int order, /* I
Max lag for correlation
*/ |
232 opus_int32 *Xt, /* O
Pointer to X'*t correlation vector [order]
*/ | 235 opus_int32 *Xt, /* O
Pointer to X'*t correlation vector [order]
*/ |
233 const opus_int rshifts /* I
Right shifts of correlations
*/ | 236 const opus_int rshifts, /* I
Right shifts of correlations
*/ |
| 237 int arch /* I
Run-time architecture
*/ |
234 ); | 238 ); |
235 | 239 |
236 /* Add noise to matrix diagonal */ | 240 /* Add noise to matrix diagonal */ |
237 void silk_regularize_correlations_FIX( | 241 void silk_regularize_correlations_FIX( |
238 opus_int32 *XX, /* I
/O Correlation matrices
*/ | 242 opus_int32 *XX, /* I
/O Correlation matrices
*/ |
239 opus_int32 *xx, /* I
/O Correlation values
*/ | 243 opus_int32 *xx, /* I
/O Correlation values
*/ |
240 opus_int32 noise, /* I
Noise to add
*/ | 244 opus_int32 noise, /* I
Noise to add
*/ |
241 opus_int D /* I
Dimension of XX
*/ | 245 opus_int D /* I
Dimension of XX
*/ |
242 ); | 246 ); |
243 | 247 |
244 /* Solves Ax = b, assuming A is symmetric */ | 248 /* Solves Ax = b, assuming A is symmetric */ |
245 void silk_solve_LDL_FIX( | 249 void silk_solve_LDL_FIX( |
246 opus_int32 *A, /* I
Pointer to symetric square matrix A
*/ | 250 opus_int32 *A, /* I
Pointer to symetric square matrix A
*/ |
247 opus_int M, /* I
Size of matrix
*/ | 251 opus_int M, /* I
Size of matrix
*/ |
248 const opus_int32 *b, /* I
Pointer to b vector
*/ | 252 const opus_int32 *b, /* I
Pointer to b vector
*/ |
249 opus_int32 *x_Q16 /* O
Pointer to x solution vector
*/ | 253 opus_int32 *x_Q16 /* O
Pointer to x solution vector
*/ |
250 ); | 254 ); |
251 | 255 |
252 #ifndef FORCE_CPP_BUILD | 256 #ifndef FORCE_CPP_BUILD |
253 #ifdef __cplusplus | 257 #ifdef __cplusplus |
254 } | 258 } |
255 #endif /* __cplusplus */ | 259 #endif /* __cplusplus */ |
256 #endif /* FORCE_CPP_BUILD */ | 260 #endif /* FORCE_CPP_BUILD */ |
257 #endif /* SILK_MAIN_FIX_H */ | 261 #endif /* SILK_MAIN_FIX_H */ |
OLD | NEW |