audio_coding/codec/ilbc: Removed usage of macro WEBRTC_SPL_MUL_16_16

The macro is in C defined as
#define WEBRTC_SPL_MUL_16_16(a, b) ((int32_t) (((int16_t)(a)) * ((int16_t)(b))))
(For definition on ARMv7 and MIPS, see common_audio/signal_processing/include/spl_inl_armv7.h and common_audio/signal_processing/include/spl_inl_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)

Some other minor code cleanup also exists.

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

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

Cr-Commit-Position: refs/heads/master@{#8358}
git-svn-id: http://webrtc.googlecode.com/svn/trunk@8358 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
bjornv@webrtc.org
2015-02-13 09:51:40 +00:00
parent 2bd299a172
commit ba97ea69f0
30 changed files with 122 additions and 126 deletions

View File

@ -43,16 +43,16 @@ void WebRtcIlbcfix_HpOutput(
+ (-a[1])*y[i-1] + (-a[2])*y[i-2];
*/
tmpW32 = WEBRTC_SPL_MUL_16_16(y[1], ba[3]); /* (-a[1])*y[i-1] (low part) */
tmpW32 += WEBRTC_SPL_MUL_16_16(y[3], ba[4]); /* (-a[2])*y[i-2] (low part) */
tmpW32 = y[1] * ba[3]; /* (-a[1])*y[i-1] (low part) */
tmpW32 += y[3] * ba[4]; /* (-a[2])*y[i-2] (low part) */
tmpW32 = (tmpW32>>15);
tmpW32 += WEBRTC_SPL_MUL_16_16(y[0], ba[3]); /* (-a[1])*y[i-1] (high part) */
tmpW32 += WEBRTC_SPL_MUL_16_16(y[2], ba[4]); /* (-a[2])*y[i-2] (high part) */
tmpW32 += y[0] * ba[3]; /* (-a[1])*y[i-1] (high part) */
tmpW32 += y[2] * ba[4]; /* (-a[2])*y[i-2] (high part) */
tmpW32 = (tmpW32<<1);
tmpW32 += WEBRTC_SPL_MUL_16_16(signal[i], ba[0]); /* b[0]*x[0] */
tmpW32 += WEBRTC_SPL_MUL_16_16(x[0], ba[1]); /* b[1]*x[i-1] */
tmpW32 += WEBRTC_SPL_MUL_16_16(x[1], ba[2]); /* b[2]*x[i-2] */
tmpW32 += signal[i] * ba[0]; /* b[0]*x[0] */
tmpW32 += x[0] * ba[1]; /* b[1]*x[i-1] */
tmpW32 += x[1] * ba[2]; /* b[2]*x[i-2] */
/* Update state (input part) */
x[1] = x[0];