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-10-09 11:07:06 +0400
committerJean-Marc Valin <jmvalin@jmvalin.ca>2012-10-09 11:07:06 +0400
commit7315b35e13a3a7c504ed6b1fe2d28ad500eb2701 (patch)
treec6ed1c6869b13c5e2514c3ff7cfda4ce350f3fc8 /celt/pitch.c
parentca82894ef16bbd74839cb93e35486e5a3b90426d (diff)
parent317ffc203efc63333fc3b6a42fdb2887321a4325 (diff)
Merge branch 'exp_analysis7'
Conflicts: celt/celt.c celt/mdct.c include/opus_defines.h src/opus_encoder.c
Diffstat (limited to 'celt/pitch.c')
-rw-r--r--celt/pitch.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/celt/pitch.c b/celt/pitch.c
index c2f08ec1..d9bba1b2 100644
--- a/celt/pitch.c
+++ b/celt/pitch.c
@@ -331,6 +331,7 @@ opus_val16 remove_doubling(opus_val16 *x, int maxperiod, int minperiod,
int T1, T1b;
opus_val16 g1;
opus_val16 cont=0;
+ opus_val16 thresh;
T1 = (2*T0+k)/(2*k);
if (T1 < minperiod)
break;
@@ -372,7 +373,14 @@ opus_val16 remove_doubling(opus_val16 *x, int maxperiod, int minperiod,
cont = HALF32(prev_gain);
else
cont = 0;
- if (g1 > QCONST16(.3f,15) + MULT16_16_Q15(QCONST16(.4f,15),g0)-cont)
+ thresh = MAX16(QCONST16(.3f,15), MULT16_16_Q15(QCONST16(.7,15),g0)-cont);
+ /* Bias against very high pitch (very short period) to avoid false-positives
+ due to short-term correlation */
+ if (T1<3*minperiod)
+ thresh = MAX16(QCONST16(.4f,15), MULT16_16_Q15(QCONST16(.85,15),g0)-cont);
+ else if (T1<2*minperiod)
+ thresh = MAX16(QCONST16(.5f,15), MULT16_16_Q15(QCONST16(.9,15),g0)-cont);
+ if (g1 > thresh)
{
best_xy = xy;
best_yy = yy;