From 8722c6f2bbc08c6a6c6915c63789f67668af6903 Mon Sep 17 00:00:00 2001 From: Mohamed Tarek Date: Sun, 14 Feb 2010 01:59:14 +0000 Subject: Make deceodeSpectrum() store the spectral coefficients of odd bands in reverse order, rather than having to reverse them in IMLT(). Also saves 0.11MHz, ~0.16% speedup on PP5024. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24641 a1c6a512-1295-4272-9138-f99709370657 --- apps/codecs/libatrac/atrac3.c | 30 +++++++++++------------------- 1 file changed, 11 insertions(+), 19 deletions(-) diff --git a/apps/codecs/libatrac/atrac3.c b/apps/codecs/libatrac/atrac3.c index cd49aec348..ac63925ce7 100644 --- a/apps/codecs/libatrac/atrac3.c +++ b/apps/codecs/libatrac/atrac3.c @@ -189,23 +189,8 @@ static void iqmf (int32_t *inlo, int32_t *inhi, unsigned int nIn, int32_t *pOut, * @param odd_band 1 if the band is an odd band */ -static void IMLT(int32_t *pInput, int32_t *pOutput, int odd_band) +static void IMLT(int32_t *pInput, int32_t *pOutput) { - int i; - if (odd_band) { - /** - * Reverse the odd bands before IMDCT, this is an effect of the QMF transform - * or it gives better compression to do it this way. - * FIXME: It should be possible to handle this in ff_imdct_calc - * for that to happen a modification of the prerotation step of - * all SIMD code and C code is needed. - * Or fix the functions before so they generate a pre reversed spectrum. - */ - - for (i=0; i<128; i++) - FFSWAP(int32_t, pInput[i], pInput[255-i]); - } - /* Apply the imdct. */ mdct_backward(512, pInput, pOutput); @@ -365,8 +350,15 @@ static int decodeSpectrum (GetBitContext *gb, int32_t *pOut) SF = fixmul31(SFTable_fixed[SF_idxs[cnt]], iMaxQuant_fix[subband_vlc_index[cnt]]); /* Inverse quantize the coefficients. */ - for (pIn=mantissas ; firstfirst; last--, pIn++) + pOut[last] = fixmul16(*pIn, SF); + } else { + for (pIn=mantissas ; firstspectrum[band*256]), pSnd->IMDCT_buf, band&1); + IMLT(&(pSnd->spectrum[band*256]), pSnd->IMDCT_buf); } else memset(pSnd->IMDCT_buf, 0, 512 * sizeof(int32_t)); -- cgit v1.2.3