Refactor common_audio/signal_processing: Removed usage of WEBRTC_SPL_MUL_16_16_RSFT
The macro is defined as
#define WEBRTC_SPL_MUL_16_16_RSFT(a, b, c) \
(WEBRTC_SPL_MUL_16_16(a, b) >> (c))
where the latter macro is in C defined as
#define WEBRTC_SPL_MUL_16_16(a, b) \
((int32_t) (((int16_t)(a)) * ((int16_t)(b))))
(For definitions on ARMv7 and MIPS, see common_audio/signal_processing/include/spl_inl_{armv7,mips}.h)
The replacement consists of
- avoiding casts to int16_t if inputs already are int16_t
- adding explicit cast to <type> if result is assigned to <type> (other than int or int32_t)
- minor cleanups like remove of unnecessary parentheses and style changes
BUG=3348, 3353
TESTED=locally on Linux for both fixed and floating point and trybots
R=kwiberg@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/49499004
Cr-Original-Commit-Position: refs/heads/master@{#8853}
Cr-Mirrored-From: https://chromium.googlesource.com/external/webrtc
Cr-Mirrored-Commit: 1ccd8b4281f8d3ebbc51e70a96ac186e787a7114
diff --git a/common_audio/signal_processing/refl_coef_to_lpc.c b/common_audio/signal_processing/refl_coef_to_lpc.c
index 17055c9..06a29b6 100644
--- a/common_audio/signal_processing/refl_coef_to_lpc.c
+++ b/common_audio/signal_processing/refl_coef_to_lpc.c
@@ -41,8 +41,7 @@
any[m + 1] = *kptr >> 3;
for (i = 0; i < m; i++)
{
- *anyptr = (*aptr)
- + (int16_t)WEBRTC_SPL_MUL_16_16_RSFT((*aptr2), (*kptr), 15);
+ *anyptr = *aptr + (int16_t)((*aptr2 * *kptr) >> 15);
anyptr++;
aptr++;
aptr2--;