OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2013 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 15 matching lines...) Expand all Loading... |
26 void WebRtcNsx_SpeechNoiseProb(NoiseSuppressionFixedC* inst, | 26 void WebRtcNsx_SpeechNoiseProb(NoiseSuppressionFixedC* inst, |
27 uint16_t* nonSpeechProbFinal, | 27 uint16_t* nonSpeechProbFinal, |
28 uint32_t* priorLocSnr, | 28 uint32_t* priorLocSnr, |
29 uint32_t* postLocSnr) { | 29 uint32_t* postLocSnr) { |
30 uint32_t zeros, num, den, tmpU32no1, tmpU32no2, tmpU32no3; | 30 uint32_t zeros, num, den, tmpU32no1, tmpU32no2, tmpU32no3; |
31 int32_t invLrtFX, indPriorFX, tmp32, tmp32no1, tmp32no2, besselTmpFX32; | 31 int32_t invLrtFX, indPriorFX, tmp32, tmp32no1, tmp32no2, besselTmpFX32; |
32 int32_t frac32, logTmp; | 32 int32_t frac32, logTmp; |
33 int32_t logLrtTimeAvgKsumFX; | 33 int32_t logLrtTimeAvgKsumFX; |
34 int16_t indPriorFX16; | 34 int16_t indPriorFX16; |
35 int16_t tmp16, tmp16no1, tmp16no2, tmpIndFX, tableIndex, frac, intPart; | 35 int16_t tmp16, tmp16no1, tmp16no2, tmpIndFX, tableIndex, frac, intPart; |
36 int i, normTmp, normTmp2, nShifts; | 36 size_t i; |
| 37 int normTmp, normTmp2, nShifts; |
37 | 38 |
38 // compute feature based on average LR factor | 39 // compute feature based on average LR factor |
39 // this is the average over all frequencies of the smooth log LRT | 40 // this is the average over all frequencies of the smooth log LRT |
40 logLrtTimeAvgKsumFX = 0; | 41 logLrtTimeAvgKsumFX = 0; |
41 for (i = 0; i < inst->magnLen; i++) { | 42 for (i = 0; i < inst->magnLen; i++) { |
42 besselTmpFX32 = (int32_t)postLocSnr[i]; // Q11 | 43 besselTmpFX32 = (int32_t)postLocSnr[i]; // Q11 |
43 normTmp = WebRtcSpl_NormU32(postLocSnr[i]); | 44 normTmp = WebRtcSpl_NormU32(postLocSnr[i]); |
44 num = postLocSnr[i] << normTmp; // Q(11+normTmp) | 45 num = postLocSnr[i] << normTmp; // Q(11+normTmp) |
45 if (normTmp > 10) { | 46 if (normTmp > 10) { |
46 den = priorLocSnr[i] << (normTmp - 11); // Q(normTmp) | 47 den = priorLocSnr[i] << (normTmp - 11); // Q(normTmp) |
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
251 tmp32no1 = (int32_t)inst->priorNonSpeechProb << 8; // Q22 | 252 tmp32no1 = (int32_t)inst->priorNonSpeechProb << 8; // Q22 |
252 | 253 |
253 nonSpeechProbFinal[i] = tmp32no1 / | 254 nonSpeechProbFinal[i] = tmp32no1 / |
254 (inst->priorNonSpeechProb + invLrtFX); // Q8 | 255 (inst->priorNonSpeechProb + invLrtFX); // Q8 |
255 } | 256 } |
256 } | 257 } |
257 } | 258 } |
258 } | 259 } |
259 } | 260 } |
260 | 261 |
OLD | NEW |