← Documents Documentation/userspace-api/media/v4l/pixfmt-compressed.rst GitHub 원문 ↗

Linux 6.18.37 · Userspace API / Media / V4L

압축 영상 형식

V4L2 압축 FourCC와 일반·stateless codec의 buffer 및 control 계약을 설명합니다.

Source pathDocumentation/userspace-api/media/v4l/pixfmt-compressed.rst
Source versionLinux v6.18.37
TranslationDUJINLABS 전문 번역 + 해설

요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.

1. 요약·해설

원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.

요약·해설

pixfmt-compressed.rst:1-279

26개 압축 형식을 picture·Access Unit·continuous bytestream·stateless parsed payload로 나누고 codec별 metadata control과 buffer 경계를 정리합니다.

2. 영어 원문 전체

번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.

원문 전체 펼치기
1 .. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later
2
3 ******************
4 Compressed 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

3. 한국어 전문 번역

영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.

컨테이너·Access Unit 기반 형식

1-58

이 문서는 V4L2가 압축 이미지와 영상 payload를 식별할 때 사용하는 FourCC를 정리합니다. 압축 형식에서는 한 buffer가 완전한 picture 또는 Access Unit을 담아야 하는지, 연속 bytestream을 허용하는지, 별도 control로 stream 종류를 정하는지가 핵심 계약입니다.

기본 압축 형식
Identifier / Codebuffer와 stream 의미
`V4L2_PIX_FMT_JPEG` / `JPEG`세부 정의는 아직 TBD이며 `VIDIOC_G_JPEGCOMP`, `VIDIOC_S_JPEGCOMP`와 함께 봅니다.
`V4L2_PIX_FMT_MPEG` / `MPEG`MPEG multiplexed stream입니다. 실제 형식은 extended control `V4L2_CID_MPEG_STREAM_TYPE`으로 결정합니다.
`V4L2_PIX_FMT_H264` / `H264`H.264 Access Unit 형식입니다. decoder와 encoder 모두 buffer 하나당 Access Unit 하나를 사용합니다. `VIDIOC_ENUM_FMT`가 `V4L2_FMT_FLAG_CONTINUOUS_BYTESTREAM`을 보고하면 decoder가 raw bytestream에서 필요한 정보를 직접 분석하므로 buffer 경계 제약이 없습니다.
`V4L2_PIX_FMT_H264_NO_SC` / `AVC1`start code가 없는 H.264 elementary stream입니다.
`V4L2_PIX_FMT_H264_MVC` / `M264`H.264 MVC video elementary stream입니다.

Identifier와 FourCC를 그대로 유지하고 buffer 단위 의미를 함께 정리했습니다.

압축 buffer 계약 확인
`VIDIOC_ENUM_FMT`로 FourCC와 flag 조회picture·Access Unit·continuous bytestream 중 buffer 경계 규칙 확인필요하면 MPEG stream type 또는 codec control 설정정해진 단위로 output/capture buffer 교환

형식 선택 뒤 application이 확인해야 할 순서입니다.

.. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later

******************
Compressed Formats
******************


.. _compressed-formats:

.. raw:: latex

    \small

.. tabularcolumns:: |p{5.8cm}|p{1.2cm}|p{10.3cm}|

.. cssclass:: longtable

.. flat-table:: Compressed Image Formats
    :header-rows:  1
    :stub-columns: 0
    :widths:       3 1 4

    * - Identifier
      - Code
      - Details
    * .. _V4L2-PIX-FMT-JPEG:

      - ``V4L2_PIX_FMT_JPEG``
      - 'JPEG'
      - TBD. See also :ref:`VIDIOC_G_JPEGCOMP <VIDIOC_G_JPEGCOMP>`,
	:ref:`VIDIOC_S_JPEGCOMP <VIDIOC_G_JPEGCOMP>`.
    * .. _V4L2-PIX-FMT-MPEG:

      - ``V4L2_PIX_FMT_MPEG``
      - 'MPEG'
      - MPEG multiplexed stream. The actual format is determined by
	extended control ``V4L2_CID_MPEG_STREAM_TYPE``, see
	:ref:`mpeg-control-id`.
    * .. _V4L2-PIX-FMT-H264:

      - ``V4L2_PIX_FMT_H264``
      - 'H264'
      - H264 Access Unit.
	The decoder expects one Access Unit per buffer.
	The encoder generates one Access Unit per buffer.
	If :ref:`VIDIOC_ENUM_FMT` reports ``V4L2_FMT_FLAG_CONTINUOUS_BYTESTREAM``
	then the decoder has no requirements since it can parse all the
	information from the raw bytestream.
    * .. _V4L2-PIX-FMT-H264-NO-SC:

      - ``V4L2_PIX_FMT_H264_NO_SC``
      - 'AVC1'
      - H264 video elementary stream without start codes.
    * .. _V4L2-PIX-FMT-H264-MVC:

      - ``V4L2_PIX_FMT_H264_MVC``
      - 'M264'
      - H264 MVC video elementary stream.

