From 415546921b9640b7718e9553ce96be6698f0f830 Mon Sep 17 00:00:00 2001 From: Michael Giacomelli Date: Sun, 16 Aug 2009 02:24:09 +0000 Subject: [PATCH] Make the IMDCT temporary working buffer a local variable instead of keeping one for each channel. Saves 4KB of RAM. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22339 a1c6a512-1295-4272-9138-f99709370657 --- apps/codecs/libatrac/atrac3.c | 9 +++++---- apps/codecs/libatrac/atrac3.h | 1 - 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/apps/codecs/libatrac/atrac3.c b/apps/codecs/libatrac/atrac3.c index e134998dfd..2e4af2963d 100644 --- a/apps/codecs/libatrac/atrac3.c +++ b/apps/codecs/libatrac/atrac3.c @@ -665,17 +665,18 @@ static int decodeChannelSoundUnit (GetBitContext *gb, channel_unit *pSnd, int32_ if (lastTonal >= 0) numBands = FFMAX((lastTonal + 256) >> 8, numBands); - + /* Reconstruct time domain samples. */ for (band=0; band<4; band++) { + int32_t IMDCT_buf[1024]; /* Perform the IMDCT step without overlapping. */ if (band <= numBands) { - IMLT(&(pSnd->spectrum[band*256]), pSnd->IMDCT_buf, band&1); + IMLT(&(pSnd->spectrum[band*256]), IMDCT_buf, band&1); } else - memset(pSnd->IMDCT_buf, 0, 512 * sizeof(int32_t)); + memset(IMDCT_buf, 0, 512 * sizeof(int32_t)); /* gain compensation and overlapping */ - gainCompensateAndOverlap (pSnd->IMDCT_buf, &(pSnd->prevFrame[band*256]), &(pOut[band*256]), + gainCompensateAndOverlap (IMDCT_buf, &(pSnd->prevFrame[band*256]), &(pOut[band*256]), &((pSnd->gainBlock[1 - (pSnd->gcBlkSwitch)]).gBlock[band]), &((pSnd->gainBlock[pSnd->gcBlkSwitch]).gBlock[band])); } diff --git a/apps/codecs/libatrac/atrac3.h b/apps/codecs/libatrac/atrac3.h index f81fc0a734..dbbafef34f 100644 --- a/apps/codecs/libatrac/atrac3.h +++ b/apps/codecs/libatrac/atrac3.h @@ -27,7 +27,6 @@ typedef struct { gain_block gainBlock[2]; int32_t spectrum[1024] __attribute__((aligned(16))); - int32_t IMDCT_buf[1024] __attribute__((aligned(16))); int32_t delayBuf1[46]; ///