From a602f46d69d9d18756b7f317470f654f695faa80 Mon Sep 17 00:00:00 2001 From: Andree Buschmann Date: Sun, 24 Apr 2011 20:19:05 +0000 Subject: 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 --- apps/codecs/raac.c | 36 ------------------------------------ 1 file changed, 36 deletions(-) (limited to 'apps/codecs/raac.c') diff --git a/apps/codecs/raac.c b/apps/codecs/raac.c index e3ad2b5dd8..b322ae7df3 100644 --- a/apps/codecs/raac.c +++ b/apps/codecs/raac.c @@ -28,13 +28,6 @@ CODEC_HEADER -/* 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 ALIGN real_t gb_time_buffer[2][GB_BUF_SIZE] IBSS_ATTR_FAAD_LARGE_IRAM; -static ALIGN real_t gb_fb_intermed[2][GB_BUF_SIZE] IBSS_ATTR_FAAD_LARGE_IRAM; - - static void init_rm(RMContext *rmctx) { memcpy(rmctx, (void*)(( (intptr_t)ci->id3->id3v2buf + 3 ) &~ 3), sizeof(RMContext)); @@ -49,7 +42,6 @@ enum codec_status codec_main(void) NeAACDecHandle decoder; size_t n; void *ret; - int needed_bufsize; unsigned int i; unsigned char* buffer; int err, consumed, pkt_offset, skipped = 0; @@ -103,34 +95,6 @@ next_track: 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]; - } - /* check for a mid-track resume and force a seek time accordingly */ if(resume_offset > rmctx.data_offset + DATA_HEADER_SIZE) { resume_offset -= rmctx.data_offset + DATA_HEADER_SIZE; -- cgit v1.2.3