Browse code

Add code to the self test to print jitter & drift.

Originally committed as revision 17857 to svn://svn.ffmpeg.org/ffmpeg/trunk

Michael Niedermayer authored on 2009/03/07 05:48:31
Showing 1 changed files
... ...
@@ -81,8 +81,14 @@ int main(void)
81 81
 #define SAMPLES 1000
82 82
     double ideal[SAMPLES];
83 83
     double samples[SAMPLES];
84
+#if 1
84 85
     for(n0= 0; n0<40; n0=2*n0+1){
85 86
         for(n1= 0; n1<10; n1=2*n1+1){
87
+#else
88
+    {{
89
+        n0=7;
90
+        n1=1;
91
+#endif
86 92
             double best_error= 1000000000;
87 93
             double bestpar0=1;
88 94
             double bestpar1=0.001;
... ...
@@ -116,7 +122,19 @@ int main(void)
116 116
                     }
117 117
                 }
118 118
             }while(better);
119
+#if 0
120
+            double lastfil=9;
121
+            TimeFilter *tf= ff_timefilter_new(1, bestpar0, bestpar1);
122
+            for(i=0; i<SAMPLES; i++){
123
+                double filtered;
124
+                filtered=  ff_timefilter_update(tf, samples[i], 1);
125
+                printf("%f %f %f %f\n", i - samples[i] + 10, filtered - samples[i], samples[FFMAX(i, 1)] - samples[FFMAX(i-1, 0)], filtered - lastfil);
126
+                lastfil= filtered;
127
+            }
128
+            ff_timefilter_destroy(tf);
129
+#else
119 130
             printf(" [%f %f %f]", bestpar0, bestpar1, best_error);
131
+#endif
120 132
         }
121 133
         printf("\n");
122 134
     }