[media] docs-rst: add tabularcolumns to all tables
[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 .. tabularcolumns:: |p{5.8cm}|p{2.9cm}|p{2.9cm}|p{2.9cm}|p{3.0cm}|
51
52 .. flat-table::
53     :header-rows:  0
54     :stub-columns: 0
55     :widths:       2 1 1 1 1
56
57
58     -  .. row 1
59
60        -  start0 + 0:
61
62        -  Y'\ :sub:`00`
63
64        -  Y'\ :sub:`01`
65
66        -  Y'\ :sub:`02`
67
68        -  Y'\ :sub:`03`
69
70     -  .. row 2
71
72        -  start0 + 4:
73
74        -  Y'\ :sub:`10`
75
76        -  Y'\ :sub:`11`
77
78        -  Y'\ :sub:`12`
79
80        -  Y'\ :sub:`13`
81
82     -  .. row 3
83
84        -  start0 + 8:
85
86        -  Y'\ :sub:`20`
87
88        -  Y'\ :sub:`21`
89
90        -  Y'\ :sub:`22`
91
92        -  Y'\ :sub:`23`
93
94     -  .. row 4
95
96        -  start0 + 12:
97
98        -  Y'\ :sub:`30`
99
100        -  Y'\ :sub:`31`
101
102        -  Y'\ :sub:`32`
103
104        -  Y'\ :sub:`33`
105
106     -  .. row 5
107
108        -
109
110     -  .. row 6
111
112        -  start1 + 0:
113
114        -  Cb\ :sub:`00`
115
116        -  Cr\ :sub:`00`
117
118        -  Cb\ :sub:`01`
119
120        -  Cr\ :sub:`01`
121
122     -  .. row 7
123
124        -  start1 + 4:
125
126        -  Cb\ :sub:`10`
127
128        -  Cr\ :sub:`10`
129
130        -  Cb\ :sub:`11`
131
132        -  Cr\ :sub:`11`
133
134
135 **Color Sample Location..**
136
137
138
139 .. flat-table::
140     :header-rows:  0
141     :stub-columns: 0
142
143
144     -  .. row 1
145
146        -
147        -  0
148
149        -
150        -  1
151
152        -  2
153
154        -
155        -  3
156
157     -  .. row 2
158
159        -  0
160
161        -  Y
162
163        -
164        -  Y
165
166        -  Y
167
168        -
169        -  Y
170
171     -  .. row 3
172
173        -
174        -
175        -  C
176
177        -
178        -
179        -  C
180
181        -
182
183     -  .. row 4
184
185        -  1
186
187        -  Y
188
189        -
190        -  Y
191
192        -  Y
193
194        -
195        -  Y
196
197     -  .. row 5
198
199        -
200
201     -  .. row 6
202
203        -  2
204
205        -  Y
206
207        -
208        -  Y
209
210        -  Y
211
212        -
213        -  Y
214
215     -  .. row 7
216
217        -
218        -
219        -  C
220
221        -
222        -
223        -
224        -  C
225
226        -
227
228     -  .. row 8
229
230        -  3
231
232        -  Y
233
234        -
235        -  Y
236
237        -  Y
238
239        -
240        -  Y