Merge tag 'xfs-4.21-merge-3' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux
[sfrench/cifs-2.6.git] / Documentation / media / uapi / v4l / pixfmt-yuv420m.rst
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/media/uapi/fdl-appendix.rst.
7 ..
8 .. TODO: replace it to GFDL-1.1-or-later WITH no-invariant-sections
9
10 .. _V4L2-PIX-FMT-YUV420M:
11 .. _v4l2-pix-fmt-yvu420m:
12
13 ************************************************************
14 V4L2_PIX_FMT_YUV420M ('YM12'), V4L2_PIX_FMT_YVU420M ('YM21')
15 ************************************************************
16
17
18 V4L2_PIX_FMT_YVU420M
19 Variation of ``V4L2_PIX_FMT_YUV420`` and ``V4L2_PIX_FMT_YVU420`` with
20 planes non contiguous in memory.
21
22
23 Description
24 ===========
25
26 This is a multi-planar format, as opposed to a packed format. The three
27 components are separated into three sub-images or planes.
28
29 The Y plane is first. The Y plane has one byte per pixel. For
30 ``V4L2_PIX_FMT_YUV420M`` the Cb data constitutes the second plane which
31 is half the width and half the height of the Y plane (and of the image).
32 Each Cb belongs to four pixels, a two-by-two square of the image. For
33 example, Cb\ :sub:`0` belongs to Y'\ :sub:`00`, Y'\ :sub:`01`,
34 Y'\ :sub:`10`, and Y'\ :sub:`11`. The Cr data, just like the Cb plane,
35 is in the third plane.
36
37 ``V4L2_PIX_FMT_YVU420M`` is the same except the Cr data is stored in the
38 second plane and the Cb data in the third plane.
39
40 If the Y plane has pad bytes after each row, then the Cb and Cr planes
41 have half as many pad bytes after their rows. In other words, two Cx
42 rows (including padding) is exactly as long as one Y row (including
43 padding).
44
45 ``V4L2_PIX_FMT_YUV420M`` and ``V4L2_PIX_FMT_YVU420M`` are intended to be
46 used only in drivers and applications that support the multi-planar API,
47 described in :ref:`planar-apis`.
48
49 **Byte Order.**
50 Each cell is one byte.
51
52
53
54
55 .. flat-table::
56     :header-rows:  0
57     :stub-columns: 0
58
59     * - start0 + 0:
60       - Y'\ :sub:`00`
61       - Y'\ :sub:`01`
62       - Y'\ :sub:`02`
63       - Y'\ :sub:`03`
64     * - start0 + 4:
65       - Y'\ :sub:`10`
66       - Y'\ :sub:`11`
67       - Y'\ :sub:`12`
68       - Y'\ :sub:`13`
69     * - start0 + 8:
70       - Y'\ :sub:`20`
71       - Y'\ :sub:`21`
72       - Y'\ :sub:`22`
73       - Y'\ :sub:`23`
74     * - start0 + 12:
75       - Y'\ :sub:`30`
76       - Y'\ :sub:`31`
77       - Y'\ :sub:`32`
78       - Y'\ :sub:`33`
79     * -
80     * - start1 + 0:
81       - Cb\ :sub:`00`
82       - Cb\ :sub:`01`
83     * - start1 + 2:
84       - Cb\ :sub:`10`
85       - Cb\ :sub:`11`
86     * -
87     * - start2 + 0:
88       - Cr\ :sub:`00`
89       - Cr\ :sub:`01`
90     * - start2 + 2:
91       - Cr\ :sub:`10`
92       - Cr\ :sub:`11`
93
94
95 **Color Sample Location:**
96
97
98
99 .. flat-table::
100     :header-rows:  0
101     :stub-columns: 0
102
103     * -
104       - 0
105       -
106       - 1
107       -
108       - 2
109       -
110       - 3
111     * - 0
112       - Y
113       -
114       - Y
115       -
116       - Y
117       -
118       - Y
119     * -
120       -
121       - C
122       -
123       -
124       -
125       - C
126       -
127     * - 1
128       - Y
129       -
130       - Y
131       -
132       - Y
133       -
134       - Y
135     * -
136     * - 2
137       - Y
138       -
139       - Y
140       -
141       - Y
142       -
143       - Y
144     * -
145       -
146       - C
147       -
148       -
149       -
150       - C
151       -
152     * - 3
153       - Y
154       -
155       - Y
156       -
157       - Y
158       -
159       - Y