Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.xiph.org/xiph/opus.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Marc Valin <jmvalin@jmvalin.ca>2012-11-03 19:36:39 +0400
committerJean-Marc Valin <jmvalin@jmvalin.ca>2012-11-03 19:36:39 +0400
commit5ab07e6b9a349c5e612890236cd1a5fd06c6b9fc (patch)
tree09e56f925142b09f43bccbe9a5adb9382a7e4623
parentfedfe91d3783b3ae9eabccd60ab32e0f3d49e453 (diff)
comb_filter() bypass for the case where the gain is zero.
-rw-r--r--celt/celt.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/celt/celt.c b/celt/celt.c
index c68566f0..26695fae 100644
--- a/celt/celt.c
+++ b/celt/celt.c
@@ -639,6 +639,14 @@ static void comb_filter(opus_val32 *y, opus_val32 *x, int T0, int T1, int N,
{QCONST16(0.3066406250f, 15), QCONST16(0.2170410156f, 15), QCONST16(0.1296386719f, 15)},
{QCONST16(0.4638671875f, 15), QCONST16(0.2680664062f, 15), QCONST16(0.f, 15)},
{QCONST16(0.7998046875f, 15), QCONST16(0.1000976562f, 15), QCONST16(0.f, 15)}};
+
+ if (g0==0 && g1==0)
+ {
+ /* OPT: Happens to work without the OPUS_MOVE(), but only because the current encoder already copies x to y */
+ if (x!=y)
+ OPUS_MOVE(y, x, N);
+ return;
+ }
g00 = MULT16_16_Q15(g0, gains[tapset0][0]);
g01 = MULT16_16_Q15(g0, gains[tapset0][1]);
g02 = MULT16_16_Q15(g0, gains[tapset0][2]);
@@ -667,6 +675,13 @@ static void comb_filter(opus_val32 *y, opus_val32 *x, int T0, int T1, int N,
x1=x0;
}
+ if (g1==0)
+ {
+ /* OPT: Happens to work without the OPUS_MOVE(), but only because the current encoder already copies x to y */
+ if (x!=y)
+ OPUS_MOVE(y+overlap, x+overlap, N-overlap);
+ return;
+ }
/* OPT: For machines where the movs are costly, unroll by 5 */
for (;i<N;i++)
{