View Full Version : colour space bitstream(YUV): details please
Shinigami-Sama
24th July 2007, 05:53
I've been poking a little here and there looking for how the data is represented, I haven't had much luck with so I thought I'd break down and ask.
what I'd like to know is how chroma and luma are actually stored processed and used, RGB is pretty easy to figure out if follows the same logic standard colour mixers in things like paint, but YUV and such still confuse me, Wikipedia really confused me - mostly the maths. So any help with finding some more info on it would be nice
Guest
24th July 2007, 14:00
This is a great site for YUV details:
http://www.fourcc.org/yuv.php
Be aware that 'YUV' is generic and covers several formats. You have to be specific. For example, in Avisynth we have YUY2. Open the site and then find YUY2 in the left column. Then click on YUY2. You'll get the format details.
For how to process the data, have a look at the source code for filters that work in YUY2. There are several at my web site.
Shinigami-Sama
24th July 2007, 19:20
This is a great site for YUV details:
http://www.fourcc.org/yuv.php
Be aware that 'YUV' is generic and covers several formats. You have to be specific. For example, in Avisynth we have YUY2. Open the site and then find YUY2 in the left column. Then click on YUY2. You'll get the format details.
For how to process the data, have a look at the source code for filters that work in YUY2. There are several at my web site.
yeah I found that out already.
thanks again thats helped out a bit already :).
Guest
24th July 2007, 19:32
If you have more specific questions, feel free to ask them. :)
Shinigami-Sama
27th July 2007, 06:13
ok so each raw yuy2 datagram is 2 pixels
I'm going to assume that they're horizontal, with the whole interlace thing and all
so, is there anywhere I should look to see how different filters/codecs/what have you turn it into a macroblock?
and I'm poking your site as I type this btw
[edit again]
guess it'd help if I understood C a little better D:
Guest
27th July 2007, 14:15
ok so each raw yuy2 datagram is 2 pixels
I'm going to assume that they're horizontal, with the whole interlace thing and all
so, is there anywhere I should look to see how different filters/codecs/what have you turn it into a macroblock?
The question makes no sense to me. The YUY2 four byte unit codes two image pixels. A macroblock codes 16 x 16 image pixels. How can you turn the former into the latter?
Here is a YUY2 unit:
Y0 U0 Y1 V0
This codes two fully sampled, horizontally adjacent pixels:
1st image pixel - Y0/U0/V0
2nd image pixel - Y1/U0/V0
That is, both pixels have the same chroma. The next two image pixels in horizontal order are coded by the next YUY2 unit in the same way, and that progresses all the way across the horizontal line. Then you start doing the same thing on the next line and progress all the way down the picture.
Now you have all the image pixels with their individual YUV values. You can convert each YUV value to RGB if you like and then you have ended up with fully sampled RGB.
The key is that each two horizontally adjacent pixels share the same color information, and so when you expand back to the fully sampled data, you just apply the shared color to both of the pixels.
Shinigami-Sama
27th July 2007, 21:09
oh ok, even without understanding the question you managed to answer it :D
thanks
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.