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/sbr_qmf.c | |
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/sbr_qmf.c')
-rw-r--r-- | apps/codecs/libfaad/sbr_qmf.c | 48 |
1 files changed, 0 insertions, 48 deletions
diff --git a/apps/codecs/libfaad/sbr_qmf.c b/apps/codecs/libfaad/sbr_qmf.c index 7cb62c241a..5f8203e5b1 100644 --- a/apps/codecs/libfaad/sbr_qmf.c +++ b/apps/codecs/libfaad/sbr_qmf.c | |||
@@ -50,30 +50,6 @@ | |||
50 | #define FAAD_ANALYSIS_SCALE3(X) ((X)/32.0f) | 50 | #define FAAD_ANALYSIS_SCALE3(X) ((X)/32.0f) |
51 | #endif | 51 | #endif |
52 | 52 | ||
53 | qmfa_info *qmfa_init(uint8_t channels) | ||
54 | { | ||
55 | qmfa_info *qmfa = (qmfa_info*)faad_malloc(sizeof(qmfa_info)); | ||
56 | |||
57 | /* x is implemented as double ringbuffer */ | ||
58 | qmfa->x = (real_t*)faad_malloc(2 * channels * 10 * sizeof(real_t)); | ||
59 | memset(qmfa->x, 0, 2 * channels * 10 * sizeof(real_t)); | ||
60 | |||
61 | /* ringbuffer index */ | ||
62 | qmfa->x_index = 0; | ||
63 | |||
64 | qmfa->channels = channels; | ||
65 | |||
66 | return qmfa; | ||
67 | } | ||
68 | |||
69 | void qmfa_end(qmfa_info *qmfa) | ||
70 | { | ||
71 | if (qmfa) | ||
72 | { | ||
73 | if (qmfa->x) faad_free(qmfa->x); | ||
74 | faad_free(qmfa); | ||
75 | } | ||
76 | } | ||
77 | 53 | ||
78 | void sbr_qmf_analysis_32(sbr_info *sbr, qmfa_info *qmfa, const real_t *input, | 54 | void sbr_qmf_analysis_32(sbr_info *sbr, qmfa_info *qmfa, const real_t *input, |
79 | qmf_t X[MAX_NTSR][64], uint8_t offset, uint8_t kx) | 55 | qmf_t X[MAX_NTSR][64], uint8_t offset, uint8_t kx) |
@@ -198,30 +174,6 @@ void sbr_qmf_analysis_32(sbr_info *sbr, qmfa_info *qmfa, const real_t *input, | |||
198 | } | 174 | } |
199 | } | 175 | } |
200 | 176 | ||
201 | qmfs_info *qmfs_init(uint8_t channels) | ||
202 | { | ||
203 | qmfs_info *qmfs = (qmfs_info*)faad_malloc(sizeof(qmfs_info)); | ||
204 | |||
205 | /* v is a double ringbuffer */ | ||
206 | qmfs->v = (real_t*)faad_malloc(2 * channels * 20 * sizeof(real_t)); | ||
207 | memset(qmfs->v, 0, 2 * channels * 20 * sizeof(real_t)); | ||
208 | |||
209 | qmfs->v_index = 0; | ||
210 | |||
211 | qmfs->channels = channels; | ||
212 | |||
213 | return qmfs; | ||
214 | } | ||
215 | |||
216 | void qmfs_end(qmfs_info *qmfs) | ||
217 | { | ||
218 | if (qmfs) | ||
219 | { | ||
220 | if (qmfs->v) faad_free(qmfs->v); | ||
221 | faad_free(qmfs); | ||
222 | } | ||
223 | } | ||
224 | |||
225 | #ifdef SBR_LOW_POWER | 177 | #ifdef SBR_LOW_POWER |
226 | 178 | ||
227 | void sbr_qmf_synthesis_32(sbr_info *sbr, qmfs_info *qmfs, qmf_t X[MAX_NTSR][64], | 179 | void sbr_qmf_synthesis_32(sbr_info *sbr, qmfs_info *qmfs, qmf_t X[MAX_NTSR][64], |