43 return 1 - 1 / (1 + x * (1 + x / 2 * (1 + x / 3)));
51 double o = 2 *
M_PI * bandwidth * period * time_base;
56 self->clock_period = time_base;
58 self->feedback3_factor =
qexpneg(o * o) / period;
75 if (self->count == 1) {
76 self->cycle_time = system_time;
79 self->cycle_time +=
self->clock_period * period;
80 loop_error = system_time -
self->cycle_time;
82 self->cycle_time +=
FFMAX(self->feedback2_factor, 1.0 / self->count) * loop_error;
83 self->clock_period +=
self->feedback3_factor * loop_error;
85 return self->cycle_time;
90 return self->cycle_time +
self->clock_period *
delta;
void ff_timefilter_destroy(TimeFilter *self)
Free all resources associated with the filter.
Memory handling functions.
void ff_timefilter_reset(TimeFilter *self)
Reset the filter.
void * av_mallocz(size_t size)
Allocate a memory block with alignment suitable for all memory accesses (including vectors if availab...
double ff_timefilter_eval(TimeFilter *self, double delta)
Evaluate the filter at a specified time.
Opaque type representing a time filter state.
static double qexpneg(double x)
TimeFilter * ff_timefilter_new(double time_base, double period, double bandwidth)
Create a new Delay Locked Loop time filter.
double ff_timefilter_update(TimeFilter *self, double system_time, double period)
Update the filter.
common internal and external API header