• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1.. Permission is granted to copy, distribute and/or modify this
2.. document under the terms of the GNU Free Documentation License,
3.. Version 1.1 or any later version published by the Free Software
4.. Foundation, with no Invariant Sections, no Front-Cover Texts
5.. and no Back-Cover Texts. A copy of the license is included at
6.. Documentation/media/uapi/fdl-appendix.rst.
7..
8.. TODO: replace it to GFDL-1.1-or-later WITH no-invariant-sections
9
10******************
11Compressed Formats
12******************
13
14
15.. _compressed-formats:
16
17.. tabularcolumns:: |p{6.6cm}|p{2.2cm}|p{8.7cm}|
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, without the start code and as
65	extracted from the H264 bitstream.  This format is adapted for
66	stateless video decoders that implement an H264 pipeline
67	(using the :ref:`mem2mem` and :ref:`media-request-api`).
68	This pixelformat has two modifiers that must be set at least once
69	through the ``V4L2_CID_MPEG_VIDEO_H264_DECODE_MODE``
70        and ``V4L2_CID_MPEG_VIDEO_H264_START_CODE`` controls.
71	In addition, metadata associated with the frame to decode are
72	required to be passed through the ``V4L2_CID_MPEG_VIDEO_H264_SPS``,
73	``V4L2_CID_MPEG_VIDEO_H264_PPS``,
74	``V4L2_CID_MPEG_VIDEO_H264_SCALING_MATRIX``,
75	``V4L2_CID_MPEG_VIDEO_H264_SLICE_PARAMS`` and
76	``V4L2_CID_MPEG_VIDEO_H264_DECODE_PARAMS`` controls.  See the
77	:ref:`associated Codec Control IDs <v4l2-mpeg-h264>`.  Exactly
78	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	.. note::
84
85	   This format is not yet part of the public kernel API and it
86	   is expected to change.
87
88    * .. _V4L2-PIX-FMT-H263:
89
90      - ``V4L2_PIX_FMT_H263``
91      - 'H263'
92      - H263 video elementary stream.
93    * .. _V4L2-PIX-FMT-MPEG1:
94
95      - ``V4L2_PIX_FMT_MPEG1``
96      - 'MPG1'
97      - MPEG1 Picture. Each buffer starts with a Picture header, followed
98	by other headers as needed and ending with the Picture data.
99	If :ref:`VIDIOC_ENUM_FMT` reports ``V4L2_FMT_FLAG_CONTINUOUS_BYTESTREAM``
100	then the decoder has no requirements since it can parse all the
101	information from the raw bytestream.
102    * .. _V4L2-PIX-FMT-MPEG2:
103
104      - ``V4L2_PIX_FMT_MPEG2``
105      - 'MPG2'
106      - MPEG2 Picture. Each buffer starts with a Picture header, followed
107	by other headers as needed and ending with the Picture data.
108	If :ref:`VIDIOC_ENUM_FMT` reports ``V4L2_FMT_FLAG_CONTINUOUS_BYTESTREAM``
109	then the decoder has no requirements since it can parse all the
110	information from the raw bytestream.
111    * .. _V4L2-PIX-FMT-MPEG2-SLICE:
112
113      - ``V4L2_PIX_FMT_MPEG2_SLICE``
114      - 'MG2S'
115      - MPEG-2 parsed slice data, as extracted from the MPEG-2 bitstream.
116	This format is adapted for stateless video decoders that implement a
117	MPEG-2 pipeline (using the :ref:`mem2mem` and :ref:`media-request-api`).
118	Metadata associated with the frame to decode is required to be passed
119	through the ``V4L2_CID_MPEG_VIDEO_MPEG2_SLICE_PARAMS`` control and
120	quantization matrices can optionally be specified through the
121	``V4L2_CID_MPEG_VIDEO_MPEG2_QUANTIZATION`` control.
122	See the :ref:`associated Codec Control IDs <v4l2-mpeg-mpeg2>`.
123	Exactly one output and one capture buffer must be provided for use with
124	this pixel format. The output buffer must contain the appropriate number
125	of macroblocks to decode a full corresponding frame to the matching
126	capture buffer.
127    * .. _V4L2-PIX-FMT-MPEG4:
128
129      - ``V4L2_PIX_FMT_MPEG4``
130      - 'MPG4'
131      - MPEG4 video elementary stream.
132    * .. _V4L2-PIX-FMT-XVID:
133
134      - ``V4L2_PIX_FMT_XVID``
135      - 'XVID'
136      - Xvid video elementary stream.
137    * .. _V4L2-PIX-FMT-VC1-ANNEX-G:
138
139      - ``V4L2_PIX_FMT_VC1_ANNEX_G``
140      - 'VC1G'
141      - VC1, SMPTE 421M Annex G compliant stream.
142    * .. _V4L2-PIX-FMT-VC1-ANNEX-L:
143
144      - ``V4L2_PIX_FMT_VC1_ANNEX_L``
145      - 'VC1L'
146      - VC1, SMPTE 421M Annex L compliant stream.
147    * .. _V4L2-PIX-FMT-VP8:
148
149      - ``V4L2_PIX_FMT_VP8``
150      - 'VP80'
151      - VP8 compressed video frame. The encoder generates one
152	compressed frame per buffer, and the decoder requires one
153	compressed frame per buffer.
154    * .. _V4L2-PIX-FMT-VP8-FRAME:
155
156      - ``V4L2_PIX_FMT_VP8_FRAME``
157      - 'VP8F'
158      - VP8 parsed frame, as extracted from the container.
159	This format is adapted for stateless video decoders that implement a
160	VP8 pipeline (using the :ref:`mem2mem` and :ref:`media-request-api`).
161	Metadata associated with the frame to decode is required to be passed
162	through the ``V4L2_CID_MPEG_VIDEO_VP8_FRAME_HEADER`` control.
163	See the :ref:`associated Codec Control IDs <v4l2-mpeg-vp8>`.
164	Exactly one output and one capture buffer must be provided for use with
165	this pixel format. The output buffer must contain the appropriate number
166	of macroblocks to decode a full corresponding frame to the matching
167	capture buffer.
168
169	.. note::
170
171	   This format is not yet part of the public kernel API and it
172	   is expected to change.
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-HEVC:
182
183      - ``V4L2_PIX_FMT_HEVC``
184      - 'HEVC'
185      - HEVC/H.265 Access Unit.
186	The decoder expects one Access Unit per buffer.
187	The encoder generates one Access Unit per buffer.
188	If :ref:`VIDIOC_ENUM_FMT` reports ``V4L2_FMT_FLAG_CONTINUOUS_BYTESTREAM``
189	then the decoder has no	requirements since it can parse all the
190	information from the raw bytestream.
191    * .. _V4L2-PIX-FMT-FWHT:
192
193      - ``V4L2_PIX_FMT_FWHT``
194      - 'FWHT'
195      - Video elementary stream using a codec based on the Fast Walsh Hadamard
196        Transform. This codec is implemented by the vicodec ('Virtual Codec')
197	driver. See the codec-fwht.h header for more details.
198	:ref:`VIDIOC_ENUM_FMT` reports ``V4L2_FMT_FLAG_CONTINUOUS_BYTESTREAM``
199	since the decoder can parse all the information from the raw bytestream.
200    * .. _V4L2-PIX-FMT-FWHT-STATELESS:
201
202      - ``V4L2_PIX_FMT_FWHT_STATELESS``
203      - 'SFWH'
204      - Same format as V4L2_PIX_FMT_FWHT but requires stateless codec implementation.
205	See the :ref:`associated Codec Control IDs <v4l2-mpeg-fwht>`.
206