i am a little confused about the NV12 format. i am looking the this page to understand the format.
What i currently understand is that if you have an image or video of 640 x 480
diminsion then the Y plane will be having 640 x 480
bytes and U and V both planes have 640/2 x 480/2
. It does not mean that U plane have 640/2 x 480/2
and V plane have 640/2 x 480/2
both have only 640/2 x 480/2
bytes. so the total number of bytes in out buffer array will be.
2 is multiplied with (640/2) * (480/2)
because uv plane will take two bytes.
byte [] myArray new byte[(640 * 480) + (2 * (640/2) * (480/2)) ];
so the question is that i am understanding it in a right way? and am i making the byte array in the format that specify the NV12 format.
The NV12 format is subsampled as 4:2:0
The total size of a frame is W x H x 3 / 2
Where W is width and H is height.
1 frame in vga resolution is 460800 bytes, where
Hope this answers your question...
To add to the first answer, the NV12 format interleaves the U and V chroma data.
For a 640x480
image frame, the NV12 representation consists of 720 rows of 640 bytes:
the first 480 rows each contain 640 luminance (Y) values.
the last 240 rows each contain 320 tuples of (U,V) values.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With