diff options
author | Linfeng Zhang <linfengz@google.com> | 2016-06-17 02:21:02 +0300 |
---|---|---|
committer | Felicia Lim <flim@google.com> | 2017-01-18 01:04:37 +0300 |
commit | 783ad76766e1f6b6aaca5d6eb415ac8a8269e1f2 (patch) | |
tree | 120458893d45586c9c1f3ee07135a71b4d22fc01 /celt/celt_decoder.c | |
parent | c9ba55208c842a1681d82e7d7ff44fafedd2a853 (diff) |
Revise celt_fir_c() to not pass in argument "mem"
The "mem" in celt_fir_c() either is contained in the head of input "x"
in reverse order already, or can be easily attached to the head of "x"
before calling the function. Removing argument "mem" can eliminate the
redundant buffer copies inside.
Update celt_fir_sse4_1() accordingly.
Diffstat (limited to 'celt/celt_decoder.c')
-rw-r--r-- | celt/celt_decoder.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/celt/celt_decoder.c b/celt/celt_decoder.c index 58e7b75a..567d7456 100644 --- a/celt/celt_decoder.c +++ b/celt/celt_decoder.c @@ -556,10 +556,11 @@ static void celt_decode_lost(CELTDecoder * OPUS_RESTRICT st, int N, int LM) } else { /* Pitch-based PLC */ const opus_val16 *window; + opus_val16 *exc; opus_val16 fade = Q15ONE; int pitch_index; VARDECL(opus_val32, etmp); - VARDECL(opus_val16, exc); + VARDECL(opus_val16, _exc); if (loss_count == 0) { @@ -570,7 +571,8 @@ static void celt_decode_lost(CELTDecoder * OPUS_RESTRICT st, int N, int LM) } ALLOC(etmp, overlap, opus_val32); - ALLOC(exc, MAX_PERIOD, opus_val16); + ALLOC(_exc, MAX_PERIOD+LPC_ORDER, opus_val16); + exc = _exc+LPC_ORDER; window = mode->window; c=0; do { opus_val16 decay; @@ -635,15 +637,14 @@ static void celt_decode_lost(CELTDecoder * OPUS_RESTRICT st, int N, int LM) /* Initialize the LPC history with the samples just before the start of the region for which we're computing the excitation. */ { - opus_val16 lpc_mem[LPC_ORDER]; for (i=0;i<LPC_ORDER;i++) { - lpc_mem[i] = - ROUND16(buf[DECODE_BUFFER_SIZE-exc_length-1-i], SIG_SHIFT); + exc[MAX_PERIOD-exc_length-LPC_ORDER+i] = + ROUND16(buf[DECODE_BUFFER_SIZE-exc_length-LPC_ORDER+i], SIG_SHIFT); } /* Compute the excitation for exc_length samples before the loss. */ celt_fir(exc+MAX_PERIOD-exc_length, lpc+c*LPC_ORDER, - exc+MAX_PERIOD-exc_length, exc_length, LPC_ORDER, lpc_mem, st->arch); + exc+MAX_PERIOD-exc_length, exc_length, LPC_ORDER, st->arch); } /* Check if the waveform is decaying, and if so how fast. |