1 .. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later
9 Similarly to the packed RGB formats, the packed YUV formats store the Y, Cb and
10 Cr components consecutively in memory. They may apply subsampling to the chroma
11 components and thus differ in how they interlave the three components.
15 - In all the tables that follow, bit 7 is the most significant bit in a byte.
16 - 'Y', 'Cb' and 'Cr' denote bits of the luma, blue chroma (also known as
17 'U') and red chroma (also known as 'V') components respectively. 'A'
18 denotes bits of the alpha component (if supported by the format), and 'X'
25 These formats do not subsample the chroma components and store each pixels as a
26 full triplet of Y, Cb and Cr values.
28 The next table lists the packed YUV 4:4:4 formats with less than 8 bits per
29 component. They are named based on the order of the Y, Cb and Cr components as
30 seen in a 16-bit word, which is then stored in memory in little endian byte
31 order, and on the number of bits for each component. For instance the YUV565
32 format stores a pixel in a 16-bit word [15:0] laid out at as [Y'\ :sub:`4-0`
33 Cb\ :sub:`5-0` Cr\ :sub:`4-0`], and stored in memory in two bytes,
34 [Cb\ :sub:`2-0` Cr\ :sub:`4-0`] followed by [Y'\ :sub:`4-0` Cb\ :sub:`5-3`].
40 \setlength{\tabcolsep}{2pt}
42 .. tabularcolumns:: |p{3.5cm}|p{0.96cm}|p{0.52cm}|p{0.52cm}|p{0.52cm}|p{0.52cm}|p{0.52cm}|p{0.52cm}|p{0.52cm}|p{0.52cm}|p{0.52cm}|p{0.52cm}|p{0.52cm}|p{0.52cm}|p{0.52cm}|p{0.52cm}|p{0.52cm}|p{0.52cm}|
44 .. flat-table:: Packed YUV 4:4:4 Image Formats (less than 8bpc)
51 - :cspan:`7` Byte 0 in memory
75 * .. _V4L2-PIX-FMT-YUV444:
77 - ``V4L2_PIX_FMT_YUV444``
98 * .. _V4L2-PIX-FMT-YUV555:
100 - ``V4L2_PIX_FMT_YUV555``
121 * .. _V4L2-PIX-FMT-YUV565:
123 - ``V4L2_PIX_FMT_YUV565``
150 For the YUV444 and YUV555 formats, the value of alpha bits is undefined
151 when reading from the driver, ignored when writing to the driver, except
152 when alpha blending has been negotiated for a :ref:`Video Overlay
153 <overlay>` or :ref:`Video Output Overlay <osd>`.
156 The next table lists the packed YUV 4:4:4 formats with 8 bits per component.
157 They are named based on the order of the Y, Cb and Cr components as stored in
158 memory, and on the total number of bits per pixel. For instance, the VUYX32
159 format stores a pixel with Cr\ :sub:`7-0` in the first byte, Cb\ :sub:`7-0` in
160 the second byte and Y'\ :sub:`7-0` in the third byte.
162 .. flat-table:: Packed YUV Image Formats (8bpc)
173 * .. _V4L2-PIX-FMT-YUV32:
175 - ``V4L2_PIX_FMT_YUV32``
183 * .. _V4L2-PIX-FMT-AYUV32:
185 - ``V4L2_PIX_FMT_AYUV32``
193 * .. _V4L2-PIX-FMT-XYUV32:
195 - ``V4L2_PIX_FMT_XYUV32``
203 * .. _V4L2-PIX-FMT-VUYA32:
205 - ``V4L2_PIX_FMT_VUYA32``
213 * .. _V4L2-PIX-FMT-VUYX32:
215 - ``V4L2_PIX_FMT_VUYX32``
223 * .. _V4L2-PIX-FMT-YUVA32:
225 - ``V4L2_PIX_FMT_YUVA32``
233 * .. _V4L2-PIX-FMT-YUVX32:
235 - ``V4L2_PIX_FMT_YUVX32``
243 * .. _V4L2-PIX-FMT-YUV24:
245 - ``V4L2_PIX_FMT_YUV24``
255 - The alpha component is expected to contain a meaningful value that can be
256 used by drivers and applications.
257 - The padding bits contain undefined values that must be ignored by all
258 applications and drivers.
260 The next table lists the packed YUV 4:4:4 formats with 12 bits per component.
261 Expand the bits per component to 16 bits, data in the high bits, zeros in the low bits,
262 arranged in little endian order, storing 1 pixel in 6 bytes.
264 .. flat-table:: Packed YUV 4:4:4 Image Formats (12bpc)
277 * .. _V4L2-PIX-FMT-YUV48-12:
279 - ``V4L2_PIX_FMT_YUV48_12``
292 These formats, commonly referred to as YUYV or YUY2, subsample the chroma
293 components horizontally by 2, storing 2 pixels in a container. The container
294 is 32-bits for 8-bit formats, and 64-bits for 10+-bit formats.
296 The packed YUYV formats with more than 8 bits per component are stored as four
297 16-bit little-endian words. Each word's most significant bits contain one
298 component, and the least significant bits are zero padding.
304 .. tabularcolumns:: |p{3.4cm}|p{1.2cm}|p{0.8cm}|p{0.8cm}|p{0.8cm}|p{0.8cm}|p{0.8cm}|p{0.8cm}|p{0.8cm}|p{0.8cm}|
306 .. flat-table:: Packed YUV 4:2:2 Formats in 32-bit container
320 * .. _V4L2-PIX-FMT-UYVY:
322 - ``V4L2_PIX_FMT_UYVY``
333 * .. _V4L2-PIX-FMT-VYUY:
335 - ``V4L2_PIX_FMT_VYUY``
346 * .. _V4L2-PIX-FMT-YUYV:
348 - ``V4L2_PIX_FMT_YUYV``
359 * .. _V4L2-PIX-FMT-YVYU:
361 - ``V4L2_PIX_FMT_YVYU``
373 .. tabularcolumns:: |p{3.4cm}|p{1.2cm}|p{0.8cm}|p{0.8cm}|p{0.8cm}|p{0.8cm}|p{0.8cm}|p{0.8cm}|p{0.8cm}|p{0.8cm}|
375 .. flat-table:: Packed YUV 4:2:2 Formats in 64-bit container
385 * .. _V4L2-PIX-FMT-Y210:
387 - ``V4L2_PIX_FMT_Y210``
390 - Y'\ :sub:`0` (bits 15-6)
391 - Cb\ :sub:`0` (bits 15-6)
392 - Y'\ :sub:`1` (bits 15-6)
393 - Cr\ :sub:`0` (bits 15-6)
394 * .. _V4L2-PIX-FMT-Y212:
396 - ``V4L2_PIX_FMT_Y212``
399 - Y'\ :sub:`0` (bits 15-4)
400 - Cb\ :sub:`0` (bits 15-4)
401 - Y'\ :sub:`1` (bits 15-4)
402 - Cr\ :sub:`0` (bits 15-4)
403 * .. _V4L2-PIX-FMT-Y216:
405 - ``V4L2_PIX_FMT_Y216``
408 - Y'\ :sub:`0` (bits 15-0)
409 - Cb\ :sub:`0` (bits 15-0)
410 - Y'\ :sub:`1` (bits 15-0)
411 - Cr\ :sub:`0` (bits 15-0)
417 **Color Sample Location:**
418 Chroma samples are :ref:`interstitially sited<yuv-chroma-centered>`
425 This format subsamples the chroma components horizontally by 4, storing 8
432 .. tabularcolumns:: |p{2.9cm}|p{0.8cm}|p{0.5cm}|p{0.5cm}|p{0.5cm}|p{0.5cm}|p{0.5cm}|p{0.5cm}|p{0.5cm}|p{0.5cm}|p{0.5cm}|p{0.5cm}|p{0.5cm}|p{0.5cm}|
434 .. flat-table:: Packed YUV 4:1:1 Formats
452 * .. _V4L2-PIX-FMT-Y41P:
454 - ``V4L2_PIX_FMT_Y41P``
476 Do not confuse ``V4L2_PIX_FMT_Y41P`` with
477 :ref:`V4L2_PIX_FMT_YUV411P <V4L2-PIX-FMT-YUV411P>`. Y41P is derived from
478 "YUV 4:1:1 **packed**", while YUV411P stands for "YUV 4:1:1 **planar**".
480 **Color Sample Location:**
481 Chroma samples are :ref:`interstitially sited<yuv-chroma-centered>`