blob: a5b70b8a1273458e3ff139be00592a24d6032494 [file] [log] [blame]
Markus Heiser5377d912016-06-30 15:18:56 +02001.. -*- coding: utf-8; mode: rst -*-
2
3.. _V4L2-PIX-FMT-NV12:
Mauro Carvalho Chehab9aff73d2016-07-07 16:16:21 -03004.. _V4L2-PIX-FMT-NV21:
Markus Heiser5377d912016-06-30 15:18:56 +02005
6******************************************************
7V4L2_PIX_FMT_NV12 ('NV12'), V4L2_PIX_FMT_NV21 ('NV21')
8******************************************************
9
10*man V4L2_PIX_FMT_NV12(2)*
11
12V4L2_PIX_FMT_NV21
13Formats with ½ horizontal and vertical chroma resolution, also known as
14YUV 4:2:0. One luminance and one chrominance plane with alternating
15chroma samples as opposed to ``V4L2_PIX_FMT_YVU420``
16
17
18Description
19===========
20
21These are two-plane versions of the YUV 4:2:0 format. The three
22components are separated into two sub-images or planes. The Y plane is
23first. The Y plane has one byte per pixel. For ``V4L2_PIX_FMT_NV12``, a
24combined CbCr plane immediately follows the Y plane in memory. The CbCr
25plane is the same width, in bytes, as the Y plane (and of the image),
26but is half as tall in pixels. Each CbCr pair belongs to four pixels.
Mauro Carvalho Chehabeba9e912016-07-04 09:04:31 -030027For example, Cb\ :sub:`0`/Cr\ :sub:`0` belongs to Y'\ :sub:`00`,
Markus Heiser5377d912016-06-30 15:18:56 +020028Y'\ :sub:`01`, Y'\ :sub:`10`, Y'\ :sub:`11`. ``V4L2_PIX_FMT_NV21`` is
29the same except the Cb and Cr bytes are swapped, the CrCb plane starts
30with a Cr byte.
31
32If the Y plane has pad bytes after each row, then the CbCr plane has as
33many pad bytes after its rows.
34
Mauro Carvalho Chehab056d2ee2016-07-04 13:58:01 -030035**Byte Order.**
Markus Heiser5377d912016-06-30 15:18:56 +020036Each cell is one byte.
37
38
39
Mauro Carvalho Chehab5bd4bb72016-08-17 08:14:19 -030040.. tabularcolumns:: |p{5.8cm}|p{2.9cm}|p{2.9cm}|p{2.9cm}|p{3.0cm}|
41
Markus Heiser5377d912016-06-30 15:18:56 +020042.. 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
Markus Heiser5377d912016-06-30 15:18:56 +0200123.. flat-table::
124 :header-rows: 0
125 :stub-columns: 0
126
127
128 - .. row 1
129
Mauro Carvalho Chehab0579e6e2016-07-04 16:25:48 -0300130 -
Markus Heiser5377d912016-06-30 15:18:56 +0200131 - 0
132
Mauro Carvalho Chehab0579e6e2016-07-04 16:25:48 -0300133 -
Markus Heiser5377d912016-06-30 15:18:56 +0200134 - 1
135
Markus Heiser5377d912016-06-30 15:18:56 +0200136 - 2
137
Mauro Carvalho Chehab0579e6e2016-07-04 16:25:48 -0300138 -
Markus Heiser5377d912016-06-30 15:18:56 +0200139 - 3
140
141 - .. row 2
142
143 - 0
144
145 - Y
146
Mauro Carvalho Chehab0579e6e2016-07-04 16:25:48 -0300147 -
Markus Heiser5377d912016-06-30 15:18:56 +0200148 - Y
149
Markus Heiser5377d912016-06-30 15:18:56 +0200150 - Y
151
Mauro Carvalho Chehab0579e6e2016-07-04 16:25:48 -0300152 -
Markus Heiser5377d912016-06-30 15:18:56 +0200153 - Y
154
155 - .. row 3
156
Mauro Carvalho Chehab0579e6e2016-07-04 16:25:48 -0300157 -
158 -
Markus Heiser5377d912016-06-30 15:18:56 +0200159 - C
160
Mauro Carvalho Chehab0579e6e2016-07-04 16:25:48 -0300161 -
162 -
Markus Heiser5377d912016-06-30 15:18:56 +0200163 - C
164
Mauro Carvalho Chehab0579e6e2016-07-04 16:25:48 -0300165 -
Markus Heiser5377d912016-06-30 15:18:56 +0200166
167 - .. row 4
168
169 - 1
170
171 - Y
Mauro Carvalho Chehab0579e6e2016-07-04 16:25:48 -0300172 -
Mauro Carvalho Chehab31ad2502016-07-03 18:55:19 -0300173
Markus Heiser5377d912016-06-30 15:18:56 +0200174 - Y
175
Markus Heiser5377d912016-06-30 15:18:56 +0200176 - Y
177
Mauro Carvalho Chehab0579e6e2016-07-04 16:25:48 -0300178 -
Markus Heiser5377d912016-06-30 15:18:56 +0200179 - Y
180
181 - .. row 5
182
Mauro Carvalho Chehab0579e6e2016-07-04 16:25:48 -0300183 -
Markus Heiser5377d912016-06-30 15:18:56 +0200184
185 - .. row 6
186
187 - 2
188
189 - Y
Mauro Carvalho Chehab0579e6e2016-07-04 16:25:48 -0300190 -
Mauro Carvalho Chehab31ad2502016-07-03 18:55:19 -0300191
Markus Heiser5377d912016-06-30 15:18:56 +0200192 - Y
193
Markus Heiser5377d912016-06-30 15:18:56 +0200194 - Y
195
Mauro Carvalho Chehab0579e6e2016-07-04 16:25:48 -0300196 -
Markus Heiser5377d912016-06-30 15:18:56 +0200197 - Y
198
199 - .. row 7
200
Mauro Carvalho Chehab0579e6e2016-07-04 16:25:48 -0300201 -
202 -
Markus Heiser5377d912016-06-30 15:18:56 +0200203 - C
204
Mauro Carvalho Chehab0579e6e2016-07-04 16:25:48 -0300205 -
206 -
Markus Heiser5377d912016-06-30 15:18:56 +0200207 - C
208
Mauro Carvalho Chehab0579e6e2016-07-04 16:25:48 -0300209 -
Markus Heiser5377d912016-06-30 15:18:56 +0200210
211 - .. row 8
212
213 - 3
214
215 - Y
216
Mauro Carvalho Chehab0579e6e2016-07-04 16:25:48 -0300217 -
Markus Heiser5377d912016-06-30 15:18:56 +0200218 - Y
219
Markus Heiser5377d912016-06-30 15:18:56 +0200220 - Y
221
Mauro Carvalho Chehab0579e6e2016-07-04 16:25:48 -0300222 -
Markus Heiser5377d912016-06-30 15:18:56 +0200223 - Y