What is YUY2 byte meaning? Y0?,U0?Y1?.....?Are they for color, which color?
Could you explain?
I have an image YUY2 format and I want to image processing on this format. But I dont know image byte value.
+ Reply to Thread
Results 1 to 7 of 7
-
Sinan
-
http://www.fourcc.org/
Bytes line up like this across the line.
YUY2 is a 4:2:2 standard
Y0 is a 8 bit luminance pixel component
U0 is a 8 bit (R-Y) pixel component
V0 is a 8 bit (B-Y) pixel component
All three represent a pixel on the screen. Since UV are half sampled, the next pixel would look like this
Y1
U0
V0
and so on ...
BTW: Green = Y-(Red-Y)-(Blue-Y) = Y-U-V
Does that help?Recommends: Kiva.org - Loans that change lives.
http://www.kiva.org/about -
I understand from your note,
Y0= luminance of macropixel[0] that is two pixel of image.
U0= red value of macropixel[0]....
V0=blue value of macropixel[0]....
but Y1 =? Is this also for luminance of macropixel[0]?Sinan -
Y=R+G+B=luminance=monochrome
U=R-Y
V=B-Y
Macropixels
Y0Y1|Y2Y3| etc.
U0U0|U2U2|
V0V0|V2V2|
"but Y1 =? Is this also for luminance of macropixel[0]?"
Pixel 1 = Y0-U0-V0
Pixel 2 = Y1-U0-V0
The two pixels represent a macropixel. Data byte order Y0-U0-Y1-V0
http://www.answers.com/topic/ycbcr-samplingRecommends: Kiva.org - Loans that change lives.
http://www.kiva.org/about -
YUV/RGB conversion:
http://www.fourcc.org/fccyvrgb.php
Direct link to YUY2 format at fourcc:
http://www.fourcc.org/yuv.php#YUY2 -
The logic is that Y0 and Y1 do share the U0 and V0 Color compounds.
in YUY2 the HORIZONTAL Colorfrequency is half the lumafrequency in planar YV12 its even that Colorfrequency is a quarter (half vert. and half horiz.) of the Lumafrequency.
The YUYVYUYVYUYV order of YUY2 describes a packet/interleaved format where for example YV12 is a planar format.
So for parsing the Y Values you need to peek every second byte in the MemorySpace starting from first byte of the YUY2 Data memory adress+zero where the YUY2 Data is stored. For U then its the first byte +1 and then every fourth, for V its the first byte +3 and also here every fourth.
Put these into separate Y U V Arrays and you'll see again that the U and V arrays do will have a quarter of the Y array in their size each.
That alocation of bytes makes it possible to keep YUY2 and YV12 Data byte-alignet. BUT you have to watch out when parsing the values of these Y U V bytes as Y Values are stored as least significant bits (LSBs) and U and V values are stored as most significant bits (MSBs).
Means if Y < 0 then Y = Y + 256 ... for getting the common used Y value out of the LSB value.
So if Y = -16 the Y is 240! .. means highest lit value in Y luma range.
Also a very good page (dunno if it already has been mentioned in the posts above):
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnwmt/html/YUVFormats.asp
Y=R+G+B=luminance=monochrome
U=R-Y
V=B-Y
When doing RGB to YUV conversions there are several maths according to CCIR Standards available as to bee seen in this link like posted some posts above:
http://www.fourcc.org/fccyvrgb.php -
Originally Posted by incredible
Y = (0.257 * R) + (0.504 * G) + (0.098 * B) + 16
U = Cb = -(0.148 * R) - (0.291 * G) + (0.439 * B) + 128
V = Cr = (0.439 * R) - (0.368 * G) - (0.071 * B) + 128Recommends: Kiva.org - Loans that change lives.
http://www.kiva.org/about
Similar Threads
-
Pavtube - Byte Co[py
By charlie_brownuk in forum Blu-ray RippingReplies: 6Last Post: 26th Sep 2011, 09:04 -
WMV File with YUY2 Raw Video Format
By toreachdeepak in forum Video ConversionReplies: 3Last Post: 24th Feb 2011, 09:43 -
ffmpegX gives me 0 byte flash file
By flim in forum ffmpegX general discussionReplies: 2Last Post: 9th Apr 2010, 13:12 -
HELP! FAVC 1.04- Why is it creating 0 byte iso's at times?
By spexwood in forum Video ConversionReplies: 7Last Post: 5th Dec 2007, 23:40 -
Raw YUY2 to YV12 format?
By allyli2007 in forum ProgrammingReplies: 8Last Post: 2nd Jun 2007, 12:43