26 #define LFG_MAX ((1LL << 32) - 1) 35 for (n0 = 0; n0 < 40; n0 = 2 * n0 + 1) {
36 for (n1 = 0; n1 < 10; n1 = 2 * n1 + 1) {
37 double best_error = 1000000000;
39 double bestpar1 = 0.001;
44 ideal[i] = 10 + i + n1 * i / (1000);
51 for (par0 = bestpar0 * 0.8; par0 <= bestpar0 * 1.21; par0 += bestpar0 * 0.05) {
52 for (par1 = bestpar1 * 0.8; par1 <= bestpar1 * 1.21; par1 += bestpar1 * 0.05) {
56 printf(
"Could not allocate memory for timefilter.\n");
62 error += (filtered - ideal[i]) * (filtered - ideal[i]);
65 if (error < best_error) {
74 printf(
" [%f %f %9f]", bestpar0, bestpar1, best_error);
void ff_timefilter_destroy(TimeFilter *self)
Free all resources associated with the filter.
Opaque type representing a time filter state.
static unsigned int av_lfg_get(AVLFG *c)
Get the next random unsigned 32-bit number using an ALFG.
TimeFilter * ff_timefilter_new(double clock_period, double feedback2_factor, double feedback3_factor)
Create a new Delay Locked Loop time filter.
av_cold void av_lfg_init(AVLFG *c, unsigned int seed)
double ff_timefilter_update(TimeFilter *self, double system_time, double period)
Update the filter.
common internal and external API header