162306a36Sopenharmony_ci.. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later
262306a36Sopenharmony_ci
362306a36Sopenharmony_ci******************
462306a36Sopenharmony_ciCompressed Formats
562306a36Sopenharmony_ci******************
662306a36Sopenharmony_ci
762306a36Sopenharmony_ci
862306a36Sopenharmony_ci.. _compressed-formats:
962306a36Sopenharmony_ci
1062306a36Sopenharmony_ci.. raw:: latex
1162306a36Sopenharmony_ci
1262306a36Sopenharmony_ci    \small
1362306a36Sopenharmony_ci
1462306a36Sopenharmony_ci.. tabularcolumns:: |p{5.8cm}|p{1.2cm}|p{10.3cm}|
1562306a36Sopenharmony_ci
1662306a36Sopenharmony_ci.. cssclass:: longtable
1762306a36Sopenharmony_ci
1862306a36Sopenharmony_ci.. flat-table:: Compressed Image Formats
1962306a36Sopenharmony_ci    :header-rows:  1
2062306a36Sopenharmony_ci    :stub-columns: 0
2162306a36Sopenharmony_ci    :widths:       3 1 4
2262306a36Sopenharmony_ci
2362306a36Sopenharmony_ci    * - Identifier
2462306a36Sopenharmony_ci      - Code
2562306a36Sopenharmony_ci      - Details
2662306a36Sopenharmony_ci    * .. _V4L2-PIX-FMT-JPEG:
2762306a36Sopenharmony_ci
2862306a36Sopenharmony_ci      - ``V4L2_PIX_FMT_JPEG``
2962306a36Sopenharmony_ci      - 'JPEG'
3062306a36Sopenharmony_ci      - TBD. See also :ref:`VIDIOC_G_JPEGCOMP <VIDIOC_G_JPEGCOMP>`,
3162306a36Sopenharmony_ci	:ref:`VIDIOC_S_JPEGCOMP <VIDIOC_G_JPEGCOMP>`.
3262306a36Sopenharmony_ci    * .. _V4L2-PIX-FMT-MPEG:
3362306a36Sopenharmony_ci
3462306a36Sopenharmony_ci      - ``V4L2_PIX_FMT_MPEG``
3562306a36Sopenharmony_ci      - 'MPEG'
3662306a36Sopenharmony_ci      - MPEG multiplexed stream. The actual format is determined by
3762306a36Sopenharmony_ci	extended control ``V4L2_CID_MPEG_STREAM_TYPE``, see
3862306a36Sopenharmony_ci	:ref:`mpeg-control-id`.
3962306a36Sopenharmony_ci    * .. _V4L2-PIX-FMT-H264:
4062306a36Sopenharmony_ci
4162306a36Sopenharmony_ci      - ``V4L2_PIX_FMT_H264``
4262306a36Sopenharmony_ci      - 'H264'
4362306a36Sopenharmony_ci      - H264 Access Unit.
4462306a36Sopenharmony_ci	The decoder expects one Access Unit per buffer.
4562306a36Sopenharmony_ci	The encoder generates one Access Unit per buffer.
4662306a36Sopenharmony_ci	If :ref:`VIDIOC_ENUM_FMT` reports ``V4L2_FMT_FLAG_CONTINUOUS_BYTESTREAM``
4762306a36Sopenharmony_ci	then the decoder has no requirements since it can parse all the
4862306a36Sopenharmony_ci	information from the raw bytestream.
4962306a36Sopenharmony_ci    * .. _V4L2-PIX-FMT-H264-NO-SC:
5062306a36Sopenharmony_ci
5162306a36Sopenharmony_ci      - ``V4L2_PIX_FMT_H264_NO_SC``
5262306a36Sopenharmony_ci      - 'AVC1'
5362306a36Sopenharmony_ci      - H264 video elementary stream without start codes.
5462306a36Sopenharmony_ci    * .. _V4L2-PIX-FMT-H264-MVC:
5562306a36Sopenharmony_ci
5662306a36Sopenharmony_ci      - ``V4L2_PIX_FMT_H264_MVC``
5762306a36Sopenharmony_ci      - 'M264'
5862306a36Sopenharmony_ci      - H264 MVC video elementary stream.
5962306a36Sopenharmony_ci    * .. _V4L2-PIX-FMT-H264-SLICE:
6062306a36Sopenharmony_ci
6162306a36Sopenharmony_ci      - ``V4L2_PIX_FMT_H264_SLICE``
6262306a36Sopenharmony_ci      - 'S264'
6362306a36Sopenharmony_ci      - H264 parsed slice data, including slice headers, either with or
6462306a36Sopenharmony_ci	without the start code, as extracted from the H264 bitstream.
6562306a36Sopenharmony_ci	This format is adapted for stateless video decoders that implement an
6662306a36Sopenharmony_ci	H264 pipeline with the :ref:`stateless_decoder`.
6762306a36Sopenharmony_ci	This pixelformat has two modifiers that must be set at least once
6862306a36Sopenharmony_ci	through the ``V4L2_CID_STATELESS_H264_DECODE_MODE``
6962306a36Sopenharmony_ci        and ``V4L2_CID_STATELESS_H264_START_CODE`` controls.
7062306a36Sopenharmony_ci	In addition, metadata associated with the frame to decode are
7162306a36Sopenharmony_ci	required to be passed through the ``V4L2_CID_STATELESS_H264_SPS``,
7262306a36Sopenharmony_ci	``V4L2_CID_STATELESS_H264_PPS``,
7362306a36Sopenharmony_ci	``V4L2_CID_STATELESS_H264_SCALING_MATRIX``,
7462306a36Sopenharmony_ci	``V4L2_CID_STATELESS_H264_SLICE_PARAMS`` and
7562306a36Sopenharmony_ci	``V4L2_CID_STATELESS_H264_DECODE_PARAMS`` controls.  See the
7662306a36Sopenharmony_ci	:ref:`associated Codec Control IDs <v4l2-codec-stateless-h264>`.
7762306a36Sopenharmony_ci        Exactly one output and one capture buffer must be provided for use
7862306a36Sopenharmony_ci	with this pixel format. The output buffer must contain the
7962306a36Sopenharmony_ci	appropriate number of macroblocks to decode a full
8062306a36Sopenharmony_ci	corresponding frame to the matching capture buffer.
8162306a36Sopenharmony_ci
8262306a36Sopenharmony_ci	The syntax for this format is documented in :ref:`h264`, section
8362306a36Sopenharmony_ci	7.3.2.8 "Slice layer without partitioning RBSP syntax" and the following
8462306a36Sopenharmony_ci	sections.
8562306a36Sopenharmony_ci
8662306a36Sopenharmony_ci    * .. _V4L2-PIX-FMT-H263:
8762306a36Sopenharmony_ci
8862306a36Sopenharmony_ci      - ``V4L2_PIX_FMT_H263``
8962306a36Sopenharmony_ci      - 'H263'
9062306a36Sopenharmony_ci      - H263 video elementary stream.
9162306a36Sopenharmony_ci    * .. _V4L2-PIX-FMT-SPK:
9262306a36Sopenharmony_ci
9362306a36Sopenharmony_ci      - ``V4L2_PIX_FMT_SPK``
9462306a36Sopenharmony_ci      - 'SPK0'
9562306a36Sopenharmony_ci      - Sorenson Spark is an implementation of H.263 for use in Flash Video and Adobe Flash files
9662306a36Sopenharmony_ci    * .. _V4L2-PIX-FMT-MPEG1:
9762306a36Sopenharmony_ci
9862306a36Sopenharmony_ci      - ``V4L2_PIX_FMT_MPEG1``
9962306a36Sopenharmony_ci      - 'MPG1'
10062306a36Sopenharmony_ci      - MPEG1 Picture. Each buffer starts with a Picture header, followed
10162306a36Sopenharmony_ci	by other headers as needed and ending with the Picture data.
10262306a36Sopenharmony_ci	If :ref:`VIDIOC_ENUM_FMT` reports ``V4L2_FMT_FLAG_CONTINUOUS_BYTESTREAM``
10362306a36Sopenharmony_ci	then the decoder has no requirements since it can parse all the
10462306a36Sopenharmony_ci	information from the raw bytestream.
10562306a36Sopenharmony_ci    * .. _V4L2-PIX-FMT-MPEG2:
10662306a36Sopenharmony_ci
10762306a36Sopenharmony_ci      - ``V4L2_PIX_FMT_MPEG2``
10862306a36Sopenharmony_ci      - 'MPG2'
10962306a36Sopenharmony_ci      - MPEG2 Picture. Each buffer starts with a Picture header, followed
11062306a36Sopenharmony_ci	by other headers as needed and ending with the Picture data.
11162306a36Sopenharmony_ci	If :ref:`VIDIOC_ENUM_FMT` reports ``V4L2_FMT_FLAG_CONTINUOUS_BYTESTREAM``
11262306a36Sopenharmony_ci	then the decoder has no requirements since it can parse all the
11362306a36Sopenharmony_ci	information from the raw bytestream.
11462306a36Sopenharmony_ci    * .. _V4L2-PIX-FMT-MPEG2-SLICE:
11562306a36Sopenharmony_ci
11662306a36Sopenharmony_ci      - ``V4L2_PIX_FMT_MPEG2_SLICE``
11762306a36Sopenharmony_ci      - 'MG2S'
11862306a36Sopenharmony_ci      - MPEG-2 parsed slice data, as extracted from the MPEG-2 bitstream.
11962306a36Sopenharmony_ci	This format is adapted for stateless video decoders that implement a
12062306a36Sopenharmony_ci	MPEG-2 pipeline with the :ref:`stateless_decoder`.
12162306a36Sopenharmony_ci	Metadata associated with the frame to decode is required to be passed
12262306a36Sopenharmony_ci	through the ``V4L2_CID_STATELESS_MPEG2_SEQUENCE`` and
12362306a36Sopenharmony_ci        ``V4L2_CID_STATELESS_MPEG2_PICTURE`` controls.
12462306a36Sopenharmony_ci        Quantisation matrices can optionally be specified through the
12562306a36Sopenharmony_ci	``V4L2_CID_STATELESS_MPEG2_QUANTISATION`` control.
12662306a36Sopenharmony_ci	See the :ref:`associated Codec Control IDs <v4l2-codec-stateless-mpeg2>`.
12762306a36Sopenharmony_ci	Exactly one output and one capture buffer must be provided for use with
12862306a36Sopenharmony_ci	this pixel format. The output buffer must contain the appropriate number
12962306a36Sopenharmony_ci	of macroblocks to decode a full corresponding frame to the matching
13062306a36Sopenharmony_ci	capture buffer.
13162306a36Sopenharmony_ci    * .. _V4L2-PIX-FMT-MPEG4:
13262306a36Sopenharmony_ci
13362306a36Sopenharmony_ci      - ``V4L2_PIX_FMT_MPEG4``
13462306a36Sopenharmony_ci      - 'MPG4'
13562306a36Sopenharmony_ci      - MPEG4 video elementary stream.
13662306a36Sopenharmony_ci    * .. _V4L2-PIX-FMT-XVID:
13762306a36Sopenharmony_ci
13862306a36Sopenharmony_ci      - ``V4L2_PIX_FMT_XVID``
13962306a36Sopenharmony_ci      - 'XVID'
14062306a36Sopenharmony_ci      - Xvid video elementary stream.
14162306a36Sopenharmony_ci    * .. _V4L2-PIX-FMT-VC1-ANNEX-G:
14262306a36Sopenharmony_ci
14362306a36Sopenharmony_ci      - ``V4L2_PIX_FMT_VC1_ANNEX_G``
14462306a36Sopenharmony_ci      - 'VC1G'
14562306a36Sopenharmony_ci      - VC1, SMPTE 421M Annex G compliant stream.
14662306a36Sopenharmony_ci    * .. _V4L2-PIX-FMT-VC1-ANNEX-L:
14762306a36Sopenharmony_ci
14862306a36Sopenharmony_ci      - ``V4L2_PIX_FMT_VC1_ANNEX_L``
14962306a36Sopenharmony_ci      - 'VC1L'
15062306a36Sopenharmony_ci      - VC1, SMPTE 421M Annex L compliant stream.
15162306a36Sopenharmony_ci    * .. _V4L2-PIX-FMT-VP8:
15262306a36Sopenharmony_ci
15362306a36Sopenharmony_ci      - ``V4L2_PIX_FMT_VP8``
15462306a36Sopenharmony_ci      - 'VP80'
15562306a36Sopenharmony_ci      - VP8 compressed video frame. The encoder generates one
15662306a36Sopenharmony_ci	compressed frame per buffer, and the decoder requires one
15762306a36Sopenharmony_ci	compressed frame per buffer.
15862306a36Sopenharmony_ci    * .. _V4L2-PIX-FMT-VP8-FRAME:
15962306a36Sopenharmony_ci
16062306a36Sopenharmony_ci      - ``V4L2_PIX_FMT_VP8_FRAME``
16162306a36Sopenharmony_ci      - 'VP8F'
16262306a36Sopenharmony_ci      - VP8 parsed frame, including the frame header, as extracted from the container.
16362306a36Sopenharmony_ci	This format is adapted for stateless video decoders that implement an
16462306a36Sopenharmony_ci	VP8 pipeline with the :ref:`stateless_decoder`.
16562306a36Sopenharmony_ci	Metadata associated with the frame to decode is required to be passed
16662306a36Sopenharmony_ci	through the ``V4L2_CID_STATELESS_VP8_FRAME`` control.
16762306a36Sopenharmony_ci	See the :ref:`associated Codec Control IDs <v4l2-codec-stateless-vp8>`.
16862306a36Sopenharmony_ci	Exactly one output and one capture buffer must be provided for use with
16962306a36Sopenharmony_ci	this pixel format. The output buffer must contain the appropriate number
17062306a36Sopenharmony_ci	of macroblocks to decode a full corresponding frame to the matching
17162306a36Sopenharmony_ci	capture buffer.
17262306a36Sopenharmony_ci
17362306a36Sopenharmony_ci    * .. _V4L2-PIX-FMT-VP9:
17462306a36Sopenharmony_ci
17562306a36Sopenharmony_ci      - ``V4L2_PIX_FMT_VP9``
17662306a36Sopenharmony_ci      - 'VP90'
17762306a36Sopenharmony_ci      - VP9 compressed video frame. The encoder generates one
17862306a36Sopenharmony_ci	compressed frame per buffer, and the decoder requires one
17962306a36Sopenharmony_ci	compressed frame per buffer.
18062306a36Sopenharmony_ci    * .. _V4L2-PIX-FMT-VP9-FRAME:
18162306a36Sopenharmony_ci
18262306a36Sopenharmony_ci      - ``V4L2_PIX_FMT_VP9_FRAME``
18362306a36Sopenharmony_ci      - 'VP9F'
18462306a36Sopenharmony_ci      - VP9 parsed frame, including the frame header, as extracted from the container.
18562306a36Sopenharmony_ci	This format is adapted for stateless video decoders that implement a
18662306a36Sopenharmony_ci	VP9 pipeline with the :ref:`stateless_decoder`.
18762306a36Sopenharmony_ci	Metadata associated with the frame to decode is required to be passed
18862306a36Sopenharmony_ci	through the ``V4L2_CID_STATELESS_VP9_FRAME`` and
18962306a36Sopenharmony_ci	the ``V4L2_CID_STATELESS_VP9_COMPRESSED_HDR`` controls.
19062306a36Sopenharmony_ci	See the :ref:`associated Codec Control IDs <v4l2-codec-stateless-vp9>`.
19162306a36Sopenharmony_ci	Exactly one output and one capture buffer must be provided for use with
19262306a36Sopenharmony_ci	this pixel format. The output buffer must contain the appropriate number
19362306a36Sopenharmony_ci	of macroblocks to decode a full corresponding frame to the matching
19462306a36Sopenharmony_ci	capture buffer.
19562306a36Sopenharmony_ci    * .. _V4L2-PIX-FMT-HEVC:
19662306a36Sopenharmony_ci
19762306a36Sopenharmony_ci      - ``V4L2_PIX_FMT_HEVC``
19862306a36Sopenharmony_ci      - 'HEVC'
19962306a36Sopenharmony_ci      - HEVC/H.265 Access Unit.
20062306a36Sopenharmony_ci	The decoder expects one Access Unit per buffer.
20162306a36Sopenharmony_ci	The encoder generates one Access Unit per buffer.
20262306a36Sopenharmony_ci	If :ref:`VIDIOC_ENUM_FMT` reports ``V4L2_FMT_FLAG_CONTINUOUS_BYTESTREAM``
20362306a36Sopenharmony_ci	then the decoder has no	requirements since it can parse all the
20462306a36Sopenharmony_ci	information from the raw bytestream.
20562306a36Sopenharmony_ci    * .. _V4L2-PIX-FMT-HEVC-SLICE:
20662306a36Sopenharmony_ci
20762306a36Sopenharmony_ci      - ``V4L2_PIX_FMT_HEVC_SLICE``
20862306a36Sopenharmony_ci      - 'S265'
20962306a36Sopenharmony_ci      - HEVC parsed slice data, as extracted from the HEVC bitstream.
21062306a36Sopenharmony_ci	This format is adapted for stateless video decoders that implement a
21162306a36Sopenharmony_ci	HEVC pipeline (using the :ref:`mem2mem` and :ref:`media-request-api`).
21262306a36Sopenharmony_ci	This pixelformat has two modifiers that must be set at least once
21362306a36Sopenharmony_ci	through the ``V4L2_CID_MPEG_VIDEO_HEVC_DECODE_MODE``
21462306a36Sopenharmony_ci        and ``V4L2_CID_MPEG_VIDEO_HEVC_START_CODE`` controls.
21562306a36Sopenharmony_ci	Metadata associated with the frame to decode is required to be passed
21662306a36Sopenharmony_ci	through the following controls:
21762306a36Sopenharmony_ci        ``V4L2_CID_MPEG_VIDEO_HEVC_SPS``,
21862306a36Sopenharmony_ci        ``V4L2_CID_MPEG_VIDEO_HEVC_PPS``, and
21962306a36Sopenharmony_ci        ``V4L2_CID_MPEG_VIDEO_HEVC_SLICE_PARAMS``.
22062306a36Sopenharmony_ci	See the :ref:`associated Codec Control IDs <v4l2-codec-stateless-hevc>`.
22162306a36Sopenharmony_ci	Buffers associated with this pixel format must contain the appropriate
22262306a36Sopenharmony_ci	number of macroblocks to decode a full corresponding frame.
22362306a36Sopenharmony_ci    * .. _V4L2-PIX-FMT-FWHT:
22462306a36Sopenharmony_ci
22562306a36Sopenharmony_ci      - ``V4L2_PIX_FMT_FWHT``
22662306a36Sopenharmony_ci      - 'FWHT'
22762306a36Sopenharmony_ci      - Video elementary stream using a codec based on the Fast Walsh Hadamard
22862306a36Sopenharmony_ci        Transform. This codec is implemented by the vicodec ('Virtual Codec')
22962306a36Sopenharmony_ci	driver. See the codec-fwht.h header for more details.
23062306a36Sopenharmony_ci	:ref:`VIDIOC_ENUM_FMT` reports ``V4L2_FMT_FLAG_CONTINUOUS_BYTESTREAM``
23162306a36Sopenharmony_ci	since the decoder can parse all the information from the raw bytestream.
23262306a36Sopenharmony_ci    * .. _V4L2-PIX-FMT-FWHT-STATELESS:
23362306a36Sopenharmony_ci
23462306a36Sopenharmony_ci      - ``V4L2_PIX_FMT_FWHT_STATELESS``
23562306a36Sopenharmony_ci      - 'SFWH'
23662306a36Sopenharmony_ci      - Same format as V4L2_PIX_FMT_FWHT but requires stateless codec implementation.
23762306a36Sopenharmony_ci        Metadata associated with the frame to decode is required to be passed
23862306a36Sopenharmony_ci        through the ``V4L2_CID_STATELESS_FWHT_PARAMS`` control.
23962306a36Sopenharmony_ci	See the :ref:`associated Codec Control ID <codec-stateless-fwht>`.
24062306a36Sopenharmony_ci    * .. _V4L2-PIX-FMT-RV30:
24162306a36Sopenharmony_ci
24262306a36Sopenharmony_ci      - ``V4L2_PIX_FMT_RV30``
24362306a36Sopenharmony_ci      - 'RV30'
24462306a36Sopenharmony_ci      - RealVideo, or also spelled as Real Video, is a suite of
24562306a36Sopenharmony_ci        proprietary video compression formats developed by
24662306a36Sopenharmony_ci        RealNetworks - the specific format changes with the version.
24762306a36Sopenharmony_ci        RealVideo codecs are identified by four-character codes.
24862306a36Sopenharmony_ci        RV30 corresponds to RealVideo 8, suspected to be based
24962306a36Sopenharmony_ci        largely on an early draft of H.264
25062306a36Sopenharmony_ci    * .. _V4L2-PIX-FMT-RV40:
25162306a36Sopenharmony_ci
25262306a36Sopenharmony_ci      - ``V4L2_PIX_FMT_RV40``
25362306a36Sopenharmony_ci      - 'RV40'
25462306a36Sopenharmony_ci      - RV40 represents RealVideo 9 and RealVideo 10.
25562306a36Sopenharmony_ci        RealVideo 9, suspected to be based on H.264.
25662306a36Sopenharmony_ci        RealVideo 10, aka RV9 EHQ, This refers to an improved encoder
25762306a36Sopenharmony_ci        for the RV9 format that is fully backwards compatible with
25862306a36Sopenharmony_ci        RV9 players - the format and decoder did not change, only
25962306a36Sopenharmony_ci        the encoder did. As a result, it uses the same FourCC.
26062306a36Sopenharmony_ci
26162306a36Sopenharmony_ci    * .. _V4L2-PIX-FMT-AV1-FRAME:
26262306a36Sopenharmony_ci
26362306a36Sopenharmony_ci      - ``V4L2_PIX_FMT_AV1_FRAME``
26462306a36Sopenharmony_ci      - 'AV1F'
26562306a36Sopenharmony_ci      - AV1 parsed frame, including the frame header, as extracted from the container.
26662306a36Sopenharmony_ci        This format is adapted for stateless video decoders that implement a AV1
26762306a36Sopenharmony_ci        pipeline with the :ref:`stateless_decoder`. Metadata associated with the
26862306a36Sopenharmony_ci        frame to decode is required to be passed through the
26962306a36Sopenharmony_ci        ``V4L2_CID_STATELESS_AV1_SEQUENCE``, ``V4L2_CID_STATELESS_AV1_FRAME``,
27062306a36Sopenharmony_ci        and ``V4L2_CID_STATELESS_AV1_TILE_GROUP_ENTRY`` controls.
27162306a36Sopenharmony_ci        See the :ref:`associated Codec Control IDs <v4l2-codec-stateless-av1>`.
27262306a36Sopenharmony_ci        Exactly one output and one capture buffer must be provided for use with
27362306a36Sopenharmony_ci        this pixel format. The output buffer must contain the appropriate number
27462306a36Sopenharmony_ci        of macroblocks to decode a full corresponding frame to the matching
27562306a36Sopenharmony_ci        capture buffer.
27662306a36Sopenharmony_ci
27762306a36Sopenharmony_ci.. raw:: latex
27862306a36Sopenharmony_ci
27962306a36Sopenharmony_ci    \normalsize
280