From 11dba8d902983e271da4a7499ef56e4d7bd7111f Mon Sep 17 00:00:00 2001 From: Jean-Marc Valin Date: Sun, 14 Aug 2016 17:56:45 -0400 Subject: Apply deemphasis to both channels in the same loop for the simple case This makes the decoder ~2.5% faster on x86 because the stereo loop takes the same processing time as one mono loop due to the dependency chain --- celt/celt_decoder.c | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/celt/celt_decoder.c b/celt/celt_decoder.c index 43b876b8..e441d045 100644 --- a/celt/celt_decoder.c +++ b/celt/celt_decoder.c @@ -177,6 +177,36 @@ void opus_custom_decoder_destroy(CELTDecoder *st) } #endif /* CUSTOM_MODES */ +#ifndef CUSTOM_MODES +/* Special case for stereo with no downsampling and no accumulation. This is + quite common and we can make it faster by processing both channels in the + same loop, reducing overhead due to the dependency loop in the IIR filter. */ +static void deemphasis_stereo_simple(celt_sig *in[], opus_val16 *pcm, int N, const opus_val16 coef0, + celt_sig *mem) +{ + celt_sig * OPUS_RESTRICT x0; + celt_sig * OPUS_RESTRICT x1; + celt_sig m0, m1; + int j; + x0=in[0]; + x1=in[1]; + m0 = mem[0]; + m1 = mem[1]; + for (j=0;j