1.. -*- coding: utf-8; mode: rst -*-
2
3.. _packed-yuv:
4
5******************
6Packed YUV formats
7******************
8
9Description
10===========
11
12Similar to the packed RGB formats these formats store the Y, Cb and Cr
13component of each pixel in one 16 or 32 bit word.
14
15
16.. raw:: latex
17
18    \begingroup
19    \tiny
20    \setlength{\tabcolsep}{2pt}
21
22.. _packed-yuv-formats:
23
24.. 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}|
25
26.. flat-table:: Packed YUV Image Formats
27    :header-rows:  2
28    :stub-columns: 0
29
30    * - Identifier
31      - Code
32
33      - :cspan:`7` Byte 0 in memory
34
35      - :cspan:`7` Byte 1
36
37      - :cspan:`7` Byte 2
38
39      - :cspan:`7` Byte 3
40    * -
41      -
42      - 7
43      - 6
44      - 5
45      - 4
46      - 3
47      - 2
48      - 1
49      - 0
50
51      - 7
52      - 6
53      - 5
54      - 4
55      - 3
56      - 2
57      - 1
58      - 0
59
60      - 7
61      - 6
62      - 5
63      - 4
64      - 3
65      - 2
66      - 1
67      - 0
68
69      - 7
70      - 6
71      - 5
72      - 4
73      - 3
74      - 2
75      - 1
76      - 0
77    * .. _V4L2-PIX-FMT-YUV444:
78
79      - ``V4L2_PIX_FMT_YUV444``
80      - 'Y444'
81
82      - Cb\ :sub:`3`
83      - Cb\ :sub:`2`
84      - Cb\ :sub:`1`
85      - Cb\ :sub:`0`
86      - Cr\ :sub:`3`
87      - Cr\ :sub:`2`
88      - Cr\ :sub:`1`
89      - Cr\ :sub:`0`
90
91      - a\ :sub:`3`
92      - a\ :sub:`2`
93      - a\ :sub:`1`
94      - a\ :sub:`0`
95      - Y'\ :sub:`3`
96      - Y'\ :sub:`2`
97      - Y'\ :sub:`1`
98      - Y'\ :sub:`0`
99      -
100    * .. _V4L2-PIX-FMT-YUV555:
101
102      - ``V4L2_PIX_FMT_YUV555``
103      - 'YUVO'
104
105      - Cb\ :sub:`2`
106      - Cb\ :sub:`1`
107      - Cb\ :sub:`0`
108      - Cr\ :sub:`4`
109      - Cr\ :sub:`3`
110      - Cr\ :sub:`2`
111      - Cr\ :sub:`1`
112      - Cr\ :sub:`0`
113
114      - a
115      - Y'\ :sub:`4`
116      - Y'\ :sub:`3`
117      - Y'\ :sub:`2`
118      - Y'\ :sub:`1`
119      - Y'\ :sub:`0`
120      - Cb\ :sub:`4`
121      - Cb\ :sub:`3`
122      -
123    * .. _V4L2-PIX-FMT-YUV565:
124
125      - ``V4L2_PIX_FMT_YUV565``
126      - 'YUVP'
127
128      - Cb\ :sub:`2`
129      - Cb\ :sub:`1`
130      - Cb\ :sub:`0`
131      - Cr\ :sub:`4`
132      - Cr\ :sub:`3`
133      - Cr\ :sub:`2`
134      - Cr\ :sub:`1`
135      - Cr\ :sub:`0`
136
137      - Y'\ :sub:`4`
138      - Y'\ :sub:`3`
139      - Y'\ :sub:`2`
140      - Y'\ :sub:`1`
141      - Y'\ :sub:`0`
142      - Cb\ :sub:`5`
143      - Cb\ :sub:`4`
144      - Cb\ :sub:`3`
145      -
146    * .. _V4L2-PIX-FMT-YUV32:
147
148      - ``V4L2_PIX_FMT_YUV32``
149      - 'YUV4'
150
151      - a\ :sub:`7`
152      - a\ :sub:`6`
153      - a\ :sub:`5`
154      - a\ :sub:`4`
155      - a\ :sub:`3`
156      - a\ :sub:`2`
157      - a\ :sub:`1`
158      - a\ :sub:`0`
159
160      - Y'\ :sub:`7`
161      - Y'\ :sub:`6`
162      - Y'\ :sub:`5`
163      - Y'\ :sub:`4`
164      - Y'\ :sub:`3`
165      - Y'\ :sub:`2`
166      - Y'\ :sub:`1`
167      - Y'\ :sub:`0`
168
169      - Cb\ :sub:`7`
170      - Cb\ :sub:`6`
171      - Cb\ :sub:`5`
172      - Cb\ :sub:`4`
173      - Cb\ :sub:`3`
174      - Cb\ :sub:`2`
175      - Cb\ :sub:`1`
176      - Cb\ :sub:`0`
177
178      - Cr\ :sub:`7`
179      - Cr\ :sub:`6`
180      - Cr\ :sub:`5`
181      - Cr\ :sub:`4`
182      - Cr\ :sub:`3`
183      - Cr\ :sub:`2`
184      - Cr\ :sub:`1`
185      - Cr\ :sub:`0`
186
187.. raw:: latex
188
189    \endgroup
190
191.. note::
192
193    #) Bit 7 is the most significant bit;
194
195    #) The value of a = alpha bits is undefined when reading from the driver,
196       ignored when writing to the driver, except when alpha blending has
197       been negotiated for a :ref:`Video Overlay <overlay>` or
198       :ref:`Video Output Overlay <osd>`.
199