Merge remote-tracking branch 'selinux/next'
[deliverable/linux.git] / Documentation / media / uapi / v4l / pixfmt-yuv420.rst
1 .. -*- coding: utf-8; mode: rst -*-
2
3 .. _V4L2-PIX-FMT-YVU420:
4 .. _V4L2-PIX-FMT-YUV420:
5
6 **********************************************************
7 V4L2_PIX_FMT_YVU420 ('YV12'), V4L2_PIX_FMT_YUV420 ('YU12')
8 **********************************************************
9
10
11 V4L2_PIX_FMT_YUV420
12 Planar formats with ½ horizontal and vertical chroma resolution, also
13 known as YUV 4:2:0
14
15
16 Description
17 ===========
18
19 These are planar formats, as opposed to a packed format. The three
20 components are separated into three sub- images or planes. The Y plane
21 is first. The Y plane has one byte per pixel. For
22 ``V4L2_PIX_FMT_YVU420``, the Cr plane immediately follows the Y plane in
23 memory. The Cr plane is half the width and half the height of the Y
24 plane (and of the image). Each Cr belongs to four pixels, a two-by-two
25 square of the image. For example, Cr\ :sub:`0` belongs to Y'\ :sub:`00`,
26 Y'\ :sub:`01`, Y'\ :sub:`10`, and Y'\ :sub:`11`. Following the Cr plane
27 is the Cb plane, just like the Cr plane. ``V4L2_PIX_FMT_YUV420`` is the
28 same except the Cb plane comes first, then the Cr plane.
29
30 If the Y plane has pad bytes after each row, then the Cr and Cb planes
31 have half as many pad bytes after their rows. In other words, two Cx
32 rows (including padding) is exactly as long as one Y row (including
33 padding).
34
35 **Byte Order.**
36 Each cell is one byte.
37
38
39
40
41 .. flat-table::
42 :header-rows: 0
43 :stub-columns: 0
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 - Cr\ :sub:`00`
99
100 - Cr\ :sub:`01`
101
102 - .. row 6
103
104 - start + 18:
105
106 - Cr\ :sub:`10`
107
108 - Cr\ :sub:`11`
109
110 - .. row 7
111
112 - start + 20:
113
114 - Cb\ :sub:`00`
115
116 - Cb\ :sub:`01`
117
118 - .. row 8
119
120 - start + 22:
121
122 - Cb\ :sub:`10`
123
124 - Cb\ :sub:`11`
125
126
127 **Color Sample Location..**
128
129
130
131 .. flat-table::
132 :header-rows: 0
133 :stub-columns: 0
134
135
136 - .. row 1
137
138 -
139 - 0
140
141 -
142 - 1
143
144 -
145 - 2
146
147 -
148 - 3
149
150 - .. row 2
151
152 - 0
153
154 - Y
155
156 -
157 - Y
158
159 -
160 - Y
161
162 -
163 - Y
164
165 - .. row 3
166
167 -
168 -
169 - C
170
171 -
172 -
173 -
174 - C
175
176 -
177
178 - .. row 4
179
180 - 1
181
182 - Y
183
184 -
185 - Y
186
187 -
188 - Y
189
190 -
191 - Y
192
193 - .. row 5
194
195 -
196
197 - .. row 6
198
199 - 2
200
201 - Y
202
203 -
204 - Y
205
206 -
207 - Y
208
209 -
210 - Y
211
212 - .. row 7
213
214 -
215 -
216 - C
217
218 -
219 -
220 -
221 - C
222
223 -
224
225 - .. row 8
226
227 - 3
228
229 - Y
230
231 -
232 - Y
233
234 -
235 - Y
236
237 -
238 - Y
This page took 0.04312 seconds and 5 git commands to generate.