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 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
227 CorrQ11[k] = (sum * tmpGain + round) >> shftVal; | 227 CorrQ11[k] = (sum * tmpGain + round) >> shftVal; |
228 } | 228 } |
229 sum = CorrQ11[0] << 7; | 229 sum = CorrQ11[0] << 7; |
230 for (n = 0; n < FRAMESAMPLES/8; n++) | 230 for (n = 0; n < FRAMESAMPLES/8; n++) |
231 CurveQ16[n] = sum; | 231 CurveQ16[n] = sum; |
232 | 232 |
233 for (k = 1; k < AR_ORDER; k += 2) { | 233 for (k = 1; k < AR_ORDER; k += 2) { |
234 for (n = 0; n < FRAMESAMPLES/8; n++) { | 234 for (n = 0; n < FRAMESAMPLES/8; n++) { |
235 const int64_t p = | 235 const int64_t p = |
236 (WebRtcIsacfix_kCos[k][n] * (int64_t)CorrQ11[k + 1] + 2) >> 2; | 236 (WebRtcIsacfix_kCos[k][n] * (int64_t)CorrQ11[k + 1] + 2) >> 2; |
237 RTC_DCHECK_EQ(p, (int32_t)p); // p fits in 32 bits | 237 CurveQ16[n] += WebRtcSpl_SatW64ToW32(p); |
238 CurveQ16[n] += (int32_t)p; | |
239 } | 238 } |
240 } | 239 } |
241 | 240 |
242 CS_ptrQ9 = WebRtcIsacfix_kCos[0]; | 241 CS_ptrQ9 = WebRtcIsacfix_kCos[0]; |
243 | 242 |
244 /* If CorrQ11[1] too large we avoid getting overflow in the calculation by shi
fting */ | 243 /* If CorrQ11[1] too large we avoid getting overflow in the calculation by shi
fting */ |
245 sh=WebRtcSpl_NormW32(CorrQ11[1]); | 244 sh=WebRtcSpl_NormW32(CorrQ11[1]); |
246 if (CorrQ11[1]==0) /* Use next correlation */ | 245 if (CorrQ11[1]==0) /* Use next correlation */ |
247 sh=WebRtcSpl_NormW32(CorrQ11[2]); | 246 sh=WebRtcSpl_NormW32(CorrQ11[2]); |
248 | 247 |
(...skipping 1787 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2036 | 2035 |
2037 index_gQQ[k] = pos2QQ + WebRtcIsacfix_kQuantMinGain[k]; //ATTN: ok? | 2036 index_gQQ[k] = pos2QQ + WebRtcIsacfix_kQuantMinGain[k]; //ATTN: ok? |
2038 if (index_gQQ[k] < 0) { | 2037 if (index_gQQ[k] < 0) { |
2039 index_gQQ[k] = 0; | 2038 index_gQQ[k] = 0; |
2040 } | 2039 } |
2041 else if (index_gQQ[k] > WebRtcIsacfix_kMaxIndGain[k]) { | 2040 else if (index_gQQ[k] > WebRtcIsacfix_kMaxIndGain[k]) { |
2042 index_gQQ[k] = WebRtcIsacfix_kMaxIndGain[k]; | 2041 index_gQQ[k] = WebRtcIsacfix_kMaxIndGain[k]; |
2043 } | 2042 } |
2044 } | 2043 } |
2045 } | 2044 } |
OLD | NEW |