ref: 9ac942660dd662851f025a97784fdcbf21be87fe
parent: 11dba8d902983e271da4a7499ef56e4d7bd7111f
author: Jean-Marc Valin <jmvalin@jmvalin.ca>
date: Mon Aug 15 12:46:05 EDT 2016
Reducing the dependency chain in dc_reject() Speeds up the encoder by about 1%
--- a/src/opus_encoder.c
+++ b/src/opus_encoder.c
@@ -415,10 +415,10 @@
x = in[channels*i+c];
/* First stage */
tmp = x-hp_mem[2*c];
- hp_mem[2*c] = hp_mem[2*c] + coef*(x - hp_mem[2*c]) + VERY_SMALL;
+ hp_mem[2*c] = coef*x + VERY_SMALL - (1-coef)*hp_mem[2*c];
/* Second stage */
y = tmp - hp_mem[2*c+1];
- hp_mem[2*c+1] = hp_mem[2*c+1] + coef*(tmp - hp_mem[2*c+1]) + VERY_SMALL;
+ hp_mem[2*c+1] = coef*tmp + VERY_SMALL + (1-coef)*hp_mem[2*c+1];
out[channels*i+c] = y;
}
}