[MPlayer-dev-eng] enhancement for yuv4mpeg output driver

Trent Piepho xyzzy at speakeasy.org
Thu Jan 20 22:51:20 CET 2005


On Thu, 20 Jan 2005, Michael Niedermayer wrote:
> 
> see the attached file, which checks this by brute force

It is nice that you really check that av_d2q works instead of just stating it
must be so.

However, your test cheated at one thing!  The fps value is passed to the vo
driver via a float global variable.  You passed the fps value (a/(double)b)
directly to av_d2q, this allows gcc to leave the floating point number in a
register and give you extra precision.

Try this little change to make it a fair comparison:

@@ -12,0 +13,2 @@
+float vo_fps;
+
@@ -22 +24,2 @@
-            q= av_d2q(a/(double)b, MAXI);
+            vo_fps = a/(double)b;
+            q= av_d2q(vo_fps, MAXI);

Now you find many many cases where av_d2q fails!  Such as these, after raising
MAXI to 60000:
23993/1001 -> 29410/1227
23997/1001 -> 36439/1520
24000/1001 -> 31001/1293   Where I have seen this before???
24001/1001 -> 26087/1088
24004/1001 -> 46809/1952




More information about the MPlayer-dev-eng mailing list