H.264 slice와 MPEG 계열

59-130

`V4L2_PIX_FMT_H264_SLICE`는 H.264 bitstream에서 꺼낸 slice header 포함 parsed slice data이며 start code 유무를 모두 허용합니다. Stateless decoder pipeline용이므로 `V4L2_CID_STATELESS_H264_DECODE_MODE`와 `V4L2_CID_STATELESS_H264_START_CODE`를 최소 한 번 설정해야 합니다.

Frame metadata는 `V4L2_CID_STATELESS_H264_SPS`, `PPS`, `SCALING_MATRIX`, `SLICE_PARAMS`, `DECODE_PARAMS` control로 전달합니다. 정확히 output buffer 하나와 capture buffer 하나를 제공하며 output에는 대응 capture frame 전체를 복호화할 만큼의 macroblock이 있어야 합니다. 문법 기준은 H.264 7.3.2.8의 slice layer without partitioning RBSP syntax와 후속 절입니다.

H.263·MPEG-1/2 형식
Identifier / Code전문 번역
`V4L2_PIX_FMT_H263` / `H263`H.263 video elementary stream입니다.
`V4L2_PIX_FMT_SPK` / `SPK0`Flash Video와 Adobe Flash 파일에서 쓰는 H.263 구현인 Sorenson Spark입니다.
`V4L2_PIX_FMT_MPEG1` / `MPG1`MPEG-1 picture입니다. 각 buffer는 Picture header로 시작해 필요한 header와 Picture data로 끝납니다. `CONTINUOUS_BYTESTREAM`이면 decoder가 raw stream을 직접 분석합니다.
`V4L2_PIX_FMT_MPEG2` / `MPG2`MPEG-2 picture이며 MPEG-1과 같은 buffer 경계 규칙을 사용합니다. `CONTINUOUS_BYTESTREAM`이면 별도 경계 요구가 없습니다.
`V4L2_PIX_FMT_MPEG2_SLICE` / `MG2S`MPEG-2 bitstream에서 추출한 parsed slice입니다. Stateless pipeline은 `V4L2_CID_STATELESS_MPEG2_SEQUENCE`, `PICTURE`를 필수로 받고 `QUANTISATION` matrix는 선택적으로 받습니다. output/capture buffer를 정확히 하나씩 제공하고 frame 전체를 만들 macroblock을 담습니다.

일반 elementary stream과 stateless parsed slice를 구분합니다.

H.264 stateless 필수 control
항목설명
형식 modifier`V4L2_CID_STATELESS_H264_DECODE_MODE`, `V4L2_CID_STATELESS_H264_START_CODE`
sequence·picture`V4L2_CID_STATELESS_H264_SPS`, `V4L2_CID_STATELESS_H264_PPS`
matrix·slice·decode`V4L2_CID_STATELESS_H264_SCALING_MATRIX`, `SLICE_PARAMS`, `DECODE_PARAMS`
buffer 수output 1개와 대응 capture 1개

