Merge remote-tracking branch 'regmap/fix/cache' into regmap-linus
[sfrench/cifs-2.6.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 *man V4L2_PIX_FMT_YVU420(2)*
11
12 V4L2_PIX_FMT_YUV420
13 Planar formats with ½ horizontal and vertical chroma resolution, also
14 known as YUV 4:2:0
15
16
17 Description
18 ===========
19
20 These are planar formats, as opposed to a packed format. The three
21 components are separated into three sub- images or planes. The Y plane
22 is first. The Y plane has one byte per pixel. For
23 ``V4L2_PIX_FMT_YVU420``, the Cr plane immediately follows the Y plane in
24 memory. The Cr plane is half the width and half the height of the Y
25 plane (and of the image). Each Cr belongs to four pixels, a two-by-two
26 square of the image. For example, Cr\ :sub:`0` belongs to Y'\ :sub:`00`,
27 Y'\ :sub:`01`, Y'\ :sub:`10`, and Y'\ :sub:`11`. Following the Cr plane
28 is the Cb plane, just like the Cr plane. ``V4L2_PIX_FMT_YUV420`` is the
29 same except the Cb plane comes first, then the Cr plane.
30
31 If the Y plane has pad bytes after each row, then the Cr and Cb planes
32 have half as many pad bytes after their rows. In other words, two Cx
33 rows (including padding) is exactly as long as one Y row (including
34 padding).
35
36 **Byte Order.**
37 Each cell is one byte.
38
39
40
41 .. flat-table::
42     :header-rows:  0
43     :stub-columns: 0
44     :widths:       2 1 1 1 1
45
46
47     -  .. row 1
48
49        -  start + 0:
50
51        -  Y'\ :sub:`00`
52
53        -  Y'\ :sub:`01`
54
55        -  Y'\ :sub:`02`
56
57        -  Y'\ :sub:`03`
58
59     -  .. row 2
60
61        -  start + 4:
62
63        -  Y'\ :sub:`10`
64
65        -  Y'\ :sub:`11`
66
67        -  Y'\ :sub:`12`
68
69        -  Y'\ :sub:`13`
70
71     -  .. row 3
72
73        -  start + 8:
74
75        -  Y'\ :sub:`20`
76
77        -  Y'\ :sub:`21`
78
79        -  Y'\ :sub:`22`
80
81        -  Y'\ :sub:`23`
82
83     -  .. row 4
84
85        -  start + 12:
86
87        -  Y'\ :sub:`30`
88
89        -  Y'\ :sub:`31`
90
91        -  Y'\ :sub:`32`
92
93        -  Y'\ :sub:`33`
94
95     -  .. row 5
96
97        -  start + 16:
98
99        -  Cr\ :sub:`00`
100
101        -  Cr\ :sub:`01`
102
103     -  .. row 6
104
105        -  start + 18:
106
107        -  Cr\ :sub:`10`
108
109        -  Cr\ :sub:`11`
110
111     -  .. row 7
112
113        -  start + 20:
114
115        -  Cb\ :sub:`00`
116
117        -  Cb\ :sub:`01`
118
119     -  .. row 8
120
121        -  start + 22:
122
123        -  Cb\ :sub:`10`
124
125        -  Cb\ :sub:`11`
126
127
128 **Color Sample Location..**
129
130
131
132 .. flat-table::
133     :header-rows:  0
134     :stub-columns: 0
135
136
137     -  .. row 1
138
139        -
140        -  0
141
142        -
143        -  1
144
145        -
146        -  2
147
148        -
149        -  3
150
151     -  .. row 2
152
153        -  0
154
155        -  Y
156
157        -
158        -  Y
159
160        -
161        -  Y
162
163        -
164        -  Y
165
166     -  .. row 3
167
168        -
169        -
170        -  C
171
172        -
173        -
174        -
175        -  C
176
177        -
178
179     -  .. row 4
180
181        -  1
182
183        -  Y
184
185        -
186        -  Y
187
188        -
189        -  Y
190
191        -
192        -  Y
193
194     -  .. row 5
195
196        -
197
198     -  .. row 6
199
200        -  2
201
202        -  Y
203
204        -
205        -  Y
206
207        -
208        -  Y
209
210        -
211        -  Y
212
213     -  .. row 7
214
215        -
216        -
217        -  C
218
219        -
220        -
221        -
222        -  C
223
224        -
225
226     -  .. row 8
227
228        -  3
229
230        -  Y
231
232        -
233        -  Y
234
235        -
236        -  Y
237
238        -
239        -  Y