OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 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 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 diffQ16[n] = (CS_ptrQ9[n] * (CorrQ11[1] >> shftVal) + 2) >> 2; | 155 diffQ16[n] = (CS_ptrQ9[n] * (CorrQ11[1] >> shftVal) + 2) >> 2; |
156 } | 156 } |
157 for (k = 2; k < AR_ORDER; k += 2) { | 157 for (k = 2; k < AR_ORDER; k += 2) { |
158 CS_ptrQ9 = WebRtcIsac_kCos[k]; | 158 CS_ptrQ9 = WebRtcIsac_kCos[k]; |
159 for (n = 0; n < FRAMESAMPLES / 8; n++) { | 159 for (n = 0; n < FRAMESAMPLES / 8; n++) { |
160 diffQ16[n] += (CS_ptrQ9[n] * (CorrQ11[k + 1] >> shftVal) + 2) >> 2; | 160 diffQ16[n] += (CS_ptrQ9[n] * (CorrQ11[k + 1] >> shftVal) + 2) >> 2; |
161 } | 161 } |
162 } | 162 } |
163 | 163 |
164 for (k = 0; k < FRAMESAMPLES / 8; k++) { | 164 for (k = 0; k < FRAMESAMPLES / 8; k++) { |
165 CurveQ16[FRAMESAMPLES_QUARTER - 1 - k] = CurveQ16[k] - | 165 int32_t diff_q16_shifted = (int32_t)((uint32_t)(diffQ16[k]) << shftVal); |
166 (diffQ16[k] << shftVal); | 166 CurveQ16[FRAMESAMPLES_QUARTER - 1 - k] = CurveQ16[k] - diff_q16_shifted; |
167 CurveQ16[k] += diffQ16[k] << shftVal; | 167 CurveQ16[k] += diff_q16_shifted; |
168 } | 168 } |
169 } | 169 } |
170 | 170 |
171 /* Generate array of dither samples in Q7. */ | 171 /* Generate array of dither samples in Q7. */ |
172 static void GenerateDitherQ7Lb(int16_t* bufQ7, uint32_t seed, | 172 static void GenerateDitherQ7Lb(int16_t* bufQ7, uint32_t seed, |
173 int length, int16_t AvgPitchGain_Q12) { | 173 int length, int16_t AvgPitchGain_Q12) { |
174 int k, shft; | 174 int k, shft; |
175 int16_t dither1_Q7, dither2_Q7, dither_gain_Q14; | 175 int16_t dither1_Q7, dither2_Q7, dither_gain_Q14; |
176 | 176 |
177 /* This threshold should be equal to that in decode_spec(). */ | 177 /* This threshold should be equal to that in decode_spec(). */ |
(...skipping 1879 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2057 /* Use the same CDF table as for bandwidth | 2057 /* Use the same CDF table as for bandwidth |
2058 * both take two values with equal probability. */ | 2058 * both take two values with equal probability. */ |
2059 if (WebRtcIsac_DecHistOneStepMulti(&intVar, streamData, | 2059 if (WebRtcIsac_DecHistOneStepMulti(&intVar, streamData, |
2060 kOneBitEqualProbCdf_ptr, | 2060 kOneBitEqualProbCdf_ptr, |
2061 kOneBitEqualProbInitIndex, 1) < 0) { | 2061 kOneBitEqualProbInitIndex, 1) < 0) { |
2062 return -ISAC_RANGE_ERROR_DECODE_BANDWITH; | 2062 return -ISAC_RANGE_ERROR_DECODE_BANDWITH; |
2063 } | 2063 } |
2064 *jitterInfo = (int16_t)(intVar); | 2064 *jitterInfo = (int16_t)(intVar); |
2065 return 0; | 2065 return 0; |
2066 } | 2066 } |
OLD | NEW |