Remove potential left shift of negative value in WebRtcSpl_AnalysisQMF

WebRtcSpl_AnalysisQMF takes raw (user) audio input represented by
int16_t samples. The samples are converted to Q10 with the
WEBRTC_SPL_LSHIFT_W32 macro. The macro is implemeted as a left
shift. This CL replaces the shift with a multiplication, similar
to https://codereview.webrtc.org/2253943002

TBR=kwiberg@webrtc.org

Bug: chromium:735773
Change-Id: Ic4e63269390e82b86f304e5aa1b5e2dc22122bcb
Reviewed-on: https://chromium-review.googlesource.com/552124
Commit-Queue: Alex Loiko <aleloi@webrtc.org>
Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
Reviewed-by: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#19068}
This commit is contained in:
Alex Loiko 2017-06-28 13:05:39 +02:00 committed by Commit Bot
parent 157cbbd3a7
commit 16005b7783

View File

@ -141,8 +141,8 @@ void WebRtcSpl_AnalysisQMF(const int16_t* in_data, size_t in_data_length,
// Split even and odd samples. Also shift them to Q10.
for (i = 0, k = 0; i < band_length; i++, k += 2)
{
half_in2[i] = WEBRTC_SPL_LSHIFT_W32((int32_t)in_data[k], 10);
half_in1[i] = WEBRTC_SPL_LSHIFT_W32((int32_t)in_data[k + 1], 10);
half_in2[i] = ((int32_t)in_data[k]) * (1 << 10);
half_in1[i] = ((int32_t)in_data[k + 1]) * (1 << 10);
}
// All pass filter even and odd samples, independently.