summaryrefslogtreecommitdiffstats
path: root/sbc/sbc.c
diff options
context:
space:
mode:
authorBrad Midgley <bmidgley@xmission.com>2007-10-05 05:42:55 +0000
committerBrad Midgley <bmidgley@xmission.com>2007-10-05 05:42:55 +0000
commit99b92496ace832a5c75776a55126d731ee42df43 (patch)
tree67ffc29ab6b624f858b9c46a160ae2f505cc9bd9 /sbc/sbc.c
parent7fbcefdd87d222c04023dcb1b3ff3cf5aeae8613 (diff)
fix MUL* macros with ()
factor more multiplies in 4-subband encoder
Diffstat (limited to 'sbc/sbc.c')
-rw-r--r--sbc/sbc.c17
1 files changed, 5 insertions, 12 deletions
diff --git a/sbc/sbc.c b/sbc/sbc.c
index a5cbf803..c262f16d 100644
--- a/sbc/sbc.c
+++ b/sbc/sbc.c
@@ -793,19 +793,12 @@ static inline void _sbc_analyze_four(const int32_t *in, int32_t *out)
MULA(res, _anamatrix4[3], t[7]);
out[3] = SCALE4_STAGE2(res);
#else
- /* some of these multiplies could be factored more but something overflows */
- /* eg replace the first two lines with MUL(s[0], _anamatrix4[0], t[0] + t[4]) */
- MUL(s[0], _anamatrix4[0], t[0]);
- MULA(s[0], _anamatrix4[0], t[4]);
+ MUL(s[0], _anamatrix4[0], t[0] + t[4]);
MUL(s[1], _anamatrix4[2], t[2]);
- MUL(s[2], _anamatrix4[1], t[1]);
- MULA(s[2], _anamatrix4[1], t[3]);
- MULA(s[2], _anamatrix4[3], t[5]);
- MULA(s[2], -_anamatrix4[3], t[7]);
- MUL(s[3], _anamatrix4[3], t[1]);
- MULA(s[3], _anamatrix4[3], t[3]);
- MULA(s[3], -_anamatrix4[1], t[5]);
- MULA(s[3], _anamatrix4[1], t[7]);
+ MUL(s[2], _anamatrix4[1], t[1] + t[3]);
+ MULA(s[2], _anamatrix4[3], t[5] + t[7]);
+ MUL(s[3], _anamatrix4[3], t[1] + t[3]);
+ MULA(s[3], _anamatrix4[1], - t[5] + t[7]);
out[0] = SCALE4_STAGE2( s[0] + s[1] + s[2]);
out[1] = SCALE4_STAGE2(-s[0] + s[1] + s[3]);
out[2] = SCALE4_STAGE2(-s[0] + s[1] - s[3]);