logo Sign In

Post #127675

Author
Moth3r
Parent topic
.: Moth3r's PAL DVD project :.
Link to post in topic
https://originaltrilogy.com/post/id/127675/action/topic#127675
Date created
4-Aug-2005, 4:17 PM
I believe it's a problem with some MJPEG codecs doing a non-standard YUY2 -> RGB conversion.

http://www.doom9.org/capture/digital_video_color.html

A good thing to know. If you feed a YUY2 file into VirtualDub or TMPGEnc, it will be converted to RGB before it gets there. This conversion will be done by the codec (like huffyuv or an mjpeg codec) if you open the avi directly. It can be done by an explicit ConvertToRGB32() within AviSynth, or it will be done by your operating system if you open the file in AviSynth and output uncompressed YUY2. The reason you may care is that the luma range may be handled differently depending upon the method of conversion. The standard way of converting is to take the normal range of YUY2 (which is 16-235) and expand it to the normal range of RGB (which is 0-255). Huffyuv, the AviSynth conversion routines, and the default OS conversions do this. The down side of this is that any values outside of the normal range will be set to 0 or 255. This is called clamping. A non-standard method of conversion is to keep the 16-235 range for the RGB. The problem with this is that if you don't deal with this correctly, you will get washed out looking video. The major mjpeg codecs (and some DV ones) do this non-standard YUY2->RGB conversion. TMPGEnc and other mpeg encoders have a setting to adjust for this. In VirtualDub, you need to make the adjustment manually, or simply know what you have before you feed it to your encoder.