[MPlayer-dev-eng] [PATCH] MPEG-2 TS 60000/1001 FPS Conversion Error in mencoder

Trent Piepho xyzzy at speakeasy.org
Tue Dec 5 12:30:22 CET 2006


On Sun, 26 Nov 2006, Uoti Urpala wrote:
> On Sun, 2006-11-26 at 06:09 -0800, Trent Piepho wrote:
> > You can find an even older thread, where I explain that av_d2q doesn't
> > work.
>
> And don't have a clue when you say that.
>
> >   Certain people refused to acknowledge that the numbers were wrong.
>
> Other people did note in that thread that it's possible to reconstruct
> the fraction from doubles but float accuracy might not be enough. And

No, they said, "you must be doing something wrong." No one would admit to
what I had claimed all along, that you can't stick the standard NTSC
framerates into a float and get them back out with av_d2q().

> guess what, they were right and your claims were wrong.
>
> (gdb) print (float)(31001./1293) == (float)(24000./1001)
> $1 = 1
>
> So av_d2q or whatever function was used to reconstruct the fraction
> "didn't work" when it could not tell the difference between 2 equal
> float values?

That's the whole problem.  The true value of 31001/1293 is closer to the
floating point representation of 24000/1001 than 24000/1001 is.  So av_d2q
picks over 31001/1293 over 24000/1001.

The original claim was that 24000/1001, 30000/1001 and 60000/1001 could be
put into a float and av_d2q would be able to get them back out.  This
obviously doesn't work and I demonstrated that, but certain people would
not believe me.



More information about the MPlayer-dev-eng mailing list