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) |
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 } #endif +#define S_F_BUF_SIZE (1920>>1) /* N = 1920 for static modes */ +static kiss_fft_scalar s_f2[S_F_BUF_SIZE] IBSS_ATTR MEM_ALIGN_ATTR; void clt_mdct_backward(const mdct_lookup *l, kiss_fft_scalar *in, kiss_fft_scalar * OPUS_RESTRICT out, const opus_val16 * OPUS_RESTRICT window, int overlap, int shift, int stride) { int i; int N, N2, N4; kiss_twiddle_scalar sine; -/* VARDECL(kiss_fft_scalar, f); */ + VARDECL(kiss_fft_scalar, f); VARDECL(kiss_fft_scalar, f2); SAVE_STACK; - N = l->n; /* static modes => N = 1920 */ + N = l->n; N >>= shift; N2 = N>>1; N4 = N>>2; -/* ALLOC(f, N2, kiss_fft_scalar); */ - kiss_fft_scalar f[N2]; /* worst case 3840b */ - ALLOC(f2, N2, kiss_fft_scalar); + kiss_fft_scalar s_f[S_F_BUF_SIZE]; + + if (S_F_BUF_SIZE >= N2) + { + f = s_f; + f2 = s_f2; + } + else + { + ALLOC(f , N2, kiss_fft_scalar); + ALLOC(f2, N2, kiss_fft_scalar); + } + /* sin(x) ~= x here */ #ifdef FIXED_POINT sine = TRIG_UPSCALE*(QCONST16(0.7853981f, 15)+N2)/N; |