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