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