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>2016-08-15 23:46:05 +0300
committerJean-Marc Valin <jmvalin@jmvalin.ca>2016-08-15 23:46:05 +0300
commit9ac942660dd662851f025a97784fdcbf21be87fe (patch)
tree800d3d3a1a84829f6db799d189de79ec30405aba
parent11dba8d902983e271da4a7499ef56e4d7bd7111f (diff)
Reducing the dependency chain in dc_reject()
Speeds up the encoder by about 1%
-rw-r--r--src/opus_encoder.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/opus_encoder.c b/src/opus_encoder.c
index 319ac64d..58a0cab9 100644
--- a/src/opus_encoder.c
+++ b/src/opus_encoder.c
@@ -415,10 +415,10 @@ static void dc_reject(const opus_val16 *in, opus_int32 cutoff_Hz, opus_val16 *ou
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;
}
}