1
0
Fork 0
forked from len0rd/rockbox

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
This commit is contained in:
Andree Buschmann 2011-04-24 20:19:05 +00:00
parent 69580a96eb
commit a602f46d69
26 changed files with 262 additions and 688 deletions

View file

@ -558,7 +558,7 @@ void raw_data_block(NeAACDecHandle hDecoder, NeAACDecFrameInfo *hInfo,
/* Table 4.4.4 and */
/* Table 4.4.9 */
int16_t spec_data[1024] MEM_ALIGN_ATTR = {0};
int16_t spec_data[FRAME_LEN] MEM_ALIGN_ATTR = {0};
element sce;
static uint8_t single_lfe_channel_element(NeAACDecHandle hDecoder, bitfile *ld,
uint8_t channel, uint8_t *tag)
@ -603,8 +603,9 @@ static uint8_t single_lfe_channel_element(NeAACDecHandle hDecoder, bitfile *ld,
}
/* Table 4.4.5 */
int16_t spec_data1[1024] IBSS_ATTR MEM_ALIGN_ATTR;
int16_t spec_data2[1024] IBSS_ATTR MEM_ALIGN_ATTR;
int16_t spec_data1[FRAME_LEN] IBSS_ATTR MEM_ALIGN_ATTR;
int16_t spec_data2[FRAME_LEN] IBSS_ATTR MEM_ALIGN_ATTR;
element cpe;
static uint8_t channel_pair_element(NeAACDecHandle hDecoder, bitfile *ld,
uint8_t channels, uint8_t *tag)
@ -884,7 +885,7 @@ static uint8_t coupling_channel_element(NeAACDecHandle hDecoder, bitfile *ld)
element el_empty = {0};
ic_stream ics_empty = {0};
static int16_t sh_data[1024];
static int16_t sh_data[FRAME_LEN];
c = faad_getbits(ld, LEN_TAG
DEBUGVAR(1,900,"coupling_channel_element(): element_instance_tag"));
@ -1028,7 +1029,8 @@ static uint8_t fill_element(NeAACDecHandle hDecoder, bitfile *ld, drc_info *drc
if (!hDecoder->sbr[sbr_ele])
{
hDecoder->sbr[sbr_ele] = sbrDecodeInit(hDecoder->frameLength,
hDecoder->element_id[sbr_ele], 2*get_sample_rate(hDecoder->sf_index),
hDecoder->element_id[sbr_ele], sbr_ele,
2*get_sample_rate(hDecoder->sf_index),
hDecoder->downSampledSBR
#ifdef DRM
, 0
@ -1170,8 +1172,8 @@ static void gain_control_data(bitfile *ld, ic_stream *ics)
#endif
#ifdef SCALABLE_DEC
int16_t spec_data1[1024] MEM_ALIGN_ATTR;
int16_t spec_data2[1024] MEM_ALIGN_ATTR;
int16_t spec_data1[FRAME_LEN] MEM_ALIGN_ATTR;
int16_t spec_data2[FRAME_LEN] MEM_ALIGN_ATTR;
/* Table 4.4.13 ASME */
void aac_scalable_main_element(NeAACDecHandle hDecoder, NeAACDecFrameInfo *hInfo,
bitfile *ld, program_config *pce, drc_info *drc)