1 .. -*- coding: utf-8; mode: rst -*-
9 .. _v4l2-mbus-framefmt:
11 .. flat-table:: struct v4l2_mbus_framefmt
23 - Image width, in pixels.
31 - Image height, in pixels.
39 - Format code, from enum
40 :ref:`v4l2_mbus_pixelcode <v4l2-mbus-pixelcode>`.
48 - Field order, from enum :ref:`v4l2_field <v4l2-field>`. See
49 :ref:`field-order` for details.
57 - Image colorspace, from enum
58 :ref:`v4l2_colorspace <v4l2-colorspace>`. See
59 :ref:`colorspaces` for details.
63 - enum :ref:`v4l2_ycbcr_encoding <v4l2-ycbcr-encoding>`
67 - This information supplements the ``colorspace`` and must be set by
68 the driver for capture streams and by the application for output
69 streams, see :ref:`colorspaces`.
73 - enum :ref:`v4l2_quantization <v4l2-quantization>`
77 - This information supplements the ``colorspace`` and must be set by
78 the driver for capture streams and by the application for output
79 streams, see :ref:`colorspaces`.
83 - enum :ref:`v4l2_xfer_func <v4l2-xfer-func>`
87 - This information supplements the ``colorspace`` and must be set by
88 the driver for capture streams and by the application for output
89 streams, see :ref:`colorspaces`.
97 - Reserved for future extensions. Applications and drivers must set
102 .. _v4l2-mbus-pixelcode:
104 Media Bus Pixel Codes
105 ---------------------
107 The media bus pixel codes describe image formats as flowing over
108 physical busses (both between separate physical components and inside
109 SoC devices). This should not be confused with the V4L2 pixel formats
110 that describe, using four character codes, image formats as stored in
113 While there is a relationship between image formats on busses and image
114 formats in memory (a raw Bayer image won't be magically converted to
115 JPEG just by storing it to memory), there is no one-to-one
116 correspondance between them.
122 Those formats transfer pixel data as red, green and blue components. The
123 format code is made of the following information.
125 - The red, green and blue components order code, as encoded in a pixel
126 sample. Possible values are RGB and BGR.
128 - The number of bits per component, for each component. The values can
129 be different for all components. Common values are 555 and 565.
131 - The number of bus samples per pixel. Pixels that are wider than the
132 bus width must be transferred in multiple samples. Common values are
137 - For formats where the total number of bits per pixel is smaller than
138 the number of bus samples per pixel times the bus width, a padding
139 value stating if the bytes are padded in their most high order bits
140 (PADHI) or low order bits (PADLO). A "C" prefix is used for
141 component-wise padding in the most high order bits (CPADHI) or low
142 order bits (CPADLO) of each separate component.
144 - For formats where the number of bus samples per pixel is larger than
145 1, an endianness value stating if the pixel is transferred MSB first
146 (BE) or LSB first (LE).
148 For instance, a format where pixels are encoded as 5-bits red, 5-bits
149 green and 5-bit blue values padded on the high bit, transferred as 2
150 8-bit samples per pixel with the most significant bits (padding, red and
151 half of the green value) transferred first will be named
152 ``MEDIA_BUS_FMT_RGB555_2X8_PADHI_BE``.
154 The following tables list existing packed RGB formats.
157 .. _v4l2-mbus-pixelcode-rgb:
159 .. flat-table:: RGB formats
171 - :cspan:`31` Data organization
243 - .. _`MEDIA-BUS-FMT-RGB444-1X12`:
245 - MEDIA_BUS_FMT_RGB444_1X12
314 - .. _`MEDIA-BUS-FMT-RGB444-2X8-PADHI-BE`:
316 - MEDIA_BUS_FMT_RGB444_2X8_PADHI_BE
454 - .. _`MEDIA-BUS-FMT-RGB444-2X8-PADHI-LE`:
456 - MEDIA_BUS_FMT_RGB444_2X8_PADHI_LE
594 - .. _`MEDIA-BUS-FMT-RGB555-2X8-PADHI-BE`:
596 - MEDIA_BUS_FMT_RGB555_2X8_PADHI_BE
734 - .. _`MEDIA-BUS-FMT-RGB555-2X8-PADHI-LE`:
736 - MEDIA_BUS_FMT_RGB555_2X8_PADHI_LE
874 - .. _`MEDIA-BUS-FMT-RGB565-1X16`:
876 - MEDIA_BUS_FMT_RGB565_1X16
945 - .. _`MEDIA-BUS-FMT-BGR565-2X8-BE`:
947 - MEDIA_BUS_FMT_BGR565_2X8_BE
1085 - .. _`MEDIA-BUS-FMT-BGR565-2X8-LE`:
1087 - MEDIA_BUS_FMT_BGR565_2X8_LE
1225 - .. _`MEDIA-BUS-FMT-RGB565-2X8-BE`:
1227 - MEDIA_BUS_FMT_RGB565_2X8_BE
1365 - .. _`MEDIA-BUS-FMT-RGB565-2X8-LE`:
1367 - MEDIA_BUS_FMT_RGB565_2X8_LE
1505 - .. _`MEDIA-BUS-FMT-RGB666-1X18`:
1507 - MEDIA_BUS_FMT_RGB666_1X18
1576 - .. _`MEDIA-BUS-FMT-RBG888-1X24`:
1578 - MEDIA_BUS_FMT_RBG888_1X24
1647 - .. _`MEDIA-BUS-FMT-RGB666-1X24_CPADHI`:
1649 - MEDIA_BUS_FMT_RGB666_1X24_CPADHI
1718 - .. _`MEDIA-BUS-FMT-BGR888-1X24`:
1720 - MEDIA_BUS_FMT_BGR888_1X24
1789 - .. _`MEDIA-BUS-FMT-GBR888-1X24`:
1791 - MEDIA_BUS_FMT_GBR888_1X24
1860 - .. _`MEDIA-BUS-FMT-RGB888-1X24`:
1862 - MEDIA_BUS_FMT_RGB888_1X24
1931 - .. _`MEDIA-BUS-FMT-RGB888-2X12-BE`:
1933 - MEDIA_BUS_FMT_RGB888_2X12_BE
2071 - .. _`MEDIA-BUS-FMT-RGB888-2X12-LE`:
2073 - MEDIA_BUS_FMT_RGB888_2X12_LE
2211 - .. _`MEDIA-BUS-FMT-ARGB888-1X32`:
2213 - MEDIA_BUS_FMT_ARGB888_1X32
2282 - .. _`MEDIA-BUS-FMT-RGB888-1X32-PADHI`:
2284 - MEDIA_BUS_FMT_RGB888_1X32_PADHI
2354 On LVDS buses, usually each sample is transferred serialized in seven
2355 time slots per pixel clock, on three (18-bit) or four (24-bit)
2356 differential data pairs at the same time. The remaining bits are used
2357 for control signals as defined by SPWG/PSWG/VESA or JEIDA standards. The
2358 24-bit RGB format serialized in seven time slots on four lanes using
2359 JEIDA defined bit mapping will be named
2360 ``MEDIA_BUS_FMT_RGB888_1X7X4_JEIDA``, for example.
2363 .. _v4l2-mbus-pixelcode-rgb-lvds:
2365 .. flat-table:: LVDS RGB formats
2378 - :cspan:`3` Data organization
2396 - .. _`MEDIA-BUS-FMT-RGB666-1X7X3-SPWG`:
2398 - MEDIA_BUS_FMT_RGB666_1X7X3_SPWG
2503 - .. _`MEDIA-BUS-FMT-RGB888-1X7X4-SPWG`:
2505 - MEDIA_BUS_FMT_RGB888_1X7X4_SPWG
2610 - .. _`MEDIA-BUS-FMT-RGB888-1X7X4-JEIDA`:
2612 - MEDIA_BUS_FMT_RGB888_1X7X4_JEIDA
2722 Those formats transfer pixel data as red, green and blue components. The
2723 format code is made of the following information.
2725 - The red, green and blue components order code, as encoded in a pixel
2726 sample. The possible values are shown in :ref:`bayer-patterns`.
2728 - The number of bits per pixel component. All components are
2729 transferred on the same number of bits. Common values are 8, 10 and
2732 - The compression (optional). If the pixel components are ALAW- or
2733 DPCM-compressed, a mention of the compression scheme and the number
2734 of bits per compressed pixel component.
2736 - The number of bus samples per pixel. Pixels that are wider than the
2737 bus width must be transferred in multiple samples. Common values are
2742 - For formats where the total number of bits per pixel is smaller than
2743 the number of bus samples per pixel times the bus width, a padding
2744 value stating if the bytes are padded in their most high order bits
2745 (PADHI) or low order bits (PADLO).
2747 - For formats where the number of bus samples per pixel is larger than
2748 1, an endianness value stating if the pixel is transferred MSB first
2749 (BE) or LSB first (LE).
2751 For instance, a format with uncompressed 10-bit Bayer components
2752 arranged in a red, green, green, blue pattern transferred as 2 8-bit
2753 samples per pixel with the least significant bits transferred first will
2754 be named ``MEDIA_BUS_FMT_SRGGB10_2X8_PADHI_LE``.
2759 .. figure:: subdev-formats_files/bayer.*
2765 Bayer filter color patterns
2769 The following table lists existing packed Bayer formats. The data
2770 organization is given as an example for the first pixel only.
2773 .. _v4l2-mbus-pixelcode-bayer:
2775 .. flat-table:: Bayer Formats
2787 - :cspan:`11` Data organization
2819 - .. _`MEDIA-BUS-FMT-SBGGR8-1X8`:
2821 - MEDIA_BUS_FMT_SBGGR8_1X8
2850 - .. _`MEDIA-BUS-FMT-SGBRG8-1X8`:
2852 - MEDIA_BUS_FMT_SGBRG8_1X8
2881 - .. _`MEDIA-BUS-FMT-SGRBG8-1X8`:
2883 - MEDIA_BUS_FMT_SGRBG8_1X8
2912 - .. _`MEDIA-BUS-FMT-SRGGB8-1X8`:
2914 - MEDIA_BUS_FMT_SRGGB8_1X8
2943 - .. _`MEDIA-BUS-FMT-SBGGR10-ALAW8-1X8`:
2945 - MEDIA_BUS_FMT_SBGGR10_ALAW8_1X8
2974 - .. _`MEDIA-BUS-FMT-SGBRG10-ALAW8-1X8`:
2976 - MEDIA_BUS_FMT_SGBRG10_ALAW8_1X8
3005 - .. _`MEDIA-BUS-FMT-SGRBG10-ALAW8-1X8`:
3007 - MEDIA_BUS_FMT_SGRBG10_ALAW8_1X8
3036 - .. _`MEDIA-BUS-FMT-SRGGB10-ALAW8-1X8`:
3038 - MEDIA_BUS_FMT_SRGGB10_ALAW8_1X8
3067 - .. _`MEDIA-BUS-FMT-SBGGR10-DPCM8-1X8`:
3069 - MEDIA_BUS_FMT_SBGGR10_DPCM8_1X8
3098 - .. _`MEDIA-BUS-FMT-SGBRG10-DPCM8-1X8`:
3100 - MEDIA_BUS_FMT_SGBRG10_DPCM8_1X8
3129 - .. _`MEDIA-BUS-FMT-SGRBG10-DPCM8-1X8`:
3131 - MEDIA_BUS_FMT_SGRBG10_DPCM8_1X8
3160 - .. _`MEDIA-BUS-FMT-SRGGB10-DPCM8-1X8`:
3162 - MEDIA_BUS_FMT_SRGGB10_DPCM8_1X8
3191 - .. _`MEDIA-BUS-FMT-SBGGR10-2X8-PADHI-BE`:
3193 - MEDIA_BUS_FMT_SBGGR10_2X8_PADHI_BE
3251 - .. _`MEDIA-BUS-FMT-SBGGR10-2X8-PADHI-LE`:
3253 - MEDIA_BUS_FMT_SBGGR10_2X8_PADHI_LE
3311 - .. _`MEDIA-BUS-FMT-SBGGR10-2X8-PADLO-BE`:
3313 - MEDIA_BUS_FMT_SBGGR10_2X8_PADLO_BE
3371 - .. _`MEDIA-BUS-FMT-SBGGR10-2X8-PADLO-LE`:
3373 - MEDIA_BUS_FMT_SBGGR10_2X8_PADLO_LE
3431 - .. _`MEDIA-BUS-FMT-SBGGR10-1X10`:
3433 - MEDIA_BUS_FMT_SBGGR10_1X10
3462 - .. _`MEDIA-BUS-FMT-SGBRG10-1X10`:
3464 - MEDIA_BUS_FMT_SGBRG10_1X10
3493 - .. _`MEDIA-BUS-FMT-SGRBG10-1X10`:
3495 - MEDIA_BUS_FMT_SGRBG10_1X10
3524 - .. _`MEDIA-BUS-FMT-SRGGB10-1X10`:
3526 - MEDIA_BUS_FMT_SRGGB10_1X10
3555 - .. _`MEDIA-BUS-FMT-SBGGR12-1X12`:
3557 - MEDIA_BUS_FMT_SBGGR12_1X12
3586 - .. _`MEDIA-BUS-FMT-SGBRG12-1X12`:
3588 - MEDIA_BUS_FMT_SGBRG12_1X12
3617 - .. _`MEDIA-BUS-FMT-SGRBG12-1X12`:
3619 - MEDIA_BUS_FMT_SGRBG12_1X12
3648 - .. _`MEDIA-BUS-FMT-SRGGB12-1X12`:
3650 - MEDIA_BUS_FMT_SRGGB12_1X12
3684 Those data formats transfer pixel data as (possibly downsampled) Y, U
3685 and V components. Some formats include dummy bits in some of their
3686 samples and are collectively referred to as "YDYC" (Y-Dummy-Y-Chroma)
3687 formats. One cannot rely on the values of these dummy bits as those are
3690 The format code is made of the following information.
3692 - The Y, U and V components order code, as transferred on the bus.
3693 Possible values are YUYV, UYVY, YVYU and VYUY for formats with no
3694 dummy bit, and YDYUYDYV, YDYVYDYU, YUYDYVYD and YVYDYUYD for YDYC
3697 - The number of bits per pixel component. All components are
3698 transferred on the same number of bits. Common values are 8, 10 and
3701 - The number of bus samples per pixel. Pixels that are wider than the
3702 bus width must be transferred in multiple samples. Common values are
3703 1, 1.5 (encoded as 1_5) and 2.
3705 - The bus width. When the bus width is larger than the number of bits
3706 per pixel component, several components are packed in a single bus
3707 sample. The components are ordered as specified by the order code,
3708 with components on the left of the code transferred in the high order
3709 bits. Common values are 8 and 16.
3711 For instance, a format where pixels are encoded as 8-bit YUV values
3712 downsampled to 4:2:2 and transferred as 2 8-bit bus samples per pixel in
3713 the U, Y, V, Y order will be named ``MEDIA_BUS_FMT_UYVY8_2X8``.
3715 :ref:`v4l2-mbus-pixelcode-yuv8` lists existing packed YUV formats and
3716 describes the organization of each pixel data in each sample. When a
3717 format pattern is split across multiple samples each of the samples in
3718 the pattern is described.
3720 The role of each bit transferred over the bus is identified by one of
3721 the following codes.
3723 - y\ :sub:`x` for luma component bit number x
3725 - u\ :sub:`x` for blue chroma component bit number x
3727 - v\ :sub:`x` for red chroma component bit number x
3729 - a\ :sub:`x` for alpha component bit number x
3731 - - for non-available bits (for positions higher than the bus width)
3736 .. _v4l2-mbus-pixelcode-yuv8:
3738 .. flat-table:: YUV Formats
3750 - :cspan:`31` Data organization
3822 - .. _`MEDIA-BUS-FMT-Y8-1X8`:
3824 - MEDIA_BUS_FMT_Y8_1X8
3893 - .. _`MEDIA-BUS-FMT-UV8-1X8`:
3895 - MEDIA_BUS_FMT_UV8_1X8
4033 - .. _`MEDIA-BUS-FMT-UYVY8-1_5X8`:
4035 - MEDIA_BUS_FMT_UYVY8_1_5X8
4449 - .. _`MEDIA-BUS-FMT-VYUY8-1_5X8`:
4451 - MEDIA_BUS_FMT_VYUY8_1_5X8
4865 - .. _`MEDIA-BUS-FMT-YUYV8-1_5X8`:
4867 - MEDIA_BUS_FMT_YUYV8_1_5X8
5281 - .. _`MEDIA-BUS-FMT-YVYU8-1_5X8`:
5283 - MEDIA_BUS_FMT_YVYU8_1_5X8
5697 - .. _`MEDIA-BUS-FMT-UYVY8-2X8`:
5699 - MEDIA_BUS_FMT_UYVY8_2X8
5975 - .. _`MEDIA-BUS-FMT-VYUY8-2X8`:
5977 - MEDIA_BUS_FMT_VYUY8_2X8
6253 - .. _`MEDIA-BUS-FMT-YUYV8-2X8`:
6255 - MEDIA_BUS_FMT_YUYV8_2X8
6531 - .. _`MEDIA-BUS-FMT-YVYU8-2X8`:
6533 - MEDIA_BUS_FMT_YVYU8_2X8
6809 - .. _`MEDIA-BUS-FMT-Y10-1X10`:
6811 - MEDIA_BUS_FMT_Y10_1X10
6880 - .. _`MEDIA-BUS-FMT-UYVY10-2X10`:
6882 - MEDIA_BUS_FMT_UYVY10_2X10
7158 - .. _`MEDIA-BUS-FMT-VYUY10-2X10`:
7160 - MEDIA_BUS_FMT_VYUY10_2X10
7436 - .. _`MEDIA-BUS-FMT-YUYV10-2X10`:
7438 - MEDIA_BUS_FMT_YUYV10_2X10
7714 - .. _`MEDIA-BUS-FMT-YVYU10-2X10`:
7716 - MEDIA_BUS_FMT_YVYU10_2X10
7992 - .. _`MEDIA-BUS-FMT-Y12-1X12`:
7994 - MEDIA_BUS_FMT_Y12_1X12
8063 - .. _`MEDIA-BUS-FMT-UYVY12-2X12`:
8065 - MEDIA_BUS_FMT_UYVY12_2X12
8341 - .. _`MEDIA-BUS-FMT-VYUY12-2X12`:
8343 - MEDIA_BUS_FMT_VYUY12_2X12
8619 - .. _`MEDIA-BUS-FMT-YUYV12-2X12`:
8621 - MEDIA_BUS_FMT_YUYV12_2X12
8897 - .. _`MEDIA-BUS-FMT-YVYU12-2X12`:
8899 - MEDIA_BUS_FMT_YVYU12_2X12
9175 - .. _`MEDIA-BUS-FMT-UYVY8-1X16`:
9177 - MEDIA_BUS_FMT_UYVY8_1X16
9315 - .. _`MEDIA-BUS-FMT-VYUY8-1X16`:
9317 - MEDIA_BUS_FMT_VYUY8_1X16
9455 - .. _`MEDIA-BUS-FMT-YUYV8-1X16`:
9457 - MEDIA_BUS_FMT_YUYV8_1X16
9595 - .. _`MEDIA-BUS-FMT-YVYU8-1X16`:
9597 - MEDIA_BUS_FMT_YVYU8_1X16
9735 - .. _`MEDIA-BUS-FMT-YDYUYDYV8-1X16`:
9737 - MEDIA_BUS_FMT_YDYUYDYV8_1X16
10013 - .. _`MEDIA-BUS-FMT-UYVY10-1X20`:
10015 - MEDIA_BUS_FMT_UYVY10_1X20
10153 - .. _`MEDIA-BUS-FMT-VYUY10-1X20`:
10155 - MEDIA_BUS_FMT_VYUY10_1X20
10293 - .. _`MEDIA-BUS-FMT-YUYV10-1X20`:
10295 - MEDIA_BUS_FMT_YUYV10_1X20
10433 - .. _`MEDIA-BUS-FMT-YVYU10-1X20`:
10435 - MEDIA_BUS_FMT_YVYU10_1X20
10573 - .. _`MEDIA-BUS-FMT-VUY8-1X24`:
10575 - MEDIA_BUS_FMT_VUY8_1X24
10644 - .. _`MEDIA-BUS-FMT-YUV8-1X24`:
10646 - MEDIA_BUS_FMT_YUV8_1X24
10715 - .. _`MEDIA-BUS-FMT-UYVY12-1X24`:
10717 - MEDIA_BUS_FMT_UYVY12_1X24
10855 - .. _`MEDIA-BUS-FMT-VYUY12-1X24`:
10857 - MEDIA_BUS_FMT_VYUY12_1X24
10995 - .. _`MEDIA-BUS-FMT-YUYV12-1X24`:
10997 - MEDIA_BUS_FMT_YUYV12_1X24
11135 - .. _`MEDIA-BUS-FMT-YVYU12-1X24`:
11137 - MEDIA_BUS_FMT_YVYU12_1X24
11275 - .. _`MEDIA-BUS-FMT-YUV10-1X30`:
11277 - MEDIA_BUS_FMT_YUV10_1X30
11346 - .. _`MEDIA-BUS-FMT-AYUV8-1X32`:
11348 - MEDIA_BUS_FMT_AYUV8_1X32
11422 Those formats transfer pixel data as RGB values in a
11423 cylindrical-coordinate system using Hue-Saturation-Value or
11424 Hue-Saturation-Lightness components. The format code is made of the
11425 following information.
11427 - The hue, saturation, value or lightness and optional alpha components
11428 order code, as encoded in a pixel sample. The only currently
11429 supported value is AHSV.
11431 - The number of bits per component, for each component. The values can
11432 be different for all components. The only currently supported value
11435 - The number of bus samples per pixel. Pixels that are wider than the
11436 bus width must be transferred in multiple samples. The only currently
11437 supported value is 1.
11441 - For formats where the total number of bits per pixel is smaller than
11442 the number of bus samples per pixel times the bus width, a padding
11443 value stating if the bytes are padded in their most high order bits
11444 (PADHI) or low order bits (PADLO).
11446 - For formats where the number of bus samples per pixel is larger than
11447 1, an endianness value stating if the pixel is transferred MSB first
11448 (BE) or LSB first (LE).
11450 The following table lists existing HSV/HSL formats.
11453 .. _v4l2-mbus-pixelcode-hsv:
11455 .. flat-table:: HSV/HSL formats
11467 - :cspan:`31` Data organization
11539 - .. _`MEDIA-BUS-FMT-AHSV8888-1X32`:
11541 - MEDIA_BUS_FMT_AHSV8888_1X32
11612 JPEG Compressed Formats
11613 ^^^^^^^^^^^^^^^^^^^^^^^
11615 Those data formats consist of an ordered sequence of 8-bit bytes
11616 obtained from JPEG compression process. Additionally to the ``_JPEG``
11617 postfix the format code is made of the following information.
11619 - The number of bus samples per entropy encoded byte.
11623 For instance, for a JPEG baseline process and an 8-bit bus width the
11624 format will be named ``MEDIA_BUS_FMT_JPEG_1X8``.
11626 The following table lists existing JPEG compressed formats.
11629 .. _v4l2-mbus-pixelcode-jpeg:
11631 .. flat-table:: JPEG Formats
11644 - .. _`MEDIA-BUS-FMT-JPEG-1X8`:
11646 - MEDIA_BUS_FMT_JPEG_1X8
11650 - Besides of its usage for the parallel bus this format is
11651 recommended for transmission of JPEG data over MIPI CSI bus using
11652 the User Defined 8-bit Data types.
11656 .. _v4l2-mbus-vendor-spec-fmts:
11658 Vendor and Device Specific Formats
11659 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
11661 This section lists complex data formats that are either vendor or device
11664 The following table lists the existing vendor and device specific
11668 .. _v4l2-mbus-pixelcode-vendor-specific:
11670 .. flat-table:: Vendor and device specific formats
11683 - .. _`MEDIA-BUS-FMT-S5C-UYVY-JPEG-1X8`:
11685 - MEDIA_BUS_FMT_S5C_UYVY_JPEG_1X8
11689 - Interleaved raw UYVY and JPEG image format with embedded meta-data
11690 used by Samsung S3C73MX camera sensors.
11695 .. ------------------------------------------------------------------------------
11696 .. This file was automatically converted from DocBook-XML with the dbxml
11697 .. library (https://github.com/return42/sphkerneldoc). The origin XML comes
11698 .. from the linux kernel, refer to:
11700 .. * https://github.com/torvalds/linux/tree/master/Documentation/DocBook
11701 .. ------------------------------------------------------------------------------