Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is difference between planar, semi planar and interleaved format.?

Tags:

colors

Difference between color models and color space

how RGB565 is different from RGB888 any suggested link

YUV vs RGB vs YCbCr.?

like image 654
Vineet Avatar asked Mar 06 '14 05:03

Vineet


People also ask

What is semi planar?

Semi planar formats have two planes instead of three, one plane for luminance, and one plane for both chrominance components. Here both array can be at different offset in single buffer also.

What are interleaved images?

Description. Band interleaved by pixel (BIP) is one of three primary methods for encoding image data for multiband raster images in the geospatial domain, such as images obtained from satellites. BIP is not in itself an image format, but is a method for encoding the actual pixel values of an image in a file.

What is planar format?

In computer graphics, planar is the method of arranging pixel data into several bitplanes of RAM. Each bit in a bitplane is related to one pixel on the screen.

What is NV12 color format?

NV12 is a biplanar format with a full sized Y plane followed by a single chroma plane with weaved U and V values. NV21 is the same but with weaved V and U values. The 12 in NV12 refers to 12 bits per pixel. NV12 has a half width and half height chroma channel, and therefore is a 420 subsampling.


1 Answers

RGB is an additive color model where red, green, and blue intensities are added together in different combinations to produce a exhaustive set of colors.

RGB888 --> R is an 8 bit value varies from 0 to 255. Same for G and B. RGB565 --> Here R is of 5 most significant bits from R (8 bits) of RGB888. Here G is of 6 most significant bits from G (8 bits) of RGB888. Here B is of 5 most significant bits from B (8 bits) of RGB888.

If you see the mathematical calculations of converting from RGB888 to RGB565, it looks as below:

short int rgb565_pixel; rgb565_pixel = ((R >> 3) << 11) | ((G >> 2) << 5) | (B >> 3);

It is the conversion of 24 bits per pixel to 16 bits per pixel.

Coming to YUV: YUV is the color format where you can have a complete separation of brightness and color components from RGB format.

Y represents Brightness components where as Cb and Cr represents Color components.

Planar: In memory, Y followed by Cb and followed by Cr

[Y1Y2......][Cb1Cb2......][Cr1Cr2.......]

Semi Planar: In memory, Y followed by interleaved data of Cb and Cr, looks as below:

[Y1Y2......][Cb1Cr1Cb2Cr2......]

Interleaved: In case of YUV422 interleaved data, it looks as below:

Y1U1Y2V1 Y3U2Y4V2 ... ...

like image 68
stackuser Avatar answered Sep 20 '22 08:09

stackuser