Slice payload만으로는 frame 복호화 상태가 완성되지 않습니다.

    * .. _V4L2-PIX-FMT-H264-SLICE:

      - ``V4L2_PIX_FMT_H264_SLICE``
      - 'S264'
      - H264 parsed slice data, including slice headers, either with or
	without the start code, as extracted from the H264 bitstream.
	This format is adapted for stateless video decoders that implement an
	H264 pipeline with the :ref:`stateless_decoder`.
	This pixelformat has two modifiers that must be set at least once
	through the ``V4L2_CID_STATELESS_H264_DECODE_MODE``
        and ``V4L2_CID_STATELESS_H264_START_CODE`` controls.
	In addition, metadata associated with the frame to decode are
	required to be passed through the ``V4L2_CID_STATELESS_H264_SPS``,
	``V4L2_CID_STATELESS_H264_PPS``,
	``V4L2_CID_STATELESS_H264_SCALING_MATRIX``,
	``V4L2_CID_STATELESS_H264_SLICE_PARAMS`` and
	``V4L2_CID_STATELESS_H264_DECODE_PARAMS`` controls.  See the
	:ref:`associated Codec Control IDs <v4l2-codec-stateless-h264>`.
        Exactly one output and one capture buffer must be provided for use
	with this pixel format. The output buffer must contain the
	appropriate number of macroblocks to decode a full
	corresponding frame to the matching capture buffer.

	The syntax for this format is documented in :ref:`h264`, section
	7.3.2.8 "Slice layer without partitioning RBSP syntax" and the following
	sections.

    * .. _V4L2-PIX-FMT-H263:

      - ``V4L2_PIX_FMT_H263``
      - 'H263'
      - H263 video elementary stream.
    * .. _V4L2-PIX-FMT-SPK:

      - ``V4L2_PIX_FMT_SPK``
      - 'SPK0'
      - Sorenson Spark is an implementation of H.263 for use in Flash Video and Adobe Flash files
    * .. _V4L2-PIX-FMT-MPEG1:

      - ``V4L2_PIX_FMT_MPEG1``
      - 'MPG1'
      - MPEG1 Picture. Each buffer starts with a Picture header, followed
	by other headers as needed and ending with the Picture data.
	If :ref:`VIDIOC_ENUM_FMT` reports ``V4L2_FMT_FLAG_CONTINUOUS_BYTESTREAM``
	then the decoder has no requirements since it can parse all the
	information from the raw bytestream.
    * .. _V4L2-PIX-FMT-MPEG2:

      - ``V4L2_PIX_FMT_MPEG2``
      - 'MPG2'
      - MPEG2 Picture. Each buffer starts with a Picture header, followed
	by other headers as needed and ending with the Picture data.
	If :ref:`VIDIOC_ENUM_FMT` reports ``V4L2_FMT_FLAG_CONTINUOUS_BYTESTREAM``
	then the decoder has no requirements since it can parse all the
	information from the raw bytestream.
    * .. _V4L2-PIX-FMT-MPEG2-SLICE:

      - ``V4L2_PIX_FMT_MPEG2_SLICE``
      - 'MG2S'
      - MPEG-2 parsed slice data, as extracted from the MPEG-2 bitstream.
	This format is adapted for stateless video decoders that implement a
	MPEG-2 pipeline with the :ref:`stateless_decoder`.
	Metadata associated with the frame to decode is required to be passed
	through the ``V4L2_CID_STATELESS_MPEG2_SEQUENCE`` and
        ``V4L2_CID_STATELESS_MPEG2_PICTURE`` controls.
        Quantisation matrices can optionally be specified through the
	``V4L2_CID_STATELESS_MPEG2_QUANTISATION`` control.
	See the :ref:`associated Codec Control IDs <v4l2-codec-stateless-mpeg2>`.
	Exactly one output and one capture buffer must be provided for use with
	this pixel format. The output buffer must contain the appropriate number
	of macroblocks to decode a full corresponding frame to the matching
	capture buffer.

MPEG-4·VC-1·VP8·VP9

131-194

MPEG-4, Xvid와 VC-1 형식은 elementary 또는 표준 annex stream을 식별합니다. VP8·VP9의 일반 형식은 압축 frame 하나를 buffer 하나에 대응시키고, `_FRAME` 형식은 container에서 추출한 parsed frame과 stateless metadata control을 결합합니다.

