From 6d2ad505dccda640439b6fa75fb742caf2981e11 Mon Sep 17 00:00:00 2001 From: Nils Wallménius Date: Thu, 4 Oct 2012 19:20:55 +0200 Subject: opus: put arrays frequently used by pulse decoding on the stack speeds up decoding of a 64kbps test file by 14MHz on h300 (cf) and 1MHz on c200 (pp) Change-Id: I852cb66808676ea51109423f5b70cfc8782dd109 --- lib/rbcodec/codecs/libopus/celt/cwrs.c | 8 +++++--- lib/rbcodec/codecs/libopus/celt/vq.c | 12 ++++++++---- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/lib/rbcodec/codecs/libopus/celt/cwrs.c b/lib/rbcodec/codecs/libopus/celt/cwrs.c index 3d5dd790d9..b8ade96fce 100644 --- a/lib/rbcodec/codecs/libopus/celt/cwrs.c +++ b/lib/rbcodec/codecs/libopus/celt/cwrs.c @@ -35,6 +35,7 @@ #include "cwrs.h" #include "mathops.h" #include "arch.h" +#include "rate.h" #ifdef CUSTOM_MODES @@ -632,11 +633,12 @@ void decode_pulses(int *_y,int _n,int _k,ec_dec *_dec) default: { #endif - VARDECL(opus_uint32,u); +/* VARDECL(opus_uint32,u); SAVE_STACK; - ALLOC(u,_k+2U,opus_uint32); + ALLOC(u,_k+2U,opus_uint32); */ + opus_uint32 u[MAX_PULSES+2]; cwrsi(_n,_k,ec_dec_uint(_dec,ncwrs_urow(_n,_k,u)),_y,u); - RESTORE_STACK; +/* RESTORE_STACK; */ #ifndef SMALL_FOOTPRINT } break; diff --git a/lib/rbcodec/codecs/libopus/celt/vq.c b/lib/rbcodec/codecs/libopus/celt/vq.c index 6a00edf9cd..f6b6e4fc64 100644 --- a/lib/rbcodec/codecs/libopus/celt/vq.c +++ b/lib/rbcodec/codecs/libopus/celt/vq.c @@ -325,12 +325,16 @@ unsigned alg_unquant(celt_norm *X, int N, int K, int spread, int B, int i; opus_val32 Ryy; unsigned collapse_mask; - VARDECL(int, iy); - SAVE_STACK; +/* VARDECL(int, iy); + SAVE_STACK; */ + + /* the difference between the last two values of eband5ms shifted by maxLM + which is 22 << 3 with the static mode */ + int iy[176]; celt_assert2(K>0, "alg_unquant() needs at least one pulse"); celt_assert2(N>1, "alg_unquant() needs at least two dimensions"); - ALLOC(iy, N, int); +/* ALLOC(iy, N, int); */ decode_pulses(iy, N, K, dec); Ryy = 0; i=0; @@ -340,7 +344,7 @@ unsigned alg_unquant(celt_norm *X, int N, int K, int spread, int B, normalise_residual(iy, X, N, Ryy, gain); exp_rotation(X, N, -1, B, K, spread); collapse_mask = extract_collapse_mask(iy, N, B); - RESTORE_STACK; +/* RESTORE_STACK; */ return collapse_mask; } -- cgit v1.2.3