68 if (self->count == 1) {
69 self->cycle_time = system_time;
72 self->cycle_time +=
self->clock_period * period;
73 loop_error = system_time -
self->cycle_time;
75 self->cycle_time +=
FFMAX(self->feedback2_factor, 1.0 / self->count) * loop_error;
76 self->clock_period +=
self->feedback3_factor * loop_error / period;
78 return self->cycle_time;
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_freep(void *arg)
Free a memory block which has been allocated with av_malloc(z)() or av_realloc() and set the pointer ...
Opaque type representing a time filter state.
TimeFilter * ff_timefilter_new(double clock_period, double feedback2_factor, double feedback3_factor)
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
void * av_mallocz(size_t size)
Allocate a block of size bytes with alignment suitable for all memory accesses (including vectors if ...