MPEG-4와 VC-1
Identifier / Code전문 번역
`V4L2_PIX_FMT_MPEG4` / `MPG4`MPEG-4 video elementary stream입니다.
`V4L2_PIX_FMT_XVID` / `XVID`Xvid video elementary stream입니다.
`V4L2_PIX_FMT_VC1_ANNEX_G` / `VC1G`SMPTE 421M Annex G를 따르는 VC-1 stream입니다.
`V4L2_PIX_FMT_VC1_ANNEX_L` / `VC1L`SMPTE 421M Annex L을 따르는 VC-1 stream입니다.

FourCC별 stream 의미입니다.

VP8·VP9 일반/Stateless 형식
Identifier / Codebuffer·control 계약
`V4L2_PIX_FMT_VP8` / `VP80`VP8 압축 frame입니다. encoder는 buffer마다 frame 하나를 만들고 decoder도 buffer마다 frame 하나를 요구합니다.
`V4L2_PIX_FMT_VP8_FRAME` / `VP8F`Container에서 꺼낸 header 포함 parsed frame입니다. `V4L2_CID_STATELESS_VP8_FRAME` metadata를 전달하고 output/capture를 하나씩 제공해 전체 frame을 복호화합니다.
`V4L2_PIX_FMT_VP9` / `VP90`VP9 압축 frame이며 buffer 하나당 frame 하나입니다.
`V4L2_PIX_FMT_VP9_FRAME` / `VP9F`Container에서 꺼낸 header 포함 parsed frame입니다. `V4L2_CID_STATELESS_VP9_FRAME`과 `V4L2_CID_STATELESS_VP9_COMPRESSED_HDR`를 전달하고 output/capture 하나씩으로 전체 frame을 복호화합니다.

일반 frame과 parsed frame의 control 요구를 비교합니다.

    * .. _V4L2-PIX-FMT-MPEG4:

      - ``V4L2_PIX_FMT_MPEG4``
      - 'MPG4'
      - MPEG4 video elementary stream.
    * .. _V4L2-PIX-FMT-XVID:

      - ``V4L2_PIX_FMT_XVID``
      - 'XVID'
      - Xvid video elementary stream.
    * .. _V4L2-PIX-FMT-VC1-ANNEX-G:

      - ``V4L2_PIX_FMT_VC1_ANNEX_G``
      - 'VC1G'
      - VC1, SMPTE 421M Annex G compliant stream.
    * .. _V4L2-PIX-FMT-VC1-ANNEX-L:

      - ``V4L2_PIX_FMT_VC1_ANNEX_L``
      - 'VC1L'
      - VC1, SMPTE 421M Annex L compliant stream.
    * .. _V4L2-PIX-FMT-VP8:

      - ``V4L2_PIX_FMT_VP8``
      - 'VP80'
      - VP8 compressed video frame. The encoder generates one
	compressed frame per buffer, and the decoder requires one
	compressed frame per buffer.
    * .. _V4L2-PIX-FMT-VP8-FRAME:

      - ``V4L2_PIX_FMT_VP8_FRAME``
      - 'VP8F'
      - VP8 parsed frame, including the frame header, as extracted from the container.
	This format is adapted for stateless video decoders that implement an
	VP8 pipeline with the :ref:`stateless_decoder`.
	Metadata associated with the frame to decode is required to be passed
	through the ``V4L2_CID_STATELESS_VP8_FRAME`` control.
	See the :ref:`associated Codec Control IDs <v4l2-codec-stateless-vp8>`.
	Exactly one output and one capture buffer must be provided for use with
	this pixel format. The output buffer must contain the appropriate number
	of macroblocks to decode a full corresponding frame to the matching
	capture buffer.

    * .. _V4L2-PIX-FMT-VP9:

      - ``V4L2_PIX_FMT_VP9``
      - 'VP90'
      - VP9 compressed video frame. The encoder generates one
	compressed frame per buffer, and the decoder requires one
	compressed frame per buffer.
    * .. _V4L2-PIX-FMT-VP9-FRAME:

      - ``V4L2_PIX_FMT_VP9_FRAME``
      - 'VP9F'
      - VP9 parsed frame, including the frame header, as extracted from the container.
	This format is adapted for stateless video decoders that implement a
	VP9 pipeline with the :ref:`stateless_decoder`.
	Metadata associated with the frame to decode is required to be passed
	through the ``V4L2_CID_STATELESS_VP9_FRAME`` and
	the ``V4L2_CID_STATELESS_VP9_COMPRESSED_HDR`` controls.
	See the :ref:`associated Codec Control IDs <v4l2-codec-stateless-vp9>`.
	Exactly one output and one capture buffer must be provided for use with
	this pixel format. The output buffer must contain the appropriate number
	of macroblocks to decode a full corresponding frame to the matching
	capture buffer.

