Refactor common_audio/vad: Removed usage of macro WEBRTC_SPL_MUL_16_16()

BUG=3348,3353
TESTED=Locally on Mac and trybots
R=kwiberg@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/34719004

git-svn-id: http://webrtc.googlecode.com/svn/trunk@8152 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
bjornv@webrtc.org 2015-01-26 15:32:47 +00:00
parent 04cd466bd5
commit d25c034051
3 changed files with 8 additions and 8 deletions

View File

@ -56,15 +56,15 @@ static void HighPassFilter(const int16_t* data_in, int data_length,
for (i = 0; i < data_length; i++) {
// All-zero section (filter coefficients in Q14).
tmp32 = WEBRTC_SPL_MUL_16_16(kHpZeroCoefs[0], *in_ptr);
tmp32 += WEBRTC_SPL_MUL_16_16(kHpZeroCoefs[1], filter_state[0]);
tmp32 += WEBRTC_SPL_MUL_16_16(kHpZeroCoefs[2], filter_state[1]);
tmp32 = kHpZeroCoefs[0] * *in_ptr;
tmp32 += kHpZeroCoefs[1] * filter_state[0];
tmp32 += kHpZeroCoefs[2] * filter_state[1];
filter_state[1] = filter_state[0];
filter_state[0] = *in_ptr++;
// All-pole section (filter coefficients in Q14).
tmp32 -= WEBRTC_SPL_MUL_16_16(kHpPoleCoefs[1], filter_state[2]);
tmp32 -= WEBRTC_SPL_MUL_16_16(kHpPoleCoefs[2], filter_state[3]);
tmp32 -= kHpPoleCoefs[1] * filter_state[2];
tmp32 -= kHpPoleCoefs[2] * filter_state[3];
filter_state[3] = filter_state[2];
filter_state[2] = (int16_t) (tmp32 >> 14);
*out_ptr++ = filter_state[2];

View File

@ -79,5 +79,5 @@ int32_t WebRtcVad_GaussianProbability(int16_t input,
// Calculate and return (1 / s) * exp(-(x - m)^2 / (2 * s^2)), in Q20.
// Q-domain: Q10 * Q10 = Q20.
return WEBRTC_SPL_MUL_16_16(inv_std, exp_value);
return inv_std * exp_value;
}

View File

@ -170,8 +170,8 @@ int16_t WebRtcVad_FindMinimum(VadInstT* self,
alpha = kSmoothingUp; // 0.99 in Q15.
}
}
tmp32 = WEBRTC_SPL_MUL_16_16(alpha + 1, self->mean_value[channel]);
tmp32 += WEBRTC_SPL_MUL_16_16(WEBRTC_SPL_WORD16_MAX - alpha, current_median);
tmp32 = (alpha + 1) * self->mean_value[channel];
tmp32 += (WEBRTC_SPL_WORD16_MAX - alpha) * current_median;
tmp32 += 16384;
self->mean_value[channel] = (int16_t) (tmp32 >> 15);