mm: split gfp_mask and mapping flags into separate fields
[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 .. flat-table::
41     :header-rows:  0
42     :stub-columns: 0
43     :widths:       2 1 1 1 1
44
45
46     -  .. row 1
47
48        -  start + 0:
49
50        -  Y'\ :sub:`00`
51
52        -  Y'\ :sub:`01`
53
54        -  Y'\ :sub:`02`
55
56        -  Y'\ :sub:`03`
57
58     -  .. row 2
59
60        -  start + 4:
61
62        -  Y'\ :sub:`10`
63
64        -  Y'\ :sub:`11`
65
66        -  Y'\ :sub:`12`
67
68        -  Y'\ :sub:`13`
69
70     -  .. row 3
71
72        -  start + 8:
73
74        -  Y'\ :sub:`20`
75
76        -  Y'\ :sub:`21`
77
78        -  Y'\ :sub:`22`
79
80        -  Y'\ :sub:`23`
81
82     -  .. row 4
83
84        -  start + 12:
85
86        -  Y'\ :sub:`30`
87
88        -  Y'\ :sub:`31`
89
90        -  Y'\ :sub:`32`
91
92        -  Y'\ :sub:`33`
93
94     -  .. row 5
95
96        -  start + 16:
97
98        -  Cb\ :sub:`00`
99
100        -  Cr\ :sub:`00`
101
102        -  Cb\ :sub:`01`
103
104        -  Cr\ :sub:`01`
105
106     -  .. row 6
107
108        -  start + 20:
109
110        -  Cb\ :sub:`10`
111
112        -  Cr\ :sub:`10`
113
114        -  Cb\ :sub:`11`
115
116        -  Cr\ :sub:`11`
117
118
119 **Color Sample Location..**
120
121 .. flat-table::
122     :header-rows:  0
123     :stub-columns: 0
124
125
126     -  .. row 1
127
128        -
129        -  0
130
131        -
132        -  1
133
134        -  2
135
136        -
137        -  3
138
139     -  .. row 2
140
141        -  0
142
143        -  Y
144
145        -
146        -  Y
147
148        -  Y
149
150        -
151        -  Y
152
153     -  .. row 3
154
155        -
156        -
157        -  C
158
159        -
160        -
161        -  C
162
163        -
164
165     -  .. row 4
166
167        -  1
168
169        -  Y
170        -
171
172        -  Y
173
174        -  Y
175
176        -
177        -  Y
178
179     -  .. row 5
180
181        -
182
183     -  .. row 6
184
185        -  2
186
187        -  Y
188        -
189
190        -  Y
191
192        -  Y
193
194        -
195        -  Y
196
197     -  .. row 7
198
199        -
200        -
201        -  C
202
203        -
204        -
205        -  C
206
207        -
208
209     -  .. row 8
210
211        -  3
212
213        -  Y
214
215        -
216        -  Y
217
218        -  Y
219
220        -
221        -  Y