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

D Richard Felker III dalias at aerifal.cx
Fri Jan 21 00:12:54 CET 2005

On Thu, Jan 20, 2005 at 01:18:50PM -0800, Trent Piepho wrote:
> On Thu, 20 Jan 2005, D Richard Felker III wrote:
> > > any fraction that was converted to a floating point number back into a
> > > fraction, that is theoretically impossible.
> > 
> > of course. but if you know a bound on the denominator, and the bound
> > is small enough, it IS possible to losslessly reverse the conversion
> > to float.
> Only if the number of bits in the mantissa is smaller than the number of bits
> in the original denominator.  Secondly, you don't know the original bound on the
> denominator.  

Smaller?? Nonsense, you have things totally backwards. I'm a
mathematician so I think there might just be a chance I understand
these things... And I can assure you that it works fine in practice,
at least if fps is given as a double. Perhaps with float it's

> > > I came up with a simple routine for converting floats to fractions that works
> > > correctly for any frame rate you are ever likely to see.  The routine in lavc
> > 
> > your code is idiotic. it will produce wrong results for avi files with
> > broken near-ntsc framerates in their headers.
> Do a google search for mplayer and yuv4mpeg.  I think you'll find that
> every single example of people ysing the yuv4mpeg output driver involves them
> overriding the incorrect yuv4mpeg header mplayer generates with one that uses
> a standard frame-rate.  I dare you to find a counter example.

Yes the current mplayer code is stupid and incorrect. Yours is just
even more stupid.

> > > does not even work for all 18 of the ATSC standard formats, much less typical
> > > avi files, while being more complex.  Why do you want me to cut and paste the
> > > code from lavc into vo_yuv4mpeg?
> > > 
> > > If you want to replace what's in lavc with my code, that's really a different
> > > issue than getting the yuv4mpeg output driver to create a working header.
> > 
> > rotfl!! no thanks. lavc's code already works perfectly.
> You said I'm probably doing something else wrong, and that's why lavc isn't
> always correct.  So, what was I doing wrong?  Try my patch, av_d2q doesn't
> always give the correct fraction.  Did you try it and find that it works for
> mpeg files with frame-rate codes 1, 4, and 7?  Or do you simply believe it
> will work on faith and refuse to look at my evidence that it doesn't?

I trust Michael, who said av_d2q works fine for him.


More information about the MPlayer-dev-eng mailing list