YUV 422, YUV 420, YUV 444

I have, for example, 4 * 4 images. I want to extract components Y, U and V separately. How to do this if the image is YUV 422, YUV 420 and YUV444. I'm interested in knowing the structure of the array, how Y, U and V are stored in 422,420 and 444, so that it can be accessed.

+8
c image-processing opencv yuv
source share
2 answers

This site gives you a pretty good overview on the various YUV formats. There is also a pixel structure.

To clarify: these numbers are for defining a subsample of the color component . For example, a subsample of YUV 444 = 4: 4: 4, which means that each of the three components (Y, U, and V) has the same sampling rate. While 4: 2: 2 states that U and V are selected with only half the speed of Y. Or, in other words, 2 bytes for Y and for U and V are 1 byte, respectively, if the depth is 1 byte. This means that Y may have a higher dynamic range.

It should be noted that the JPEG standard defines horizontal and vertical sampling rates for each color component. The human visual system is related standard JPEG allows you to encode such content.

+12
source share

This is a pretty old question, however, I just finished some work on decoding YUV, and I would like to share some information. There are 3 main aspects of the YUV scheme: 1 - if the source YUV buffer is a packed or flat buffer. Packed means that the YUV bits are grouped horizontally, flat - the buffers Y, U and V are divided in 3 different memory areas. 2 - channel size YUV; one channel Y, U, V can be 8-bit, 10-bit, 12-bit, etc. 3 - sampling ratio; A: B: C. 4: 2: 2 means that you have a horizontal value of 1 Y for each pixel, and only one value of U and V, shared between two pixels at the bottom of the screen.

I just worked on decoding YUV 4: 2: 2 v210, following this link , there is GLSL source code for decoding, and the resources I talked about. Any advice is appreciated, this is my first decoder.

0
source share

All Articles