>There is a simple scenario I used to test theese things: I created a jpeg
 >with colorbars of known RGB-values ( grey0(=black), grey8, ...,
 >grey255(=white), and similar for red, green, blue ). Then I duplicated the
 >file many times and made a YUV stream of it using jpeg2yuv. I piped this
 >stream to some mjpeg-tools and checked the value range of the YUV stream
 >after each tool by inserting a selfmade yuvfilter. At last I encoded the
 >stream with mpeg2enc, decoded it with mplayer to jpegs again and checked
 >the colorbars with gimp.
 >
 >Result: Everything works well if YUV ranges are kept within
 >[16-235]-range. mpeg2enc then encodes [black-white] and after decoding the
 >original colorbars are replicated. When YUV-ranges broaden before
 >mpeg2enc, then the resulting colorbars have an increased contrast and the
 >dark/light bars are replicated as black/white.
 >So it's indifferent where in mpeg2enc/dec the clipping/whatever takes
 >place. The main thing is, that out-of-border-values finally get lost.
 >This is bad. It's not intended.

Actually, it *does* make a difference where it happens.
(i.e., now it is your turn to get flamed by me for shoddy work... :)

1)  Your test scenario is *far* from simple --- it uses at least 6 different
     utilities, some with well-known flaws, and some which are not part of
     this MJPEGtools project...

2)  You *should* have just created a program to produce a synthetic YUV4MPEG2
     stream which you could feed through the various tools, and then you
     *should* have analyzed the results, directly from the output YUV4MPEG2
     stream.

3)  It's not "YUV".  It is "Y'CbCr" or "YCbCr".  If you are going to be picky
     about standards, then you should conform yourself to those standards.

4)  OF COURSE you are getting clipping --- you are taking out-of-range Y'CbCr
     values, passing them through some byzantine collection of codecs, and
     then, as your final step, you are converting them to R'G'B' in the Gimp!
    That last step is always going to clip Y'CbCr values which are out of the
     range of the R'G'B' color cube.
    I would venture to say that mplayer is actually doing the correct
     rescaling of the Y'CbCr in the MPEG stream it is converting to JPEG,
     and thus the clipping is (correctly) occurring there.

5)  At most, you have demonstrated that jpeg2yuv didn't properly rescale the
     Y'CbCr values in your colorbars.  This is not news; it is documented in
     the jpeg2yuv manpage, and it was fixed by Gernot this week.

 >So why not accept standards and try to cleanup software?

I don't think anyone around here has ever refused a clean patch or a useful
 bug report.

-matt m.


-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com
_______________________________________________
Mjpeg-users mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/mjpeg-users

Reply via email to