Index: webrtc/modules/audio_processing/ns/nsx_core_mips.c |
diff --git a/webrtc/modules/audio_processing/ns/nsx_core_mips.c b/webrtc/modules/audio_processing/ns/nsx_core_mips.c |
index 7688d82d78df9e0f29e36354be92bef5b01b0ab4..0aa60a23510ce5d06aaf905d6325e768ad82f44a 100644 |
--- a/webrtc/modules/audio_processing/ns/nsx_core_mips.c |
+++ b/webrtc/modules/audio_processing/ns/nsx_core_mips.c |
@@ -131,8 +131,8 @@ void WebRtcNsx_SpeechNoiseProb(NoiseSuppressionFixedC* inst, |
} |
tmp32no1 = WEBRTC_SPL_SHIFT_W32(tmp32no1, nShifts); // Q14 |
// compute indicator function: sigmoid map |
- tableIndex = (int16_t)(tmp32no1 >> 14); |
- if ((tableIndex < 16) && (tableIndex >= 0)) { |
+ if (tmp32no1 < (16<<14) && tmp32no1 >= 0) { |
+ tableIndex = (int16_t)(tmp32no1 >> 14); |
tmp16no2 = kIndicatorTable[tableIndex]; |
tmp16no1 = kIndicatorTable[tableIndex + 1] - kIndicatorTable[tableIndex]; |
frac = (int16_t)(tmp32no1 & 0x00003fff); // Q14 |
@@ -163,8 +163,8 @@ void WebRtcNsx_SpeechNoiseProb(NoiseSuppressionFixedC* inst, |
// FLOAT code |
// indicator1 = 0.5 * (tanh(sgnMap * widthPrior * |
// (threshPrior1 - tmpFloat1)) + 1.0); |
- tableIndex = (int16_t)(tmpU32no1 >> 14); |
- if (tableIndex < 16) { |
+ if (tmp32no1 < (16<<14) && tmp32no1 >= 0) { |
hlundin-webrtc
2016/04/15 08:28:31
This is wrong. The old code deals with tmpU32no1,
ivoc
2016/04/15 08:37:25
Oops, you're right. These wonderfully descriptive
|
+ tableIndex = (int16_t)(tmp32no1 >> 14); |
tmp16no2 = kIndicatorTable[tableIndex]; |
tmp16no1 = kIndicatorTable[tableIndex + 1] - kIndicatorTable[tableIndex]; |
frac = (int16_t)(tmpU32no1 & 0x00003fff); // Q14 |
@@ -210,8 +210,8 @@ void WebRtcNsx_SpeechNoiseProb(NoiseSuppressionFixedC* inst, |
/* FLOAT code |
indicator2 = 0.5 * (tanh(widthPrior * (tmpFloat1 - threshPrior2)) + 1.0); |
*/ |
- tableIndex = (int16_t)(tmpU32no1 >> 14); |
- if (tableIndex < 16) { |
+ if (tmp32no1 < (16<<14) && tmp32no1 >= 0) { |
hlundin-webrtc
2016/04/15 08:28:31
Same here. Wrong variable.
ivoc
2016/04/15 08:37:25
Fixed.
|
+ tableIndex = (int16_t)(tmp32no1 >> 14); |
tmp16no2 = kIndicatorTable[tableIndex]; |
tmp16no1 = kIndicatorTable[tableIndex + 1] - kIndicatorTable[tableIndex]; |
frac = (int16_t)(tmpU32no1 & 0x00003fff); // Q14 |