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.
source share