NV12 format and UV plane

I got a little confused in the NV12 format. I look at this page to understand the format. I understand that if you have an image or video with 640 x 480 diminsion, then the Y plane will have 640 x 480 bytes, and U and V both planes will have 640/2 x 480/2 . This does not mean that the U-plane has 640/2 x 480/2 , and the V plane has 640/2 x 480/2 , both have only 640/2 x 480/2 bytes. therefore, the total number of bytes in the out buffer array will be. 2 is multiplied by (640/2) * (480/2) , because the uv-plane will take two bytes.

 byte [] myArray new byte[(640 * 480) + (2 * (640/2) * (480/2)) ]; 

so the question is, do I understand it correctly? and I am making an array of bytes in a format that indicates the format of NV12.

+5
source share
1 answer

NV12 format sub-expressed as 4: 2: 0

420

Total frame size W x H x 3 / 2 3/2 Where W is the width and H is the height.

1 frame in vga resolution is 460800 bytes, where

  • Y-part - 640x480 bytes.
  • The cb part is 640 * 480/4 = 76800 bytes.
  • Cr part - 640 * 480/4 = 76800 bytes.

Hope this answers your question ...

+20
source

All Articles