Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion. Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules. |
9th January 2005, 23:34 | #1 | Link |
Moderator
Join Date: Nov 2002
Location: Inside
Posts: 718
|
Colorspace packing formats
Could someone briefly explain what the various packing formats for colorspace are and how they relate to the colorspaces themselves?
ie: What are 4:4:4, 4:2:2, 4:2:0 formats? How do they relate to colorspaces like RGB32, YUV2 or YV12? |
10th January 2005, 00:07 | #3 | Link |
AviSynth Enthusiast
Join Date: Jul 2002
Location: California, U.S.
Posts: 1,267
|
RGB and YUV are colorspaces.
RGB32 is a specific format for RGB, where it uses 1 byte for red, 1 byte for green, 1 byte for blue, and 1 byte that's unused (or is sometimes used for alpha). YUY2 and YV12 are specific formats of YUV. YUY2 uses 4:2:2 subsampling, consuming an average of 16 bits per pixel, and YV12 uses 4:2:0, consuming an average of 12 bits per pixel. Explanation of subsampling formats: Chroma Subsampling Standards |
10th January 2005, 12:07 | #5 | Link |
Registered User
Join Date: Oct 2001
Posts: 62
|
Since we're already on that topic...
I have some more dumb questions that have been nagging me for some time now. In RGB I know that each channel can take a variety of 256 values in total, hence the resulting 8 bit. In YUV each channel is represented with a value from 0-4 like in 4:4:4 , 4:2:2 , etc. Obviously the 4 does not represent the maximum of bits it can hold, since only 16 possible values for a channel would result in quite a poor picture... So what does this 4 stand for? And YUY2 is 16 bit, okay. That makes sense, when we say that 4*2*2 = 16, but why is YV12 (4:2:0) 12 bits then? Oh, and my last question has a bit to do with my bad memory...don't know if I recall it correctly, but in a former in-depth discussion of DVD-Video, it was stated that DVDs don't exactly use YV12 but rather a 4:2:0 colorspace with the chroma channels switched (UYUY ? ) Was that correct? And if yes, I obviously had never trouble in dealing with DVDs + Avisynth, so does Avisynth handle this conversion internally or any of the plugins I use to import DVD-footage? Hope I made some sense. |
10th January 2005, 12:28 | #6 | Link | |
gone
Join Date: Apr 2004
Posts: 1,706
|
The 4:4:4, 4:2:2, etc notations do not stand for the amount of bits per channel used. All channels in the YUV colorspace use 8 bits. Those numbers refer to the horizontal and vertical downsampling that is used for the chroma.
YUV 4:4:4 has no downsampling YUV 4:2:2 has the chroma downsampled in a 2:1 ratio vertically and but not horizontally YUV 4:2:0 (YV12) has a 2:1 downsampling for chroma, both vertically and horizontally. so to calculate the average bits per pixel of YV12 we need to take a square block of 4 pixels (2x2). Such a block will contain 4 values for the luma (Y) and 1 value for the chroma (U+V). Each channel is 8 bit therefor the total amount of bits is 4*8 + 8 + 8 = 48 bits for 4 pixels this results in an average bits per pixel of 12. in the links from Wilbert you should be able to find more info. Quote:
Last edited by stephanV; 10th January 2005 at 12:30. |
|
10th January 2005, 13:07 | #7 | Link | |
Moderator
Join Date: Nov 2001
Location: Netherlands
Posts: 6,364
|
Quote:
Speaking about color formats. Do anyone of you know what 4:1:0 means? We were discussing this somewhere else, and looking at some indeo (which seems to be the only codec which uses YUV 4:1:0) screenshots we concluded that chroma is shared by 4x4 luma pixels. But, I'm not sure how to conclude from the notation 4:1:0? Last edited by Wilbert; 10th January 2005 at 13:13. |
|
10th January 2005, 13:42 | #8 | Link |
gone
Join Date: Apr 2004
Posts: 1,706
|
I have trouble understanding the notation too but i have came to the following conclusion
the first 2 numbers (for example 4:2) give the horizontal resolution ratio of the chroma. In case of YUY2 and YV12 this is both 2:1 (= 4:2). The 3rd number says something about the vertical resolution of the chroma. However the use of it is rather weird, but I've came to the following conclusion: - If the 3rd number is equal to the 2nd number, the vertical chroma resolution is untouched (as in 4:4:4, 4:2:2 and 4:1:1). - If the 3rd number is 0 the vertical chroma resolution is equal to the horizontal chroma resolution. considering 4:1:0, the horizontal chroma downsampling would have a ratio of 4:1 and the vertical downsampling equals that (because of the 0). So this would confirm your guess about Indeo. I havent any source for this to confirm my findings but it is the only way I can make sense out of the numbers. [edit]from my conclusion, you could say that 4:4:4 is the same as 4:4:0... although that probably doesnt excist [edit2]It is my personal believe that 4:2:4 would be a better notation for YUY2 and 4:2:2 for YV12... then the ratio ( : ) sign actually makes sense... there should be some reason for the notation we have now though, although its probably not a logical one. Last edited by stephanV; 10th January 2005 at 13:57. |
10th January 2005, 14:13 | #9 | Link | ||
Moderator
Join Date: Nov 2001
Location: Netherlands
Posts: 6,364
|
Quote:
Quote:
But that interpretation (if indeed true in some form) is very restrictive. Suppose we make a codec where the chroma is shared between 2x4 pixels. What notation would you use? 4:1:1/2 or something like that |
||
10th January 2005, 14:31 | #10 | Link |
gone
Join Date: Apr 2004
Posts: 1,706
|
well, i've thought about this too
I think a 2x4 sharing of chroma is a very unlikely situation considering it is easier to give up horizontal resolution before vertical due to difficulties with interlaced video. although, this would still leave a question like: how do we describe 4x2 block? the first numbers should be 4:1 but then... 2? i dont know of anything that uses this... you might though. im finding the use of the number 0 in what appears to be a ratio of some sort rather confusing, but again, this is the only way i can make sense of it... if you know something better or have a different idea, please share! |
10th January 2005, 17:27 | #11 | Link |
Registered Jedi
Join Date: Jan 2003
Location: Georgia, U.S.A.
Posts: 733
|
The numbering scheme dates back to the 1980's I think, but their historical usage seems a bit obscure today. I did find some interesting explanations on the web:
http://www.tvtechnology.com/features...07.10.02.shtml http://forum.matrox.com/rt2000/Forum8/HTML/000052.html
__________________
May the FOURCC be with you... |
10th January 2005, 18:10 | #13 | Link | |||
Moderator
Join Date: Nov 2001
Location: Netherlands
Posts: 6,364
|
I've read similar links. But I'm not very impressed by the first link (it thinks that DV sampling and MPEG-2 sampling are the same, MPEG-1 sampling is described wrong too).
If such links say something about 4:1:0 (see second link for example), they say the following Quote:
@stephanV, Quote:
Quote:
|
|||
11th January 2005, 03:56 | #14 | Link | |
Registered Jedi
Join Date: Jan 2003
Location: Georgia, U.S.A.
Posts: 733
|
Quote:
The description of MPEG-1 sampling is not necessarily wrong if he's talking about interlaced sampling (although we know that MPEG-1 is strictly progressive). I do agree about one thing; the diagrams are pretty useless.
__________________
May the FOURCC be with you... |
|
11th January 2005, 09:52 | #15 | Link | |||
Moderator
Join Date: Nov 2001
Location: Netherlands
Posts: 6,364
|
Quote:
Quote:
Quote:
|
|||
11th January 2005, 09:53 | #16 | Link | |||
Moderator
Join Date: Nov 2001
Location: Netherlands
Posts: 6,364
|
Quote:
Quote:
Quote:
edit: sorry for the double posting, something went wrong |
|||
11th January 2005, 17:21 | #17 | Link | |
Registered Jedi
Join Date: Jan 2003
Location: Georgia, U.S.A.
Posts: 733
|
Quote:
__________________
May the FOURCC be with you... |
|
11th January 2005, 23:50 | #18 | Link |
brainless
Join Date: Mar 2003
Location: Germany
Posts: 3,653
|
uhm. I've gotten some kind of flash in my mind while reading your post, fcchandler!
SECAM! SECAM is a color-system that is based on the 625-lines 50 Hertz blackwhite television (the same like PAL is based on) BUT SECAM is transferring its chroma components sequential, which means: every even (big assumption!) line of a FIELD transfers the U and every odd line of a FIELD transfers the V this is exactly, how the chroma sampling of 'PAL'-DV works. knows the devil why... I am afraid! but maybe I am way to tired and throwed some (mis)information together...
__________________
Don't forget the 'c'! Don't PM me for technical support, please. |
11th January 2005, 23:53 | #19 | Link | |
ffdshow/AviSynth wrangler
Join Date: Feb 2003
Location: Austria
Posts: 2,441
|
Quote:
np: Keishi Urata - Mischievous Voices (Texhnolyze OST The Man Of Men) |
|
12th January 2005, 00:21 | #20 | Link |
brainless
Join Date: Mar 2003
Location: Germany
Posts: 3,653
|
I really doubt that. Both assumptions.
(But I am not absolutely sure about them) SECAM is NOT a production format. It is a broadcast format. This means: Production is done on very common 625-50 Equipment with 4:4:4 or at least 4:2:2 subsampling. no color encoding scheme like pal or secam is used here. the format-encoding (PAL,SECAM,NTSC) is the very last step of this production -> storing -> delivering -> encoding & brodcasting chain. the encoding is done withing the broadcasting station. or the signal comes preprocessed to the broadcasting station. but the encoder is feed with a component YUV analogue signal. so noone in production works with composite video signals like SECAM, PAL or NTSC. It's all YUV.
__________________
Don't forget the 'c'! Don't PM me for technical support, please. |
|
|