1.. Permission is granted to copy, distribute and/or modify this
2.. document under the terms of the GNU Free Documentation License,
3.. Version 1.1 or any later version published by the Free Software
4.. Foundation, with no Invariant Sections, no Front-Cover Texts
5.. and no Back-Cover Texts. A copy of the license is included at
6.. Documentation/userspace-api/media/fdl-appendix.rst.
7..
8.. TODO: replace it to GFDL-1.1-or-later WITH no-invariant-sections
9
10.. _V4L2-PIX-FMT-M420:
11
12**************************
13V4L2_PIX_FMT_M420 ('M420')
14**************************
15
16Format with ½ horizontal and vertical chroma resolution, also known as
17YUV 4:2:0. Hybrid plane line-interleaved layout.
18
19
20Description
21===========
22
23M420 is a YUV format with ½ horizontal and vertical chroma subsampling
24(YUV 4:2:0). Pixels are organized as interleaved luma and chroma planes.
25Two lines of luma data are followed by one line of chroma data.
26
27The luma plane has one byte per pixel. The chroma plane contains
28interleaved CbCr pixels subsampled by ½ in the horizontal and vertical
29directions. Each CbCr pair belongs to four pixels. For example,
30Cb\ :sub:`0`/Cr\ :sub:`0` belongs to Y'\ :sub:`00`, Y'\ :sub:`01`,
31Y'\ :sub:`10`, Y'\ :sub:`11`.
32
33All line lengths are identical: if the Y lines include pad bytes so do
34the CbCr lines.
35
36**Byte Order.**
37Each cell is one byte.
38
39
40.. flat-table::
41    :header-rows:  0
42    :stub-columns: 0
43
44    * - start + 0:
45      - Y'\ :sub:`00`
46      - Y'\ :sub:`01`
47      - Y'\ :sub:`02`
48      - Y'\ :sub:`03`
49    * - start + 4:
50      - Y'\ :sub:`10`
51      - Y'\ :sub:`11`
52      - Y'\ :sub:`12`
53      - Y'\ :sub:`13`
54    * - start + 8:
55      - Cb\ :sub:`00`
56      - Cr\ :sub:`00`
57      - Cb\ :sub:`01`
58      - Cr\ :sub:`01`
59    * - start + 16:
60      - Y'\ :sub:`20`
61      - Y'\ :sub:`21`
62      - Y'\ :sub:`22`
63      - Y'\ :sub:`23`
64    * - start + 20:
65      - Y'\ :sub:`30`
66      - Y'\ :sub:`31`
67      - Y'\ :sub:`32`
68      - Y'\ :sub:`33`
69    * - start + 24:
70      - Cb\ :sub:`10`
71      - Cr\ :sub:`10`
72      - Cb\ :sub:`11`
73      - Cr\ :sub:`11`
74
75
76**Color Sample Location:**
77
78
79
80.. flat-table::
81    :header-rows:  0
82    :stub-columns: 0
83
84    * -
85      - 0
86      -
87      - 1
88      - 2
89      -
90      - 3
91    * - 0
92      - Y
93      -
94      - Y
95      - Y
96      -
97      - Y
98    * -
99      -
100      - C
101      -
102      -
103      - C
104      -
105    * - 1
106      - Y
107      -
108      - Y
109      - Y
110      -
111      - Y
112    * -
113    * - 2
114      - Y
115      -
116      - Y
117      - Y
118      -
119      - Y
120    * -
121      -
122      - C
123      -
124      -
125      - C
126      -
127    * - 3
128      - Y
129      -
130      - Y
131      - Y
132      -
133      - Y
134