Log in

View Full Version : Colorspace and YUV->RGB scale


r6d2
7th June 2003, 05:08
Hello guys. I am confused about the colorspace and YUY->RBG scale from DVD2AVI (1.76 included in D2S) related to D2S (1.1.3b2). I am using TMPGEnc (2.511). I have read many threads, FAQs, and the information I find is contradictory.

Some guides advice you to keep the defaults settings, like this one:


http://www.doom9.org/index.html?/mpg/d2a-svcd.htm

Now we have to make sure that the video data stays in YUV format. Make sure that YUV is checked, otherwise we're going to lose our speed advantage.

Or here, in advanced reference:


http://www.doom9.org/index.html?/mpg/d2a-svcd.htm

Output YUV data as Basic YCbCr not CCIR601 default unchecked
Enabling this cause the 8-bit value for the components to be of a value between 0 and 255 in YCbCr, and not the CCIR601 values of 16 to 235.

This is usually disabled.

So, the D2S defaults seem to be right!

But in this thread, for instance:


http://forum.doom9.org/showthread.php?s=&threadid=46851

Q10: Which colorspace should I use?
A: RGB if you are doing to frameserve to vfapi. YUV in all other cases.

Q11: Which YUV->RGB scale should I use?
A: Rather selfexplaining: Use PC scale if you are going to mainly watch the final video on a PC, and and TV scale if you mainly are going to watch it on a TV.


you are adviced to use RGB and PC scale for TVs, which (I guess)applies to the SVCDs I want to encode.

This one also says something similar:


http://www.dvdrhelp.com/forum/userguides/131154.php

- Outputting YUV data as Basic YCbCr not CCIR601 is preferrable, if your DVD player can handle it. Most players can. The rationale is that for every color CCIR allows 227 values while Basic YCbCr allows 256 values. Essentially this allows for more individual colors to be displayed. This is good if your source is true RGB (like all divx avi's are). DV is CCIR601 so if your source is DV, remapping 227 values onto 256 values will cause a loss in definition i.e. bad.


and this one is more detailed and convicing:


http://www.dvdrhelp.com/tmpgencexplained.htm

Output YUV Data as basic YCbCr not CCIR601: This changes the colour scale from 8-235 to 0-255.

If the source comes from DVD2AVI this box should be ticked and the colours should be set to TV scale in DVD2AVI. By doing it this way, any detail above 235 and below 8 will be kept. It is VERY important to do this when encoding test patterns for setting brightness and contrast levels.

Alternatively, the box can be unticked, and the color set to PC scale in DVD2AVI. With it set this way, detail below 8 and above 235 is lost forever.

Following this last advice, I enabled this setting in the advanced options for TMPGEnc and tried to change the YUY-RGB scale to "TV Scale" in DVD2AVI before launching D2S and encoding the movie.

However, it appears that D2S changed that, since the DVD2AVI project says:

YUVRGB_Scale=1

which seems to be "PC Scale".

The question is then: For encoding movies to be watched on TVs as SVCDs with TMPGEnc, is it really better to use "TV Scale" and "Output YUV Data as basic YCbCr not CCIR601"?

And if it is, how do you tell D2S to do that?

Many thanks in advance. I am really confused.

Wilbert
7th June 2003, 11:18
The correct info is given in this link: Q12, http://forum.doom9.org/showthread.php?s=&threadid=53770

Especially:

"DVD2AVI projects frame served into CCE via AVISynth/mpeg2decX.dll do not use RGB but the YUV color space which is basically just another name for YCbCr. So no conversion takes place and you can ignore both the YUV -> RGB Scale setting in DVD2AVI and the Luminance Level setting in CCE."

I.e. mpeg2dec/mpeg2dec3 (which I assume you use) just ignores that setting.

r6d2
7th June 2003, 14:37
Thank you very much for your response, Wilbert.

I am using TMPGEnc, not CCE, but from what I understand reading the the thread you indicate, the situation should be the same, i.e., since the AVISynth script generated by D2S/FitCD is the following:


Import("D:\Movies\THESUM~1\Video\RESAMP~1.AVS")
LoadPlugin("C:\ARCHIV~1\DVD2SVCD\AVISYN~1\Mpeg2dec\mpeg2dec.dll")
LoadPlugin("C:\ARCHIV~1\DVD2SVCD\AVISYN~1\AVISYN~2.DLL")
mpeg2source("D:\Movies\THESUM~1\Source\DVD2AV~1.D2V")
# -= AviSynth script by FitCD v1.1.2 =-
BicubicResize(448,256,0,0.6,2,55,716,364)
AddBorders(16,112,16,112)
AvisynthSubtitler("D:\Movies\THESUM~1\Subs\","permsubs.txt")


And it seems to use mpeg2dec.dll as you describe.

Thanks again.