| 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 23 matching lines...) Expand all Loading... |
| 34 // Prediction gain Alpha in high precision and with scale factor | 34 // Prediction gain Alpha in high precision and with scale factor |
| 35 int16_t Alpha_hi, Alpha_low, Alpha_exp; | 35 int16_t Alpha_hi, Alpha_low, Alpha_exp; |
| 36 int16_t tmp_hi, tmp_low; | 36 int16_t tmp_hi, tmp_low; |
| 37 int32_t temp1W32, temp2W32, temp3W32; | 37 int32_t temp1W32, temp2W32, temp3W32; |
| 38 int16_t norm; | 38 int16_t norm; |
| 39 | 39 |
| 40 // Normalize the autocorrelation R[0]...R[order+1] | 40 // Normalize the autocorrelation R[0]...R[order+1] |
| 41 | 41 |
| 42 norm = WebRtcSpl_NormW32(R[0]); | 42 norm = WebRtcSpl_NormW32(R[0]); |
| 43 | 43 |
| 44 for (i = order; i >= 0; i--) | 44 for (i = 0; i <= order; ++i) |
| 45 { | 45 { |
| 46 temp1W32 = WEBRTC_SPL_LSHIFT_W32(R[i], norm); | 46 temp1W32 = WEBRTC_SPL_LSHIFT_W32(R[i], norm); |
| 47 // Put R in hi and low format | 47 // Put R in hi and low format |
| 48 R_hi[i] = (int16_t)(temp1W32 >> 16); | 48 R_hi[i] = (int16_t)(temp1W32 >> 16); |
| 49 R_low[i] = (int16_t)((temp1W32 - ((int32_t)R_hi[i] << 16)) >> 1); | 49 R_low[i] = (int16_t)((temp1W32 - ((int32_t)R_hi[i] << 16)) >> 1); |
| 50 } | 50 } |
| 51 | 51 |
| 52 // K = A[1] = -R[1] / R[0] | 52 // K = A[1] = -R[1] / R[0] |
| 53 | 53 |
| 54 temp2W32 = WEBRTC_SPL_LSHIFT_W32((int32_t)R_hi[1],16) | 54 temp2W32 = WEBRTC_SPL_LSHIFT_W32((int32_t)R_hi[1],16) |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 237 for (i = 1; i <= order; i++) | 237 for (i = 1; i <= order; i++) |
| 238 { | 238 { |
| 239 // temp1W32 in Q27 | 239 // temp1W32 in Q27 |
| 240 temp1W32 = WEBRTC_SPL_LSHIFT_W32((int32_t)A_hi[i], 16) | 240 temp1W32 = WEBRTC_SPL_LSHIFT_W32((int32_t)A_hi[i], 16) |
| 241 + WEBRTC_SPL_LSHIFT_W32((int32_t)A_low[i], 1); | 241 + WEBRTC_SPL_LSHIFT_W32((int32_t)A_low[i], 1); |
| 242 // Round and store upper word | 242 // Round and store upper word |
| 243 A[i] = (int16_t)(((temp1W32 << 1) + 32768) >> 16); | 243 A[i] = (int16_t)(((temp1W32 << 1) + 32768) >> 16); |
| 244 } | 244 } |
| 245 return 1; // Stable filters | 245 return 1; // Stable filters |
| 246 } | 246 } |
| OLD | NEW |