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 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
272 for (i=0;i<HALF_SUBFRAMELEN;i++) | 272 for (i=0;i<HALF_SUBFRAMELEN;i++) |
273 { | 273 { |
274 | 274 |
275 tmp32 = lat_inQ25[i + temp1] << 1; // Q25->Q26 | 275 tmp32 = lat_inQ25[i + temp1] << 1; // Q25->Q26 |
276 tmp32 = WEBRTC_SPL_MUL_16_32_RSFT16(inv_gain16, tmp32); //lat_in[]*inv_gai
n in (Q(18-sh)*Q26)>>16 = Q(28-sh) | 276 tmp32 = WEBRTC_SPL_MUL_16_32_RSFT16(inv_gain16, tmp32); //lat_in[]*inv_gai
n in (Q(18-sh)*Q26)>>16 = Q(28-sh) |
277 tmp32 = WEBRTC_SPL_SHIFT_W32(tmp32, -(28-sh)); // lat_in[]*inv_gain in Q0 | 277 tmp32 = WEBRTC_SPL_SHIFT_W32(tmp32, -(28-sh)); // lat_in[]*inv_gain in Q0 |
278 | 278 |
279 ARfQ0vec[i] = (int16_t)WebRtcSpl_SatW32ToW16(tmp32); // Q0 | 279 ARfQ0vec[i] = (int16_t)WebRtcSpl_SatW32ToW16(tmp32); // Q0 |
280 } | 280 } |
281 | 281 |
282 for (i=orderCoef-1;i>=0;i--) //get the state of f&g for the first input, for
all orders | 282 for (i=orderCoef;i>0;i--) //get the state of f&g for the first input, for al
l orders |
283 { | 283 { |
284 tmp32 = (cthQ15[i] * ARfQ0vec[0] - sthQ15[i] * stateGQ0[i] + 16384) >> 15; | 284 tmp32 = (cthQ15[i - 1] * ARfQ0vec[0] - sthQ15[i - 1] * stateGQ0[i - 1] + |
| 285 16384) >> 15; |
285 tmpAR = (int16_t)WebRtcSpl_SatW32ToW16(tmp32); // Q0 | 286 tmpAR = (int16_t)WebRtcSpl_SatW32ToW16(tmp32); // Q0 |
286 | 287 |
287 tmp32 = (sthQ15[i] * ARfQ0vec[0] + cthQ15[i] * stateGQ0[i] + 16384) >> 15; | 288 tmp32 = (sthQ15[i - 1] * ARfQ0vec[0] + cthQ15[i - 1] * stateGQ0[i - 1] + |
288 ARgQ0vec[i+1] = (int16_t)WebRtcSpl_SatW32ToW16(tmp32); // Q0 | 289 16384) >> 15; |
| 290 ARgQ0vec[i] = (int16_t)WebRtcSpl_SatW32ToW16(tmp32); // Q0 |
289 ARfQ0vec[0] = tmpAR; | 291 ARfQ0vec[0] = tmpAR; |
290 } | 292 } |
291 ARgQ0vec[0] = ARfQ0vec[0]; | 293 ARgQ0vec[0] = ARfQ0vec[0]; |
292 | 294 |
293 // Filter ARgQ0vec[] and ARfQ0vec[] through coefficients cthQ15[] and sthQ15
[]. | 295 // Filter ARgQ0vec[] and ARfQ0vec[] through coefficients cthQ15[] and sthQ15
[]. |
294 WebRtcIsacfix_FilterArLoop(ARgQ0vec, ARfQ0vec, cthQ15, sthQ15, orderCoef); | 296 WebRtcIsacfix_FilterArLoop(ARgQ0vec, ARfQ0vec, cthQ15, sthQ15, orderCoef); |
295 | 297 |
296 for(n=0;n<HALF_SUBFRAMELEN;n++) | 298 for(n=0;n<HALF_SUBFRAMELEN;n++) |
297 { | 299 { |
298 lat_outQ0[n + temp1] = ARfQ0vec[n]; | 300 lat_outQ0[n + temp1] = ARfQ0vec[n]; |
299 } | 301 } |
300 | 302 |
301 | 303 |
302 /* cannot use memcpy in the following */ | 304 /* cannot use memcpy in the following */ |
303 | 305 |
304 for (i=0;i<ord_1;i++) | 306 for (i=0;i<ord_1;i++) |
305 { | 307 { |
306 stateGQ0[i] = ARgQ0vec[i]; | 308 stateGQ0[i] = ARgQ0vec[i]; |
307 } | 309 } |
308 } | 310 } |
309 | 311 |
310 return; | 312 return; |
311 } | 313 } |
OLD | NEW |