diff options
| author | Dave Chapman <dave@dchapman.com> | 2005-10-31 20:33:27 +0000 |
|---|---|---|
| committer | Dave Chapman <dave@dchapman.com> | 2005-10-31 20:33:27 +0000 |
| commit | 798a4f3533cc63be2b313797bd4be5d53bda8fb9 (patch) | |
| tree | 0e2b8bdeff50b3d0a1cbe73c591f97ef73179b65 /apps/codecs/libfaad/ps_dec.c | |
| parent | 65de1cc6af31f547bd36d320f09cbcc6e6975421 (diff) | |
| download | rockbox-798a4f3533cc63be2b313797bd4be5d53bda8fb9.zip rockbox-798a4f3533cc63be2b313797bd4be5d53bda8fb9.tar.gz rockbox-798a4f3533cc63be2b313797bd4be5d53bda8fb9.tar.bz2 rockbox-798a4f3533cc63be2b313797bd4be5d53bda8fb9.tar.xz | |
Changes to make libfaad compile in Rockbox. Also remove compiler warnings, use some IRAM (IRAM usage needs reviewing) and drastically reduce the stack usage
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@7700 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/codecs/libfaad/ps_dec.c')
| -rw-r--r-- | apps/codecs/libfaad/ps_dec.c | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/apps/codecs/libfaad/ps_dec.c b/apps/codecs/libfaad/ps_dec.c index cfc5629..b219f58 100644 --- a/apps/codecs/libfaad/ps_dec.c +++ b/apps/codecs/libfaad/ps_dec.c @@ -159,10 +159,10 @@ typedef struct /* static function declarations */ static void ps_data_decode(ps_info *ps); -static hyb_info *hybrid_init(); +static hyb_info *hybrid_init(void); static void channel_filter2(hyb_info *hyb, uint8_t frame_len, const real_t *filter, qmf_t *buffer, qmf_t **X_hybrid); -static void INLINE DCT3_4_unscaled(real_t *y, real_t *x); +static INLINE void DCT3_4_unscaled(real_t *y, real_t *x); static void channel_filter8(hyb_info *hyb, uint8_t frame_len, const real_t *filter, qmf_t *buffer, qmf_t **X_hybrid); static void hybrid_analysis(hyb_info *hyb, qmf_t X[32][64], qmf_t X_hybrid[32][32], @@ -256,6 +256,7 @@ static void channel_filter2(hyb_info *hyb, uint8_t frame_len, const real_t *filt { uint8_t i; + (void)hyb; for (i = 0; i < frame_len; i++) { real_t r0 = MUL_F(filter[0],(QMF_RE(buffer[0+i]) + QMF_RE(buffer[12+i]))); @@ -290,6 +291,7 @@ static void channel_filter4(hyb_info *hyb, uint8_t frame_len, const real_t *filt uint8_t i; real_t input_re1[2], input_re2[2], input_im1[2], input_im2[2]; + (void)hyb; for (i = 0; i < frame_len; i++) { input_re1[0] = -MUL_F(filter[2], (QMF_RE(buffer[i+2]) + QMF_RE(buffer[i+10]))) + @@ -338,7 +340,7 @@ static void channel_filter4(hyb_info *hyb, uint8_t frame_len, const real_t *filt } } -static void INLINE DCT3_4_unscaled(real_t *y, real_t *x) +static INLINE void DCT3_4_unscaled(real_t *y, real_t *x) { real_t f0, f1, f2, f3, f4, f5, f6, f7, f8; @@ -365,6 +367,7 @@ static void channel_filter8(hyb_info *hyb, uint8_t frame_len, const real_t *filt real_t input_re1[4], input_re2[4], input_im1[4], input_im2[4]; real_t x[4]; + (void)hyb; for (i = 0; i < frame_len; i++) { input_re1[0] = MUL_F(filter[6],QMF_RE(buffer[6+i])); @@ -429,7 +432,7 @@ static void channel_filter8(hyb_info *hyb, uint8_t frame_len, const real_t *filt } } -static void INLINE DCT3_6_unscaled(real_t *y, real_t *x) +static INLINE void DCT3_6_unscaled(real_t *y, real_t *x) { real_t f0, f1, f2, f3, f4, f5, f6, f7; @@ -457,6 +460,7 @@ static void channel_filter12(hyb_info *hyb, uint8_t frame_len, const real_t *fil real_t input_re1[6], input_re2[6], input_im1[6], input_im2[6]; real_t out_re1[6], out_re2[6], out_im1[6], out_im2[6]; + (void)hyb; for (i = 0; i < frame_len; i++) { for (n = 0; n < 6; n++) @@ -1027,7 +1031,7 @@ static void ps_decorrelate(ps_info *ps, qmf_t X_left[38][64], qmf_t X_right[38][ qmf_t X_hybrid_left[32][32], qmf_t X_hybrid_right[32][32]) { uint8_t gr, n, m, bk; - uint8_t temp_delay; + uint8_t temp_delay = 0; uint8_t sb, maxsb; const complex_t *Phi_Fract_SubQmf; uint8_t temp_delay_ser[NO_ALLPASS_LINKS]; @@ -1847,6 +1851,7 @@ ps_info *ps_init(uint8_t sr_index) ps_info *ps = (ps_info*)faad_malloc(sizeof(ps_info)); memset(ps, 0, sizeof(ps_info)); + (void)sr_index; ps->hyb = hybrid_init(); ps->ps_data_available = 0; @@ -1935,8 +1940,11 @@ ps_info *ps_init(uint8_t sr_index) /* main Parametric Stereo decoding function */ uint8_t ps_decode(ps_info *ps, qmf_t X_left[38][64], qmf_t X_right[38][64]) { - qmf_t X_hybrid_left[32][32] = {{0}}; - qmf_t X_hybrid_right[32][32] = {{0}}; + qmf_t X_hybrid_left[32][32]; + qmf_t X_hybrid_right[32][32]; + + memset(&X_hybrid_left,0,sizeof(X_hybrid_left)); + memset(&X_hybrid_right,0,sizeof(X_hybrid_right)); /* delta decoding of the bitstream data */ ps_data_decode(ps); |