HEVC·FWHT·RealVideo·AV1

195-279

`V4L2_PIX_FMT_HEVC`는 H.265 Access Unit 형식으로 encoder와 decoder가 buffer 하나당 Access Unit 하나를 교환합니다. `V4L2_FMT_FLAG_CONTINUOUS_BYTESTREAM`이 있으면 raw bytestream 자체에서 정보를 분석할 수 있어 decoder의 buffer 경계 요구가 사라집니다.

`V4L2_PIX_FMT_HEVC_SLICE`는 HEVC parsed slice이며 stateless mem2mem·Media Request pipeline에 맞춰집니다. `V4L2_CID_MPEG_VIDEO_HEVC_DECODE_MODE`와 `START_CODE`를 최소 한 번 설정하고 SPS, PPS, SLICE_PARAMS control을 전달합니다. 각 buffer에는 대응 frame 전체를 복호화할 만큼의 macroblock이 있어야 합니다.

후속 압축 형식
Identifier / Code전문 번역
`V4L2_PIX_FMT_FWHT` / `FWHT`Fast Walsh Hadamard Transform 기반 elementary stream이며 vicodec Virtual Codec driver가 구현합니다. `codec-fwht.h`를 참조합니다. Decoder가 raw stream을 분석하므로 `CONTINUOUS_BYTESTREAM`이 보고됩니다.
`V4L2_PIX_FMT_FWHT_STATELESS` / `SFWH`FWHT와 같은 data 형식이지만 stateless codec 구현이 필요합니다. `V4L2_CID_STATELESS_FWHT_PARAMS` metadata control을 전달합니다.
`V4L2_PIX_FMT_RV30` / `RV30`RealNetworks의 proprietary RealVideo 계열입니다. RV30은 RealVideo 8에 대응하며 H.264 초기 초안을 상당 부분 바탕으로 한 것으로 추정됩니다.
`V4L2_PIX_FMT_RV40` / `RV40`RealVideo 9와 10을 나타냅니다. RV10, 즉 RV9 EHQ는 RV9 player와 완전히 호환되는 개선 encoder이며 data 형식과 decoder가 바뀌지 않아 같은 FourCC를 씁니다.
`V4L2_PIX_FMT_AV1_FRAME` / `AV1F`Container에서 추출한 frame header 포함 AV1 parsed frame입니다. Stateless pipeline은 `V4L2_CID_STATELESS_AV1_SEQUENCE`, `FRAME`, `TILE_GROUP_ENTRY`를 전달합니다. output/capture 하나씩을 제공하며 output에는 전체 대응 frame에 필요한 macroblock이 있어야 합니다.

원문의 나머지 Identifier와 동작을 빠짐없이 정리했습니다.

Stateless frame 복호화
parsed slice 또는 frame payload를 output buffer에 배치codec별 sequence·picture·slice metadata control 설정필요한 경우 Media Request에 buffer와 control을 결합대응 capture buffer 하나를 queueframe 전체를 복호화할 payload 단위를 제출

