1.. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later
2
3******************
4Compressed Formats
5******************
6
7
8.. _compressed-formats:
9
10.. raw:: latex
11
12    \small
13
14.. tabularcolumns:: |p{5.8cm}|p{1.2cm}|p{10.3cm}|
15
16.. cssclass:: longtable
17
18.. flat-table:: Compressed Image Formats
19    :header-rows:  1
20    :stub-columns: 0
21    :widths:       3 1 4
22
23    * - Identifier
24      - Code
25      - Details
26    * .. _V4L2-PIX-FMT-JPEG:
27
28      - ``V4L2_PIX_FMT_JPEG``
29      - 'JPEG'
30      - TBD. See also :ref:`VIDIOC_G_JPEGCOMP <VIDIOC_G_JPEGCOMP>`,
31	:ref:`VIDIOC_S_JPEGCOMP <VIDIOC_G_JPEGCOMP>`.
32    * .. _V4L2-PIX-FMT-MPEG:
33
34      - ``V4L2_PIX_FMT_MPEG``
35      - 'MPEG'
36      - MPEG multiplexed stream. The actual format is determined by
37	extended control ``V4L2_CID_MPEG_STREAM_TYPE``, see
38	:ref:`mpeg-control-id`.
39    * .. _V4L2-PIX-FMT-H264:
40
41      - ``V4L2_PIX_FMT_H264``
42      - 'H264'
43      - H264 Access Unit.
44	The decoder expects one Access Unit per buffer.
45	The encoder generates one Access Unit per buffer.
46	If :ref:`VIDIOC_ENUM_FMT` reports ``V4L2_FMT_FLAG_CONTINUOUS_BYTESTREAM``
47	then the decoder has no requirements since it can parse all the
48	information from the raw bytestream.
49    * .. _V4L2-PIX-FMT-H264-NO-SC:
50
51      - ``V4L2_PIX_FMT_H264_NO_SC``
52      - 'AVC1'
53      - H264 video elementary stream without start codes.
54    * .. _V4L2-PIX-FMT-H264-MVC:
55
56      - ``V4L2_PIX_FMT_H264_MVC``
57      - 'M264'
58      - H264 MVC video elementary stream.
59    * .. _V4L2-PIX-FMT-H264-SLICE:
60
61      - ``V4L2_PIX_FMT_H264_SLICE``
62      - 'S264'
63      - H264 parsed slice data, including slice headers, either with or
64	without the start code, as extracted from the H264 bitstream.
65	This format is adapted for stateless video decoders that implement an
66	H264 pipeline with the :ref:`stateless_decoder`.
67	This pixelformat has two modifiers that must be set at least once
68	through the ``V4L2_CID_STATELESS_H264_DECODE_MODE``
69        and ``V4L2_CID_STATELESS_H264_START_CODE`` controls.
70	In addition, metadata associated with the frame to decode are
71	required to be passed through the ``V4L2_CID_STATELESS_H264_SPS``,
72	``V4L2_CID_STATELESS_H264_PPS``,
73	``V4L2_CID_STATELESS_H264_SCALING_MATRIX``,
74	``V4L2_CID_STATELESS_H264_SLICE_PARAMS`` and
75	``V4L2_CID_STATELESS_H264_DECODE_PARAMS`` controls.  See the
76	:ref:`associated Codec Control IDs <v4l2-codec-stateless-h264>`.
77        Exactly one output and one capture buffer must be provided for use
78	with this pixel format. The output buffer must contain the
79	appropriate number of macroblocks to decode a full
80	corresponding frame to the matching capture buffer.
81
82	The syntax for this format is documented in :ref:`h264`, section
83	7.3.2.8 "Slice layer without partitioning RBSP syntax" and the following
84	sections.
85
86    * .. _V4L2-PIX-FMT-H263:
87
88      - ``V4L2_PIX_FMT_H263``
89      - 'H263'
90      - H263 video elementary stream.
91    * .. _V4L2-PIX-FMT-SPK:
92
93      - ``V4L2_PIX_FMT_SPK``
94      - 'SPK0'
95      - Sorenson Spark is an implementation of H.263 for use in Flash Video and Adobe Flash files
96    * .. _V4L2-PIX-FMT-MPEG1:
97
98      - ``V4L2_PIX_FMT_MPEG1``
99      - 'MPG1'
100      - MPEG1 Picture. Each buffer starts with a Picture header, followed
101	by other headers as needed and ending with the Picture data.
102	If :ref:`VIDIOC_ENUM_FMT` reports ``V4L2_FMT_FLAG_CONTINUOUS_BYTESTREAM``
103	then the decoder has no requirements since it can parse all the
104	information from the raw bytestream.
105    * .. _V4L2-PIX-FMT-MPEG2:
106
107      - ``V4L2_PIX_FMT_MPEG2``
108      - 'MPG2'
109      - MPEG2 Picture. Each buffer starts with a Picture header, followed
110	by other headers as needed and ending with the Picture data.
111	If :ref:`VIDIOC_ENUM_FMT` reports ``V4L2_FMT_FLAG_CONTINUOUS_BYTESTREAM``
112	then the decoder has no requirements since it can parse all the
113	information from the raw bytestream.
114    * .. _V4L2-PIX-FMT-MPEG2-SLICE:
115
116      - ``V4L2_PIX_FMT_MPEG2_SLICE``
117      - 'MG2S'
118      - MPEG-2 parsed slice data, as extracted from the MPEG-2 bitstream.
119	This format is adapted for stateless video decoders that implement a
120	MPEG-2 pipeline with the :ref:`stateless_decoder`.
121	Metadata associated with the frame to decode is required to be passed
122	through the ``V4L2_CID_STATELESS_MPEG2_SEQUENCE`` and
123        ``V4L2_CID_STATELESS_MPEG2_PICTURE`` controls.
124        Quantisation matrices can optionally be specified through the
125	``V4L2_CID_STATELESS_MPEG2_QUANTISATION`` control.
126	See the :ref:`associated Codec Control IDs <v4l2-codec-stateless-mpeg2>`.
127	Exactly one output and one capture buffer must be provided for use with
128	this pixel format. The output buffer must contain the appropriate number
129	of macroblocks to decode a full corresponding frame to the matching
130	capture buffer.
131    * .. _V4L2-PIX-FMT-MPEG4:
132
133      - ``V4L2_PIX_FMT_MPEG4``
134      - 'MPG4'
135      - MPEG4 video elementary stream.
136    * .. _V4L2-PIX-FMT-XVID:
137
138      - ``V4L2_PIX_FMT_XVID``
139      - 'XVID'
140      - Xvid video elementary stream.
141    * .. _V4L2-PIX-FMT-VC1-ANNEX-G:
142
143      - ``V4L2_PIX_FMT_VC1_ANNEX_G``
144      - 'VC1G'
145      - VC1, SMPTE 421M Annex G compliant stream.
146    * .. _V4L2-PIX-FMT-VC1-ANNEX-L:
147
148      - ``V4L2_PIX_FMT_VC1_ANNEX_L``
149      - 'VC1L'
150      - VC1, SMPTE 421M Annex L compliant stream.
151    * .. _V4L2-PIX-FMT-VP8:
152
153      - ``V4L2_PIX_FMT_VP8``
154      - 'VP80'
155      - VP8 compressed video frame. The encoder generates one
156	compressed frame per buffer, and the decoder requires one
157	compressed frame per buffer.
158    * .. _V4L2-PIX-FMT-VP8-FRAME:
159
160      - ``V4L2_PIX_FMT_VP8_FRAME``
161      - 'VP8F'
162      - VP8 parsed frame, including the frame header, as extracted from the container.
163	This format is adapted for stateless video decoders that implement an
164	VP8 pipeline with the :ref:`stateless_decoder`.
165	Metadata associated with the frame to decode is required to be passed
166	through the ``V4L2_CID_STATELESS_VP8_FRAME`` control.
167	See the :ref:`associated Codec Control IDs <v4l2-codec-stateless-vp8>`.
168	Exactly one output and one capture buffer must be provided for use with
169	this pixel format. The output buffer must contain the appropriate number
170	of macroblocks to decode a full corresponding frame to the matching
171	capture buffer.
172
173    * .. _V4L2-PIX-FMT-VP9:
174
175      - ``V4L2_PIX_FMT_VP9``
176      - 'VP90'
177      - VP9 compressed video frame. The encoder generates one
178	compressed frame per buffer, and the decoder requires one
179	compressed frame per buffer.
180    * .. _V4L2-PIX-FMT-VP9-FRAME:
181
182      - ``V4L2_PIX_FMT_VP9_FRAME``
183      - 'VP9F'
184      - VP9 parsed frame, including the frame header, as extracted from the container.
185	This format is adapted for stateless video decoders that implement a
186	VP9 pipeline with the :ref:`stateless_decoder`.
187	Metadata associated with the frame to decode is required to be passed
188	through the ``V4L2_CID_STATELESS_VP9_FRAME`` and
189	the ``V4L2_CID_STATELESS_VP9_COMPRESSED_HDR`` controls.
190	See the :ref:`associated Codec Control IDs <v4l2-codec-stateless-vp9>`.
191	Exactly one output and one capture buffer must be provided for use with
192	this pixel format. The output buffer must contain the appropriate number
193	of macroblocks to decode a full corresponding frame to the matching
194	capture buffer.
195    * .. _V4L2-PIX-FMT-HEVC:
196
197      - ``V4L2_PIX_FMT_HEVC``
198      - 'HEVC'
199      - HEVC/H.265 Access Unit.
200	The decoder expects one Access Unit per buffer.
201	The encoder generates one Access Unit per buffer.
202	If :ref:`VIDIOC_ENUM_FMT` reports ``V4L2_FMT_FLAG_CONTINUOUS_BYTESTREAM``
203	then the decoder has no	requirements since it can parse all the
204	information from the raw bytestream.
205    * .. _V4L2-PIX-FMT-HEVC-SLICE:
206
207      - ``V4L2_PIX_FMT_HEVC_SLICE``
208      - 'S265'
209      - HEVC parsed slice data, as extracted from the HEVC bitstream.
210	This format is adapted for stateless video decoders that implement a
211	HEVC pipeline (using the :ref:`mem2mem` and :ref:`media-request-api`).
212	This pixelformat has two modifiers that must be set at least once
213	through the ``V4L2_CID_MPEG_VIDEO_HEVC_DECODE_MODE``
214        and ``V4L2_CID_MPEG_VIDEO_HEVC_START_CODE`` controls.
215	Metadata associated with the frame to decode is required to be passed
216	through the following controls:
217        ``V4L2_CID_MPEG_VIDEO_HEVC_SPS``,
218        ``V4L2_CID_MPEG_VIDEO_HEVC_PPS``, and
219        ``V4L2_CID_MPEG_VIDEO_HEVC_SLICE_PARAMS``.
220	See the :ref:`associated Codec Control IDs <v4l2-codec-stateless-hevc>`.
221	Buffers associated with this pixel format must contain the appropriate
222	number of macroblocks to decode a full corresponding frame.
223    * .. _V4L2-PIX-FMT-FWHT:
224
225      - ``V4L2_PIX_FMT_FWHT``
226      - 'FWHT'
227      - Video elementary stream using a codec based on the Fast Walsh Hadamard
228        Transform. This codec is implemented by the vicodec ('Virtual Codec')
229	driver. See the codec-fwht.h header for more details.
230	:ref:`VIDIOC_ENUM_FMT` reports ``V4L2_FMT_FLAG_CONTINUOUS_BYTESTREAM``
231	since the decoder can parse all the information from the raw bytestream.
232    * .. _V4L2-PIX-FMT-FWHT-STATELESS:
233
234      - ``V4L2_PIX_FMT_FWHT_STATELESS``
235      - 'SFWH'
236      - Same format as V4L2_PIX_FMT_FWHT but requires stateless codec implementation.
237        Metadata associated with the frame to decode is required to be passed
238        through the ``V4L2_CID_STATELESS_FWHT_PARAMS`` control.
239	See the :ref:`associated Codec Control ID <codec-stateless-fwht>`.
240    * .. _V4L2-PIX-FMT-RV30:
241
242      - ``V4L2_PIX_FMT_RV30``
243      - 'RV30'
244      - RealVideo, or also spelled as Real Video, is a suite of
245        proprietary video compression formats developed by
246        RealNetworks - the specific format changes with the version.
247        RealVideo codecs are identified by four-character codes.
248        RV30 corresponds to RealVideo 8, suspected to be based
249        largely on an early draft of H.264
250    * .. _V4L2-PIX-FMT-RV40:
251
252      - ``V4L2_PIX_FMT_RV40``
253      - 'RV40'
254      - RV40 represents RealVideo 9 and RealVideo 10.
255        RealVideo 9, suspected to be based on H.264.
256        RealVideo 10, aka RV9 EHQ, This refers to an improved encoder
257        for the RV9 format that is fully backwards compatible with
258        RV9 players - the format and decoder did not change, only
259        the encoder did. As a result, it uses the same FourCC.
260
261    * .. _V4L2-PIX-FMT-AV1-FRAME:
262
263      - ``V4L2_PIX_FMT_AV1_FRAME``
264      - 'AV1F'
265      - AV1 parsed frame, including the frame header, as extracted from the container.
266        This format is adapted for stateless video decoders that implement a AV1
267        pipeline with the :ref:`stateless_decoder`. Metadata associated with the
268        frame to decode is required to be passed through the
269        ``V4L2_CID_STATELESS_AV1_SEQUENCE``, ``V4L2_CID_STATELESS_AV1_FRAME``,
270        and ``V4L2_CID_STATELESS_AV1_TILE_GROUP_ENTRY`` controls.
271        See the :ref:`associated Codec Control IDs <v4l2-codec-stateless-av1>`.
272        Exactly one output and one capture buffer must be provided for use with
273        this pixel format. The output buffer must contain the appropriate number
274        of macroblocks to decode a full corresponding frame to the matching
275        capture buffer.
276
277.. raw:: latex
278
279    \normalsize
280