common_audio: Removed trivial macro WEBRTC_SPL_UMUL_16_16

The macro made a cast to uint16_t before a plain multiplication. At the few places where it was used the variables were already uint16_t.

Affected components:
* isac/fix

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

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

git-svn-id: http://webrtc.googlecode.com/svn/trunk@7543 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
bjornv@webrtc.org 2014-10-28 13:03:10 +00:00
parent ff8a98e352
commit 67ca26e087
3 changed files with 5 additions and 8 deletions

View File

@ -40,8 +40,6 @@
((int32_t) ((int32_t)(a) * (int32_t)(b)))
#define WEBRTC_SPL_UMUL(a, b) \
((uint32_t) ((uint32_t)(a) * (uint32_t)(b)))
#define WEBRTC_SPL_UMUL_16_16(a, b) \
((uint32_t) (uint16_t)(a) * (uint16_t)(b))
#define WEBRTC_SPL_UMUL_32_16(a, b) \
((uint32_t) ((uint32_t)(a) * (uint16_t)(b)))
#define WEBRTC_SPL_MUL_16_U16(a, b) \

View File

@ -41,7 +41,6 @@ TEST_F(SplTest, MacroTest) {
EXPECT_EQ(-2147483645, WEBRTC_SPL_MUL(a, b));
EXPECT_EQ(2147483651u, WEBRTC_SPL_UMUL(a, b));
b = WEBRTC_SPL_WORD16_MAX >> 1;
EXPECT_EQ(1073627139u, WEBRTC_SPL_UMUL_16_16(a, b));
EXPECT_EQ(4294918147u, WEBRTC_SPL_UMUL_32_16(a, b));
EXPECT_EQ(-49149, WEBRTC_SPL_MUL_16_U16(a, b));

View File

@ -300,7 +300,7 @@ int16_t WebRtcIsacfix_DecLogisticMulti2(int16_t *dataQ7,
candQ7 = - *dataQ7 + 64;
cdfTmp = WebRtcIsacfix_Piecewise(WEBRTC_SPL_MUL_16_U16(candQ7, tmpARSpecQ8));
W_tmp = WEBRTC_SPL_UMUL_16_16(cdfTmp, W_upper_MSB);
W_tmp = (uint32_t)cdfTmp * W_upper_MSB;
W_tmp += ((uint32_t)cdfTmp * (uint32_t)W_upper_LSB) >> 16;
if (streamVal > W_tmp)
@ -309,7 +309,7 @@ int16_t WebRtcIsacfix_DecLogisticMulti2(int16_t *dataQ7,
candQ7 += 128;
cdfTmp = WebRtcIsacfix_Piecewise(WEBRTC_SPL_MUL_16_U16(candQ7, tmpARSpecQ8));
W_tmp = WEBRTC_SPL_UMUL_16_16(cdfTmp, W_upper_MSB);
W_tmp = (uint32_t)cdfTmp * W_upper_MSB;
W_tmp += ((uint32_t)cdfTmp * (uint32_t)W_upper_LSB) >> 16;
while (streamVal > W_tmp)
@ -319,7 +319,7 @@ int16_t WebRtcIsacfix_DecLogisticMulti2(int16_t *dataQ7,
cdfTmp = WebRtcIsacfix_Piecewise(
WEBRTC_SPL_MUL_16_U16(candQ7, tmpARSpecQ8));
W_tmp = WEBRTC_SPL_UMUL_16_16(cdfTmp, W_upper_MSB);
W_tmp = (uint32_t)cdfTmp * W_upper_MSB;
W_tmp += ((uint32_t)cdfTmp * (uint32_t)W_upper_LSB) >> 16;
/* error check */
@ -338,7 +338,7 @@ int16_t WebRtcIsacfix_DecLogisticMulti2(int16_t *dataQ7,
candQ7 -= 128;
cdfTmp = WebRtcIsacfix_Piecewise(WEBRTC_SPL_MUL_16_U16(candQ7, tmpARSpecQ8));
W_tmp = WEBRTC_SPL_UMUL_16_16(cdfTmp, W_upper_MSB);
W_tmp = (uint32_t)cdfTmp * W_upper_MSB;
W_tmp += ((uint32_t)cdfTmp * (uint32_t)W_upper_LSB) >> 16;
while ( !(streamVal > W_tmp) )
@ -348,7 +348,7 @@ int16_t WebRtcIsacfix_DecLogisticMulti2(int16_t *dataQ7,
cdfTmp = WebRtcIsacfix_Piecewise(
WEBRTC_SPL_MUL_16_U16(candQ7, tmpARSpecQ8));
W_tmp = WEBRTC_SPL_UMUL_16_16(cdfTmp, W_upper_MSB);
W_tmp = (uint32_t)cdfTmp * W_upper_MSB;
W_tmp += ((uint32_t)cdfTmp * (uint32_t)W_upper_LSB) >> 16;
/* error check */