H.264·MPEG-2·VP8·VP9·HEVC·AV1 parsed 형식의 공통 관계입니다.

    * .. _V4L2-PIX-FMT-HEVC:

      - ``V4L2_PIX_FMT_HEVC``
      - 'HEVC'
      - HEVC/H.265 Access Unit.
	The decoder expects one Access Unit per buffer.
	The encoder generates one Access Unit per buffer.
	If :ref:`VIDIOC_ENUM_FMT` reports ``V4L2_FMT_FLAG_CONTINUOUS_BYTESTREAM``
	then the decoder has no	requirements since it can parse all the
	information from the raw bytestream.
    * .. _V4L2-PIX-FMT-HEVC-SLICE:

      - ``V4L2_PIX_FMT_HEVC_SLICE``
      - 'S265'
      - HEVC parsed slice data, as extracted from the HEVC bitstream.
	This format is adapted for stateless video decoders that implement a
	HEVC pipeline (using the :ref:`mem2mem` and :ref:`media-request-api`).
	This pixelformat has two modifiers that must be set at least once
	through the ``V4L2_CID_MPEG_VIDEO_HEVC_DECODE_MODE``
        and ``V4L2_CID_MPEG_VIDEO_HEVC_START_CODE`` controls.
	Metadata associated with the frame to decode is required to be passed
	through the following controls:
        ``V4L2_CID_MPEG_VIDEO_HEVC_SPS``,
        ``V4L2_CID_MPEG_VIDEO_HEVC_PPS``, and
        ``V4L2_CID_MPEG_VIDEO_HEVC_SLICE_PARAMS``.
	See the :ref:`associated Codec Control IDs <v4l2-codec-stateless-hevc>`.
	Buffers associated with this pixel format must contain the appropriate
	number of macroblocks to decode a full corresponding frame.
    * .. _V4L2-PIX-FMT-FWHT:

      - ``V4L2_PIX_FMT_FWHT``
      - 'FWHT'
      - Video elementary stream using a codec based on the Fast Walsh Hadamard
        Transform. This codec is implemented by the vicodec ('Virtual Codec')
	driver. See the codec-fwht.h header for more details.
	:ref:`VIDIOC_ENUM_FMT` reports ``V4L2_FMT_FLAG_CONTINUOUS_BYTESTREAM``
	since the decoder can parse all the information from the raw bytestream.
    * .. _V4L2-PIX-FMT-FWHT-STATELESS:

      - ``V4L2_PIX_FMT_FWHT_STATELESS``
      - 'SFWH'
      - Same format as V4L2_PIX_FMT_FWHT but requires stateless codec implementation.
        Metadata associated with the frame to decode is required to be passed
        through the ``V4L2_CID_STATELESS_FWHT_PARAMS`` control.
	See the :ref:`associated Codec Control ID <codec-stateless-fwht>`.
    * .. _V4L2-PIX-FMT-RV30:

      - ``V4L2_PIX_FMT_RV30``
      - 'RV30'
      - RealVideo, or also spelled as Real Video, is a suite of
        proprietary video compression formats developed by
        RealNetworks - the specific format changes with the version.
        RealVideo codecs are identified by four-character codes.
        RV30 corresponds to RealVideo 8, suspected to be based
        largely on an early draft of H.264
    * .. _V4L2-PIX-FMT-RV40:

      - ``V4L2_PIX_FMT_RV40``
      - 'RV40'
      - RV40 represents RealVideo 9 and RealVideo 10.
        RealVideo 9, suspected to be based on H.264.
        RealVideo 10, aka RV9 EHQ, This refers to an improved encoder
        for the RV9 format that is fully backwards compatible with
        RV9 players - the format and decoder did not change, only
        the encoder did. As a result, it uses the same FourCC.

    * .. _V4L2-PIX-FMT-AV1-FRAME:

      - ``V4L2_PIX_FMT_AV1_FRAME``
      - 'AV1F'
      - AV1 parsed frame, including the frame header, as extracted from the container.
        This format is adapted for stateless video decoders that implement a AV1
        pipeline with the :ref:`stateless_decoder`. Metadata associated with the
        frame to decode is required to be passed through the
        ``V4L2_CID_STATELESS_AV1_SEQUENCE``, ``V4L2_CID_STATELESS_AV1_FRAME``,
        and ``V4L2_CID_STATELESS_AV1_TILE_GROUP_ENTRY`` controls.
        See the :ref:`associated Codec Control IDs <v4l2-codec-stateless-av1>`.
        Exactly one output and one capture buffer must be provided for use with
        this pixel format. The output buffer must contain the appropriate number
        of macroblocks to decode a full corresponding frame to the matching
        capture buffer.

.. raw:: latex

    \normalsize