Simple and easy-understand C++ codes for converting NV12 & NV21 to YUV420P
These three format all have NxM Y plane followed by (N/2)x(M/2) V and U planes.
For example N = 6 & M = 4 the YUV420P
and the difference between NV12 and NV21 is that the position of U and V is opposite