[media] docs-rst: add tabularcolumns to all tables
[cascardo/linux.git] / Documentation / media / uapi / v4l / pixfmt-nv12.rst
1 .. -*- coding: utf-8; mode: rst -*-
2
3 .. _V4L2-PIX-FMT-NV12:
4 .. _V4L2-PIX-FMT-NV21:
5
6 ******************************************************
7 V4L2_PIX_FMT_NV12 ('NV12'), V4L2_PIX_FMT_NV21 ('NV21')
8 ******************************************************
9
10 *man V4L2_PIX_FMT_NV12(2)*
11
12 V4L2_PIX_FMT_NV21
13 Formats with ½ horizontal and vertical chroma resolution, also known as
14 YUV 4:2:0. One luminance and one chrominance plane with alternating
15 chroma samples as opposed to ``V4L2_PIX_FMT_YVU420``
16
17
18 Description
19 ===========
20
21 These are two-plane versions of the YUV 4:2:0 format. The three
22 components are separated into two sub-images or planes. The Y plane is
23 first. The Y plane has one byte per pixel. For ``V4L2_PIX_FMT_NV12``, a
24 combined CbCr plane immediately follows the Y plane in memory. The CbCr
25 plane is the same width, in bytes, as the Y plane (and of the image),
26 but is half as tall in pixels. Each CbCr pair belongs to four pixels.
27 For example, Cb\ :sub:`0`/Cr\ :sub:`0` belongs to Y'\ :sub:`00`,
28 Y'\ :sub:`01`, Y'\ :sub:`10`, Y'\ :sub:`11`. ``V4L2_PIX_FMT_NV21`` is
29 the same except the Cb and Cr bytes are swapped, the CrCb plane starts
30 with a Cr byte.
31
32 If the Y plane has pad bytes after each row, then the CbCr plane has as
33 many pad bytes after its rows.
34
35 **Byte Order.**
36 Each cell is one byte.
37
38
39
40 .. tabularcolumns:: |p{5.8cm}|p{2.9cm}|p{2.9cm}|p{2.9cm}|p{3.0cm}|
41
42 .. flat-table::
43     :header-rows:  0
44     :stub-columns: 0
45     :widths:       2 1 1 1 1
46
47
48     -  .. row 1
49
50        -  start + 0:
51
52        -  Y'\ :sub:`00`
53
54        -  Y'\ :sub:`01`
55
56        -  Y'\ :sub:`02`
57
58        -  Y'\ :sub:`03`
59
60     -  .. row 2
61
62        -  start + 4:
63
64        -  Y'\ :sub:`10`
65
66        -  Y'\ :sub:`11`
67
68        -  Y'\ :sub:`12`
69
70        -  Y'\ :sub:`13`
71
72     -  .. row 3
73
74        -  start + 8:
75
76        -  Y'\ :sub:`20`
77
78        -  Y'\ :sub:`21`
79
80        -  Y'\ :sub:`22`
81
82        -  Y'\ :sub:`23`
83
84     -  .. row 4
85
86        -  start + 12:
87
88        -  Y'\ :sub:`30`
89
90        -  Y'\ :sub:`31`
91
92        -  Y'\ :sub:`32`
93
94        -  Y'\ :sub:`33`
95
96     -  .. row 5
97
98        -  start + 16:
99
100        -  Cb\ :sub:`00`
101
102        -  Cr\ :sub:`00`
103
104        -  Cb\ :sub:`01`
105
106        -  Cr\ :sub:`01`
107
108     -  .. row 6
109
110        -  start + 20:
111
112        -  Cb\ :sub:`10`
113
114        -  Cr\ :sub:`10`
115
116        -  Cb\ :sub:`11`
117
118        -  Cr\ :sub:`11`
119
120
121 **Color Sample Location..**
122
123 .. flat-table::
124     :header-rows:  0
125     :stub-columns: 0
126
127
128     -  .. row 1
129
130        -
131        -  0
132
133        -
134        -  1
135
136        -  2
137
138        -
139        -  3
140
141     -  .. row 2
142
143        -  0
144
145        -  Y
146
147        -
148        -  Y
149
150        -  Y
151
152        -
153        -  Y
154
155     -  .. row 3
156
157        -
158        -
159        -  C
160
161        -
162        -
163        -  C
164
165        -
166
167     -  .. row 4
168
169        -  1
170
171        -  Y
172        -
173
174        -  Y
175
176        -  Y
177
178        -
179        -  Y
180
181     -  .. row 5
182
183        -
184
185     -  .. row 6
186
187        -  2
188
189        -  Y
190        -
191
192        -  Y
193
194        -  Y
195
196        -
197        -  Y
198
199     -  .. row 7
200
201        -
202        -
203        -  C
204
205        -
206        -
207        -  C
208
209        -
210
211     -  .. row 8
212
213        -  3
214
215        -  Y
216
217        -
218        -  Y
219
220        -  Y
221
222        -
223        -  Y