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/libfaad/common.h | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'apps/codecs/libfaad/common.h') diff --git a/apps/codecs/libfaad/common.h b/apps/codecs/libfaad/common.h index 9179a6e21c..08f4c7ab53 100644 --- a/apps/codecs/libfaad/common.h +++ b/apps/codecs/libfaad/common.h @@ -56,30 +56,30 @@ extern struct codec_api* ci; #define IBSS_ATTR_FAAD_LARGE_IRAM IBSS_ATTR #define ICODE_ATTR_FAAD_LARGE_IRAM #define ICONST_ATTR_FAAD_LARGE_IRAM ICONST_ATTR -#define IBSS_ATTR_FAAD_XLARGE_IRAM #elif (CONFIG_CPU == PP5022) || (CONFIG_CPU == PP5024) /* Enough IRAM to move additional data and code to it. */ #define IBSS_ATTR_FAAD_LARGE_IRAM IBSS_ATTR #define ICODE_ATTR_FAAD_LARGE_IRAM ICODE_ATTR #define ICONST_ATTR_FAAD_LARGE_IRAM ICONST_ATTR -#define IBSS_ATTR_FAAD_XLARGE_IRAM #elif defined(CPU_S5L870X) /* Very large IRAM. Move even more data to it. */ #define IBSS_ATTR_FAAD_LARGE_IRAM IBSS_ATTR #define ICODE_ATTR_FAAD_LARGE_IRAM ICODE_ATTR #define ICONST_ATTR_FAAD_LARGE_IRAM ICONST_ATTR -#define IBSS_ATTR_FAAD_XLARGE_IRAM IBSS_ATTR +#define FAAD_HAVE_XLR_IN_IRAM #else /* Not enough IRAM available. */ #define IBSS_ATTR_FAAD_LARGE_IRAM #define ICODE_ATTR_FAAD_LARGE_IRAM #define ICONST_ATTR_FAAD_LARGE_IRAM -#define IBSS_ATTR_FAAD_XLARGE_IRAM #endif +/* Used to allocate several SBR + PS arrays and variables statically. */ +//#define FAAD_STATIC_ALLOC + #define INLINE __inline #if 0 //defined(_WIN32) && !defined(_WIN32_WCE) #define ALIGN __declspec(align(16)) @@ -442,8 +442,11 @@ uint8_t max_tns_sfb(const uint8_t sr_index, const uint8_t object_type, uint32_t get_sample_rate(const uint8_t sr_index); int8_t can_decode_ot(const uint8_t object_type); -void *faad_malloc(size_t size); -void faad_free(void *b); +#ifndef FAAD_STATIC_ALLOC +/* Those should not be defined or used anymore */ +#define faad_malloc(A) malloc(A) +#define faad_free(A) free(A) +#endif //#define PROFILE #ifdef PROFILE -- cgit v1.2.3