summaryrefslogtreecommitdiffstats
path: root/sbc
diff options
context:
space:
mode:
authorBrad Midgley <bmidgley@xmission.com>2007-11-05 15:54:50 +0000
committerBrad Midgley <bmidgley@xmission.com>2007-11-05 15:54:50 +0000
commit316166212f59f4bc7bad778ff46e8b6986c52874 (patch)
treece7c684f3d9142d85cd396e61af52a0a74188be6 /sbc
parentec233a1f849d1880697ef741f19906a4f9fcbc05 (diff)
correction in the 4 subband optimization
Diffstat (limited to 'sbc')
-rw-r--r--sbc/sbc.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/sbc/sbc.c b/sbc/sbc.c
index 76df0652..c95862a0 100644
--- a/sbc/sbc.c
+++ b/sbc/sbc.c
@@ -713,7 +713,7 @@ static inline void _sbc_analyze_four(const int32_t *in, int32_t *out)
sbc_extended_t res;
sbc_extended_t t[8];
- sbc_extended_t s[4];
+ sbc_extended_t s[5];
MUL(res, _sbc_proto_4[0], (in[8] - in[32])); /* Q18 */
MULA(res, _sbc_proto_4[1], (in[16] - in[24]));
@@ -765,13 +765,14 @@ static inline void _sbc_analyze_four(const int32_t *in, int32_t *out)
MUL(s[0], _anamatrix4[0], t[0] + t[4]);
MUL(s[1], _anamatrix4[2], t[2]);
MUL(s[2], _anamatrix4[1], t[1] + t[3]);
- MULA(s[2], _anamatrix4[3], t[5] + t[7]);
+ MULA(s[2], _anamatrix4[3], t[5]);
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]); /* Q0 */
+ MUL(s[4], _anamatrix4[3], t[7]);
+ out[0] = SCALE4_STAGE2( s[0] + s[1] + s[2] + s[4]); /* Q0 */
out[1] = SCALE4_STAGE2(-s[0] + s[1] + s[3]);
out[2] = SCALE4_STAGE2(-s[0] + s[1] - s[3]);
- out[3] = SCALE4_STAGE2( s[0] + s[1] - s[2]);
+ out[3] = SCALE4_STAGE2( s[0] + s[1] - s[2] - s[4]);
}
static inline void sbc_analyze_four(struct sbc_encoder_state *state,