Merge tag 'pci-v4.21-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaa...
[sfrench/cifs-2.6.git] / Documentation / media / uapi / v4l / pixfmt-nv12m.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-NV12M:
11 .. _v4l2-pix-fmt-nv12mt-16x16:
12 .. _V4L2-PIX-FMT-NV21M:
13
14 ***********************************************************************************
15 V4L2_PIX_FMT_NV12M ('NM12'), V4L2_PIX_FMT_NV21M ('NM21'), V4L2_PIX_FMT_NV12MT_16X16
16 ***********************************************************************************
17
18
19 V4L2_PIX_FMT_NV21M
20 V4L2_PIX_FMT_NV12MT_16X16
21 Variation of ``V4L2_PIX_FMT_NV12`` and ``V4L2_PIX_FMT_NV21`` with planes
22 non contiguous in memory.
23
24
25 Description
26 ===========
27
28 This is a multi-planar, two-plane version of the YUV 4:2:0 format. The
29 three components are separated into two sub-images or planes.
30 ``V4L2_PIX_FMT_NV12M`` differs from ``V4L2_PIX_FMT_NV12`` in that the
31 two planes are non-contiguous in memory, i.e. the chroma plane do not
32 necessarily immediately follows the luma plane. The luminance data
33 occupies the first plane. The Y plane has one byte per pixel. In the
34 second plane there is a chrominance data with alternating chroma
35 samples. The CbCr plane is the same width, in bytes, as the Y plane (and
36 of the image), but is half as tall in pixels. Each CbCr pair belongs to
37 four pixels. For example, Cb\ :sub:`0`/Cr\ :sub:`0` belongs to
38 Y'\ :sub:`00`, Y'\ :sub:`01`, Y'\ :sub:`10`, Y'\ :sub:`11`.
39 ``V4L2_PIX_FMT_NV12MT_16X16`` is the tiled version of
40 ``V4L2_PIX_FMT_NV12M`` with 16x16 macroblock tiles. Here pixels are
41 arranged in 16x16 2D tiles and tiles are arranged in linear order in
42 memory. ``V4L2_PIX_FMT_NV21M`` is the same as ``V4L2_PIX_FMT_NV12M``
43 except the Cb and Cr bytes are swapped, the CrCb plane starts with a Cr
44 byte.
45
46 ``V4L2_PIX_FMT_NV12M`` is intended to be used only in drivers and
47 applications that support the multi-planar API, described in
48 :ref:`planar-apis`.
49
50 If the Y plane has pad bytes after each row, then the CbCr plane has as
51 many pad bytes after its rows.
52
53 **Byte Order.**
54 Each cell is one byte.
55
56 .. flat-table::
57     :header-rows:  0
58     :stub-columns: 0
59
60     * - start0 + 0:
61       - Y'\ :sub:`00`
62       - Y'\ :sub:`01`
63       - Y'\ :sub:`02`
64       - Y'\ :sub:`03`
65     * - start0 + 4:
66       - Y'\ :sub:`10`
67       - Y'\ :sub:`11`
68       - Y'\ :sub:`12`
69       - Y'\ :sub:`13`
70     * - start0 + 8:
71       - Y'\ :sub:`20`
72       - Y'\ :sub:`21`
73       - Y'\ :sub:`22`
74       - Y'\ :sub:`23`
75     * - start0 + 12:
76       - Y'\ :sub:`30`
77       - Y'\ :sub:`31`
78       - Y'\ :sub:`32`
79       - Y'\ :sub:`33`
80     * -
81     * - start1 + 0:
82       - Cb\ :sub:`00`
83       - Cr\ :sub:`00`
84       - Cb\ :sub:`01`
85       - Cr\ :sub:`01`
86     * - start1 + 4:
87       - Cb\ :sub:`10`
88       - Cr\ :sub:`10`
89       - Cb\ :sub:`11`
90       - Cr\ :sub:`11`
91
92
93 **Color Sample Location:**
94
95
96
97 .. flat-table::
98     :header-rows:  0
99     :stub-columns: 0
100
101     * -
102       - 0
103       -
104       - 1
105       - 2
106       -
107       - 3
108     * - 0
109       - Y
110       -
111       - Y
112       - Y
113       -
114       - Y
115     * -
116       -
117       - C
118       -
119       -
120       - C
121       -
122     * - 1
123       - Y
124       -
125       - Y
126       - Y
127       -
128       - Y
129     * -
130     * - 2
131       - Y
132       -
133       - Y
134       - Y
135       -
136       - Y
137     * -
138       -
139       - C
140       -
141       -
142       -
143       - C
144       -
145     * - 3
146       - Y
147       -
148       - Y
149       - Y
150       -
151       - Y