From d81d906adf926df3ab88efdc08d9bfb391c1b420 Mon Sep 17 00:00:00 2001 From: "kma@webrtc.org" Date: Wed, 22 Aug 2012 05:13:09 +0000 Subject: [PATCH] Fixed a bug in the C code in a filterbank function in iSAC-fix, and further optimized ARM code. The bug was introduced in the last CL during optimization. With the new inine ARM assembly, the resulted assembly code of the loop is 28 instructions, compared to 47 lines by the original. The optimized (with WEBRTC_ARCH_ARM_V7A defined in This file) and un-optimized code (with WEBRTC_ARCH_ARM_V7A not defined in This file) are bit-exact. Review URL: https://webrtc-codereview.appspot.com/748004 git-svn-id: http://webrtc.googlecode.com/svn/trunk@2651 4adac7df-926f-26a2-2b94-8c16560cd09d --- .../codecs/isac/fix/source/filterbanks.c | 48 ++++++++++--------- 1 file changed, 25 insertions(+), 23 deletions(-) diff --git a/src/modules/audio_coding/codecs/isac/fix/source/filterbanks.c b/src/modules/audio_coding/codecs/isac/fix/source/filterbanks.c index 263d409c4..6f9d85f50 100644 --- a/src/modules/audio_coding/codecs/isac/fix/source/filterbanks.c +++ b/src/modules/audio_coding/codecs/isac/fix/source/filterbanks.c @@ -60,38 +60,40 @@ static void HighpassFilterFixDec32( WebRtc_Word32 a2 = 0, b2 = 0; WebRtc_Word32 state0 = state[0]; WebRtc_Word32 state1 = state[1]; -#ifdef WEBRTC_ARCH_ARM_V7A - WebRtc_Word32* coeff_ptr = (WebRtc_Word32*) coeff; -#endif for (k=0; k Q7 */ - a1 = WEBRTC_SPL_MUL_32_32_RSFT32(coeff[5], coeff[4], state[0]); - b1 = WEBRTC_SPL_MUL_32_32_RSFT32(coeff[7], coeff[6], state[1]); + a1 = WEBRTC_SPL_MUL_32_32_RSFT32(coeff[5], coeff[4], state0); + b1 = WEBRTC_SPL_MUL_32_32_RSFT32(coeff[7], coeff[6], state1); /* Q30 * Q4 = Q34 ; shift 32 bit => Q2 */ - a2 = WEBRTC_SPL_MUL_32_32_RSFT32(coeff[1], coeff[0], state[0]); - b2 = WEBRTC_SPL_MUL_32_32_RSFT32(coeff[3], coeff[2], state[1]); + a2 = WEBRTC_SPL_MUL_32_32_RSFT32(coeff[1], coeff[0], state0); + b2 = WEBRTC_SPL_MUL_32_32_RSFT32(coeff[3], coeff[2], state1); #endif c = ((WebRtc_Word32)in) + WEBRTC_SPL_RSHIFT_W32(a1+b1, 7); // Q0