summaryrefslogtreecommitdiff
path: root/apps/codecs/libatrac/atrac3.c
diff options
context:
space:
mode:
authorMichael Giacomelli <giac2000@hotmail.com>2009-08-16 02:24:09 +0000
committerMichael Giacomelli <giac2000@hotmail.com>2009-08-16 02:24:09 +0000
commit415546921b9640b7718e9553ce96be6698f0f830 (patch)
tree4e7612f85fd21237c0d24a4796edafe8c65b4ed4 /apps/codecs/libatrac/atrac3.c
parentc74319b2f409cc384093002296654b310892b59f (diff)
downloadrockbox-415546921b9640b7718e9553ce96be6698f0f830.tar.gz
rockbox-415546921b9640b7718e9553ce96be6698f0f830.zip
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
Diffstat (limited to 'apps/codecs/libatrac/atrac3.c')
-rw-r--r--apps/codecs/libatrac/atrac3.c9
1 files changed, 5 insertions, 4 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_
665 if (lastTonal >= 0) 665 if (lastTonal >= 0)
666 numBands = FFMAX((lastTonal + 256) >> 8, numBands); 666 numBands = FFMAX((lastTonal + 256) >> 8, numBands);
667 667
668 668
669 /* Reconstruct time domain samples. */ 669 /* Reconstruct time domain samples. */
670 for (band=0; band<4; band++) { 670 for (band=0; band<4; band++) {
671 int32_t IMDCT_buf[1024];
671 /* Perform the IMDCT step without overlapping. */ 672 /* Perform the IMDCT step without overlapping. */
672 if (band <= numBands) { 673 if (band <= numBands) {
673 IMLT(&(pSnd->spectrum[band*256]), pSnd->IMDCT_buf, band&1); 674 IMLT(&(pSnd->spectrum[band*256]), IMDCT_buf, band&1);
674 } else 675 } else
675 memset(pSnd->IMDCT_buf, 0, 512 * sizeof(int32_t)); 676 memset(IMDCT_buf, 0, 512 * sizeof(int32_t));
676 677
677 /* gain compensation and overlapping */ 678 /* gain compensation and overlapping */
678 gainCompensateAndOverlap (pSnd->IMDCT_buf, &(pSnd->prevFrame[band*256]), &(pOut[band*256]), 679 gainCompensateAndOverlap (IMDCT_buf, &(pSnd->prevFrame[band*256]), &(pOut[band*256]),
679 &((pSnd->gainBlock[1 - (pSnd->gcBlkSwitch)]).gBlock[band]), 680 &((pSnd->gainBlock[1 - (pSnd->gcBlkSwitch)]).gBlock[band]),
680 &((pSnd->gainBlock[pSnd->gcBlkSwitch]).gBlock[band])); 681 &((pSnd->gainBlock[pSnd->gcBlkSwitch]).gBlock[band]));
681 } 682 }