Friday, December 24, 2010

Video YUV 420 NV12 Format and Test Clip

IYUV and I420

This format is the most popular YUV420 format. They comprise an NxN Y plane followed by (N/2)x(N/2) U and V planes. Full marks to Intel for registering the same format twice and full marks to Microsoft for not picking up on this and rejecting the second registration.

HorizontalVertical
Y Sample Period11
U Sample Period22
V Sample Period22

Positive biHeight implies top-down image (top line first)

NV12

YUV 4:2:0 image with a plane of 8 bit Y samples followed by an interleaved U/V plane containing 8 bit 2x2 subsampled colour difference samples. It is called as XDM_YUV_420SP by TI XDM.

HorizontalVertical
Y Sample Period11
V (Cr) Sample Period22
U (Cb) Sample Period22

Microsoft defines this format as follows:

"A format in which all Y samples are found first in memory as an array of unsigned char with an even number of lines (possibly with a larger stride for memory alignment), followed immediately by an array of unsigned char containing interleaved Cb and Cr samples (such that if addressed as a little-endian WORD type, Cb would be in the LSBs and Cr would be in the MSBs) with the same total stride as the Y samples. This is the preferred 4:2:0 pixel format."

For conversion from yuv420 IYUV/I420 to yuv420 NV12 to make NV12 test clip, ffmpeg can be used as a IYUV2NV12 converter:

ffmpeg -pix_fmt yuv420p -s 1600x1200 -i 1600x1200_10_420.yuv -pix_fmt nv12 1600x1200_10_nv12.yuv


No comments:

Followers

Blog Archive

About Me

My Photo
HD Multimedia Technology player