Go to the documentation of this file.
26 #define LFG_MAX ((1LL << 32) - 1)
36 for (n0 = 0; n0 < 40; n0 = 2 * n0 + 1) {
37 for (n1 = 0; n1 < 10; n1 = 2 * n1 + 1) {
38 double best_error = 1000000000;
39 double bestpar0 = n0 ? 1 : 100000;
46 ideal[
i] = samplet[
i] + n1 *
i / (1000);
55 for (par0 = bestpar0 * 0.8; par0 <= bestpar0 * 1.21; par0 += bestpar0 * 0.05) {
56 for (par1 = bestpar1 * 0.8; par1 <= bestpar1 * 1.21; par1 += bestpar1 * 0.05) {
60 printf(
"Could not allocate memory for timefilter.\n");
66 if(filtered < 0 || filtered > 1000000000)
67 printf(
"filter is unstable\n");
68 error += (filtered - ideal[
i]) * (filtered - ideal[
i]);
71 if (
error < best_error) {
80 printf(
" [%12f %11f %9f]", bestpar0, bestpar1, best_error);
static void error(const char *err)
Opaque type representing a time filter state.
av_cold void av_lfg_init(AVLFG *c, unsigned int seed)
TimeFilter * ff_timefilter_new(double time_base, double period, double bandwidth)
Create a new Delay Locked Loop time filter.
static unsigned int av_lfg_get(AVLFG *c)
Get the next random unsigned 32-bit number using an ALFG.
Context structure for the Lagged Fibonacci PRNG.
printf("static const uint8_t my_array[100] = {\n")
void ff_timefilter_destroy(TimeFilter *self)
Free all resources associated with the filter.
#define i(width, name, range_min, range_max)
double ff_timefilter_update(TimeFilter *self, double system_time, double period)
Update the filter.
Filter the word “frame” indicates either a video frame or a group of audio samples