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
This commit is contained in:
Dave Hooper 2010-02-18 00:14:13 +00:00
parent 8b4ee2cfdd
commit 3a9852be1c

View file

@ -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;