From ef0d5f15c767a03a80bf6cea9c6e6e7cfe473168 Mon Sep 17 00:00:00 2001 From: Jean-Marc Valin Date: Tue, 22 Apr 2008 09:49:22 +1000 Subject: [PATCH] Further simplifications to the forward mdct --- libcelt/arch.h | 1 + libcelt/celt.c | 13 +++++-------- libcelt/fixed_debug.h | 3 +++ libcelt/fixed_generic.h | 3 +++ libcelt/mdct.c | 40 ++++++++++++++++------------------------ 5 files changed, 28 insertions(+), 32 deletions(-) diff --git a/libcelt/arch.h b/libcelt/arch.h index 16828f9a..73e9ea72 100644 --- a/libcelt/arch.h +++ b/libcelt/arch.h @@ -189,6 +189,7 @@ typedef float celt_mask_t; #define MULT16_32_Q13(a,b) ((a)*(b)) #define MULT16_32_Q14(a,b) ((a)*(b)) #define MULT16_32_Q15(a,b) ((a)*(b)) +#define MULT16_32_Q16(a,b) ((a)*(b)) #define MULT16_32_P15(a,b) ((a)*(b)) #define MULT32_32_Q31(a,b) ((a)*(b)) diff --git a/libcelt/celt.c b/libcelt/celt.c index ff029736..ec7b5447 100644 --- a/libcelt/celt.c +++ b/libcelt/celt.c @@ -153,29 +153,26 @@ static inline celt_int16_t SIG2INT16(celt_sig_t x) /** Apply window and compute the MDCT for all sub-frames and all channels in a frame */ static void compute_mdcts(const CELTMode *mode, const celt_word16_t * restrict window, celt_sig_t * restrict in, celt_sig_t * restrict out) { - int c, N4; const mdct_lookup *lookup = MDCT(mode); const int N = FRAMESIZE(mode); const int C = CHANNELS(mode); const int overlap = OVERLAP(mode); - N4 = (N-overlap)>>1; if (C==1) { mdct_forward(lookup, in, out, window, overlap); } else { + int c; VARDECL(celt_word32_t, x); VARDECL(celt_word32_t, tmp); SAVE_STACK; - ALLOC(x, 2*N, celt_word32_t); + ALLOC(x, N+overlap, celt_word32_t); ALLOC(tmp, N, celt_word32_t); for (c=0;c