diff options
author | Nicolas George <nicolas.george@normalesup.org> | 2012-03-02 11:49:27 +0100 |
---|---|---|
committer | Nicolas George <nicolas.george@normalesup.org> | 2012-03-05 16:57:28 +0100 |
commit | 9bbe6ed1e0b80249124b8c040544cc30e753bb76 (patch) | |
tree | f79ba3c7011e201982b07d1b8194d33f508af971 /libavdevice | |
parent | 3073aadf2ded5f02f2db7ee151a02f592ea24733 (diff) | |
download | ffmpeg-9bbe6ed1e0b80249124b8c040544cc30e753bb76.tar.gz |
timefilter: allow variable periods.
Initially found and designed by Michael Niedermayer.
Diffstat (limited to 'libavdevice')
-rw-r--r-- | libavdevice/timefilter.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libavdevice/timefilter.c b/libavdevice/timefilter.c index 4b8a10cb40..8451466657 100644 --- a/libavdevice/timefilter.c +++ b/libavdevice/timefilter.c @@ -50,7 +50,7 @@ TimeFilter *ff_timefilter_new(double time_base, double o = 2 * M_PI * bandwidth * period * time_base; self->clock_period = time_base; self->feedback2_factor = qexpneg(M_SQRT2 * o); - self->feedback3_factor = qexpneg(o * o); + self->feedback3_factor = qexpneg(o * o) / period; return self; } @@ -78,7 +78,7 @@ double ff_timefilter_update(TimeFilter *self, double system_time, double period) /// update loop self->cycle_time += FFMAX(self->feedback2_factor, 1.0 / self->count) * loop_error; - self->clock_period += self->feedback3_factor * loop_error / period; + self->clock_period += self->feedback3_factor * loop_error; } return self->cycle_time; } |