diff options
author | Andree Buschmann <AndreeBuschmann@t-online.de> | 2012-10-01 22:07:44 +0200 |
---|---|---|
committer | Nils Wallménius <nils@rockbox.org> | 2012-10-01 22:07:44 +0200 |
commit | d7799aaf33d23ec4a795a2d4b769e60117d822f5 (patch) | |
tree | ed0d1f24b95fa13eb6e237e9def455469927e24f | |
parent | b6bcb1338e06c3cfcc7e844dd248c332743de5c6 (diff) | |
download | rockbox-d7799aaf33d23ec4a795a2d4b769e60117d822f5.tar.gz rockbox-d7799aaf33d23ec4a795a2d4b769e60117d822f5.zip |
opus: allocate mdct f2 buffer in iram
Speeds up decoding of 64kbps test file by 6.3MHz on h300 (cf)
and 1.2MHz on c200 (pp).
Signed-off-by: Nils Wallménius <nils@rockbox.org>
Change-Id: I08c2c332153abcbef9447c81986777fd2fcc73fe
-rw-r--r-- | lib/rbcodec/codecs/libopus/celt/mdct.c | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/lib/rbcodec/codecs/libopus/celt/mdct.c b/lib/rbcodec/codecs/libopus/celt/mdct.c index 15d2393d6f..8fc1b54db7 100644 --- a/lib/rbcodec/codecs/libopus/celt/mdct.c +++ b/lib/rbcodec/codecs/libopus/celt/mdct.c | |||
@@ -208,22 +208,34 @@ void clt_mdct_forward(const mdct_lookup *l, kiss_fft_scalar *in, kiss_fft_scalar | |||
208 | } | 208 | } |
209 | #endif | 209 | #endif |
210 | 210 | ||
211 | #define S_F_BUF_SIZE (1920>>1) /* N = 1920 for static modes */ | ||
212 | static kiss_fft_scalar s_f2[S_F_BUF_SIZE] IBSS_ATTR MEM_ALIGN_ATTR; | ||
211 | void clt_mdct_backward(const mdct_lookup *l, kiss_fft_scalar *in, kiss_fft_scalar * OPUS_RESTRICT out, | 213 | void clt_mdct_backward(const mdct_lookup *l, kiss_fft_scalar *in, kiss_fft_scalar * OPUS_RESTRICT out, |
212 | const opus_val16 * OPUS_RESTRICT window, int overlap, int shift, int stride) | 214 | const opus_val16 * OPUS_RESTRICT window, int overlap, int shift, int stride) |
213 | { | 215 | { |
214 | int i; | 216 | int i; |
215 | int N, N2, N4; | 217 | int N, N2, N4; |
216 | kiss_twiddle_scalar sine; | 218 | kiss_twiddle_scalar sine; |
217 | /* VARDECL(kiss_fft_scalar, f); */ | 219 | VARDECL(kiss_fft_scalar, f); |
218 | VARDECL(kiss_fft_scalar, f2); | 220 | VARDECL(kiss_fft_scalar, f2); |
219 | SAVE_STACK; | 221 | SAVE_STACK; |
220 | N = l->n; /* static modes => N = 1920 */ | 222 | N = l->n; |
221 | N >>= shift; | 223 | N >>= shift; |
222 | N2 = N>>1; | 224 | N2 = N>>1; |
223 | N4 = N>>2; | 225 | N4 = N>>2; |
224 | /* ALLOC(f, N2, kiss_fft_scalar); */ | 226 | kiss_fft_scalar s_f[S_F_BUF_SIZE]; |
225 | kiss_fft_scalar f[N2]; /* worst case 3840b */ | 227 | |
226 | ALLOC(f2, N2, kiss_fft_scalar); | 228 | if (S_F_BUF_SIZE >= N2) |
229 | { | ||
230 | f = s_f; | ||
231 | f2 = s_f2; | ||
232 | } | ||
233 | else | ||
234 | { | ||
235 | ALLOC(f , N2, kiss_fft_scalar); | ||
236 | ALLOC(f2, N2, kiss_fft_scalar); | ||
237 | } | ||
238 | |||
227 | /* sin(x) ~= x here */ | 239 | /* sin(x) ~= x here */ |
228 | #ifdef FIXED_POINT | 240 | #ifdef FIXED_POINT |
229 | sine = TRIG_UPSCALE*(QCONST16(0.7853981f, 15)+N2)/N; | 241 | sine = TRIG_UPSCALE*(QCONST16(0.7853981f, 15)+N2)/N; |