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/libfaad/common.h | |
parent | 69580a96eb816d9b811c542d38181126243d8563 (diff) | |
download | rockbox-a602f46d69d9d18756b7f317470f654f695faa80.tar.gz rockbox-a602f46d69d9d18756b7f317470f654f695faa80.zip |
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/libfaad/common.h')
-rw-r--r-- | apps/codecs/libfaad/common.h | 15 |
1 files changed, 9 insertions, 6 deletions
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; | |||
56 | #define IBSS_ATTR_FAAD_LARGE_IRAM IBSS_ATTR | 56 | #define IBSS_ATTR_FAAD_LARGE_IRAM IBSS_ATTR |
57 | #define ICODE_ATTR_FAAD_LARGE_IRAM | 57 | #define ICODE_ATTR_FAAD_LARGE_IRAM |
58 | #define ICONST_ATTR_FAAD_LARGE_IRAM ICONST_ATTR | 58 | #define ICONST_ATTR_FAAD_LARGE_IRAM ICONST_ATTR |
59 | #define IBSS_ATTR_FAAD_XLARGE_IRAM | ||
60 | 59 | ||
61 | #elif (CONFIG_CPU == PP5022) || (CONFIG_CPU == PP5024) | 60 | #elif (CONFIG_CPU == PP5022) || (CONFIG_CPU == PP5024) |
62 | /* Enough IRAM to move additional data and code to it. */ | 61 | /* Enough IRAM to move additional data and code to it. */ |
63 | #define IBSS_ATTR_FAAD_LARGE_IRAM IBSS_ATTR | 62 | #define IBSS_ATTR_FAAD_LARGE_IRAM IBSS_ATTR |
64 | #define ICODE_ATTR_FAAD_LARGE_IRAM ICODE_ATTR | 63 | #define ICODE_ATTR_FAAD_LARGE_IRAM ICODE_ATTR |
65 | #define ICONST_ATTR_FAAD_LARGE_IRAM ICONST_ATTR | 64 | #define ICONST_ATTR_FAAD_LARGE_IRAM ICONST_ATTR |
66 | #define IBSS_ATTR_FAAD_XLARGE_IRAM | ||
67 | 65 | ||
68 | #elif defined(CPU_S5L870X) | 66 | #elif defined(CPU_S5L870X) |
69 | /* Very large IRAM. Move even more data to it. */ | 67 | /* Very large IRAM. Move even more data to it. */ |
70 | #define IBSS_ATTR_FAAD_LARGE_IRAM IBSS_ATTR | 68 | #define IBSS_ATTR_FAAD_LARGE_IRAM IBSS_ATTR |
71 | #define ICODE_ATTR_FAAD_LARGE_IRAM ICODE_ATTR | 69 | #define ICODE_ATTR_FAAD_LARGE_IRAM ICODE_ATTR |
72 | #define ICONST_ATTR_FAAD_LARGE_IRAM ICONST_ATTR | 70 | #define ICONST_ATTR_FAAD_LARGE_IRAM ICONST_ATTR |
73 | #define IBSS_ATTR_FAAD_XLARGE_IRAM IBSS_ATTR | 71 | #define FAAD_HAVE_XLR_IN_IRAM |
74 | 72 | ||
75 | #else | 73 | #else |
76 | /* Not enough IRAM available. */ | 74 | /* Not enough IRAM available. */ |
77 | #define IBSS_ATTR_FAAD_LARGE_IRAM | 75 | #define IBSS_ATTR_FAAD_LARGE_IRAM |
78 | #define ICODE_ATTR_FAAD_LARGE_IRAM | 76 | #define ICODE_ATTR_FAAD_LARGE_IRAM |
79 | #define ICONST_ATTR_FAAD_LARGE_IRAM | 77 | #define ICONST_ATTR_FAAD_LARGE_IRAM |
80 | #define IBSS_ATTR_FAAD_XLARGE_IRAM | ||
81 | #endif | 78 | #endif |
82 | 79 | ||
80 | /* Used to allocate several SBR + PS arrays and variables statically. */ | ||
81 | //#define FAAD_STATIC_ALLOC | ||
82 | |||
83 | #define INLINE __inline | 83 | #define INLINE __inline |
84 | #if 0 //defined(_WIN32) && !defined(_WIN32_WCE) | 84 | #if 0 //defined(_WIN32) && !defined(_WIN32_WCE) |
85 | #define ALIGN __declspec(align(16)) | 85 | #define ALIGN __declspec(align(16)) |
@@ -442,8 +442,11 @@ uint8_t max_tns_sfb(const uint8_t sr_index, const uint8_t object_type, | |||
442 | uint32_t get_sample_rate(const uint8_t sr_index); | 442 | uint32_t get_sample_rate(const uint8_t sr_index); |
443 | int8_t can_decode_ot(const uint8_t object_type); | 443 | int8_t can_decode_ot(const uint8_t object_type); |
444 | 444 | ||
445 | void *faad_malloc(size_t size); | 445 | #ifndef FAAD_STATIC_ALLOC |
446 | void faad_free(void *b); | 446 | /* Those should not be defined or used anymore */ |
447 | #define faad_malloc(A) malloc(A) | ||
448 | #define faad_free(A) free(A) | ||
449 | #endif | ||
447 | 450 | ||
448 | //#define PROFILE | 451 | //#define PROFILE |
449 | #ifdef PROFILE | 452 | #ifdef PROFILE |