aboutsummaryrefslogtreecommitdiffstats
path: root/libavfilter/af_atempo.c
diff options
context:
space:
mode:
authorPavel Koshevoy <pkoshevoy@gmail.com>2012-06-17 16:45:26 -0600
committerMichael Niedermayer <michaelni@gmx.at>2012-06-19 17:29:27 +0200
commit5fa82264201c3bcd09615c5983496983b4012566 (patch)
tree3aad88546da2dadb1a825b6e1e44258f53ad9679 /libavfilter/af_atempo.c
parent08613d50d6e3088299fae6d2095fecb5e509aa9e (diff)
downloadffmpeg-5fa82264201c3bcd09615c5983496983b4012566.tar.gz
libavfilter: improve atempo audio quality
Reduce audio fragment alignment jitter by penalizing alignment correction offsets that deviate too much from the target offset. This is accomplished by multiplying the cross correlation search window with a quadratic function. Signed-off-by: Pavel Koshevoy <pavel@homestead.aragog.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavfilter/af_atempo.c')
-rw-r--r--libavfilter/af_atempo.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavfilter/af_atempo.c b/libavfilter/af_atempo.c
index 1ccc3f5629..92390cf217 100644
--- a/libavfilter/af_atempo.c
+++ b/libavfilter/af_atempo.c
@@ -654,7 +654,7 @@ static int yae_align(AudioFragment *frag,
// normalize:
FFTSample drifti = (FFTSample)(drift + i);
- metric *= drifti;
+ metric *= drifti * (FFTSample)(i - i0) * (FFTSample)(i1 - i);
if (metric > best_metric) {
best_metric = metric;