From 32454dcadc8efe61deb92dc586c69f65cf22e07a Mon Sep 17 00:00:00 2001 From: Jean-Marc Valin Date: Mon, 6 Jan 2014 09:11:52 -0500 Subject: [PATCH] Hack that makes the SMALL_FOOTPRINT CELT decoder use only 4.25 kB of stack. --- celt/celt_decoder.c | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/celt/celt_decoder.c b/celt/celt_decoder.c index 7b79094c..397ced36 100644 --- a/celt/celt_decoder.c +++ b/celt/celt_decoder.c @@ -708,7 +708,11 @@ int celt_decode_with_ec(CELTDecoder * OPUS_RESTRICT st, const unsigned char *dat opus_int32 bits; ec_dec _dec; VARDECL(celt_sig, freq); +#ifdef SMALL_FOOTPRINT + celt_norm *X; +#else VARDECL(celt_norm, X); +#endif VARDECL(int, fine_quant); VARDECL(int, pulses); VARDECL(int, cap); @@ -944,9 +948,21 @@ int celt_decode_with_ec(CELTDecoder * OPUS_RESTRICT st, const unsigned char *dat unquant_fine_energy(mode, start, end, oldBandE, fine_quant, dec, C); + c=0; do { + OPUS_MOVE(decode_mem[c], decode_mem[c]+N, DECODE_BUFFER_SIZE-N+overlap/2); + out_syn[c] = decode_mem[c]+DECODE_BUFFER_SIZE-N; + } while (++cdownsample, silence); c=0; do {