From 082cd01eb212e9d973f64b3e90ed8e3345026ac5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nils=20Wallm=C3=A9nius?= Date: Tue, 25 Sep 2012 19:28:32 +0200 Subject: opus: speed up deemphasis Remove downsampling code from deemphasis loop as we don't use it and remove multiplications that are not relevant when not using custom modes. Saves 1.4MHz on h300 (cf), 4.3MHz on c200 (pp) and 4.6 on fuzev1 (amsv1). Change-Id: Iab3f1d737a656a563aaa351d50db987a9cff2287 --- lib/rbcodec/codecs/libopus/celt/celt.c | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) (limited to 'lib') diff --git a/lib/rbcodec/codecs/libopus/celt/celt.c b/lib/rbcodec/codecs/libopus/celt/celt.c index a4afb247b1..d91b8689b5 100644 --- a/lib/rbcodec/codecs/libopus/celt/celt.c +++ b/lib/rbcodec/codecs/libopus/celt/celt.c @@ -458,10 +458,10 @@ static void compute_inv_mdcts(const CELTMode *mode, int shortBlocks, celt_sig *X RESTORE_STACK; } -static void deemphasis(celt_sig *in[], opus_val16 *pcm, int N, int C, int downsample, const opus_val16 *coef, celt_sig *mem) +static void deemphasis(celt_sig *in[], opus_val16 *pcm, int N, int C, /* int downsample,*/ const opus_val16 *coef, celt_sig *mem) { int c; - int count=0; +/* int count=0;*/ c=0; do { int j; celt_sig * OPUS_RESTRICT x; @@ -472,18 +472,21 @@ static void deemphasis(celt_sig *in[], opus_val16 *pcm, int N, int C, int downsa for (j=0;jdownsample, st->mode->preemph, st->preemph_memD); + deemphasis(out_syn, pcm, N, C, /*st->downsample,*/ st->mode->preemph, st->preemph_memD); st->loss_count++; @@ -2661,7 +2664,7 @@ int celt_decode_with_ec(CELTDecoder * OPUS_RESTRICT st, const unsigned char *dat } while (++c<2); st->rng = dec->rng; - deemphasis(out_syn, pcm, N, CC, st->downsample, st->mode->preemph, st->preemph_memD); + deemphasis(out_syn, pcm, N, CC, /*st->downsample,*/ st->mode->preemph, st->preemph_memD); st->loss_count = 0; RESTORE_STACK; if (ec_tell(dec) > 8*len) -- cgit v1.2.3