Fix for negative shift value in NetEq.

BUG=chromium:667028

Review-Url: https://codereview.webrtc.org/2562423002
Cr-Commit-Position: refs/heads/master@{#15562}
This commit is contained in:
ivoc
2016-12-13 01:05:27 -08:00
committed by Commit bot
parent 921019c48b
commit 03392d0047

View File

@ -98,8 +98,8 @@ int Normal::Process(const int16_t* input,
// Normalize new frame energy to 15 bits.
scaling = WebRtcSpl_NormW32(energy) - 16;
// We want background_noise_.energy() / energy in Q14.
int32_t bgn_energy =
background_noise_.Energy(channel_ix) << (scaling+14);
int32_t bgn_energy = WEBRTC_SPL_SHIFT_W32(
background_noise_.Energy(channel_ix), scaling + 14);
int16_t energy_scaled =
static_cast<int16_t>(WEBRTC_SPL_SHIFT_W32(energy, scaling));
int32_t ratio = WebRtcSpl_DivW32W16(bgn_energy, energy_scaled);