summaryrefslogtreecommitdiff
path: root/apps/codecs/lib
diff options
context:
space:
mode:
authorDave Hooper <dave@beermex.com>2010-02-18 00:14:13 +0000
committerDave Hooper <dave@beermex.com>2010-02-18 00:14:13 +0000
commit3a9852be1c2fa1fc6da47fedef978476c82ec951 (patch)
treef0ce1a0e40b60b611900d1f1482cabc48eff57d0 /apps/codecs/lib
parent8b4ee2cfddb0828e7985d5af1ff883280c4d2965 (diff)
downloadrockbox-3a9852be1c2fa1fc6da47fedef978476c82ec951.zip
rockbox-3a9852be1c2fa1fc6da47fedef978476c82ec951.tar.gz
rockbox-3a9852be1c2fa1fc6da47fedef978476c82ec951.tar.bz2
rockbox-3a9852be1c2fa1fc6da47fedef978476c82ec951.tar.xz
I don't yet fully understand why this is required, but without it the output is signed-inverted (compared to e.g. the output of oggdec). ac3 confirmed to be ok so the problem must be in the imdct not the ifft. but the algo seems correct (in that seems same as original ffmpeg version)..
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24739 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/codecs/lib')
-rw-r--r--apps/codecs/lib/mdct.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/apps/codecs/lib/mdct.c b/apps/codecs/lib/mdct.c
index 03baa4d..3c9fe41 100644
--- a/apps/codecs/lib/mdct.c
+++ b/apps/codecs/lib/mdct.c
@@ -139,10 +139,10 @@ void ff_imdct_half(unsigned int nbits, fixed32 *output, const fixed32 *input)
fixed32 r0,i0,r1,i1;
XNPROD31_R(z1[1], z1[0], T[0], T[1], r0, i1 ); T+=newstep;
XNPROD31_R(z2[1], z2[0], T[1], T[0], r1, i0 ); T+=newstep;
- z1[0] = r0;
- z1[1] = i0;
- z2[0] = r1;
- z2[1] = i1;
+ z1[0] = -r0;
+ z1[1] = -i0;
+ z2[0] = -r1;
+ z2[1] = -i1;
z1+=2;
z2-=2;
}
@@ -171,10 +171,10 @@ void ff_imdct_half(unsigned int nbits, fixed32 *output, const fixed32 *input)
v0 += (t0 = (T[0]>>1));
v1 += (t1 = (T[1]>>1));
XNPROD31_R(z2[1], z2[0], v1, v0, r1, i0 );
- z1[0] = r0;
- z1[1] = i0;
- z2[0] = r1;
- z2[1] = i1;
+ z1[0] = -r0;
+ z1[1] = -i0;
+ z2[0] = -r1;
+ z2[1] = -i1;
z1+=2;
z2-=2;
V+=2;
@@ -205,10 +205,10 @@ void ff_imdct_half(unsigned int nbits, fixed32 *output, const fixed32 *input)
t0 = v0-q0;
t1 = v1-q1;
XNPROD31_R(z2[1], z2[0], t1, t0, r1, i0 );
- z1[0] = r0;
- z1[1] = i0;
- z2[0] = r1;
- z2[1] = i1;
+ z1[0] = -r0;
+ z1[1] = -i0;
+ z2[0] = -r1;
+ z2[1] = -i1;
z1+=2;
z2-=2;
T+=2;
@@ -220,10 +220,10 @@ void ff_imdct_half(unsigned int nbits, fixed32 *output, const fixed32 *input)
v0 = t0-q0;
v1 = t1-q1;
XNPROD31_R(z2[1], z2[0], v1, v0, r1, i0 );
- z1[0] = r0;
- z1[1] = i0;
- z2[0] = r1;
- z2[1] = i1;
+ z1[0] = -r0;
+ z1[1] = -i0;
+ z2[0] = -r1;
+ z2[1] = -i1;
z1+=2;
z2-=2;
V+=2;