The meaning of 420 in YUV420

I have always wondered what the meaning of 420 in YUV420 means. Google has not found a suitable answer for a long time, or the answer is not the question.
Chatgtp is awesome. Now look at the answer given by chatgpt

YOU: What is the meaning of 2 and 0 in YUV420
chatGPT:
YUV420 is a compressed video format, where 2 and 0 refer to the parameters of the chroma sampling rate (chroma subsampling). Specifically, 2 means that every 4 pixels take a chroma sample in the vertical and horizontal directions, and 0 means that each pixel has only one luma sample. This sampling method reduces data volume at the expense of image quality.

OK, a concept is mentioned here, chroma sampling ,
according to chroma sampling, found in Wikipedia , related definitions.

视频系统的抽样系统中通常用一个三分比值表示:J:a:b(例如4:2:2),形容一个以J个像素宽及两个像素高的概念上区域,有时候会以四分比值表示(例如4:2:2:4)。依序列出为:

J:水平抽样参照(概念上区域的宽度)。通常为4。
a:在J个像素第一行中的色度抽样数目(Cr, Cb)。
b:在J个像素第二行中的额外色度抽样数目(Cr, Cb)。
Alpha:水平因数(与首数值有关连)。若没有此部分者可忽略,或存在时与J相同。

So the meaning of YUV420 should be:
In the conceptual area of ​​4 pixels wide and 2 pixels high:
4: luminance samples are 4, 4 Y
2: The number of chroma samples extracted in the first line is 2, 2 0 (U or V)
0: the number of extra chroma samples in the second row is 0,0 (U or V)

Wikipedia's explanation of 420

4:2:0
4:2:0 is also known as I420. I420 is a kind of YUV format, which belongs to planar format. 4:2:0 does not mean that there are only Y, Cb and no Cr components. It means that for each scan line, only one chrominance component is stored at a sampling rate of 2:1. Adjacent scan lines store different chrominance components, that is, if one line is 4:2:0, the next line is 4:0:2, and the next line is 4:2:0...and so on. For each chroma component, the sampling rate in the horizontal and vertical directions is 2:1, so it can be said that the sampling rate of chroma is 4:1. The color systems of PAL system and SECAM system are particularly suitable for storage in this way. Most video codecs use this format as their standard input format. For uncompressed 8-bit quantized video, each macropixel consisting of 2x2 adjacent pixels in 2 rows and 2 columns requires 6 bytes of memory.

YUV420 acquisition icon

おすすめ

転載: blog.csdn.net/suzhijie325/article/details/129792279