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/sbr_dec.h | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) (limited to 'apps/codecs/libfaad/sbr_dec.h') diff --git a/apps/codecs/libfaad/sbr_dec.h b/apps/codecs/libfaad/sbr_dec.h index aa145fe34a..81dac32946 100644 --- a/apps/codecs/libfaad/sbr_dec.h +++ b/apps/codecs/libfaad/sbr_dec.h @@ -48,15 +48,13 @@ extern "C" { #define MAX_L_E 5 typedef struct { - real_t *x; + real_t x[2*32*10]; int16_t x_index; - uint8_t channels; } qmfa_info; typedef struct { - real_t *v; + real_t v[2*64*20]; /* Size was "(downSampledSBR)?32:64". We use 64 now. */ int16_t v_index; - uint8_t channels; } qmfs_info; typedef struct @@ -105,8 +103,8 @@ typedef struct uint8_t f[2][MAX_L_E+1]; uint8_t f_prev[2]; - real_t *G_temp_prev[2][5]; - real_t *Q_temp_prev[2][5]; + real_t G_temp_prev[2][5][64]; + real_t Q_temp_prev[2][5][64]; int8_t GQ_ringbuf_index[2]; int16_t E[2][64][MAX_L_E]; @@ -160,10 +158,10 @@ typedef struct uint32_t header_count; uint8_t id_aac; - qmfa_info *qmfa[2]; - qmfs_info *qmfs[2]; + qmfa_info qmfa[2] MEM_ALIGN_ATTR; + qmfs_info qmfs[2] MEM_ALIGN_ATTR; - qmf_t Xsbr[2][MAX_NTSRHFG][64]; + qmf_t Xsbr[2][MAX_NTSRHFG][64] MEM_ALIGN_ATTR; #ifdef DRM uint8_t Is_DRM_SBR; @@ -223,13 +221,12 @@ typedef struct uint8_t bs_df_noise[2][3]; } sbr_info; -sbr_info *sbrDecodeInit(uint16_t framelength, uint8_t id_aac, +sbr_info *sbrDecodeInit(uint16_t framelength, uint8_t id_aac, uint8_t id_ele, uint32_t sample_rate, uint8_t downSampledSBR #ifdef DRM , uint8_t IsDRM #endif ); -void sbrDecodeEnd(sbr_info *sbr); uint8_t sbrDecodeCoupleFrame(sbr_info *sbr, real_t *left_chan, real_t *right_chan, const uint8_t just_seeked, const uint8_t downSampledSBR); -- cgit v1.2.3