From ec4ee483181d01d14444e4431159282ecd92a2c5 Mon Sep 17 00:00:00 2001 From: Mohamed Tarek Date: Mon, 12 Jul 2010 15:41:10 +0000 Subject: Complete the conversion of WMA Pro to fixed point. Floating point code is still there for better history and to have a returning point in svn should something go wrong. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27402 a1c6a512-1295-4272-9138-f99709370657 --- apps/codecs/libwmapro/wmapro_mdct.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'apps/codecs/libwmapro/wmapro_mdct.c') diff --git a/apps/codecs/libwmapro/wmapro_mdct.c b/apps/codecs/libwmapro/wmapro_mdct.c index 12cd8ce024..aaa95dccdf 100644 --- a/apps/codecs/libwmapro/wmapro_mdct.c +++ b/apps/codecs/libwmapro/wmapro_mdct.c @@ -5,10 +5,10 @@ #include "../lib/fft.h" /* for FFT data structures */ #include "codeclib.h" #include "../lib/codeclib_misc.h" /* for XNPROD31 */ +#include "wmapro_math.h" void imdct_half(unsigned int nbits, int32_t *output, const int32_t *input){ int k, n8, n4, n2, n, j; - //const uint16_t *revtab = s->revtab; const int32_t *in1, *in2; FFTComplex *z = (FFTComplex *)output; @@ -23,10 +23,9 @@ void imdct_half(unsigned int nbits, int32_t *output, const int32_t *input){ const int revtab_shift = (14- nbits); in1 = input; in2 = input + n2 - 1; - int step = 2<<(12-nbits); for(k = 0; k < n4; k++) { j=revtab[k]>>revtab_shift; - XNPROD31(*in2, *in1, T[1]<<16, T[0]<<16, &z[j].re, &z[j].im ); + XNPROD31(*in2<<2, *in1<<2, T[1]<<14, T[0]<<14, &z[j].re, &z[j].im ); in1 += 2; in2 -= 2; T += 2; @@ -39,8 +38,8 @@ void imdct_half(unsigned int nbits, int32_t *output, const int32_t *input){ const int32_t *V = T; for(k = 0; k < n8; k++) { int32_t r0, i0, r1, i1; - XNPROD31(z[n8-k-1].im, z[n8-k-1].re, T[0]<<16, T[1]<<16, &r0, &i1 ); - XNPROD31(z[n8+k ].im, z[n8+k ].re, V[0]<<16, V[1]<<16, &r1, &i0 ); + XNPROD31(z[n8-k-1].im, z[n8-k-1].re, T[0]<<8, T[1]<<8, &r0, &i1 ); + XNPROD31(z[n8+k ].im, z[n8+k ].re, V[0]<<8, V[1]<<8, &r1, &i0 ); z[n8-k-1].re = r0; z[n8-k-1].im = i0; z[n8+k ].re = r1; -- cgit v1.2.3