Refactor audio_coding/ilbc: removes usage of macro WEBRTC_SPL_LSHIFT_W32
The macro is defined as #define WEBRTC_SPL_LSHIFT_W32(a, b) ((a) << (b)) It is a trivial operation that need no macro. In fact it may be confusing for to the user, since it can be interpreted as having an implicit cast to int32_t. Also removes unnecessary casts to int32_t from int16_t. BUG=3348,3353 TESTED=locally on linux and trybots R=kwiberg@webrtc.org Review URL: https://webrtc-codereview.appspot.com/48519004 Cr-Commit-Position: refs/heads/master@{#8800} git-svn-id: http://webrtc.googlecode.com/svn/trunk@8800 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
@ -39,8 +39,7 @@ int16_t WebRtcIlbcfix_Chebyshev(
|
||||
|
||||
b2 = (int32_t)0x1000000; /* b2 = 1.0 (Q23) */
|
||||
/* Calculate b1 = 2*x + f[1] */
|
||||
tmp1W32 = WEBRTC_SPL_LSHIFT_W32((int32_t)x, 10);
|
||||
tmp1W32 += WEBRTC_SPL_LSHIFT_W32((int32_t)f[1], 14);
|
||||
tmp1W32 = (x << 10) + (f[1] << 14);
|
||||
|
||||
for (i = 2; i < 5; i++) {
|
||||
tmp2W32 = tmp1W32;
|
||||
@ -50,10 +49,7 @@ int16_t WebRtcIlbcfix_Chebyshev(
|
||||
b1_low = (int16_t)((tmp1W32 - ((int32_t)b1_high << 16)) >> 1);
|
||||
|
||||
/* Calculate 2*x*b1-b2+f[i] */
|
||||
tmp1W32 = WEBRTC_SPL_LSHIFT_W32(b1_high * x + ((b1_low * x) >> 15), 2);
|
||||
|
||||
tmp1W32 -= b2;
|
||||
tmp1W32 += WEBRTC_SPL_LSHIFT_W32((int32_t)f[i], 14);
|
||||
tmp1W32 = ((b1_high * x + ((b1_low * x) >> 15)) << 2) - b2 + (f[i] << 14);
|
||||
|
||||
/* Update b2 for next round */
|
||||
b2 = tmp2W32;
|
||||
@ -64,11 +60,8 @@ int16_t WebRtcIlbcfix_Chebyshev(
|
||||
b1_low = (int16_t)((tmp1W32 - ((int32_t)b1_high << 16)) >> 1);
|
||||
|
||||
/* tmp1W32 = x*b1 - b2 + f[i]/2 */
|
||||
tmp1W32 = WEBRTC_SPL_LSHIFT_W32(b1_high * x, 1) +
|
||||
WEBRTC_SPL_LSHIFT_W32((b1_low * x) >> 15, 1);
|
||||
|
||||
tmp1W32 -= b2;
|
||||
tmp1W32 += WEBRTC_SPL_LSHIFT_W32((int32_t)f[i], 13);
|
||||
tmp1W32 = ((b1_high * x) << 1) + (((b1_low * x) >> 15) << 1) -
|
||||
b2 + (f[i] << 13);
|
||||
|
||||
/* Handle overflows and set to maximum or minimum int16_t instead */
|
||||
if (tmp1W32>((int32_t)33553408)) {
|
||||
|
||||
Reference in New Issue
Block a user