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:
@ -76,13 +76,12 @@ void WebRtcIlbcfix_Smooth(
|
||||
scale1 = scale2 + 16;
|
||||
}
|
||||
|
||||
w00prim = WEBRTC_SPL_LSHIFT_W32(w00, scale1);
|
||||
w00prim = w00 << scale1;
|
||||
w11prim = (int16_t) WEBRTC_SPL_SHIFT_W32(w11, scale2);
|
||||
|
||||
/* Perform C = sqrt(w11/w00) (C is in Q11 since (16+6)/2=11) */
|
||||
if (w11prim>64) {
|
||||
endiff = WEBRTC_SPL_LSHIFT_W32(
|
||||
(int32_t)WebRtcSpl_DivW32W16(w00prim, w11prim), 6);
|
||||
endiff = WebRtcSpl_DivW32W16(w00prim, w11prim) << 6;
|
||||
C = (int16_t)WebRtcSpl_SqrtFloor(endiff); /* C is in Q11 */
|
||||
} else {
|
||||
C = 1;
|
||||
@ -166,7 +165,7 @@ void WebRtcIlbcfix_Smooth(
|
||||
/* B_W32 is in Q30 ( B = 1 - ENH_A0/2 - A * w10/w00 ) */
|
||||
scale1 = 31-bitsw10;
|
||||
scale2 = 21-scale1;
|
||||
w10prim = WEBRTC_SPL_LSHIFT_W32(w10, scale1);
|
||||
w10prim = w10 << scale1;
|
||||
w00prim = WEBRTC_SPL_SHIFT_W32(w00, -scale2);
|
||||
scale = bitsw00-scale2-15;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user