| 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 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 corrdim=searchSegEndPos-searchSegStartPos+1; | 68 corrdim=searchSegEndPos-searchSegStartPos+1; |
| 69 | 69 |
| 70 /* compute upsampled correlation and find | 70 /* compute upsampled correlation and find |
| 71 location of max */ | 71 location of max */ |
| 72 | 72 |
| 73 WebRtcIlbcfix_MyCorr(corrVecTemp,idata+searchSegStartPos, | 73 WebRtcIlbcfix_MyCorr(corrVecTemp,idata+searchSegStartPos, |
| 74 (int16_t)(corrdim+ENH_BLOCKL-1),idata+centerStartPos,ENH_
BLOCKL); | 74 (int16_t)(corrdim+ENH_BLOCKL-1),idata+centerStartPos,ENH_
BLOCKL); |
| 75 | 75 |
| 76 /* Calculate the rescaling factor for the correlation in order to | 76 /* Calculate the rescaling factor for the correlation in order to |
| 77 put the correlation in a int16_t vector instead */ | 77 put the correlation in a int16_t vector instead */ |
| 78 maxtemp=WebRtcSpl_MaxAbsValueW32(corrVecTemp, (int16_t)corrdim); | 78 maxtemp=WebRtcSpl_MaxAbsValueW32(corrVecTemp, corrdim); |
| 79 | 79 |
| 80 scalefact=WebRtcSpl_GetSizeInBits(maxtemp)-15; | 80 scalefact=WebRtcSpl_GetSizeInBits(maxtemp)-15; |
| 81 | 81 |
| 82 if (scalefact>0) { | 82 if (scalefact>0) { |
| 83 for (i=0;i<corrdim;i++) { | 83 for (i=0;i<corrdim;i++) { |
| 84 corrVec[i] = (int16_t)(corrVecTemp[i] >> scalefact); | 84 corrVec[i] = (int16_t)(corrVecTemp[i] >> scalefact); |
| 85 } | 85 } |
| 86 } else { | 86 } else { |
| 87 for (i=0;i<corrdim;i++) { | 87 for (i=0;i<corrdim;i++) { |
| 88 corrVec[i]=(int16_t)corrVecTemp[i]; | 88 corrVec[i]=(int16_t)corrVecTemp[i]; |
| 89 } | 89 } |
| 90 } | 90 } |
| 91 /* In order to guarantee that all values are initialized */ | 91 /* In order to guarantee that all values are initialized */ |
| 92 for (i=corrdim;i<ENH_CORRDIM;i++) { | 92 for (i=corrdim;i<ENH_CORRDIM;i++) { |
| 93 corrVec[i]=0; | 93 corrVec[i]=0; |
| 94 } | 94 } |
| 95 | 95 |
| 96 /* Upsample the correlation */ | 96 /* Upsample the correlation */ |
| 97 WebRtcIlbcfix_EnhUpsample(corrVecUps,corrVec); | 97 WebRtcIlbcfix_EnhUpsample(corrVecUps,corrVec); |
| 98 | 98 |
| 99 /* Find maximum */ | 99 /* Find maximum */ |
| 100 tloc=WebRtcSpl_MaxIndexW32(corrVecUps, (int16_t) (ENH_UPS0*corrdim)); | 100 tloc=WebRtcSpl_MaxIndexW32(corrVecUps, ENH_UPS0 * corrdim); |
| 101 | 101 |
| 102 /* make vector can be upsampled without ever running outside | 102 /* make vector can be upsampled without ever running outside |
| 103 bounds */ | 103 bounds */ |
| 104 *updStartPos = (int16_t)(searchSegStartPos * 4) + tloc + 4; | 104 *updStartPos = (int16_t)(searchSegStartPos * 4) + tloc + 4; |
| 105 | 105 |
| 106 tloc2 = (tloc + 3) >> 2; | 106 tloc2 = (tloc + 3) >> 2; |
| 107 | 107 |
| 108 st=searchSegStartPos+tloc2-ENH_FL0; | 108 st=searchSegStartPos+tloc2-ENH_FL0; |
| 109 | 109 |
| 110 /* initialize the vector to be filtered, stuff with zeros | 110 /* initialize the vector to be filtered, stuff with zeros |
| (...skipping 30 matching lines...) Expand all Loading... |
| 141 &vect[6], vect, filt, | 141 &vect[6], vect, filt, |
| 142 ENH_FLO_MULT2_PLUS1, ENH_BLOCKL); | 142 ENH_FLO_MULT2_PLUS1, ENH_BLOCKL); |
| 143 | 143 |
| 144 /* Add the contribution from this vector (scaled with gain) to the total surro
und vector */ | 144 /* Add the contribution from this vector (scaled with gain) to the total surro
und vector */ |
| 145 WebRtcSpl_AddAffineVectorToVector( | 145 WebRtcSpl_AddAffineVectorToVector( |
| 146 surround, vect, gain, | 146 surround, vect, gain, |
| 147 (int32_t)32768, 16, ENH_BLOCKL); | 147 (int32_t)32768, 16, ENH_BLOCKL); |
| 148 | 148 |
| 149 return; | 149 return; |
| 150 } | 150 } |
| OLD | NEW |