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 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 | 140 |
141 /* Second section, filtered half of the cb */ | 141 /* Second section, filtered half of the cb */ |
142 WebRtcIlbcfix_InterpolateSamples(interpSamplesFilt, cbvectors, lMem); | 142 WebRtcIlbcfix_InterpolateSamples(interpSamplesFilt, cbvectors, lMem); |
143 | 143 |
144 /* Compute the CB vectors' energies for the first cb section (non-filtered)
*/ | 144 /* Compute the CB vectors' energies for the first cb section (non-filtered)
*/ |
145 WebRtcIlbcfix_CbMemEnergyAugmentation(interpSamples, buf, | 145 WebRtcIlbcfix_CbMemEnergyAugmentation(interpSamples, buf, |
146 scale, 20, energyW16, energyShifts); | 146 scale, 20, energyW16, energyShifts); |
147 | 147 |
148 /* Compute the CB vectors' energies for the second cb section (filtered cb)
*/ | 148 /* Compute the CB vectors' energies for the second cb section (filtered cb)
*/ |
149 WebRtcIlbcfix_CbMemEnergyAugmentation(interpSamplesFilt, cbvectors, | 149 WebRtcIlbcfix_CbMemEnergyAugmentation(interpSamplesFilt, cbvectors, |
150 scale, (int16_t)(base_size+20), energy
W16, energyShifts); | 150 scale, (int16_t)(base_size + 20), |
| 151 energyW16, energyShifts); |
151 | 152 |
152 /* Compute the CB vectors' energies and store them in the vector | 153 /* Compute the CB vectors' energies and store them in the vector |
153 * energyW16. Also the corresponding shift values are stored. The | 154 * energyW16. Also the corresponding shift values are stored. The |
154 * energy values are used in all three stages. */ | 155 * energy values are used in all three stages. */ |
155 WebRtcIlbcfix_CbMemEnergy(range, buf, cbvectors, lMem, | 156 WebRtcIlbcfix_CbMemEnergy(range, buf, cbvectors, lMem, |
156 lTarget, energyW16+20, energyShifts+20, scale, bas
e_size); | 157 lTarget, energyW16+20, energyShifts+20, scale, bas
e_size); |
157 | 158 |
158 } else { | 159 } else { |
159 /* Compute the CB vectors' energies and store them in the vector | 160 /* Compute the CB vectors' energies and store them in the vector |
160 * energyW16. Also the corresponding shift values are stored. The | 161 * energyW16. Also the corresponding shift values are stored. The |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
231 if (eInd>=range) { | 232 if (eInd>=range) { |
232 eInd=range-1; | 233 eInd=range-1; |
233 sInd=eInd-CB_RESRANGE; | 234 sInd=eInd-CB_RESRANGE; |
234 } | 235 } |
235 | 236 |
236 range = WebRtcIlbcfix_kSearchRange[block][stage]; | 237 range = WebRtcIlbcfix_kSearchRange[block][stage]; |
237 | 238 |
238 if (lTarget==SUBL) { | 239 if (lTarget==SUBL) { |
239 i=sInd; | 240 i=sInd; |
240 if (sInd<20) { | 241 if (sInd<20) { |
241 WebRtcIlbcfix_AugmentedCbCorr(target, cbvectors+lMem, | 242 WebRtcIlbcfix_AugmentedCbCorr(target, cbvectors + lMem, |
242 interpSamplesFilt, cDot, | 243 interpSamplesFilt, cDot, |
243 (int16_t)(sInd+20), (int16_t)(WEBRTC_SPL_M
IN(39, (eInd+20))), scale); | 244 (int16_t)(sInd + 20), |
| 245 (int16_t)(WEBRTC_SPL_MIN(39, |
| 246 (eInd + 20))), |
| 247 scale); |
244 i=20; | 248 i=20; |
245 cDotPtr = &cDot[20 - sInd]; | 249 cDotPtr = &cDot[20 - sInd]; |
246 } else { | 250 } else { |
247 cDotPtr = cDot; | 251 cDotPtr = cDot; |
248 } | 252 } |
249 | 253 |
250 cb_vecPtr = cbvectors+lMem-20-i; | 254 cb_vecPtr = cbvectors+lMem-20-i; |
251 | 255 |
252 /* Calculate the cross correlations (main part of the filtered CB) */ | 256 /* Calculate the cross correlations (main part of the filtered CB) */ |
253 WebRtcSpl_CrossCorrelation(cDotPtr, target, cb_vecPtr, lTarget, (int16_t)(
eInd-i+1), scale, -1); | 257 WebRtcSpl_CrossCorrelation(cDotPtr, target, cb_vecPtr, lTarget, |
| 258 (int16_t)(eInd - i + 1), scale, -1); |
254 | 259 |
255 } else { | 260 } else { |
256 cDotPtr = cDot; | 261 cDotPtr = cDot; |
257 cb_vecPtr = cbvectors+lMem-lTarget-sInd; | 262 cb_vecPtr = cbvectors+lMem-lTarget-sInd; |
258 | 263 |
259 /* Calculate the cross correlations (main part of the filtered CB) */ | 264 /* Calculate the cross correlations (main part of the filtered CB) */ |
260 WebRtcSpl_CrossCorrelation(cDotPtr, target, cb_vecPtr, lTarget, (int16_t)(
eInd-sInd+1), scale, -1); | 265 WebRtcSpl_CrossCorrelation(cDotPtr, target, cb_vecPtr, lTarget, |
| 266 (int16_t)(eInd - sInd + 1), scale, -1); |
261 | 267 |
262 } | 268 } |
263 | 269 |
264 /* Adjust the search range for the augmented vectors */ | 270 /* Adjust the search range for the augmented vectors */ |
265 indexOffset=base_size+sInd; | 271 indexOffset=base_size+sInd; |
266 | 272 |
267 /* Search for best index in this part of the vector */ | 273 /* Search for best index in this part of the vector */ |
268 WebRtcIlbcfix_CbSearchCore( | 274 WebRtcIlbcfix_CbSearchCore( |
269 cDot, (int16_t)(eInd-sInd+1), stage, inverseEnergy+indexOffset, | 275 cDot, (int16_t)(eInd-sInd+1), stage, inverseEnergy+indexOffset, |
270 inverseEnergyShifts+indexOffset, Crit, | 276 inverseEnergyShifts+indexOffset, Crit, |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
387 j=i; | 393 j=i; |
388 WebRtcIlbcfix_kGainSq5_ptr = (int16_t*)&WebRtcIlbcfix_kGainSq5[i]; | 394 WebRtcIlbcfix_kGainSq5_ptr = (int16_t*)&WebRtcIlbcfix_kGainSq5[i]; |
389 } | 395 } |
390 } | 396 } |
391 gainPtr++; | 397 gainPtr++; |
392 } | 398 } |
393 gain_index[0]=j; | 399 gain_index[0]=j; |
394 | 400 |
395 return; | 401 return; |
396 } | 402 } |
OLD | NEW |