Figure below shows three sampling patterns for Y, Cb and Cr. 4:4:4 sampling means that the three components (Y, Cb and Cr) have the same resolution, i.e. each pixel contains three components. In 4:2:2 sampling, the chrominance components have the same vertical resolution as luma but half the horizontal resolution. 4:2:0 is a popular sampling format, chrominance components have half the horizontal and vertical resolution of luma. The term "4:2:0" is rather confusing because the numbers do not actually have a logical interpretation and appear to have been chosen historically as a 'code' to identify this particular sampling pattern. 4:2:0 sampling is widely used for consumer applications such as video conferencing, DVD storage. 4:2:0 sampling is sometimes described as '12 bits per pixel'. Using 4:4:4 sampling a total of 12 samples are required for four pixels, requiring a total of 12x8=96bits, an average of 96/4=24 bits per pixel. While in 4:2:0 sampling, only six samples are required, requiring a total of 6x8=48bits, an average of 48/4=12 bits per pixel.
In practice, it is common to capture or convert one of a set of "intermediate formats" prior to compression and transmission. The Common Intermediate Format (CIF) is the basis for a popular set of formats.
Sub-QCIF 128 x 96
Quarter CIF (qcif) 176 x 144
CIF 352 x 288
4CIF 704 x 576
YUV Raw file sometimes use this as file extensions, for example, a CIF format file can have a .cif extension. But sometimes the dimension can be deduced from the file size, it is only true when we know one of them: the sampling format or the video format. If we know neither, the deduction is not authentic. In the next section, we will describe the YUV raw format, it's very simple.
part of materials and the figure in this section are referrenced from the book "H.264 and MPEG-4 Video Compression" by Iain E. G. Richardson
评论