Merge tag 'irqchip-4.9-1' of git://git.kernel.org/pub/scm/linux/kernel/git/maz/arm...
[cascardo/linux.git] / Documentation / media / uapi / v4l / pixfmt-nv12m.rst
1 .. -*- coding: utf-8; mode: rst -*-
2
3 .. _V4L2-PIX-FMT-NV12M:
4 .. _v4l2-pix-fmt-nv12mt-16x16:
5 .. _V4L2-PIX-FMT-NV21M:
6
7 ***********************************************************************************
8 V4L2_PIX_FMT_NV12M ('NM12'), V4L2_PIX_FMT_NV21M ('NM21'), V4L2_PIX_FMT_NV12MT_16X16
9 ***********************************************************************************
10
11 *man V4L2_PIX_FMT_NV12M(2)*
12
13 V4L2_PIX_FMT_NV21M
14 V4L2_PIX_FMT_NV12MT_16X16
15 Variation of ``V4L2_PIX_FMT_NV12`` and ``V4L2_PIX_FMT_NV21`` with planes
16 non contiguous in memory.
17
18
19 Description
20 ===========
21
22 This is a multi-planar, two-plane version of the YUV 4:2:0 format. The
23 three components are separated into two sub-images or planes.
24 ``V4L2_PIX_FMT_NV12M`` differs from ``V4L2_PIX_FMT_NV12`` in that the
25 two planes are non-contiguous in memory, i.e. the chroma plane do not
26 necessarily immediately follows the luma plane. The luminance data
27 occupies the first plane. The Y plane has one byte per pixel. In the
28 second plane there is a chrominance data with alternating chroma
29 samples. The CbCr plane is the same width, in bytes, as the Y plane (and
30 of the image), but is half as tall in pixels. Each CbCr pair belongs to
31 four pixels. For example, Cb\ :sub:`0`/Cr\ :sub:`0` belongs to
32 Y'\ :sub:`00`, Y'\ :sub:`01`, Y'\ :sub:`10`, Y'\ :sub:`11`.
33 ``V4L2_PIX_FMT_NV12MT_16X16`` is the tiled version of
34 ``V4L2_PIX_FMT_NV12M`` with 16x16 macroblock tiles. Here pixels are
35 arranged in 16x16 2D tiles and tiles are arranged in linear order in
36 memory. ``V4L2_PIX_FMT_NV21M`` is the same as ``V4L2_PIX_FMT_NV12M``
37 except the Cb and Cr bytes are swapped, the CrCb plane starts with a Cr
38 byte.
39
40 ``V4L2_PIX_FMT_NV12M`` is intended to be used only in drivers and
41 applications that support the multi-planar API, described in
42 :ref:`planar-apis`.
43
44 If the Y plane has pad bytes after each row, then the CbCr plane has as
45 many pad bytes after its rows.
46
47 **Byte Order.**
48 Each cell is one byte.
49
50 .. flat-table::
51     :header-rows:  0
52     :stub-columns: 0
53     :widths:       2 1 1 1 1
54
55
56     -  .. row 1
57
58        -  start0 + 0:
59
60        -  Y'\ :sub:`00`
61
62        -  Y'\ :sub:`01`
63
64        -  Y'\ :sub:`02`
65
66        -  Y'\ :sub:`03`
67
68     -  .. row 2
69
70        -  start0 + 4:
71
72        -  Y'\ :sub:`10`
73
74        -  Y'\ :sub:`11`
75
76        -  Y'\ :sub:`12`
77
78        -  Y'\ :sub:`13`
79
80     -  .. row 3
81
82        -  start0 + 8:
83
84        -  Y'\ :sub:`20`
85
86        -  Y'\ :sub:`21`
87
88        -  Y'\ :sub:`22`
89
90        -  Y'\ :sub:`23`
91
92     -  .. row 4
93
94        -  start0 + 12:
95
96        -  Y'\ :sub:`30`
97
98        -  Y'\ :sub:`31`
99
100        -  Y'\ :sub:`32`
101
102        -  Y'\ :sub:`33`
103
104     -  .. row 5
105
106        -
107
108     -  .. row 6
109
110        -  start1 + 0:
111
112        -  Cb\ :sub:`00`
113
114        -  Cr\ :sub:`00`
115
116        -  Cb\ :sub:`01`
117
118        -  Cr\ :sub:`01`
119
120     -  .. row 7
121
122        -  start1 + 4:
123
124        -  Cb\ :sub:`10`
125
126        -  Cr\ :sub:`10`
127
128        -  Cb\ :sub:`11`
129
130        -  Cr\ :sub:`11`
131
132
133 **Color Sample Location..**
134
135
136
137 .. flat-table::
138     :header-rows:  0
139     :stub-columns: 0
140
141
142     -  .. row 1
143
144        -
145        -  0
146
147        -
148        -  1
149
150        -  2
151
152        -
153        -  3
154
155     -  .. row 2
156
157        -  0
158
159        -  Y
160
161        -
162        -  Y
163
164        -  Y
165
166        -
167        -  Y
168
169     -  .. row 3
170
171        -
172        -
173        -  C
174
175        -
176        -
177        -  C
178
179        -
180
181     -  .. row 4
182
183        -  1
184
185        -  Y
186
187        -
188        -  Y
189
190        -  Y
191
192        -
193        -  Y
194
195     -  .. row 5
196
197        -
198
199     -  .. row 6
200
201        -  2
202
203        -  Y
204
205        -
206        -  Y
207
208        -  Y
209
210        -
211        -  Y
212
213     -  .. row 7
214
215        -
216        -
217        -  C
218
219        -
220        -
221        -
222        -  C
223
224        -
225
226     -  .. row 8
227
228        -  3
229
230        -  Y
231
232        -
233        -  Y
234
235        -  Y
236
237        -
238        -  Y