18c2ecf20Sopenharmony_ci.. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later
28c2ecf20Sopenharmony_ci
38c2ecf20Sopenharmony_ci******************
48c2ecf20Sopenharmony_ciCompressed Formats
58c2ecf20Sopenharmony_ci******************
68c2ecf20Sopenharmony_ci
78c2ecf20Sopenharmony_ci
88c2ecf20Sopenharmony_ci.. _compressed-formats:
98c2ecf20Sopenharmony_ci
108c2ecf20Sopenharmony_ci.. tabularcolumns:: |p{6.6cm}|p{2.2cm}|p{8.7cm}|
118c2ecf20Sopenharmony_ci
128c2ecf20Sopenharmony_ci.. flat-table:: Compressed Image Formats
138c2ecf20Sopenharmony_ci    :header-rows:  1
148c2ecf20Sopenharmony_ci    :stub-columns: 0
158c2ecf20Sopenharmony_ci    :widths:       3 1 4
168c2ecf20Sopenharmony_ci
178c2ecf20Sopenharmony_ci    * - Identifier
188c2ecf20Sopenharmony_ci      - Code
198c2ecf20Sopenharmony_ci      - Details
208c2ecf20Sopenharmony_ci    * .. _V4L2-PIX-FMT-JPEG:
218c2ecf20Sopenharmony_ci
228c2ecf20Sopenharmony_ci      - ``V4L2_PIX_FMT_JPEG``
238c2ecf20Sopenharmony_ci      - 'JPEG'
248c2ecf20Sopenharmony_ci      - TBD. See also :ref:`VIDIOC_G_JPEGCOMP <VIDIOC_G_JPEGCOMP>`,
258c2ecf20Sopenharmony_ci	:ref:`VIDIOC_S_JPEGCOMP <VIDIOC_G_JPEGCOMP>`.
268c2ecf20Sopenharmony_ci    * .. _V4L2-PIX-FMT-MPEG:
278c2ecf20Sopenharmony_ci
288c2ecf20Sopenharmony_ci      - ``V4L2_PIX_FMT_MPEG``
298c2ecf20Sopenharmony_ci      - 'MPEG'
308c2ecf20Sopenharmony_ci      - MPEG multiplexed stream. The actual format is determined by
318c2ecf20Sopenharmony_ci	extended control ``V4L2_CID_MPEG_STREAM_TYPE``, see
328c2ecf20Sopenharmony_ci	:ref:`mpeg-control-id`.
338c2ecf20Sopenharmony_ci    * .. _V4L2-PIX-FMT-H264:
348c2ecf20Sopenharmony_ci
358c2ecf20Sopenharmony_ci      - ``V4L2_PIX_FMT_H264``
368c2ecf20Sopenharmony_ci      - 'H264'
378c2ecf20Sopenharmony_ci      - H264 Access Unit.
388c2ecf20Sopenharmony_ci	The decoder expects one Access Unit per buffer.
398c2ecf20Sopenharmony_ci	The encoder generates one Access Unit per buffer.
408c2ecf20Sopenharmony_ci	If :ref:`VIDIOC_ENUM_FMT` reports ``V4L2_FMT_FLAG_CONTINUOUS_BYTESTREAM``
418c2ecf20Sopenharmony_ci	then the decoder has no requirements since it can parse all the
428c2ecf20Sopenharmony_ci	information from the raw bytestream.
438c2ecf20Sopenharmony_ci    * .. _V4L2-PIX-FMT-H264-NO-SC:
448c2ecf20Sopenharmony_ci
458c2ecf20Sopenharmony_ci      - ``V4L2_PIX_FMT_H264_NO_SC``
468c2ecf20Sopenharmony_ci      - 'AVC1'
478c2ecf20Sopenharmony_ci      - H264 video elementary stream without start codes.
488c2ecf20Sopenharmony_ci    * .. _V4L2-PIX-FMT-H264-MVC:
498c2ecf20Sopenharmony_ci
508c2ecf20Sopenharmony_ci      - ``V4L2_PIX_FMT_H264_MVC``
518c2ecf20Sopenharmony_ci      - 'M264'
528c2ecf20Sopenharmony_ci      - H264 MVC video elementary stream.
538c2ecf20Sopenharmony_ci    * .. _V4L2-PIX-FMT-H264-SLICE:
548c2ecf20Sopenharmony_ci
558c2ecf20Sopenharmony_ci      - ``V4L2_PIX_FMT_H264_SLICE``
568c2ecf20Sopenharmony_ci      - 'S264'
578c2ecf20Sopenharmony_ci      - H264 parsed slice data, including slice headers, either with or
588c2ecf20Sopenharmony_ci	without the start code, as extracted from the H264 bitstream.
598c2ecf20Sopenharmony_ci	This format is adapted for stateless video decoders that implement an
608c2ecf20Sopenharmony_ci	H264 pipeline (using the :ref:`mem2mem` and :ref:`media-request-api`).
618c2ecf20Sopenharmony_ci	This pixelformat has two modifiers that must be set at least once
628c2ecf20Sopenharmony_ci	through the ``V4L2_CID_MPEG_VIDEO_H264_DECODE_MODE``
638c2ecf20Sopenharmony_ci        and ``V4L2_CID_MPEG_VIDEO_H264_START_CODE`` controls.
648c2ecf20Sopenharmony_ci	In addition, metadata associated with the frame to decode are
658c2ecf20Sopenharmony_ci	required to be passed through the ``V4L2_CID_MPEG_VIDEO_H264_SPS``,
668c2ecf20Sopenharmony_ci	``V4L2_CID_MPEG_VIDEO_H264_PPS``,
678c2ecf20Sopenharmony_ci	``V4L2_CID_MPEG_VIDEO_H264_SCALING_MATRIX``,
688c2ecf20Sopenharmony_ci	``V4L2_CID_MPEG_VIDEO_H264_SLICE_PARAMS`` and
698c2ecf20Sopenharmony_ci	``V4L2_CID_MPEG_VIDEO_H264_DECODE_PARAMS`` controls.  See the
708c2ecf20Sopenharmony_ci	:ref:`associated Codec Control IDs <v4l2-mpeg-h264>`.  Exactly
718c2ecf20Sopenharmony_ci	one output and one capture buffer must be provided for use
728c2ecf20Sopenharmony_ci	with this pixel format. The output buffer must contain the
738c2ecf20Sopenharmony_ci	appropriate number of macroblocks to decode a full
748c2ecf20Sopenharmony_ci	corresponding frame to the matching capture buffer.
758c2ecf20Sopenharmony_ci
768c2ecf20Sopenharmony_ci	The syntax for this format is documented in :ref:`h264`, section
778c2ecf20Sopenharmony_ci	7.3.2.8 "Slice layer without partitioning RBSP syntax" and the following
788c2ecf20Sopenharmony_ci	sections.
798c2ecf20Sopenharmony_ci
808c2ecf20Sopenharmony_ci	.. note::
818c2ecf20Sopenharmony_ci
828c2ecf20Sopenharmony_ci	   This format is not yet part of the public kernel API and it
838c2ecf20Sopenharmony_ci	   is expected to change.
848c2ecf20Sopenharmony_ci
858c2ecf20Sopenharmony_ci    * .. _V4L2-PIX-FMT-H263:
868c2ecf20Sopenharmony_ci
878c2ecf20Sopenharmony_ci      - ``V4L2_PIX_FMT_H263``
888c2ecf20Sopenharmony_ci      - 'H263'
898c2ecf20Sopenharmony_ci      - H263 video elementary stream.
908c2ecf20Sopenharmony_ci    * .. _V4L2-PIX-FMT-MPEG1:
918c2ecf20Sopenharmony_ci
928c2ecf20Sopenharmony_ci      - ``V4L2_PIX_FMT_MPEG1``
938c2ecf20Sopenharmony_ci      - 'MPG1'
948c2ecf20Sopenharmony_ci      - MPEG1 Picture. Each buffer starts with a Picture header, followed
958c2ecf20Sopenharmony_ci	by other headers as needed and ending with the Picture data.
968c2ecf20Sopenharmony_ci	If :ref:`VIDIOC_ENUM_FMT` reports ``V4L2_FMT_FLAG_CONTINUOUS_BYTESTREAM``
978c2ecf20Sopenharmony_ci	then the decoder has no requirements since it can parse all the
988c2ecf20Sopenharmony_ci	information from the raw bytestream.
998c2ecf20Sopenharmony_ci    * .. _V4L2-PIX-FMT-MPEG2:
1008c2ecf20Sopenharmony_ci
1018c2ecf20Sopenharmony_ci      - ``V4L2_PIX_FMT_MPEG2``
1028c2ecf20Sopenharmony_ci      - 'MPG2'
1038c2ecf20Sopenharmony_ci      - MPEG2 Picture. Each buffer starts with a Picture header, followed
1048c2ecf20Sopenharmony_ci	by other headers as needed and ending with the Picture data.
1058c2ecf20Sopenharmony_ci	If :ref:`VIDIOC_ENUM_FMT` reports ``V4L2_FMT_FLAG_CONTINUOUS_BYTESTREAM``
1068c2ecf20Sopenharmony_ci	then the decoder has no requirements since it can parse all the
1078c2ecf20Sopenharmony_ci	information from the raw bytestream.
1088c2ecf20Sopenharmony_ci    * .. _V4L2-PIX-FMT-MPEG2-SLICE:
1098c2ecf20Sopenharmony_ci
1108c2ecf20Sopenharmony_ci      - ``V4L2_PIX_FMT_MPEG2_SLICE``
1118c2ecf20Sopenharmony_ci      - 'MG2S'
1128c2ecf20Sopenharmony_ci      - MPEG-2 parsed slice data, as extracted from the MPEG-2 bitstream.
1138c2ecf20Sopenharmony_ci	This format is adapted for stateless video decoders that implement a
1148c2ecf20Sopenharmony_ci	MPEG-2 pipeline (using the :ref:`mem2mem` and :ref:`media-request-api`).
1158c2ecf20Sopenharmony_ci	Metadata associated with the frame to decode is required to be passed
1168c2ecf20Sopenharmony_ci	through the ``V4L2_CID_MPEG_VIDEO_MPEG2_SLICE_PARAMS`` control and
1178c2ecf20Sopenharmony_ci	quantization matrices can optionally be specified through the
1188c2ecf20Sopenharmony_ci	``V4L2_CID_MPEG_VIDEO_MPEG2_QUANTIZATION`` control.
1198c2ecf20Sopenharmony_ci	See the :ref:`associated Codec Control IDs <v4l2-mpeg-mpeg2>`.
1208c2ecf20Sopenharmony_ci	Exactly one output and one capture buffer must be provided for use with
1218c2ecf20Sopenharmony_ci	this pixel format. The output buffer must contain the appropriate number
1228c2ecf20Sopenharmony_ci	of macroblocks to decode a full corresponding frame to the matching
1238c2ecf20Sopenharmony_ci	capture buffer.
1248c2ecf20Sopenharmony_ci    * .. _V4L2-PIX-FMT-MPEG4:
1258c2ecf20Sopenharmony_ci
1268c2ecf20Sopenharmony_ci      - ``V4L2_PIX_FMT_MPEG4``
1278c2ecf20Sopenharmony_ci      - 'MPG4'
1288c2ecf20Sopenharmony_ci      - MPEG4 video elementary stream.
1298c2ecf20Sopenharmony_ci    * .. _V4L2-PIX-FMT-XVID:
1308c2ecf20Sopenharmony_ci
1318c2ecf20Sopenharmony_ci      - ``V4L2_PIX_FMT_XVID``
1328c2ecf20Sopenharmony_ci      - 'XVID'
1338c2ecf20Sopenharmony_ci      - Xvid video elementary stream.
1348c2ecf20Sopenharmony_ci    * .. _V4L2-PIX-FMT-VC1-ANNEX-G:
1358c2ecf20Sopenharmony_ci
1368c2ecf20Sopenharmony_ci      - ``V4L2_PIX_FMT_VC1_ANNEX_G``
1378c2ecf20Sopenharmony_ci      - 'VC1G'
1388c2ecf20Sopenharmony_ci      - VC1, SMPTE 421M Annex G compliant stream.
1398c2ecf20Sopenharmony_ci    * .. _V4L2-PIX-FMT-VC1-ANNEX-L:
1408c2ecf20Sopenharmony_ci
1418c2ecf20Sopenharmony_ci      - ``V4L2_PIX_FMT_VC1_ANNEX_L``
1428c2ecf20Sopenharmony_ci      - 'VC1L'
1438c2ecf20Sopenharmony_ci      - VC1, SMPTE 421M Annex L compliant stream.
1448c2ecf20Sopenharmony_ci    * .. _V4L2-PIX-FMT-VP8:
1458c2ecf20Sopenharmony_ci
1468c2ecf20Sopenharmony_ci      - ``V4L2_PIX_FMT_VP8``
1478c2ecf20Sopenharmony_ci      - 'VP80'
1488c2ecf20Sopenharmony_ci      - VP8 compressed video frame. The encoder generates one
1498c2ecf20Sopenharmony_ci	compressed frame per buffer, and the decoder requires one
1508c2ecf20Sopenharmony_ci	compressed frame per buffer.
1518c2ecf20Sopenharmony_ci    * .. _V4L2-PIX-FMT-VP8-FRAME:
1528c2ecf20Sopenharmony_ci
1538c2ecf20Sopenharmony_ci      - ``V4L2_PIX_FMT_VP8_FRAME``
1548c2ecf20Sopenharmony_ci      - 'VP8F'
1558c2ecf20Sopenharmony_ci      - VP8 parsed frame, as extracted from the container.
1568c2ecf20Sopenharmony_ci	This format is adapted for stateless video decoders that implement a
1578c2ecf20Sopenharmony_ci	VP8 pipeline (using the :ref:`mem2mem` and :ref:`media-request-api`).
1588c2ecf20Sopenharmony_ci	Metadata associated with the frame to decode is required to be passed
1598c2ecf20Sopenharmony_ci	through the ``V4L2_CID_MPEG_VIDEO_VP8_FRAME_HEADER`` control.
1608c2ecf20Sopenharmony_ci	See the :ref:`associated Codec Control IDs <v4l2-mpeg-vp8>`.
1618c2ecf20Sopenharmony_ci	Exactly one output and one capture buffer must be provided for use with
1628c2ecf20Sopenharmony_ci	this pixel format. The output buffer must contain the appropriate number
1638c2ecf20Sopenharmony_ci	of macroblocks to decode a full corresponding frame to the matching
1648c2ecf20Sopenharmony_ci	capture buffer.
1658c2ecf20Sopenharmony_ci
1668c2ecf20Sopenharmony_ci	.. note::
1678c2ecf20Sopenharmony_ci
1688c2ecf20Sopenharmony_ci	   This format is not yet part of the public kernel API and it
1698c2ecf20Sopenharmony_ci	   is expected to change.
1708c2ecf20Sopenharmony_ci
1718c2ecf20Sopenharmony_ci    * .. _V4L2-PIX-FMT-VP9:
1728c2ecf20Sopenharmony_ci
1738c2ecf20Sopenharmony_ci      - ``V4L2_PIX_FMT_VP9``
1748c2ecf20Sopenharmony_ci      - 'VP90'
1758c2ecf20Sopenharmony_ci      - VP9 compressed video frame. The encoder generates one
1768c2ecf20Sopenharmony_ci	compressed frame per buffer, and the decoder requires one
1778c2ecf20Sopenharmony_ci	compressed frame per buffer.
1788c2ecf20Sopenharmony_ci    * .. _V4L2-PIX-FMT-HEVC:
1798c2ecf20Sopenharmony_ci
1808c2ecf20Sopenharmony_ci      - ``V4L2_PIX_FMT_HEVC``
1818c2ecf20Sopenharmony_ci      - 'HEVC'
1828c2ecf20Sopenharmony_ci      - HEVC/H.265 Access Unit.
1838c2ecf20Sopenharmony_ci	The decoder expects one Access Unit per buffer.
1848c2ecf20Sopenharmony_ci	The encoder generates one Access Unit per buffer.
1858c2ecf20Sopenharmony_ci	If :ref:`VIDIOC_ENUM_FMT` reports ``V4L2_FMT_FLAG_CONTINUOUS_BYTESTREAM``
1868c2ecf20Sopenharmony_ci	then the decoder has no	requirements since it can parse all the
1878c2ecf20Sopenharmony_ci	information from the raw bytestream.
1888c2ecf20Sopenharmony_ci    * .. _V4L2-PIX-FMT-HEVC-SLICE:
1898c2ecf20Sopenharmony_ci
1908c2ecf20Sopenharmony_ci      - ``V4L2_PIX_FMT_HEVC_SLICE``
1918c2ecf20Sopenharmony_ci      - 'S265'
1928c2ecf20Sopenharmony_ci      - HEVC parsed slice data, as extracted from the HEVC bitstream.
1938c2ecf20Sopenharmony_ci	This format is adapted for stateless video decoders that implement a
1948c2ecf20Sopenharmony_ci	HEVC pipeline (using the :ref:`mem2mem` and :ref:`media-request-api`).
1958c2ecf20Sopenharmony_ci	This pixelformat has two modifiers that must be set at least once
1968c2ecf20Sopenharmony_ci	through the ``V4L2_CID_MPEG_VIDEO_HEVC_DECODE_MODE``
1978c2ecf20Sopenharmony_ci        and ``V4L2_CID_MPEG_VIDEO_HEVC_START_CODE`` controls.
1988c2ecf20Sopenharmony_ci	Metadata associated with the frame to decode is required to be passed
1998c2ecf20Sopenharmony_ci	through the following controls :
2008c2ecf20Sopenharmony_ci        * ``V4L2_CID_MPEG_VIDEO_HEVC_SPS``
2018c2ecf20Sopenharmony_ci        * ``V4L2_CID_MPEG_VIDEO_HEVC_PPS``
2028c2ecf20Sopenharmony_ci        * ``V4L2_CID_MPEG_VIDEO_HEVC_SLICE_PARAMS``
2038c2ecf20Sopenharmony_ci	See the :ref:`associated Codec Control IDs <v4l2-mpeg-hevc>`.
2048c2ecf20Sopenharmony_ci	Buffers associated with this pixel format must contain the appropriate
2058c2ecf20Sopenharmony_ci	number of macroblocks to decode a full corresponding frame.
2068c2ecf20Sopenharmony_ci
2078c2ecf20Sopenharmony_ci	.. note::
2088c2ecf20Sopenharmony_ci
2098c2ecf20Sopenharmony_ci	   This format is not yet part of the public kernel API and it
2108c2ecf20Sopenharmony_ci	   is expected to change.
2118c2ecf20Sopenharmony_ci    * .. _V4L2-PIX-FMT-FWHT:
2128c2ecf20Sopenharmony_ci
2138c2ecf20Sopenharmony_ci      - ``V4L2_PIX_FMT_FWHT``
2148c2ecf20Sopenharmony_ci      - 'FWHT'
2158c2ecf20Sopenharmony_ci      - Video elementary stream using a codec based on the Fast Walsh Hadamard
2168c2ecf20Sopenharmony_ci        Transform. This codec is implemented by the vicodec ('Virtual Codec')
2178c2ecf20Sopenharmony_ci	driver. See the codec-fwht.h header for more details.
2188c2ecf20Sopenharmony_ci	:ref:`VIDIOC_ENUM_FMT` reports ``V4L2_FMT_FLAG_CONTINUOUS_BYTESTREAM``
2198c2ecf20Sopenharmony_ci	since the decoder can parse all the information from the raw bytestream.
2208c2ecf20Sopenharmony_ci    * .. _V4L2-PIX-FMT-FWHT-STATELESS:
2218c2ecf20Sopenharmony_ci
2228c2ecf20Sopenharmony_ci      - ``V4L2_PIX_FMT_FWHT_STATELESS``
2238c2ecf20Sopenharmony_ci      - 'SFWH'
2248c2ecf20Sopenharmony_ci      - Same format as V4L2_PIX_FMT_FWHT but requires stateless codec implementation.
2258c2ecf20Sopenharmony_ci	See the :ref:`associated Codec Control IDs <v4l2-mpeg-fwht>`.
226