Merge tag 'trace-v5.1' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux...
[sfrench/cifs-2.6.git] / Documentation / media / uapi / v4l / pixfmt-packed-yuv.rst
1 .. Permission is granted to copy, distribute and/or modify this
2 .. document under the terms of the GNU Free Documentation License,
3 .. Version 1.1 or any later version published by the Free Software
4 .. Foundation, with no Invariant Sections, no Front-Cover Texts
5 .. and no Back-Cover Texts. A copy of the license is included at
6 .. Documentation/media/uapi/fdl-appendix.rst.
7 ..
8 .. TODO: replace it to GFDL-1.1-or-later WITH no-invariant-sections
9
10 .. _packed-yuv:
11
12 ******************
13 Packed YUV formats
14 ******************
15
16 Description
17 ===========
18
19 Similar to the packed RGB formats these formats store the Y, Cb and Cr
20 component of each pixel in one 16 or 32 bit word.
21
22
23 .. raw:: latex
24
25     \begingroup
26     \tiny
27     \setlength{\tabcolsep}{2pt}
28
29 .. _packed-yuv-formats:
30
31 .. tabularcolumns:: |p{2.0cm}|p{0.67cm}|p{0.29cm}|p{0.29cm}|p{0.29cm}|p{0.29cm}|p{0.29cm}|p{0.29cm}|p{0.29cm}|p{0.29cm}|p{0.29cm}|p{0.29cm}|p{0.29cm}|p{0.29cm}|p{0.29cm}|p{0.29cm}|p{0.29cm}|p{0.29cm}|p{0.29cm}|p{0.29cm}|p{0.29cm}|p{0.29cm}|p{0.29cm}|p{0.29cm}|p{0.29cm}|p{0.29cm}|p{0.29cm}|p{0.29cm}|p{0.29cm}|p{0.29cm}|p{0.29cm}|p{0.29cm}|p{0.29cm}|p{0.29cm}|
32
33 .. flat-table:: Packed YUV Image Formats
34     :header-rows:  2
35     :stub-columns: 0
36
37     * - Identifier
38       - Code
39
40       - :cspan:`7` Byte 0 in memory
41
42       - :cspan:`7` Byte 1
43
44       - :cspan:`7` Byte 2
45
46       - :cspan:`7` Byte 3
47     * -
48       -
49       - 7
50       - 6
51       - 5
52       - 4
53       - 3
54       - 2
55       - 1
56       - 0
57
58       - 7
59       - 6
60       - 5
61       - 4
62       - 3
63       - 2
64       - 1
65       - 0
66
67       - 7
68       - 6
69       - 5
70       - 4
71       - 3
72       - 2
73       - 1
74       - 0
75
76       - 7
77       - 6
78       - 5
79       - 4
80       - 3
81       - 2
82       - 1
83       - 0
84     * .. _V4L2-PIX-FMT-YUV444:
85
86       - ``V4L2_PIX_FMT_YUV444``
87       - 'Y444'
88
89       - Cb\ :sub:`3`
90       - Cb\ :sub:`2`
91       - Cb\ :sub:`1`
92       - Cb\ :sub:`0`
93       - Cr\ :sub:`3`
94       - Cr\ :sub:`2`
95       - Cr\ :sub:`1`
96       - Cr\ :sub:`0`
97
98       - a\ :sub:`3`
99       - a\ :sub:`2`
100       - a\ :sub:`1`
101       - a\ :sub:`0`
102       - Y'\ :sub:`3`
103       - Y'\ :sub:`2`
104       - Y'\ :sub:`1`
105       - Y'\ :sub:`0`
106       -
107     * .. _V4L2-PIX-FMT-YUV555:
108
109       - ``V4L2_PIX_FMT_YUV555``
110       - 'YUVO'
111
112       - Cb\ :sub:`2`
113       - Cb\ :sub:`1`
114       - Cb\ :sub:`0`
115       - Cr\ :sub:`4`
116       - Cr\ :sub:`3`
117       - Cr\ :sub:`2`
118       - Cr\ :sub:`1`
119       - Cr\ :sub:`0`
120
121       - a
122       - Y'\ :sub:`4`
123       - Y'\ :sub:`3`
124       - Y'\ :sub:`2`
125       - Y'\ :sub:`1`
126       - Y'\ :sub:`0`
127       - Cb\ :sub:`4`
128       - Cb\ :sub:`3`
129       -
130     * .. _V4L2-PIX-FMT-YUV565:
131
132       - ``V4L2_PIX_FMT_YUV565``
133       - 'YUVP'
134
135       - Cb\ :sub:`2`
136       - Cb\ :sub:`1`
137       - Cb\ :sub:`0`
138       - Cr\ :sub:`4`
139       - Cr\ :sub:`3`
140       - Cr\ :sub:`2`
141       - Cr\ :sub:`1`
142       - Cr\ :sub:`0`
143
144       - Y'\ :sub:`4`
145       - Y'\ :sub:`3`
146       - Y'\ :sub:`2`
147       - Y'\ :sub:`1`
148       - Y'\ :sub:`0`
149       - Cb\ :sub:`5`
150       - Cb\ :sub:`4`
151       - Cb\ :sub:`3`
152       -
153     * .. _V4L2-PIX-FMT-YUV32:
154
155       - ``V4L2_PIX_FMT_YUV32``
156       - 'YUV4'
157
158       - a\ :sub:`7`
159       - a\ :sub:`6`
160       - a\ :sub:`5`
161       - a\ :sub:`4`
162       - a\ :sub:`3`
163       - a\ :sub:`2`
164       - a\ :sub:`1`
165       - a\ :sub:`0`
166
167       - Y'\ :sub:`7`
168       - Y'\ :sub:`6`
169       - Y'\ :sub:`5`
170       - Y'\ :sub:`4`
171       - Y'\ :sub:`3`
172       - Y'\ :sub:`2`
173       - Y'\ :sub:`1`
174       - Y'\ :sub:`0`
175
176       - Cb\ :sub:`7`
177       - Cb\ :sub:`6`
178       - Cb\ :sub:`5`
179       - Cb\ :sub:`4`
180       - Cb\ :sub:`3`
181       - Cb\ :sub:`2`
182       - Cb\ :sub:`1`
183       - Cb\ :sub:`0`
184
185       - Cr\ :sub:`7`
186       - Cr\ :sub:`6`
187       - Cr\ :sub:`5`
188       - Cr\ :sub:`4`
189       - Cr\ :sub:`3`
190       - Cr\ :sub:`2`
191       - Cr\ :sub:`1`
192       - Cr\ :sub:`0`
193       -
194     * .. _V4L2-PIX-FMT-AYUV32:
195
196       - ``V4L2_PIX_FMT_AYUV32``
197       - 'AYUV'
198
199       - a\ :sub:`7`
200       - a\ :sub:`6`
201       - a\ :sub:`5`
202       - a\ :sub:`4`
203       - a\ :sub:`3`
204       - a\ :sub:`2`
205       - a\ :sub:`1`
206       - a\ :sub:`0`
207
208       - Y'\ :sub:`7`
209       - Y'\ :sub:`6`
210       - Y'\ :sub:`5`
211       - Y'\ :sub:`4`
212       - Y'\ :sub:`3`
213       - Y'\ :sub:`2`
214       - Y'\ :sub:`1`
215       - Y'\ :sub:`0`
216
217       - Cb\ :sub:`7`
218       - Cb\ :sub:`6`
219       - Cb\ :sub:`5`
220       - Cb\ :sub:`4`
221       - Cb\ :sub:`3`
222       - Cb\ :sub:`2`
223       - Cb\ :sub:`1`
224       - Cb\ :sub:`0`
225
226       - Cr\ :sub:`7`
227       - Cr\ :sub:`6`
228       - Cr\ :sub:`5`
229       - Cr\ :sub:`4`
230       - Cr\ :sub:`3`
231       - Cr\ :sub:`2`
232       - Cr\ :sub:`1`
233       - Cr\ :sub:`0`
234       -
235     * .. _V4L2-PIX-FMT-XYUV32:
236
237       - ``V4L2_PIX_FMT_XYUV32``
238       - 'XYUV'
239
240       -
241       -
242       -
243       -
244       -
245       -
246       -
247       -
248
249       - Y'\ :sub:`7`
250       - Y'\ :sub:`6`
251       - Y'\ :sub:`5`
252       - Y'\ :sub:`4`
253       - Y'\ :sub:`3`
254       - Y'\ :sub:`2`
255       - Y'\ :sub:`1`
256       - Y'\ :sub:`0`
257
258       - Cb\ :sub:`7`
259       - Cb\ :sub:`6`
260       - Cb\ :sub:`5`
261       - Cb\ :sub:`4`
262       - Cb\ :sub:`3`
263       - Cb\ :sub:`2`
264       - Cb\ :sub:`1`
265       - Cb\ :sub:`0`
266
267       - Cr\ :sub:`7`
268       - Cr\ :sub:`6`
269       - Cr\ :sub:`5`
270       - Cr\ :sub:`4`
271       - Cr\ :sub:`3`
272       - Cr\ :sub:`2`
273       - Cr\ :sub:`1`
274       - Cr\ :sub:`0`
275       -
276     * .. _V4L2-PIX-FMT-VUYA32:
277
278       - ``V4L2_PIX_FMT_VUYA32``
279       - 'VUYA'
280
281       - Cr\ :sub:`7`
282       - Cr\ :sub:`6`
283       - Cr\ :sub:`5`
284       - Cr\ :sub:`4`
285       - Cr\ :sub:`3`
286       - Cr\ :sub:`2`
287       - Cr\ :sub:`1`
288       - Cr\ :sub:`0`
289
290       - Cb\ :sub:`7`
291       - Cb\ :sub:`6`
292       - Cb\ :sub:`5`
293       - Cb\ :sub:`4`
294       - Cb\ :sub:`3`
295       - Cb\ :sub:`2`
296       - Cb\ :sub:`1`
297       - Cb\ :sub:`0`
298
299       - Y'\ :sub:`7`
300       - Y'\ :sub:`6`
301       - Y'\ :sub:`5`
302       - Y'\ :sub:`4`
303       - Y'\ :sub:`3`
304       - Y'\ :sub:`2`
305       - Y'\ :sub:`1`
306       - Y'\ :sub:`0`
307
308       - a\ :sub:`7`
309       - a\ :sub:`6`
310       - a\ :sub:`5`
311       - a\ :sub:`4`
312       - a\ :sub:`3`
313       - a\ :sub:`2`
314       - a\ :sub:`1`
315       - a\ :sub:`0`
316       -
317     * .. _V4L2-PIX-FMT-VUYX32:
318
319       - ``V4L2_PIX_FMT_VUYX32``
320       - 'VUYX'
321
322       - Cr\ :sub:`7`
323       - Cr\ :sub:`6`
324       - Cr\ :sub:`5`
325       - Cr\ :sub:`4`
326       - Cr\ :sub:`3`
327       - Cr\ :sub:`2`
328       - Cr\ :sub:`1`
329       - Cr\ :sub:`0`
330
331       - Cb\ :sub:`7`
332       - Cb\ :sub:`6`
333       - Cb\ :sub:`5`
334       - Cb\ :sub:`4`
335       - Cb\ :sub:`3`
336       - Cb\ :sub:`2`
337       - Cb\ :sub:`1`
338       - Cb\ :sub:`0`
339
340       - Y'\ :sub:`7`
341       - Y'\ :sub:`6`
342       - Y'\ :sub:`5`
343       - Y'\ :sub:`4`
344       - Y'\ :sub:`3`
345       - Y'\ :sub:`2`
346       - Y'\ :sub:`1`
347       - Y'\ :sub:`0`
348
349       -
350       -
351       -
352       -
353       -
354       -
355       -
356       -
357
358 .. raw:: latex
359
360     \endgroup
361
362 .. note::
363
364     #) Bit 7 is the most significant bit;
365
366     #) The value of a = alpha bits is undefined when reading from the driver,
367        ignored when writing to the driver, except when alpha blending has
368        been negotiated for a :ref:`Video Overlay <overlay>` or
369        :ref:`Video Output Overlay <osd>` for the formats Y444, YUV555 and
370        YUV4. However, for formats AYUV32 and VUYA32, the alpha component is
371        expected to contain a meaningful value that can be used by drivers
372        and applications. And, the formats XYUV32 and VUYX32 contain undefined
373        alpha values that must be ignored by all applications and drivers.