diff options
| author | Andree Buschmann <AndreeBuschmann@t-online.de> | 2011-04-24 20:19:05 +0000 |
|---|---|---|
| committer | Andree Buschmann <AndreeBuschmann@t-online.de> | 2011-04-24 20:19:05 +0000 |
| commit | a602f46d69d9d18756b7f317470f654f695faa80 (patch) | |
| tree | f111cc29197def94d5404d15c7febfd06efed9f7 /apps/codecs/aac.c | |
| parent | 69580a96eb816d9b811c542d38181126243d8563 (diff) | |
| download | rockbox-a602f46d69d9d18756b7f317470f654f695faa80.zip rockbox-a602f46d69d9d18756b7f317470f654f695faa80.tar.gz rockbox-a602f46d69d9d18756b7f317470f654f695faa80.tar.bz2 rockbox-a602f46d69d9d18756b7f317470f654f695faa80.tar.xz | |
Rework of libfaad in several areas. Allow removal of malloc with a new define FAAD_STATIC_ALLOC (in common.h). For now malloc is not fully removed but used by a few arrays needed for AAC-HE SBR+PS only. Reason to keep malloc is to have this amount of memory available for AAC-LC files which might require large m4a tables. The changes make the allocation routines much smaller, better centralized and allow to move duplicated code from aac.c/raa.c to libfaad. The rework includes removal of (now and former) unused code as well.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29778 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/codecs/aac.c')
| -rw-r--r-- | apps/codecs/aac.c | 35 |
1 files changed, 0 insertions, 35 deletions
diff --git a/apps/codecs/aac.c b/apps/codecs/aac.c index 6fd4e44..5638dc4 100644 --- a/apps/codecs/aac.c +++ b/apps/codecs/aac.c @@ -32,12 +32,6 @@ CODEC_HEADER * for each frame. */ #define FAAD_BYTE_BUFFER_SIZE (2048-12) -/* Global buffers to be used in the mdct synthesis. This way the arrays can - * be moved to IRAM for some targets */ -#define GB_BUF_SIZE 1024 -static real_t gb_time_buffer[2][GB_BUF_SIZE] IBSS_ATTR_FAAD_LARGE_IRAM MEM_ALIGN_ATTR; -static real_t gb_fb_intermed[2][GB_BUF_SIZE] IBSS_ATTR_FAAD_LARGE_IRAM MEM_ALIGN_ATTR; - /* this is the codec entry point */ enum codec_status codec_main(void) { @@ -55,7 +49,6 @@ enum codec_status codec_main(void) int file_offset; int framelength; int lead_trim = 0; - int needed_bufsize; unsigned int i; unsigned char* buffer; NeAACDecFrameInfo frame_info; @@ -119,34 +112,6 @@ next_track: err = CODEC_ERROR; goto done; } - - /* Set pointer to be able to use IRAM an to avoid alloc in decoder. Must - * be called after NeAACDecOpen(). */ - /* A buffer of framelength or 2*frameLenght size must be allocated for - * time_out. If frameLength is too big or SBR/forceUpSampling is active, - * we do not use the IRAM buffer and keep faad's internal allocation (see - * specrec.c). */ - needed_bufsize = decoder->frameLength; -#ifdef SBR_DEC - if ((decoder->sbr_present_flag == 1) || (decoder->forceUpSampling == 1)) - { - needed_bufsize *= 2; - } -#endif - if (needed_bufsize <= GB_BUF_SIZE) - { - decoder->time_out[0] = &gb_time_buffer[0][0]; - decoder->time_out[1] = &gb_time_buffer[1][0]; - } - /* A buffer of with frameLength elements must be allocated for fb_intermed. - * If frameLength is too big, we do not use the IRAM buffer and keep faad's - * internal allocation (see specrec.c). */ - needed_bufsize = decoder->frameLength; - if (needed_bufsize <= GB_BUF_SIZE) - { - decoder->fb_intermed[0] = &gb_fb_intermed[0][0]; - decoder->fb_intermed[1] = &gb_fb_intermed[1][0]; - } #ifdef SBR_DEC /* Check for need of special handling for seek/resume and elapsed time. */ |