media: uapi: h264: Drop SLICE_PARAMS 'size' field
[linux-2.6-microblaze.git] / Documentation / userspace-api / media / v4l / ext-ctrls-codec.rst
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/userspace-api/media/fdl-appendix.rst.
7 ..
8 .. TODO: replace it to GFDL-1.1-or-later WITH no-invariant-sections
9
10 .. _mpeg-controls:
11
12 ***********************
13 Codec Control Reference
14 ***********************
15
16 Below all controls within the Codec control class are described. First
17 the generic controls, then controls specific for certain hardware.
18
19 .. note::
20
21    These controls are applicable to all codecs and not just MPEG. The
22    defines are prefixed with V4L2_CID_MPEG/V4L2_MPEG as the controls
23    were originally made for MPEG codecs and later extended to cover all
24    encoding formats.
25
26
27 Generic Codec Controls
28 ======================
29
30
31 .. _mpeg-control-id:
32
33 Codec Control IDs
34 -----------------
35
36 ``V4L2_CID_MPEG_CLASS (class)``
37     The Codec class descriptor. Calling
38     :ref:`VIDIOC_QUERYCTRL` for this control will
39     return a description of this control class. This description can be
40     used as the caption of a Tab page in a GUI, for example.
41
42 .. _v4l2-mpeg-stream-type:
43
44 ``V4L2_CID_MPEG_STREAM_TYPE``
45     (enum)
46
47 enum v4l2_mpeg_stream_type -
48     The MPEG-1, -2 or -4 output stream type. One cannot assume anything
49     here. Each hardware MPEG encoder tends to support different subsets
50     of the available MPEG stream types. This control is specific to
51     multiplexed MPEG streams. The currently defined stream types are:
52
53
54
55 .. flat-table::
56     :header-rows:  0
57     :stub-columns: 0
58
59     * - ``V4L2_MPEG_STREAM_TYPE_MPEG2_PS``
60       - MPEG-2 program stream
61     * - ``V4L2_MPEG_STREAM_TYPE_MPEG2_TS``
62       - MPEG-2 transport stream
63     * - ``V4L2_MPEG_STREAM_TYPE_MPEG1_SS``
64       - MPEG-1 system stream
65     * - ``V4L2_MPEG_STREAM_TYPE_MPEG2_DVD``
66       - MPEG-2 DVD-compatible stream
67     * - ``V4L2_MPEG_STREAM_TYPE_MPEG1_VCD``
68       - MPEG-1 VCD-compatible stream
69     * - ``V4L2_MPEG_STREAM_TYPE_MPEG2_SVCD``
70       - MPEG-2 SVCD-compatible stream
71
72
73
74 ``V4L2_CID_MPEG_STREAM_PID_PMT (integer)``
75     Program Map Table Packet ID for the MPEG transport stream (default
76     16)
77
78 ``V4L2_CID_MPEG_STREAM_PID_AUDIO (integer)``
79     Audio Packet ID for the MPEG transport stream (default 256)
80
81 ``V4L2_CID_MPEG_STREAM_PID_VIDEO (integer)``
82     Video Packet ID for the MPEG transport stream (default 260)
83
84 ``V4L2_CID_MPEG_STREAM_PID_PCR (integer)``
85     Packet ID for the MPEG transport stream carrying PCR fields (default
86     259)
87
88 ``V4L2_CID_MPEG_STREAM_PES_ID_AUDIO (integer)``
89     Audio ID for MPEG PES
90
91 ``V4L2_CID_MPEG_STREAM_PES_ID_VIDEO (integer)``
92     Video ID for MPEG PES
93
94 .. _v4l2-mpeg-stream-vbi-fmt:
95
96 ``V4L2_CID_MPEG_STREAM_VBI_FMT``
97     (enum)
98
99 enum v4l2_mpeg_stream_vbi_fmt -
100     Some cards can embed VBI data (e. g. Closed Caption, Teletext) into
101     the MPEG stream. This control selects whether VBI data should be
102     embedded, and if so, what embedding method should be used. The list
103     of possible VBI formats depends on the driver. The currently defined
104     VBI format types are:
105
106
107
108 .. tabularcolumns:: |p{6.6 cm}|p{10.9cm}|
109
110 .. flat-table::
111     :header-rows:  0
112     :stub-columns: 0
113
114     * - ``V4L2_MPEG_STREAM_VBI_FMT_NONE``
115       - No VBI in the MPEG stream
116     * - ``V4L2_MPEG_STREAM_VBI_FMT_IVTV``
117       - VBI in private packets, IVTV format (documented in the kernel
118         sources in the file
119         ``Documentation/userspace-api/media/drivers/cx2341x-uapi.rst``)
120
121
122
123 .. _v4l2-mpeg-audio-sampling-freq:
124
125 ``V4L2_CID_MPEG_AUDIO_SAMPLING_FREQ``
126     (enum)
127
128 enum v4l2_mpeg_audio_sampling_freq -
129     MPEG Audio sampling frequency. Possible values are:
130
131
132
133 .. flat-table::
134     :header-rows:  0
135     :stub-columns: 0
136
137     * - ``V4L2_MPEG_AUDIO_SAMPLING_FREQ_44100``
138       - 44.1 kHz
139     * - ``V4L2_MPEG_AUDIO_SAMPLING_FREQ_48000``
140       - 48 kHz
141     * - ``V4L2_MPEG_AUDIO_SAMPLING_FREQ_32000``
142       - 32 kHz
143
144
145
146 .. _v4l2-mpeg-audio-encoding:
147
148 ``V4L2_CID_MPEG_AUDIO_ENCODING``
149     (enum)
150
151 enum v4l2_mpeg_audio_encoding -
152     MPEG Audio encoding. This control is specific to multiplexed MPEG
153     streams. Possible values are:
154
155
156
157 .. flat-table::
158     :header-rows:  0
159     :stub-columns: 0
160
161     * - ``V4L2_MPEG_AUDIO_ENCODING_LAYER_1``
162       - MPEG-1/2 Layer I encoding
163     * - ``V4L2_MPEG_AUDIO_ENCODING_LAYER_2``
164       - MPEG-1/2 Layer II encoding
165     * - ``V4L2_MPEG_AUDIO_ENCODING_LAYER_3``
166       - MPEG-1/2 Layer III encoding
167     * - ``V4L2_MPEG_AUDIO_ENCODING_AAC``
168       - MPEG-2/4 AAC (Advanced Audio Coding)
169     * - ``V4L2_MPEG_AUDIO_ENCODING_AC3``
170       - AC-3 aka ATSC A/52 encoding
171
172
173
174 .. _v4l2-mpeg-audio-l1-bitrate:
175
176 ``V4L2_CID_MPEG_AUDIO_L1_BITRATE``
177     (enum)
178
179 enum v4l2_mpeg_audio_l1_bitrate -
180     MPEG-1/2 Layer I bitrate. Possible values are:
181
182
183
184 .. flat-table::
185     :header-rows:  0
186     :stub-columns: 0
187
188     * - ``V4L2_MPEG_AUDIO_L1_BITRATE_32K``
189       - 32 kbit/s
190     * - ``V4L2_MPEG_AUDIO_L1_BITRATE_64K``
191       - 64 kbit/s
192     * - ``V4L2_MPEG_AUDIO_L1_BITRATE_96K``
193       - 96 kbit/s
194     * - ``V4L2_MPEG_AUDIO_L1_BITRATE_128K``
195       - 128 kbit/s
196     * - ``V4L2_MPEG_AUDIO_L1_BITRATE_160K``
197       - 160 kbit/s
198     * - ``V4L2_MPEG_AUDIO_L1_BITRATE_192K``
199       - 192 kbit/s
200     * - ``V4L2_MPEG_AUDIO_L1_BITRATE_224K``
201       - 224 kbit/s
202     * - ``V4L2_MPEG_AUDIO_L1_BITRATE_256K``
203       - 256 kbit/s
204     * - ``V4L2_MPEG_AUDIO_L1_BITRATE_288K``
205       - 288 kbit/s
206     * - ``V4L2_MPEG_AUDIO_L1_BITRATE_320K``
207       - 320 kbit/s
208     * - ``V4L2_MPEG_AUDIO_L1_BITRATE_352K``
209       - 352 kbit/s
210     * - ``V4L2_MPEG_AUDIO_L1_BITRATE_384K``
211       - 384 kbit/s
212     * - ``V4L2_MPEG_AUDIO_L1_BITRATE_416K``
213       - 416 kbit/s
214     * - ``V4L2_MPEG_AUDIO_L1_BITRATE_448K``
215       - 448 kbit/s
216
217
218
219 .. _v4l2-mpeg-audio-l2-bitrate:
220
221 ``V4L2_CID_MPEG_AUDIO_L2_BITRATE``
222     (enum)
223
224 enum v4l2_mpeg_audio_l2_bitrate -
225     MPEG-1/2 Layer II bitrate. Possible values are:
226
227
228
229 .. flat-table::
230     :header-rows:  0
231     :stub-columns: 0
232
233     * - ``V4L2_MPEG_AUDIO_L2_BITRATE_32K``
234       - 32 kbit/s
235     * - ``V4L2_MPEG_AUDIO_L2_BITRATE_48K``
236       - 48 kbit/s
237     * - ``V4L2_MPEG_AUDIO_L2_BITRATE_56K``
238       - 56 kbit/s
239     * - ``V4L2_MPEG_AUDIO_L2_BITRATE_64K``
240       - 64 kbit/s
241     * - ``V4L2_MPEG_AUDIO_L2_BITRATE_80K``
242       - 80 kbit/s
243     * - ``V4L2_MPEG_AUDIO_L2_BITRATE_96K``
244       - 96 kbit/s
245     * - ``V4L2_MPEG_AUDIO_L2_BITRATE_112K``
246       - 112 kbit/s
247     * - ``V4L2_MPEG_AUDIO_L2_BITRATE_128K``
248       - 128 kbit/s
249     * - ``V4L2_MPEG_AUDIO_L2_BITRATE_160K``
250       - 160 kbit/s
251     * - ``V4L2_MPEG_AUDIO_L2_BITRATE_192K``
252       - 192 kbit/s
253     * - ``V4L2_MPEG_AUDIO_L2_BITRATE_224K``
254       - 224 kbit/s
255     * - ``V4L2_MPEG_AUDIO_L2_BITRATE_256K``
256       - 256 kbit/s
257     * - ``V4L2_MPEG_AUDIO_L2_BITRATE_320K``
258       - 320 kbit/s
259     * - ``V4L2_MPEG_AUDIO_L2_BITRATE_384K``
260       - 384 kbit/s
261
262
263
264 .. _v4l2-mpeg-audio-l3-bitrate:
265
266 ``V4L2_CID_MPEG_AUDIO_L3_BITRATE``
267     (enum)
268
269 enum v4l2_mpeg_audio_l3_bitrate -
270     MPEG-1/2 Layer III bitrate. Possible values are:
271
272
273
274 .. flat-table::
275     :header-rows:  0
276     :stub-columns: 0
277
278     * - ``V4L2_MPEG_AUDIO_L3_BITRATE_32K``
279       - 32 kbit/s
280     * - ``V4L2_MPEG_AUDIO_L3_BITRATE_40K``
281       - 40 kbit/s
282     * - ``V4L2_MPEG_AUDIO_L3_BITRATE_48K``
283       - 48 kbit/s
284     * - ``V4L2_MPEG_AUDIO_L3_BITRATE_56K``
285       - 56 kbit/s
286     * - ``V4L2_MPEG_AUDIO_L3_BITRATE_64K``
287       - 64 kbit/s
288     * - ``V4L2_MPEG_AUDIO_L3_BITRATE_80K``
289       - 80 kbit/s
290     * - ``V4L2_MPEG_AUDIO_L3_BITRATE_96K``
291       - 96 kbit/s
292     * - ``V4L2_MPEG_AUDIO_L3_BITRATE_112K``
293       - 112 kbit/s
294     * - ``V4L2_MPEG_AUDIO_L3_BITRATE_128K``
295       - 128 kbit/s
296     * - ``V4L2_MPEG_AUDIO_L3_BITRATE_160K``
297       - 160 kbit/s
298     * - ``V4L2_MPEG_AUDIO_L3_BITRATE_192K``
299       - 192 kbit/s
300     * - ``V4L2_MPEG_AUDIO_L3_BITRATE_224K``
301       - 224 kbit/s
302     * - ``V4L2_MPEG_AUDIO_L3_BITRATE_256K``
303       - 256 kbit/s
304     * - ``V4L2_MPEG_AUDIO_L3_BITRATE_320K``
305       - 320 kbit/s
306
307
308
309 ``V4L2_CID_MPEG_AUDIO_AAC_BITRATE (integer)``
310     AAC bitrate in bits per second.
311
312 .. _v4l2-mpeg-audio-ac3-bitrate:
313
314 ``V4L2_CID_MPEG_AUDIO_AC3_BITRATE``
315     (enum)
316
317 enum v4l2_mpeg_audio_ac3_bitrate -
318     AC-3 bitrate. Possible values are:
319
320
321
322 .. flat-table::
323     :header-rows:  0
324     :stub-columns: 0
325
326     * - ``V4L2_MPEG_AUDIO_AC3_BITRATE_32K``
327       - 32 kbit/s
328     * - ``V4L2_MPEG_AUDIO_AC3_BITRATE_40K``
329       - 40 kbit/s
330     * - ``V4L2_MPEG_AUDIO_AC3_BITRATE_48K``
331       - 48 kbit/s
332     * - ``V4L2_MPEG_AUDIO_AC3_BITRATE_56K``
333       - 56 kbit/s
334     * - ``V4L2_MPEG_AUDIO_AC3_BITRATE_64K``
335       - 64 kbit/s
336     * - ``V4L2_MPEG_AUDIO_AC3_BITRATE_80K``
337       - 80 kbit/s
338     * - ``V4L2_MPEG_AUDIO_AC3_BITRATE_96K``
339       - 96 kbit/s
340     * - ``V4L2_MPEG_AUDIO_AC3_BITRATE_112K``
341       - 112 kbit/s
342     * - ``V4L2_MPEG_AUDIO_AC3_BITRATE_128K``
343       - 128 kbit/s
344     * - ``V4L2_MPEG_AUDIO_AC3_BITRATE_160K``
345       - 160 kbit/s
346     * - ``V4L2_MPEG_AUDIO_AC3_BITRATE_192K``
347       - 192 kbit/s
348     * - ``V4L2_MPEG_AUDIO_AC3_BITRATE_224K``
349       - 224 kbit/s
350     * - ``V4L2_MPEG_AUDIO_AC3_BITRATE_256K``
351       - 256 kbit/s
352     * - ``V4L2_MPEG_AUDIO_AC3_BITRATE_320K``
353       - 320 kbit/s
354     * - ``V4L2_MPEG_AUDIO_AC3_BITRATE_384K``
355       - 384 kbit/s
356     * - ``V4L2_MPEG_AUDIO_AC3_BITRATE_448K``
357       - 448 kbit/s
358     * - ``V4L2_MPEG_AUDIO_AC3_BITRATE_512K``
359       - 512 kbit/s
360     * - ``V4L2_MPEG_AUDIO_AC3_BITRATE_576K``
361       - 576 kbit/s
362     * - ``V4L2_MPEG_AUDIO_AC3_BITRATE_640K``
363       - 640 kbit/s
364
365
366
367 .. _v4l2-mpeg-audio-mode:
368
369 ``V4L2_CID_MPEG_AUDIO_MODE``
370     (enum)
371
372 enum v4l2_mpeg_audio_mode -
373     MPEG Audio mode. Possible values are:
374
375
376
377 .. flat-table::
378     :header-rows:  0
379     :stub-columns: 0
380
381     * - ``V4L2_MPEG_AUDIO_MODE_STEREO``
382       - Stereo
383     * - ``V4L2_MPEG_AUDIO_MODE_JOINT_STEREO``
384       - Joint Stereo
385     * - ``V4L2_MPEG_AUDIO_MODE_DUAL``
386       - Bilingual
387     * - ``V4L2_MPEG_AUDIO_MODE_MONO``
388       - Mono
389
390
391
392 .. _v4l2-mpeg-audio-mode-extension:
393
394 ``V4L2_CID_MPEG_AUDIO_MODE_EXTENSION``
395     (enum)
396
397 enum v4l2_mpeg_audio_mode_extension -
398     Joint Stereo audio mode extension. In Layer I and II they indicate
399     which subbands are in intensity stereo. All other subbands are coded
400     in stereo. Layer III is not (yet) supported. Possible values are:
401
402
403
404 .. flat-table::
405     :header-rows:  0
406     :stub-columns: 0
407
408     * - ``V4L2_MPEG_AUDIO_MODE_EXTENSION_BOUND_4``
409       - Subbands 4-31 in intensity stereo
410     * - ``V4L2_MPEG_AUDIO_MODE_EXTENSION_BOUND_8``
411       - Subbands 8-31 in intensity stereo
412     * - ``V4L2_MPEG_AUDIO_MODE_EXTENSION_BOUND_12``
413       - Subbands 12-31 in intensity stereo
414     * - ``V4L2_MPEG_AUDIO_MODE_EXTENSION_BOUND_16``
415       - Subbands 16-31 in intensity stereo
416
417
418
419 .. _v4l2-mpeg-audio-emphasis:
420
421 ``V4L2_CID_MPEG_AUDIO_EMPHASIS``
422     (enum)
423
424 enum v4l2_mpeg_audio_emphasis -
425     Audio Emphasis. Possible values are:
426
427
428
429 .. flat-table::
430     :header-rows:  0
431     :stub-columns: 0
432
433     * - ``V4L2_MPEG_AUDIO_EMPHASIS_NONE``
434       - None
435     * - ``V4L2_MPEG_AUDIO_EMPHASIS_50_DIV_15_uS``
436       - 50/15 microsecond emphasis
437     * - ``V4L2_MPEG_AUDIO_EMPHASIS_CCITT_J17``
438       - CCITT J.17
439
440
441
442 .. _v4l2-mpeg-audio-crc:
443
444 ``V4L2_CID_MPEG_AUDIO_CRC``
445     (enum)
446
447 enum v4l2_mpeg_audio_crc -
448     CRC method. Possible values are:
449
450
451
452 .. flat-table::
453     :header-rows:  0
454     :stub-columns: 0
455
456     * - ``V4L2_MPEG_AUDIO_CRC_NONE``
457       - None
458     * - ``V4L2_MPEG_AUDIO_CRC_CRC16``
459       - 16 bit parity check
460
461
462
463 ``V4L2_CID_MPEG_AUDIO_MUTE (boolean)``
464     Mutes the audio when capturing. This is not done by muting audio
465     hardware, which can still produce a slight hiss, but in the encoder
466     itself, guaranteeing a fixed and reproducible audio bitstream. 0 =
467     unmuted, 1 = muted.
468
469 .. _v4l2-mpeg-audio-dec-playback:
470
471 ``V4L2_CID_MPEG_AUDIO_DEC_PLAYBACK``
472     (enum)
473
474 enum v4l2_mpeg_audio_dec_playback -
475     Determines how monolingual audio should be played back. Possible
476     values are:
477
478
479
480 .. tabularcolumns:: |p{9.8cm}|p{7.7cm}|
481
482 .. flat-table::
483     :header-rows:  0
484     :stub-columns: 0
485
486     * - ``V4L2_MPEG_AUDIO_DEC_PLAYBACK_AUTO``
487       - Automatically determines the best playback mode.
488     * - ``V4L2_MPEG_AUDIO_DEC_PLAYBACK_STEREO``
489       - Stereo playback.
490     * - ``V4L2_MPEG_AUDIO_DEC_PLAYBACK_LEFT``
491       - Left channel playback.
492     * - ``V4L2_MPEG_AUDIO_DEC_PLAYBACK_RIGHT``
493       - Right channel playback.
494     * - ``V4L2_MPEG_AUDIO_DEC_PLAYBACK_MONO``
495       - Mono playback.
496     * - ``V4L2_MPEG_AUDIO_DEC_PLAYBACK_SWAPPED_STEREO``
497       - Stereo playback with swapped left and right channels.
498
499
500
501 .. _v4l2-mpeg-audio-dec-multilingual-playback:
502
503 ``V4L2_CID_MPEG_AUDIO_DEC_MULTILINGUAL_PLAYBACK``
504     (enum)
505
506 enum v4l2_mpeg_audio_dec_playback -
507     Determines how multilingual audio should be played back.
508
509 .. _v4l2-mpeg-video-encoding:
510
511 ``V4L2_CID_MPEG_VIDEO_ENCODING``
512     (enum)
513
514 enum v4l2_mpeg_video_encoding -
515     MPEG Video encoding method. This control is specific to multiplexed
516     MPEG streams. Possible values are:
517
518
519
520 .. flat-table::
521     :header-rows:  0
522     :stub-columns: 0
523
524     * - ``V4L2_MPEG_VIDEO_ENCODING_MPEG_1``
525       - MPEG-1 Video encoding
526     * - ``V4L2_MPEG_VIDEO_ENCODING_MPEG_2``
527       - MPEG-2 Video encoding
528     * - ``V4L2_MPEG_VIDEO_ENCODING_MPEG_4_AVC``
529       - MPEG-4 AVC (H.264) Video encoding
530
531
532
533 .. _v4l2-mpeg-video-aspect:
534
535 ``V4L2_CID_MPEG_VIDEO_ASPECT``
536     (enum)
537
538 enum v4l2_mpeg_video_aspect -
539     Video aspect. Possible values are:
540
541
542
543 .. flat-table::
544     :header-rows:  0
545     :stub-columns: 0
546
547     * - ``V4L2_MPEG_VIDEO_ASPECT_1x1``
548     * - ``V4L2_MPEG_VIDEO_ASPECT_4x3``
549     * - ``V4L2_MPEG_VIDEO_ASPECT_16x9``
550     * - ``V4L2_MPEG_VIDEO_ASPECT_221x100``
551
552
553
554 ``V4L2_CID_MPEG_VIDEO_B_FRAMES (integer)``
555     Number of B-Frames (default 2)
556
557 ``V4L2_CID_MPEG_VIDEO_GOP_SIZE (integer)``
558     GOP size (default 12)
559
560 ``V4L2_CID_MPEG_VIDEO_GOP_CLOSURE (boolean)``
561     GOP closure (default 1)
562
563 ``V4L2_CID_MPEG_VIDEO_PULLDOWN (boolean)``
564     Enable 3:2 pulldown (default 0)
565
566 .. _v4l2-mpeg-video-bitrate-mode:
567
568 ``V4L2_CID_MPEG_VIDEO_BITRATE_MODE``
569     (enum)
570
571 enum v4l2_mpeg_video_bitrate_mode -
572     Video bitrate mode. Possible values are:
573
574
575
576 .. flat-table::
577     :header-rows:  0
578     :stub-columns: 0
579
580     * - ``V4L2_MPEG_VIDEO_BITRATE_MODE_VBR``
581       - Variable bitrate
582     * - ``V4L2_MPEG_VIDEO_BITRATE_MODE_CBR``
583       - Constant bitrate
584
585
586
587 ``V4L2_CID_MPEG_VIDEO_BITRATE (integer)``
588     Video bitrate in bits per second.
589
590 ``V4L2_CID_MPEG_VIDEO_BITRATE_PEAK (integer)``
591     Peak video bitrate in bits per second. Must be larger or equal to
592     the average video bitrate. It is ignored if the video bitrate mode
593     is set to constant bitrate.
594
595 ``V4L2_CID_MPEG_VIDEO_TEMPORAL_DECIMATION (integer)``
596     For every captured frame, skip this many subsequent frames (default
597     0).
598
599 ``V4L2_CID_MPEG_VIDEO_MUTE (boolean)``
600     "Mutes" the video to a fixed color when capturing. This is useful
601     for testing, to produce a fixed video bitstream. 0 = unmuted, 1 =
602     muted.
603
604 ``V4L2_CID_MPEG_VIDEO_MUTE_YUV (integer)``
605     Sets the "mute" color of the video. The supplied 32-bit integer is
606     interpreted as follows (bit 0 = least significant bit):
607
608
609
610 .. flat-table::
611     :header-rows:  0
612     :stub-columns: 0
613
614     * - Bit 0:7
615       - V chrominance information
616     * - Bit 8:15
617       - U chrominance information
618     * - Bit 16:23
619       - Y luminance information
620     * - Bit 24:31
621       - Must be zero.
622
623
624
625 .. _v4l2-mpeg-video-dec-pts:
626
627 ``V4L2_CID_MPEG_VIDEO_DEC_PTS (integer64)``
628     This read-only control returns the 33-bit video Presentation Time
629     Stamp as defined in ITU T-REC-H.222.0 and ISO/IEC 13818-1 of the
630     currently displayed frame. This is the same PTS as is used in
631     :ref:`VIDIOC_DECODER_CMD`.
632
633 .. _v4l2-mpeg-video-dec-frame:
634
635 ``V4L2_CID_MPEG_VIDEO_DEC_FRAME (integer64)``
636     This read-only control returns the frame counter of the frame that
637     is currently displayed (decoded). This value is reset to 0 whenever
638     the decoder is started.
639
640 ``V4L2_CID_MPEG_VIDEO_DECODER_SLICE_INTERFACE (boolean)``
641     If enabled the decoder expects to receive a single slice per buffer,
642     otherwise the decoder expects a single frame in per buffer.
643     Applicable to the decoder, all codecs.
644
645 ``V4L2_CID_MPEG_VIDEO_H264_VUI_SAR_ENABLE (boolean)``
646     Enable writing sample aspect ratio in the Video Usability
647     Information. Applicable to the H264 encoder.
648
649 .. _v4l2-mpeg-video-h264-vui-sar-idc:
650
651 ``V4L2_CID_MPEG_VIDEO_H264_VUI_SAR_IDC``
652     (enum)
653
654 enum v4l2_mpeg_video_h264_vui_sar_idc -
655     VUI sample aspect ratio indicator for H.264 encoding. The value is
656     defined in the table E-1 in the standard. Applicable to the H264
657     encoder.
658
659
660
661 .. flat-table::
662     :header-rows:  0
663     :stub-columns: 0
664
665     * - ``V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_UNSPECIFIED``
666       - Unspecified
667     * - ``V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_1x1``
668       - 1x1
669     * - ``V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_12x11``
670       - 12x11
671     * - ``V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_10x11``
672       - 10x11
673     * - ``V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_16x11``
674       - 16x11
675     * - ``V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_40x33``
676       - 40x33
677     * - ``V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_24x11``
678       - 24x11
679     * - ``V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_20x11``
680       - 20x11
681     * - ``V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_32x11``
682       - 32x11
683     * - ``V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_80x33``
684       - 80x33
685     * - ``V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_18x11``
686       - 18x11
687     * - ``V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_15x11``
688       - 15x11
689     * - ``V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_64x33``
690       - 64x33
691     * - ``V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_160x99``
692       - 160x99
693     * - ``V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_4x3``
694       - 4x3
695     * - ``V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_3x2``
696       - 3x2
697     * - ``V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_2x1``
698       - 2x1
699     * - ``V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_EXTENDED``
700       - Extended SAR
701
702
703
704 ``V4L2_CID_MPEG_VIDEO_H264_VUI_EXT_SAR_WIDTH (integer)``
705     Extended sample aspect ratio width for H.264 VUI encoding.
706     Applicable to the H264 encoder.
707
708 ``V4L2_CID_MPEG_VIDEO_H264_VUI_EXT_SAR_HEIGHT (integer)``
709     Extended sample aspect ratio height for H.264 VUI encoding.
710     Applicable to the H264 encoder.
711
712 .. _v4l2-mpeg-video-h264-level:
713
714 ``V4L2_CID_MPEG_VIDEO_H264_LEVEL``
715     (enum)
716
717 enum v4l2_mpeg_video_h264_level -
718     The level information for the H264 video elementary stream.
719     Applicable to the H264 encoder. Possible values are:
720
721
722
723 .. flat-table::
724     :header-rows:  0
725     :stub-columns: 0
726
727     * - ``V4L2_MPEG_VIDEO_H264_LEVEL_1_0``
728       - Level 1.0
729     * - ``V4L2_MPEG_VIDEO_H264_LEVEL_1B``
730       - Level 1B
731     * - ``V4L2_MPEG_VIDEO_H264_LEVEL_1_1``
732       - Level 1.1
733     * - ``V4L2_MPEG_VIDEO_H264_LEVEL_1_2``
734       - Level 1.2
735     * - ``V4L2_MPEG_VIDEO_H264_LEVEL_1_3``
736       - Level 1.3
737     * - ``V4L2_MPEG_VIDEO_H264_LEVEL_2_0``
738       - Level 2.0
739     * - ``V4L2_MPEG_VIDEO_H264_LEVEL_2_1``
740       - Level 2.1
741     * - ``V4L2_MPEG_VIDEO_H264_LEVEL_2_2``
742       - Level 2.2
743     * - ``V4L2_MPEG_VIDEO_H264_LEVEL_3_0``
744       - Level 3.0
745     * - ``V4L2_MPEG_VIDEO_H264_LEVEL_3_1``
746       - Level 3.1
747     * - ``V4L2_MPEG_VIDEO_H264_LEVEL_3_2``
748       - Level 3.2
749     * - ``V4L2_MPEG_VIDEO_H264_LEVEL_4_0``
750       - Level 4.0
751     * - ``V4L2_MPEG_VIDEO_H264_LEVEL_4_1``
752       - Level 4.1
753     * - ``V4L2_MPEG_VIDEO_H264_LEVEL_4_2``
754       - Level 4.2
755     * - ``V4L2_MPEG_VIDEO_H264_LEVEL_5_0``
756       - Level 5.0
757     * - ``V4L2_MPEG_VIDEO_H264_LEVEL_5_1``
758       - Level 5.1
759     * - ``V4L2_MPEG_VIDEO_H264_LEVEL_5_2``
760       - Level 5.2
761     * - ``V4L2_MPEG_VIDEO_H264_LEVEL_6_0``
762       - Level 6.0
763     * - ``V4L2_MPEG_VIDEO_H264_LEVEL_6_1``
764       - Level 6.1
765     * - ``V4L2_MPEG_VIDEO_H264_LEVEL_6_2``
766       - Level 6.2
767
768
769
770 .. _v4l2-mpeg-video-mpeg2-level:
771
772 ``V4L2_CID_MPEG_VIDEO_MPEG2_LEVEL``
773     (enum)
774
775 enum v4l2_mpeg_video_mpeg2_level -
776     The level information for the MPEG2 elementary stream. Applicable to
777     MPEG2 codecs. Possible values are:
778
779
780
781 .. flat-table::
782     :header-rows:  0
783     :stub-columns: 0
784
785     * - ``V4L2_MPEG_VIDEO_MPEG2_LEVEL_LOW``
786       - Low Level (LL)
787     * - ``V4L2_MPEG_VIDEO_MPEG2_LEVEL_MAIN``
788       - Main Level (ML)
789     * - ``V4L2_MPEG_VIDEO_MPEG2_LEVEL_HIGH_1440``
790       - High-1440 Level (H-14)
791     * - ``V4L2_MPEG_VIDEO_MPEG2_LEVEL_HIGH``
792       - High Level (HL)
793
794
795
796 .. _v4l2-mpeg-video-mpeg4-level:
797
798 ``V4L2_CID_MPEG_VIDEO_MPEG4_LEVEL``
799     (enum)
800
801 enum v4l2_mpeg_video_mpeg4_level -
802     The level information for the MPEG4 elementary stream. Applicable to
803     the MPEG4 encoder. Possible values are:
804
805
806
807 .. flat-table::
808     :header-rows:  0
809     :stub-columns: 0
810
811     * - ``V4L2_MPEG_VIDEO_MPEG4_LEVEL_0``
812       - Level 0
813     * - ``V4L2_MPEG_VIDEO_MPEG4_LEVEL_0B``
814       - Level 0b
815     * - ``V4L2_MPEG_VIDEO_MPEG4_LEVEL_1``
816       - Level 1
817     * - ``V4L2_MPEG_VIDEO_MPEG4_LEVEL_2``
818       - Level 2
819     * - ``V4L2_MPEG_VIDEO_MPEG4_LEVEL_3``
820       - Level 3
821     * - ``V4L2_MPEG_VIDEO_MPEG4_LEVEL_3B``
822       - Level 3b
823     * - ``V4L2_MPEG_VIDEO_MPEG4_LEVEL_4``
824       - Level 4
825     * - ``V4L2_MPEG_VIDEO_MPEG4_LEVEL_5``
826       - Level 5
827
828
829
830 .. _v4l2-mpeg-video-h264-profile:
831
832 ``V4L2_CID_MPEG_VIDEO_H264_PROFILE``
833     (enum)
834
835 enum v4l2_mpeg_video_h264_profile -
836     The profile information for H264. Applicable to the H264 encoder.
837     Possible values are:
838
839
840
841 .. flat-table::
842     :header-rows:  0
843     :stub-columns: 0
844
845     * - ``V4L2_MPEG_VIDEO_H264_PROFILE_BASELINE``
846       - Baseline profile
847     * - ``V4L2_MPEG_VIDEO_H264_PROFILE_CONSTRAINED_BASELINE``
848       - Constrained Baseline profile
849     * - ``V4L2_MPEG_VIDEO_H264_PROFILE_MAIN``
850       - Main profile
851     * - ``V4L2_MPEG_VIDEO_H264_PROFILE_EXTENDED``
852       - Extended profile
853     * - ``V4L2_MPEG_VIDEO_H264_PROFILE_HIGH``
854       - High profile
855     * - ``V4L2_MPEG_VIDEO_H264_PROFILE_HIGH_10``
856       - High 10 profile
857     * - ``V4L2_MPEG_VIDEO_H264_PROFILE_HIGH_422``
858       - High 422 profile
859     * - ``V4L2_MPEG_VIDEO_H264_PROFILE_HIGH_444_PREDICTIVE``
860       - High 444 Predictive profile
861     * - ``V4L2_MPEG_VIDEO_H264_PROFILE_HIGH_10_INTRA``
862       - High 10 Intra profile
863     * - ``V4L2_MPEG_VIDEO_H264_PROFILE_HIGH_422_INTRA``
864       - High 422 Intra profile
865     * - ``V4L2_MPEG_VIDEO_H264_PROFILE_HIGH_444_INTRA``
866       - High 444 Intra profile
867     * - ``V4L2_MPEG_VIDEO_H264_PROFILE_CAVLC_444_INTRA``
868       - CAVLC 444 Intra profile
869     * - ``V4L2_MPEG_VIDEO_H264_PROFILE_SCALABLE_BASELINE``
870       - Scalable Baseline profile
871     * - ``V4L2_MPEG_VIDEO_H264_PROFILE_SCALABLE_HIGH``
872       - Scalable High profile
873     * - ``V4L2_MPEG_VIDEO_H264_PROFILE_SCALABLE_HIGH_INTRA``
874       - Scalable High Intra profile
875     * - ``V4L2_MPEG_VIDEO_H264_PROFILE_STEREO_HIGH``
876       - Stereo High profile
877     * - ``V4L2_MPEG_VIDEO_H264_PROFILE_MULTIVIEW_HIGH``
878       - Multiview High profile
879     * - ``V4L2_MPEG_VIDEO_H264_PROFILE_CONSTRAINED_HIGH``
880       - Constrained High profile
881
882
883
884 .. _v4l2-mpeg-video-mpeg2-profile:
885
886 ``V4L2_CID_MPEG_VIDEO_MPEG2_PROFILE``
887     (enum)
888
889 enum v4l2_mpeg_video_mpeg2_profile -
890     The profile information for MPEG2. Applicable to MPEG2 codecs.
891     Possible values are:
892
893
894
895 .. flat-table::
896     :header-rows:  0
897     :stub-columns: 0
898
899     * - ``V4L2_MPEG_VIDEO_MPEG2_PROFILE_SIMPLE``
900       - Simple profile (SP)
901     * - ``V4L2_MPEG_VIDEO_MPEG2_PROFILE_MAIN``
902       - Main profile (MP)
903     * - ``V4L2_MPEG_VIDEO_MPEG2_PROFILE_SNR_SCALABLE``
904       - SNR Scalable profile (SNR)
905     * - ``V4L2_MPEG_VIDEO_MPEG2_PROFILE_SPATIALLY_SCALABLE``
906       - Spatially Scalable profile (Spt)
907     * - ``V4L2_MPEG_VIDEO_MPEG2_PROFILE_HIGH``
908       - High profile (HP)
909     * - ``V4L2_MPEG_VIDEO_MPEG2_PROFILE_MULTIVIEW``
910       - Multi-view profile (MVP)
911
912
913
914 .. _v4l2-mpeg-video-mpeg4-profile:
915
916 ``V4L2_CID_MPEG_VIDEO_MPEG4_PROFILE``
917     (enum)
918
919 enum v4l2_mpeg_video_mpeg4_profile -
920     The profile information for MPEG4. Applicable to the MPEG4 encoder.
921     Possible values are:
922
923
924
925 .. flat-table::
926     :header-rows:  0
927     :stub-columns: 0
928
929     * - ``V4L2_MPEG_VIDEO_MPEG4_PROFILE_SIMPLE``
930       - Simple profile
931     * - ``V4L2_MPEG_VIDEO_MPEG4_PROFILE_ADVANCED_SIMPLE``
932       - Advanced Simple profile
933     * - ``V4L2_MPEG_VIDEO_MPEG4_PROFILE_CORE``
934       - Core profile
935     * - ``V4L2_MPEG_VIDEO_MPEG4_PROFILE_SIMPLE_SCALABLE``
936       - Simple Scalable profile
937     * - ``V4L2_MPEG_VIDEO_MPEG4_PROFILE_ADVANCED_CODING_EFFICIENCY``
938       -
939
940
941
942 ``V4L2_CID_MPEG_VIDEO_MAX_REF_PIC (integer)``
943     The maximum number of reference pictures used for encoding.
944     Applicable to the encoder.
945
946 .. _v4l2-mpeg-video-multi-slice-mode:
947
948 ``V4L2_CID_MPEG_VIDEO_MULTI_SLICE_MODE``
949     (enum)
950
951 enum v4l2_mpeg_video_multi_slice_mode -
952     Determines how the encoder should handle division of frame into
953     slices. Applicable to the encoder. Possible values are:
954
955
956
957 .. tabularcolumns:: |p{9.6cm}|p{7.9cm}|
958
959 .. flat-table::
960     :header-rows:  0
961     :stub-columns: 0
962
963     * - ``V4L2_MPEG_VIDEO_MULTI_SLICE_MODE_SINGLE``
964       - Single slice per frame.
965     * - ``V4L2_MPEG_VIDEO_MULTI_SLICE_MODE_MAX_MB``
966       - Multiple slices with set maximum number of macroblocks per slice.
967     * - ``V4L2_MPEG_VIDEO_MULTI_SLICE_MODE_MAX_BYTES``
968       - Multiple slice with set maximum size in bytes per slice.
969
970
971
972 ``V4L2_CID_MPEG_VIDEO_MULTI_SLICE_MAX_MB (integer)``
973     The maximum number of macroblocks in a slice. Used when
974     ``V4L2_CID_MPEG_VIDEO_MULTI_SLICE_MODE`` is set to
975     ``V4L2_MPEG_VIDEO_MULTI_SLICE_MODE_MAX_MB``. Applicable to the
976     encoder.
977
978 ``V4L2_CID_MPEG_VIDEO_MULTI_SLICE_MAX_BYTES (integer)``
979     The maximum size of a slice in bytes. Used when
980     ``V4L2_CID_MPEG_VIDEO_MULTI_SLICE_MODE`` is set to
981     ``V4L2_MPEG_VIDEO_MULTI_SLICE_MODE_MAX_BYTES``. Applicable to the
982     encoder.
983
984 .. _v4l2-mpeg-video-h264-loop-filter-mode:
985
986 ``V4L2_CID_MPEG_VIDEO_H264_LOOP_FILTER_MODE``
987     (enum)
988
989 enum v4l2_mpeg_video_h264_loop_filter_mode -
990     Loop filter mode for H264 encoder. Possible values are:
991
992 .. raw:: latex
993
994     \small
995
996 .. tabularcolumns:: |p{13.6cm}|p{3.9cm}|
997
998 .. flat-table::
999     :header-rows:  0
1000     :stub-columns: 0
1001
1002     * - ``V4L2_MPEG_VIDEO_H264_LOOP_FILTER_MODE_ENABLED``
1003       - Loop filter is enabled.
1004     * - ``V4L2_MPEG_VIDEO_H264_LOOP_FILTER_MODE_DISABLED``
1005       - Loop filter is disabled.
1006     * - ``V4L2_MPEG_VIDEO_H264_LOOP_FILTER_MODE_DISABLED_AT_SLICE_BOUNDARY``
1007       - Loop filter is disabled at the slice boundary.
1008
1009 .. raw:: latex
1010
1011     \normalsize
1012
1013
1014 ``V4L2_CID_MPEG_VIDEO_H264_LOOP_FILTER_ALPHA (integer)``
1015     Loop filter alpha coefficient, defined in the H264 standard.
1016     This value corresponds to the slice_alpha_c0_offset_div2 slice header
1017     field, and should be in the range of -6 to +6, inclusive. The actual alpha
1018     offset FilterOffsetA is twice this value.
1019     Applicable to the H264 encoder.
1020
1021 ``V4L2_CID_MPEG_VIDEO_H264_LOOP_FILTER_BETA (integer)``
1022     Loop filter beta coefficient, defined in the H264 standard.
1023     This corresponds to the slice_beta_offset_div2 slice header field, and
1024     should be in the range of -6 to +6, inclusive. The actual beta offset
1025     FilterOffsetB is twice this value.
1026     Applicable to the H264 encoder.
1027
1028 .. _v4l2-mpeg-video-h264-entropy-mode:
1029
1030 ``V4L2_CID_MPEG_VIDEO_H264_ENTROPY_MODE``
1031     (enum)
1032
1033 enum v4l2_mpeg_video_h264_entropy_mode -
1034     Entropy coding mode for H264 - CABAC/CAVALC. Applicable to the H264
1035     encoder. Possible values are:
1036
1037
1038 .. tabularcolumns:: |p{9.0cm}|p{8.5cm}|
1039
1040
1041 .. flat-table::
1042     :header-rows:  0
1043     :stub-columns: 0
1044
1045     * - ``V4L2_MPEG_VIDEO_H264_ENTROPY_MODE_CAVLC``
1046       - Use CAVLC entropy coding.
1047     * - ``V4L2_MPEG_VIDEO_H264_ENTROPY_MODE_CABAC``
1048       - Use CABAC entropy coding.
1049
1050
1051
1052 ``V4L2_CID_MPEG_VIDEO_H264_8X8_TRANSFORM (boolean)``
1053     Enable 8X8 transform for H264. Applicable to the H264 encoder.
1054
1055 ``V4L2_CID_MPEG_VIDEO_H264_CONSTRAINED_INTRA_PREDICTION (boolean)``
1056     Enable constrained intra prediction for H264. Applicable to the H264
1057     encoder.
1058
1059 ``V4L2_CID_MPEG_VIDEO_H264_CHROMA_QP_INDEX_OFFSET (integer)``
1060     Specify the offset that should be added to the luma quantization
1061     parameter to determine the chroma quantization parameter. Applicable
1062     to the H264 encoder.
1063
1064 ``V4L2_CID_MPEG_VIDEO_CYCLIC_INTRA_REFRESH_MB (integer)``
1065     Cyclic intra macroblock refresh. This is the number of continuous
1066     macroblocks refreshed every frame. Each frame a successive set of
1067     macroblocks is refreshed until the cycle completes and starts from
1068     the top of the frame. Applicable to H264, H263 and MPEG4 encoder.
1069
1070 ``V4L2_CID_MPEG_VIDEO_FRAME_RC_ENABLE (boolean)``
1071     Frame level rate control enable. If this control is disabled then
1072     the quantization parameter for each frame type is constant and set
1073     with appropriate controls (e.g.
1074     ``V4L2_CID_MPEG_VIDEO_H263_I_FRAME_QP``). If frame rate control is
1075     enabled then quantization parameter is adjusted to meet the chosen
1076     bitrate. Minimum and maximum value for the quantization parameter
1077     can be set with appropriate controls (e.g.
1078     ``V4L2_CID_MPEG_VIDEO_H263_MIN_QP``). Applicable to encoders.
1079
1080 ``V4L2_CID_MPEG_VIDEO_MB_RC_ENABLE (boolean)``
1081     Macroblock level rate control enable. Applicable to the MPEG4 and
1082     H264 encoders.
1083
1084 ``V4L2_CID_MPEG_VIDEO_MPEG4_QPEL (boolean)``
1085     Quarter pixel motion estimation for MPEG4. Applicable to the MPEG4
1086     encoder.
1087
1088 ``V4L2_CID_MPEG_VIDEO_H263_I_FRAME_QP (integer)``
1089     Quantization parameter for an I frame for H263. Valid range: from 1
1090     to 31.
1091
1092 ``V4L2_CID_MPEG_VIDEO_H263_MIN_QP (integer)``
1093     Minimum quantization parameter for H263. Valid range: from 1 to 31.
1094
1095 ``V4L2_CID_MPEG_VIDEO_H263_MAX_QP (integer)``
1096     Maximum quantization parameter for H263. Valid range: from 1 to 31.
1097
1098 ``V4L2_CID_MPEG_VIDEO_H263_P_FRAME_QP (integer)``
1099     Quantization parameter for an P frame for H263. Valid range: from 1
1100     to 31.
1101
1102 ``V4L2_CID_MPEG_VIDEO_H263_B_FRAME_QP (integer)``
1103     Quantization parameter for an B frame for H263. Valid range: from 1
1104     to 31.
1105
1106 ``V4L2_CID_MPEG_VIDEO_H264_I_FRAME_QP (integer)``
1107     Quantization parameter for an I frame for H264. Valid range: from 0
1108     to 51.
1109
1110 ``V4L2_CID_MPEG_VIDEO_H264_MIN_QP (integer)``
1111     Minimum quantization parameter for H264. Valid range: from 0 to 51.
1112
1113 ``V4L2_CID_MPEG_VIDEO_H264_MAX_QP (integer)``
1114     Maximum quantization parameter for H264. Valid range: from 0 to 51.
1115
1116 ``V4L2_CID_MPEG_VIDEO_H264_P_FRAME_QP (integer)``
1117     Quantization parameter for an P frame for H264. Valid range: from 0
1118     to 51.
1119
1120 ``V4L2_CID_MPEG_VIDEO_H264_B_FRAME_QP (integer)``
1121     Quantization parameter for an B frame for H264. Valid range: from 0
1122     to 51.
1123
1124 ``V4L2_CID_MPEG_VIDEO_H264_I_FRAME_MIN_QP (integer)``
1125     Minimum quantization parameter for the H264 I frame to limit I frame
1126     quality to a range. Valid range: from 0 to 51. If
1127     V4L2_CID_MPEG_VIDEO_H264_MIN_QP is also set, the quantization parameter
1128     should be chosen to meet both requirements.
1129
1130 ``V4L2_CID_MPEG_VIDEO_H264_I_FRAME_MAX_QP (integer)``
1131     Maximum quantization parameter for the H264 I frame to limit I frame
1132     quality to a range. Valid range: from 0 to 51. If
1133     V4L2_CID_MPEG_VIDEO_H264_MAX_QP is also set, the quantization parameter
1134     should be chosen to meet both requirements.
1135
1136 ``V4L2_CID_MPEG_VIDEO_H264_P_FRAME_MIN_QP (integer)``
1137     Minimum quantization parameter for the H264 P frame to limit P frame
1138     quality to a range. Valid range: from 0 to 51. If
1139     V4L2_CID_MPEG_VIDEO_H264_MIN_QP is also set, the quantization parameter
1140     should be chosen to meet both requirements.
1141
1142 ``V4L2_CID_MPEG_VIDEO_H264_P_FRAME_MAX_QP (integer)``
1143     Maximum quantization parameter for the H264 P frame to limit P frame
1144     quality to a range. Valid range: from 0 to 51. If
1145     V4L2_CID_MPEG_VIDEO_H264_MAX_QP is also set, the quantization parameter
1146     should be chosen to meet both requirements.
1147
1148 ``V4L2_CID_MPEG_VIDEO_MPEG4_I_FRAME_QP (integer)``
1149     Quantization parameter for an I frame for MPEG4. Valid range: from 1
1150     to 31.
1151
1152 ``V4L2_CID_MPEG_VIDEO_MPEG4_MIN_QP (integer)``
1153     Minimum quantization parameter for MPEG4. Valid range: from 1 to 31.
1154
1155 ``V4L2_CID_MPEG_VIDEO_MPEG4_MAX_QP (integer)``
1156     Maximum quantization parameter for MPEG4. Valid range: from 1 to 31.
1157
1158 ``V4L2_CID_MPEG_VIDEO_MPEG4_P_FRAME_QP (integer)``
1159     Quantization parameter for an P frame for MPEG4. Valid range: from 1
1160     to 31.
1161
1162 ``V4L2_CID_MPEG_VIDEO_MPEG4_B_FRAME_QP (integer)``
1163     Quantization parameter for an B frame for MPEG4. Valid range: from 1
1164     to 31.
1165
1166 ``V4L2_CID_MPEG_VIDEO_VBV_SIZE (integer)``
1167     The Video Buffer Verifier size in kilobytes, it is used as a
1168     limitation of frame skip. The VBV is defined in the standard as a
1169     mean to verify that the produced stream will be successfully
1170     decoded. The standard describes it as "Part of a hypothetical
1171     decoder that is conceptually connected to the output of the encoder.
1172     Its purpose is to provide a constraint on the variability of the
1173     data rate that an encoder or editing process may produce.".
1174     Applicable to the MPEG1, MPEG2, MPEG4 encoders.
1175
1176 .. _v4l2-mpeg-video-vbv-delay:
1177
1178 ``V4L2_CID_MPEG_VIDEO_VBV_DELAY (integer)``
1179     Sets the initial delay in milliseconds for VBV buffer control.
1180
1181 .. _v4l2-mpeg-video-hor-search-range:
1182
1183 ``V4L2_CID_MPEG_VIDEO_MV_H_SEARCH_RANGE (integer)``
1184     Horizontal search range defines maximum horizontal search area in
1185     pixels to search and match for the present Macroblock (MB) in the
1186     reference picture. This V4L2 control macro is used to set horizontal
1187     search range for motion estimation module in video encoder.
1188
1189 .. _v4l2-mpeg-video-vert-search-range:
1190
1191 ``V4L2_CID_MPEG_VIDEO_MV_V_SEARCH_RANGE (integer)``
1192     Vertical search range defines maximum vertical search area in pixels
1193     to search and match for the present Macroblock (MB) in the reference
1194     picture. This V4L2 control macro is used to set vertical search
1195     range for motion estimation module in video encoder.
1196
1197 .. _v4l2-mpeg-video-force-key-frame:
1198
1199 ``V4L2_CID_MPEG_VIDEO_FORCE_KEY_FRAME (button)``
1200     Force a key frame for the next queued buffer. Applicable to
1201     encoders. This is a general, codec-agnostic keyframe control.
1202
1203 ``V4L2_CID_MPEG_VIDEO_H264_CPB_SIZE (integer)``
1204     The Coded Picture Buffer size in kilobytes, it is used as a
1205     limitation of frame skip. The CPB is defined in the H264 standard as
1206     a mean to verify that the produced stream will be successfully
1207     decoded. Applicable to the H264 encoder.
1208
1209 ``V4L2_CID_MPEG_VIDEO_H264_I_PERIOD (integer)``
1210     Period between I-frames in the open GOP for H264. In case of an open
1211     GOP this is the period between two I-frames. The period between IDR
1212     (Instantaneous Decoding Refresh) frames is taken from the GOP_SIZE
1213     control. An IDR frame, which stands for Instantaneous Decoding
1214     Refresh is an I-frame after which no prior frames are referenced.
1215     This means that a stream can be restarted from an IDR frame without
1216     the need to store or decode any previous frames. Applicable to the
1217     H264 encoder.
1218
1219 .. _v4l2-mpeg-video-header-mode:
1220
1221 ``V4L2_CID_MPEG_VIDEO_HEADER_MODE``
1222     (enum)
1223
1224 enum v4l2_mpeg_video_header_mode -
1225     Determines whether the header is returned as the first buffer or is
1226     it returned together with the first frame. Applicable to encoders.
1227     Possible values are:
1228
1229 .. raw:: latex
1230
1231     \small
1232
1233 .. tabularcolumns:: |p{10.3cm}|p{7.2cm}|
1234
1235 .. flat-table::
1236     :header-rows:  0
1237     :stub-columns: 0
1238
1239     * - ``V4L2_MPEG_VIDEO_HEADER_MODE_SEPARATE``
1240       - The stream header is returned separately in the first buffer.
1241     * - ``V4L2_MPEG_VIDEO_HEADER_MODE_JOINED_WITH_1ST_FRAME``
1242       - The stream header is returned together with the first encoded
1243         frame.
1244
1245 .. raw:: latex
1246
1247     \normalsize
1248
1249
1250 ``V4L2_CID_MPEG_VIDEO_REPEAT_SEQ_HEADER (boolean)``
1251     Repeat the video sequence headers. Repeating these headers makes
1252     random access to the video stream easier. Applicable to the MPEG1, 2
1253     and 4 encoder.
1254
1255 ``V4L2_CID_MPEG_VIDEO_DECODER_MPEG4_DEBLOCK_FILTER (boolean)``
1256     Enabled the deblocking post processing filter for MPEG4 decoder.
1257     Applicable to the MPEG4 decoder.
1258
1259 ``V4L2_CID_MPEG_VIDEO_MPEG4_VOP_TIME_RES (integer)``
1260     vop_time_increment_resolution value for MPEG4. Applicable to the
1261     MPEG4 encoder.
1262
1263 ``V4L2_CID_MPEG_VIDEO_MPEG4_VOP_TIME_INC (integer)``
1264     vop_time_increment value for MPEG4. Applicable to the MPEG4
1265     encoder.
1266
1267 ``V4L2_CID_MPEG_VIDEO_H264_SEI_FRAME_PACKING (boolean)``
1268     Enable generation of frame packing supplemental enhancement
1269     information in the encoded bitstream. The frame packing SEI message
1270     contains the arrangement of L and R planes for 3D viewing.
1271     Applicable to the H264 encoder.
1272
1273 ``V4L2_CID_MPEG_VIDEO_H264_SEI_FP_CURRENT_FRAME_0 (boolean)``
1274     Sets current frame as frame0 in frame packing SEI. Applicable to the
1275     H264 encoder.
1276
1277 .. _v4l2-mpeg-video-h264-sei-fp-arrangement-type:
1278
1279 ``V4L2_CID_MPEG_VIDEO_H264_SEI_FP_ARRANGEMENT_TYPE``
1280     (enum)
1281
1282 enum v4l2_mpeg_video_h264_sei_fp_arrangement_type -
1283     Frame packing arrangement type for H264 SEI. Applicable to the H264
1284     encoder. Possible values are:
1285
1286 .. raw:: latex
1287
1288     \small
1289
1290 .. tabularcolumns:: |p{12cm}|p{5.5cm}|
1291
1292 .. flat-table::
1293     :header-rows:  0
1294     :stub-columns: 0
1295
1296     * - ``V4L2_MPEG_VIDEO_H264_SEI_FP_ARRANGEMENT_TYPE_CHEKERBOARD``
1297       - Pixels are alternatively from L and R.
1298     * - ``V4L2_MPEG_VIDEO_H264_SEI_FP_ARRANGEMENT_TYPE_COLUMN``
1299       - L and R are interlaced by column.
1300     * - ``V4L2_MPEG_VIDEO_H264_SEI_FP_ARRANGEMENT_TYPE_ROW``
1301       - L and R are interlaced by row.
1302     * - ``V4L2_MPEG_VIDEO_H264_SEI_FP_ARRANGEMENT_TYPE_SIDE_BY_SIDE``
1303       - L is on the left, R on the right.
1304     * - ``V4L2_MPEG_VIDEO_H264_SEI_FP_ARRANGEMENT_TYPE_TOP_BOTTOM``
1305       - L is on top, R on bottom.
1306     * - ``V4L2_MPEG_VIDEO_H264_SEI_FP_ARRANGEMENT_TYPE_TEMPORAL``
1307       - One view per frame.
1308
1309 .. raw:: latex
1310
1311     \normalsize
1312
1313
1314
1315 ``V4L2_CID_MPEG_VIDEO_H264_FMO (boolean)``
1316     Enables flexible macroblock ordering in the encoded bitstream. It is
1317     a technique used for restructuring the ordering of macroblocks in
1318     pictures. Applicable to the H264 encoder.
1319
1320 .. _v4l2-mpeg-video-h264-fmo-map-type:
1321
1322 ``V4L2_CID_MPEG_VIDEO_H264_FMO_MAP_TYPE``
1323    (enum)
1324
1325 enum v4l2_mpeg_video_h264_fmo_map_type -
1326     When using FMO, the map type divides the image in different scan
1327     patterns of macroblocks. Applicable to the H264 encoder. Possible
1328     values are:
1329
1330 .. raw:: latex
1331
1332     \small
1333
1334 .. tabularcolumns:: |p{12.5cm}|p{5.0cm}|
1335
1336 .. flat-table::
1337     :header-rows:  0
1338     :stub-columns: 0
1339
1340     * - ``V4L2_MPEG_VIDEO_H264_FMO_MAP_TYPE_INTERLEAVED_SLICES``
1341       - Slices are interleaved one after other with macroblocks in run
1342         length order.
1343     * - ``V4L2_MPEG_VIDEO_H264_FMO_MAP_TYPE_SCATTERED_SLICES``
1344       - Scatters the macroblocks based on a mathematical function known to
1345         both encoder and decoder.
1346     * - ``V4L2_MPEG_VIDEO_H264_FMO_MAP_TYPE_FOREGROUND_WITH_LEFT_OVER``
1347       - Macroblocks arranged in rectangular areas or regions of interest.
1348     * - ``V4L2_MPEG_VIDEO_H264_FMO_MAP_TYPE_BOX_OUT``
1349       - Slice groups grow in a cyclic way from centre to outwards.
1350     * - ``V4L2_MPEG_VIDEO_H264_FMO_MAP_TYPE_RASTER_SCAN``
1351       - Slice groups grow in raster scan pattern from left to right.
1352     * - ``V4L2_MPEG_VIDEO_H264_FMO_MAP_TYPE_WIPE_SCAN``
1353       - Slice groups grow in wipe scan pattern from top to bottom.
1354     * - ``V4L2_MPEG_VIDEO_H264_FMO_MAP_TYPE_EXPLICIT``
1355       - User defined map type.
1356
1357 .. raw:: latex
1358
1359     \normalsize
1360
1361
1362
1363 ``V4L2_CID_MPEG_VIDEO_H264_FMO_SLICE_GROUP (integer)``
1364     Number of slice groups in FMO. Applicable to the H264 encoder.
1365
1366 .. _v4l2-mpeg-video-h264-fmo-change-direction:
1367
1368 ``V4L2_CID_MPEG_VIDEO_H264_FMO_CHANGE_DIRECTION``
1369     (enum)
1370
1371 enum v4l2_mpeg_video_h264_fmo_change_dir -
1372     Specifies a direction of the slice group change for raster and wipe
1373     maps. Applicable to the H264 encoder. Possible values are:
1374
1375
1376
1377 .. flat-table::
1378     :header-rows:  0
1379     :stub-columns: 0
1380
1381     * - ``V4L2_MPEG_VIDEO_H264_FMO_CHANGE_DIR_RIGHT``
1382       - Raster scan or wipe right.
1383     * - ``V4L2_MPEG_VIDEO_H264_FMO_CHANGE_DIR_LEFT``
1384       - Reverse raster scan or wipe left.
1385
1386
1387
1388 ``V4L2_CID_MPEG_VIDEO_H264_FMO_CHANGE_RATE (integer)``
1389     Specifies the size of the first slice group for raster and wipe map.
1390     Applicable to the H264 encoder.
1391
1392 ``V4L2_CID_MPEG_VIDEO_H264_FMO_RUN_LENGTH (integer)``
1393     Specifies the number of consecutive macroblocks for the interleaved
1394     map. Applicable to the H264 encoder.
1395
1396 ``V4L2_CID_MPEG_VIDEO_H264_ASO (boolean)``
1397     Enables arbitrary slice ordering in encoded bitstream. Applicable to
1398     the H264 encoder.
1399
1400 ``V4L2_CID_MPEG_VIDEO_H264_ASO_SLICE_ORDER (integer)``
1401     Specifies the slice order in ASO. Applicable to the H264 encoder.
1402     The supplied 32-bit integer is interpreted as follows (bit 0 = least
1403     significant bit):
1404
1405
1406
1407 .. flat-table::
1408     :header-rows:  0
1409     :stub-columns: 0
1410
1411     * - Bit 0:15
1412       - Slice ID
1413     * - Bit 16:32
1414       - Slice position or order
1415
1416
1417
1418 ``V4L2_CID_MPEG_VIDEO_H264_HIERARCHICAL_CODING (boolean)``
1419     Enables H264 hierarchical coding. Applicable to the H264 encoder.
1420
1421 .. _v4l2-mpeg-video-h264-hierarchical-coding-type:
1422
1423 ``V4L2_CID_MPEG_VIDEO_H264_HIERARCHICAL_CODING_TYPE``
1424     (enum)
1425
1426 enum v4l2_mpeg_video_h264_hierarchical_coding_type -
1427     Specifies the hierarchical coding type. Applicable to the H264
1428     encoder. Possible values are:
1429
1430
1431
1432 .. flat-table::
1433     :header-rows:  0
1434     :stub-columns: 0
1435
1436     * - ``V4L2_MPEG_VIDEO_H264_HIERARCHICAL_CODING_B``
1437       - Hierarchical B coding.
1438     * - ``V4L2_MPEG_VIDEO_H264_HIERARCHICAL_CODING_P``
1439       - Hierarchical P coding.
1440
1441
1442
1443 ``V4L2_CID_MPEG_VIDEO_H264_HIERARCHICAL_CODING_LAYER (integer)``
1444     Specifies the number of hierarchical coding layers. Applicable to
1445     the H264 encoder.
1446
1447 ``V4L2_CID_MPEG_VIDEO_H264_HIERARCHICAL_CODING_LAYER_QP (integer)``
1448     Specifies a user defined QP for each layer. Applicable to the H264
1449     encoder. The supplied 32-bit integer is interpreted as follows (bit
1450     0 = least significant bit):
1451
1452
1453
1454 .. flat-table::
1455     :header-rows:  0
1456     :stub-columns: 0
1457
1458     * - Bit 0:15
1459       - QP value
1460     * - Bit 16:32
1461       - Layer number
1462
1463
1464 .. _v4l2-mpeg-h264:
1465
1466 ``V4L2_CID_MPEG_VIDEO_H264_SPS (struct)``
1467     Specifies the sequence parameter set (as extracted from the
1468     bitstream) for the associated H264 slice data. This includes the
1469     necessary parameters for configuring a stateless hardware decoding
1470     pipeline for H264. The bitstream parameters are defined according
1471     to :ref:`h264`, section 7.4.2.1.1 "Sequence Parameter Set Data
1472     Semantics". For further documentation, refer to the above
1473     specification, unless there is an explicit comment stating
1474     otherwise.
1475
1476     .. note::
1477
1478        This compound control is not yet part of the public kernel API and
1479        it is expected to change.
1480
1481 .. c:type:: v4l2_ctrl_h264_sps
1482
1483 .. cssclass:: longtable
1484
1485 .. flat-table:: struct v4l2_ctrl_h264_sps
1486     :header-rows:  0
1487     :stub-columns: 0
1488     :widths:       1 1 2
1489
1490     * - __u8
1491       - ``profile_idc``
1492       -
1493     * - __u8
1494       - ``constraint_set_flags``
1495       - See :ref:`Sequence Parameter Set Constraints Set Flags <h264_sps_constraints_set_flags>`
1496     * - __u8
1497       - ``level_idc``
1498       -
1499     * - __u8
1500       - ``seq_parameter_set_id``
1501       -
1502     * - __u8
1503       - ``chroma_format_idc``
1504       -
1505     * - __u8
1506       - ``bit_depth_luma_minus8``
1507       -
1508     * - __u8
1509       - ``bit_depth_chroma_minus8``
1510       -
1511     * - __u8
1512       - ``log2_max_frame_num_minus4``
1513       -
1514     * - __u8
1515       - ``pic_order_cnt_type``
1516       -
1517     * - __u8
1518       - ``log2_max_pic_order_cnt_lsb_minus4``
1519       -
1520     * - __u8
1521       - ``max_num_ref_frames``
1522       -
1523     * - __u8
1524       - ``num_ref_frames_in_pic_order_cnt_cycle``
1525       -
1526     * - __s32
1527       - ``offset_for_ref_frame[255]``
1528       -
1529     * - __s32
1530       - ``offset_for_non_ref_pic``
1531       -
1532     * - __s32
1533       - ``offset_for_top_to_bottom_field``
1534       -
1535     * - __u16
1536       - ``pic_width_in_mbs_minus1``
1537       -
1538     * - __u16
1539       - ``pic_height_in_map_units_minus1``
1540       -
1541     * - __u32
1542       - ``flags``
1543       - See :ref:`Sequence Parameter Set Flags <h264_sps_flags>`
1544
1545 .. _h264_sps_constraints_set_flags:
1546
1547 ``Sequence Parameter Set Constraints Set Flags``
1548
1549 .. cssclass:: longtable
1550
1551 .. flat-table::
1552     :header-rows:  0
1553     :stub-columns: 0
1554     :widths:       1 1 2
1555
1556     * - ``V4L2_H264_SPS_CONSTRAINT_SET0_FLAG``
1557       - 0x00000001
1558       -
1559     * - ``V4L2_H264_SPS_CONSTRAINT_SET1_FLAG``
1560       - 0x00000002
1561       -
1562     * - ``V4L2_H264_SPS_CONSTRAINT_SET2_FLAG``
1563       - 0x00000004
1564       -
1565     * - ``V4L2_H264_SPS_CONSTRAINT_SET3_FLAG``
1566       - 0x00000008
1567       -
1568     * - ``V4L2_H264_SPS_CONSTRAINT_SET4_FLAG``
1569       - 0x00000010
1570       -
1571     * - ``V4L2_H264_SPS_CONSTRAINT_SET5_FLAG``
1572       - 0x00000020
1573       -
1574
1575 .. _h264_sps_flags:
1576
1577 ``Sequence Parameter Set Flags``
1578
1579 .. cssclass:: longtable
1580
1581 .. flat-table::
1582     :header-rows:  0
1583     :stub-columns: 0
1584     :widths:       1 1 2
1585
1586     * - ``V4L2_H264_SPS_FLAG_SEPARATE_COLOUR_PLANE``
1587       - 0x00000001
1588       -
1589     * - ``V4L2_H264_SPS_FLAG_QPPRIME_Y_ZERO_TRANSFORM_BYPASS``
1590       - 0x00000002
1591       -
1592     * - ``V4L2_H264_SPS_FLAG_DELTA_PIC_ORDER_ALWAYS_ZERO``
1593       - 0x00000004
1594       -
1595     * - ``V4L2_H264_SPS_FLAG_GAPS_IN_FRAME_NUM_VALUE_ALLOWED``
1596       - 0x00000008
1597       -
1598     * - ``V4L2_H264_SPS_FLAG_FRAME_MBS_ONLY``
1599       - 0x00000010
1600       -
1601     * - ``V4L2_H264_SPS_FLAG_MB_ADAPTIVE_FRAME_FIELD``
1602       - 0x00000020
1603       -
1604     * - ``V4L2_H264_SPS_FLAG_DIRECT_8X8_INFERENCE``
1605       - 0x00000040
1606       -
1607
1608 ``V4L2_CID_MPEG_VIDEO_H264_PPS (struct)``
1609     Specifies the picture parameter set (as extracted from the
1610     bitstream) for the associated H264 slice data. This includes the
1611     necessary parameters for configuring a stateless hardware decoding
1612     pipeline for H264.  The bitstream parameters are defined according
1613     to :ref:`h264`, section 7.4.2.2 "Picture Parameter Set RBSP
1614     Semantics". For further documentation, refer to the above
1615     specification, unless there is an explicit comment stating
1616     otherwise.
1617
1618     .. note::
1619
1620        This compound control is not yet part of the public kernel API and
1621        it is expected to change.
1622
1623 .. c:type:: v4l2_ctrl_h264_pps
1624
1625 .. cssclass:: longtable
1626
1627 .. flat-table:: struct v4l2_ctrl_h264_pps
1628     :header-rows:  0
1629     :stub-columns: 0
1630     :widths:       1 1 2
1631
1632     * - __u8
1633       - ``pic_parameter_set_id``
1634       -
1635     * - __u8
1636       - ``seq_parameter_set_id``
1637       -
1638     * - __u8
1639       - ``num_slice_groups_minus1``
1640       -
1641     * - __u8
1642       - ``num_ref_idx_l0_default_active_minus1``
1643       -
1644     * - __u8
1645       - ``num_ref_idx_l1_default_active_minus1``
1646       -
1647     * - __u8
1648       - ``weighted_bipred_idc``
1649       -
1650     * - __s8
1651       - ``pic_init_qp_minus26``
1652       -
1653     * - __s8
1654       - ``pic_init_qs_minus26``
1655       -
1656     * - __s8
1657       - ``chroma_qp_index_offset``
1658       -
1659     * - __s8
1660       - ``second_chroma_qp_index_offset``
1661       -
1662     * - __u16
1663       - ``flags``
1664       - See :ref:`Picture Parameter Set Flags <h264_pps_flags>`
1665
1666 .. _h264_pps_flags:
1667
1668 ``Picture Parameter Set Flags``
1669
1670 .. cssclass:: longtable
1671
1672 .. flat-table::
1673     :header-rows:  0
1674     :stub-columns: 0
1675     :widths:       1 1 2
1676
1677     * - ``V4L2_H264_PPS_FLAG_ENTROPY_CODING_MODE``
1678       - 0x00000001
1679       -
1680     * - ``V4L2_H264_PPS_FLAG_BOTTOM_FIELD_PIC_ORDER_IN_FRAME_PRESENT``
1681       - 0x00000002
1682       -
1683     * - ``V4L2_H264_PPS_FLAG_WEIGHTED_PRED``
1684       - 0x00000004
1685       -
1686     * - ``V4L2_H264_PPS_FLAG_DEBLOCKING_FILTER_CONTROL_PRESENT``
1687       - 0x00000008
1688       -
1689     * - ``V4L2_H264_PPS_FLAG_CONSTRAINED_INTRA_PRED``
1690       - 0x00000010
1691       -
1692     * - ``V4L2_H264_PPS_FLAG_REDUNDANT_PIC_CNT_PRESENT``
1693       - 0x00000020
1694       -
1695     * - ``V4L2_H264_PPS_FLAG_TRANSFORM_8X8_MODE``
1696       - 0x00000040
1697       -
1698     * - ``V4L2_H264_PPS_FLAG_PIC_SCALING_MATRIX_PRESENT``
1699       - 0x00000080
1700       -
1701
1702 ``V4L2_CID_MPEG_VIDEO_H264_SCALING_MATRIX (struct)``
1703     Specifies the scaling matrix (as extracted from the bitstream) for
1704     the associated H264 slice data. The bitstream parameters are
1705     defined according to :ref:`h264`, section 7.4.2.1.1.1 "Scaling
1706     List Semantics". For further documentation, refer to the above
1707     specification, unless there is an explicit comment stating
1708     otherwise.
1709
1710     .. note::
1711
1712        This compound control is not yet part of the public kernel API and
1713        it is expected to change.
1714
1715 .. c:type:: v4l2_ctrl_h264_scaling_matrix
1716
1717 .. cssclass:: longtable
1718
1719 .. flat-table:: struct v4l2_ctrl_h264_scaling_matrix
1720     :header-rows:  0
1721     :stub-columns: 0
1722     :widths:       1 1 2
1723
1724     * - __u8
1725       - ``scaling_list_4x4[6][16]``
1726       - Scaling matrix after applying the inverse scanning process.
1727         Expected list order is Intra Y, Intra Cb, Intra Cr, Inter Y,
1728         Inter Cb, Inter Cr. The values on each scaling list are
1729         expected in raster scan order.
1730     * - __u8
1731       - ``scaling_list_8x8[6][64]``
1732       - Scaling matrix after applying the inverse scanning process.
1733         Expected list order is Intra Y, Inter Y, Intra Cb, Inter Cb,
1734         Intra Cr, Inter Cr. The values on each scaling list are
1735         expected in raster scan order.
1736
1737 ``V4L2_CID_MPEG_VIDEO_H264_SLICE_PARAMS (struct)``
1738     Specifies the slice parameters (as extracted from the bitstream)
1739     for the associated H264 slice data. This includes the necessary
1740     parameters for configuring a stateless hardware decoding pipeline
1741     for H264.  The bitstream parameters are defined according to
1742     :ref:`h264`, section 7.4.3 "Slice Header Semantics". For further
1743     documentation, refer to the above specification, unless there is
1744     an explicit comment stating otherwise.
1745
1746     .. note::
1747
1748        This compound control is not yet part of the public kernel API
1749        and it is expected to change.
1750
1751        This structure is expected to be passed as an array, with one
1752        entry for each slice included in the bitstream buffer.
1753
1754 .. c:type:: v4l2_ctrl_h264_slice_params
1755
1756 .. cssclass:: longtable
1757
1758 .. flat-table:: struct v4l2_ctrl_h264_slice_params
1759     :header-rows:  0
1760     :stub-columns: 0
1761     :widths:       1 1 2
1762
1763     * - __u32
1764       - ``start_byte_offset``
1765         Offset (in bytes) from the beginning of the OUTPUT buffer to the start
1766         of the slice. If the slice starts with a start code, then this is the
1767         offset to such start code. When operating in slice-based decoding mode
1768         (see :c:type:`v4l2_mpeg_video_h264_decode_mode`), this field should
1769         be set to 0. When operating in frame-based decoding mode, this field
1770         should be 0 for the first slice.
1771     * - __u32
1772       - ``header_bit_size``
1773       -
1774     * - __u32
1775       - ``first_mb_in_slice``
1776       -
1777     * - __u8
1778       - ``slice_type``
1779       -
1780     * - __u8
1781       - ``pic_parameter_set_id``
1782       -
1783     * - __u8
1784       - ``colour_plane_id``
1785       -
1786     * - __u8
1787       - ``redundant_pic_cnt``
1788       -
1789     * - __u16
1790       - ``frame_num``
1791       -
1792     * - __u16
1793       - ``idr_pic_id``
1794       -
1795     * - __u16
1796       - ``pic_order_cnt_lsb``
1797       -
1798     * - __s32
1799       - ``delta_pic_order_cnt_bottom``
1800       -
1801     * - __s32
1802       - ``delta_pic_order_cnt0``
1803       -
1804     * - __s32
1805       - ``delta_pic_order_cnt1``
1806       -
1807     * - struct :c:type:`v4l2_h264_pred_weight_table`
1808       - ``pred_weight_table``
1809       -
1810     * - __u32
1811       - ``dec_ref_pic_marking_bit_size``
1812       - Size in bits of the dec_ref_pic_marking() syntax element.
1813     * - __u32
1814       - ``pic_order_cnt_bit_size``
1815       - Combined size in bits of the picture order count related syntax
1816         elements: pic_order_cnt_lsb, delta_pic_order_cnt_bottom,
1817         delta_pic_order_cnt0, and delta_pic_order_cnt1.
1818     * - __u8
1819       - ``cabac_init_idc``
1820       -
1821     * - __s8
1822       - ``slice_qp_delta``
1823       -
1824     * - __s8
1825       - ``slice_qs_delta``
1826       -
1827     * - __u8
1828       - ``disable_deblocking_filter_idc``
1829       -
1830     * - __s8
1831       - ``slice_alpha_c0_offset_div2``
1832       -
1833     * - __s8
1834       - ``slice_beta_offset_div2``
1835       -
1836     * - __u8
1837       - ``num_ref_idx_l0_active_minus1``
1838       - If num_ref_idx_active_override_flag is not set, this field must be
1839         set to the value of num_ref_idx_l0_default_active_minus1.
1840     * - __u8
1841       - ``num_ref_idx_l1_active_minus1``
1842       - If num_ref_idx_active_override_flag is not set, this field must be
1843         set to the value of num_ref_idx_l1_default_active_minus1.
1844     * - __u32
1845       - ``slice_group_change_cycle``
1846       -
1847     * - struct :c:type:`v4l2_h264_reference`
1848       - ``ref_pic_list0[32]``
1849       - Reference picture list after applying the per-slice modifications
1850     * - struct :c:type:`v4l2_h264_reference`
1851       - ``ref_pic_list1[32]``
1852       - Reference picture list after applying the per-slice modifications
1853     * - __u32
1854       - ``flags``
1855       - See :ref:`Slice Parameter Flags <h264_slice_flags>`
1856
1857 .. _h264_slice_flags:
1858
1859 ``Slice Parameter Set Flags``
1860
1861 .. cssclass:: longtable
1862
1863 .. flat-table::
1864     :header-rows:  0
1865     :stub-columns: 0
1866     :widths:       1 1 2
1867
1868     * - ``V4L2_H264_SLICE_FLAG_FIELD_PIC``
1869       - 0x00000001
1870       -
1871     * - ``V4L2_H264_SLICE_FLAG_BOTTOM_FIELD``
1872       - 0x00000002
1873       -
1874     * - ``V4L2_H264_SLICE_FLAG_DIRECT_SPATIAL_MV_PRED``
1875       - 0x00000004
1876       -
1877     * - ``V4L2_H264_SLICE_FLAG_SP_FOR_SWITCH``
1878       - 0x00000008
1879       -
1880
1881 ``V4L2_CID_MPEG_VIDEO_H264_PRED_WEIGHTS (struct)``
1882     Prediction weight table defined according to :ref:`h264`,
1883     section 7.4.3.2 "Prediction Weight Table Semantics".
1884     The prediction weight table must be passed by applications
1885     under the conditions explained in section 7.3.3 "Slice header
1886     syntax".
1887
1888     .. note::
1889
1890        This compound control is not yet part of the public kernel API and
1891        it is expected to change.
1892
1893 .. c:type:: v4l2_ctrl_h264_pred_weights
1894
1895 .. cssclass:: longtable
1896
1897 .. flat-table:: struct v4l2_ctrl_h264_pred_weights
1898     :header-rows:  0
1899     :stub-columns: 0
1900     :widths:       1 1 2
1901
1902     * - __u16
1903       - ``luma_log2_weight_denom``
1904       -
1905     * - __u16
1906       - ``chroma_log2_weight_denom``
1907       -
1908     * - struct :c:type:`v4l2_h264_weight_factors`
1909       - ``weight_factors[2]``
1910       - The weight factors at index 0 are the weight factors for the reference
1911         list 0, the one at index 1 for the reference list 1.
1912
1913 .. c:type:: v4l2_h264_weight_factors
1914
1915 .. cssclass:: longtable
1916
1917 .. flat-table:: struct v4l2_h264_weight_factors
1918     :header-rows:  0
1919     :stub-columns: 0
1920     :widths:       1 1 2
1921
1922     * - __s16
1923       - ``luma_weight[32]``
1924       -
1925     * - __s16
1926       - ``luma_offset[32]``
1927       -
1928     * - __s16
1929       - ``chroma_weight[32][2]``
1930       -
1931     * - __s16
1932       - ``chroma_offset[32][2]``
1933       -
1934
1935 ``Picture Reference``
1936
1937 .. c:type:: v4l2_h264_reference
1938
1939 .. cssclass:: longtable
1940
1941 .. flat-table:: struct v4l2_h264_reference
1942     :header-rows:  0
1943     :stub-columns: 0
1944     :widths:       1 1 2
1945
1946     * - __u8
1947       - ``fields``
1948       - Specifies how the picture is referenced. See :ref:`Reference Fields <h264_ref_fields>`
1949     * - __u8
1950       - ``index``
1951       - Index into the :c:type:`v4l2_ctrl_h264_decode_params`.dpb array.
1952
1953 .. _h264_ref_fields:
1954
1955 ``Reference Fields``
1956
1957 .. cssclass:: longtable
1958
1959 .. flat-table::
1960     :header-rows:  0
1961     :stub-columns: 0
1962     :widths:       1 1 2
1963
1964     * - ``V4L2_H264_TOP_FIELD_REF``
1965       - 0x1
1966       - The top field in field pair is used for short-term reference.
1967     * - ``V4L2_H264_BOTTOM_FIELD_REF``
1968       - 0x2
1969       - The bottom field in field pair is used for short-term reference.
1970     * - ``V4L2_H264_FRAME_REF``
1971       - 0x3
1972       - The frame (or the top/bottom fields, if it's a field pair)
1973         is used for short-term reference.
1974
1975 ``V4L2_CID_MPEG_VIDEO_H264_DECODE_PARAMS (struct)``
1976     Specifies the decode parameters (as extracted from the bitstream)
1977     for the associated H264 slice data. This includes the necessary
1978     parameters for configuring a stateless hardware decoding pipeline
1979     for H264. The bitstream parameters are defined according to
1980     :ref:`h264`. For further documentation, refer to the above
1981     specification, unless there is an explicit comment stating
1982     otherwise.
1983
1984     .. note::
1985
1986        This compound control is not yet part of the public kernel API and
1987        it is expected to change.
1988
1989 .. c:type:: v4l2_ctrl_h264_decode_params
1990
1991 .. cssclass:: longtable
1992
1993 .. flat-table:: struct v4l2_ctrl_h264_decode_params
1994     :header-rows:  0
1995     :stub-columns: 0
1996     :widths:       1 1 2
1997
1998     * - struct :c:type:`v4l2_h264_dpb_entry`
1999       - ``dpb[16]``
2000       -
2001     * - __u16
2002       - ``num_slices``
2003       - Number of slices needed to decode the current frame/field. When
2004         operating in slice-based decoding mode (see
2005         :c:type:`v4l2_mpeg_video_h264_decode_mode`), this field
2006         should always be set to one.
2007     * - __u16
2008       - ``nal_ref_idc``
2009       - NAL reference ID value coming from the NAL Unit header
2010     * - __s32
2011       - ``top_field_order_cnt``
2012       - Picture Order Count for the coded top field
2013     * - __s32
2014       - ``bottom_field_order_cnt``
2015       - Picture Order Count for the coded bottom field
2016     * - __u32
2017       - ``flags``
2018       - See :ref:`Decode Parameters Flags <h264_decode_params_flags>`
2019
2020 .. _h264_decode_params_flags:
2021
2022 ``Decode Parameters Flags``
2023
2024 .. cssclass:: longtable
2025
2026 .. flat-table::
2027     :header-rows:  0
2028     :stub-columns: 0
2029     :widths:       1 1 2
2030
2031     * - ``V4L2_H264_DECODE_PARAM_FLAG_IDR_PIC``
2032       - 0x00000001
2033       - That picture is an IDR picture
2034
2035 .. c:type:: v4l2_h264_dpb_entry
2036
2037 .. cssclass:: longtable
2038
2039 .. flat-table:: struct v4l2_h264_dpb_entry
2040     :header-rows:  0
2041     :stub-columns: 0
2042     :widths:       1 1 2
2043
2044     * - __u64
2045       - ``reference_ts``
2046       - Timestamp of the V4L2 capture buffer to use as reference, used
2047         with B-coded and P-coded frames. The timestamp refers to the
2048         ``timestamp`` field in struct :c:type:`v4l2_buffer`. Use the
2049         :c:func:`v4l2_timeval_to_ns()` function to convert the struct
2050         :c:type:`timeval` in struct :c:type:`v4l2_buffer` to a __u64.
2051     * - __u32
2052       - ``pic_num``
2053       -
2054     * - __u16
2055       - ``frame_num``
2056       -
2057     * - __u8
2058       - ``fields``
2059       - Specifies how the DPB entry is referenced. See :ref:`Reference Fields <h264_ref_fields>`
2060     * - __u8
2061       - ``reserved[5]``
2062       - Applications and drivers must set this to zero.
2063     * - __s32
2064       - ``top_field_order_cnt``
2065       -
2066     * - __s32
2067       - ``bottom_field_order_cnt``
2068       -
2069     * - __u32
2070       - ``flags``
2071       - See :ref:`DPB Entry Flags <h264_dpb_flags>`
2072
2073 .. _h264_dpb_flags:
2074
2075 ``DPB Entries Flags``
2076
2077 .. cssclass:: longtable
2078
2079 .. flat-table::
2080     :header-rows:  0
2081     :stub-columns: 0
2082     :widths:       1 1 2
2083
2084     * - ``V4L2_H264_DPB_ENTRY_FLAG_VALID``
2085       - 0x00000001
2086       - The DPB entry is valid (non-empty) and should be considered.
2087     * - ``V4L2_H264_DPB_ENTRY_FLAG_ACTIVE``
2088       - 0x00000002
2089       - The DPB entry is used for reference.
2090     * - ``V4L2_H264_DPB_ENTRY_FLAG_LONG_TERM``
2091       - 0x00000004
2092       - The DPB entry is used for long-term reference.
2093     * - ``V4L2_H264_DPB_ENTRY_FLAG_FIELD``
2094       - 0x00000008
2095       - The DPB entry is a single field or a complementary field pair.
2096
2097 ``V4L2_CID_MPEG_VIDEO_H264_DECODE_MODE (enum)``
2098     Specifies the decoding mode to use. Currently exposes slice-based and
2099     frame-based decoding but new modes might be added later on.
2100     This control is used as a modifier for V4L2_PIX_FMT_H264_SLICE
2101     pixel format. Applications that support V4L2_PIX_FMT_H264_SLICE
2102     are required to set this control in order to specify the decoding mode
2103     that is expected for the buffer.
2104     Drivers may expose a single or multiple decoding modes, depending
2105     on what they can support.
2106
2107     .. note::
2108
2109        This menu control is not yet part of the public kernel API and
2110        it is expected to change.
2111
2112 .. c:type:: v4l2_mpeg_video_h264_decode_mode
2113
2114 .. cssclass:: longtable
2115
2116 .. flat-table::
2117     :header-rows:  0
2118     :stub-columns: 0
2119     :widths:       1 1 2
2120
2121     * - ``V4L2_MPEG_VIDEO_H264_DECODE_MODE_SLICE_BASED``
2122       - 0
2123       - Decoding is done at the slice granularity.
2124         In this mode, ``num_slices`` field in struct
2125         :c:type:`v4l2_ctrl_h264_decode_params` should be set to 1,
2126         and ``start_byte_offset`` in struct
2127         :c:type:`v4l2_ctrl_h264_slice_params` should be set to 0.
2128         The OUTPUT buffer must contain a single slice.
2129     * - ``V4L2_MPEG_VIDEO_H264_DECODE_MODE_FRAME_BASED``
2130       - 1
2131       - Decoding is done at the frame granularity.
2132         In this mode, ``num_slices`` field in struct
2133         :c:type:`v4l2_ctrl_h264_decode_params` should be set to the number
2134         of slices in the frame, and ``start_byte_offset`` in struct
2135         :c:type:`v4l2_ctrl_h264_slice_params` should be set accordingly
2136         for each slice. For the first slice, ``start_byte_offset`` should
2137         be zero.
2138         The OUTPUT buffer must contain all slices needed to decode the
2139         frame. The OUTPUT buffer must also contain both fields.
2140
2141 ``V4L2_CID_MPEG_VIDEO_H264_START_CODE (enum)``
2142     Specifies the H264 slice start code expected for each slice.
2143     This control is used as a modifier for V4L2_PIX_FMT_H264_SLICE
2144     pixel format. Applications that support V4L2_PIX_FMT_H264_SLICE
2145     are required to set this control in order to specify the start code
2146     that is expected for the buffer.
2147     Drivers may expose a single or multiple start codes, depending
2148     on what they can support.
2149
2150     .. note::
2151
2152        This menu control is not yet part of the public kernel API and
2153        it is expected to change.
2154
2155 .. c:type:: v4l2_mpeg_video_h264_start_code
2156
2157 .. cssclass:: longtable
2158
2159 .. flat-table::
2160     :header-rows:  0
2161     :stub-columns: 0
2162     :widths:       1 1 2
2163
2164     * - ``V4L2_MPEG_VIDEO_H264_START_CODE_NONE``
2165       - 0
2166       - Selecting this value specifies that H264 slices are passed
2167         to the driver without any start code.
2168     * - ``V4L2_MPEG_VIDEO_H264_START_CODE_ANNEX_B``
2169       - 1
2170       - Selecting this value specifies that H264 slices are expected
2171         to be prefixed by Annex B start codes. According to :ref:`h264`
2172         valid start codes can be 3-bytes 0x000001 or 4-bytes 0x00000001.
2173
2174 .. _v4l2-mpeg-mpeg2:
2175
2176 ``V4L2_CID_MPEG_VIDEO_MPEG2_SLICE_PARAMS (struct)``
2177     Specifies the slice parameters (as extracted from the bitstream) for the
2178     associated MPEG-2 slice data. This includes the necessary parameters for
2179     configuring a stateless hardware decoding pipeline for MPEG-2.
2180     The bitstream parameters are defined according to :ref:`mpeg2part2`.
2181
2182     .. note::
2183
2184        This compound control is not yet part of the public kernel API and
2185        it is expected to change.
2186
2187 .. c:type:: v4l2_ctrl_mpeg2_slice_params
2188
2189 .. cssclass:: longtable
2190
2191 .. tabularcolumns:: |p{5.8cm}|p{4.8cm}|p{6.6cm}|
2192
2193 .. flat-table:: struct v4l2_ctrl_mpeg2_slice_params
2194     :header-rows:  0
2195     :stub-columns: 0
2196     :widths:       1 1 2
2197
2198     * - __u32
2199       - ``bit_size``
2200       - Size (in bits) of the current slice data.
2201     * - __u32
2202       - ``data_bit_offset``
2203       - Offset (in bits) to the video data in the current slice data.
2204     * - struct :c:type:`v4l2_mpeg2_sequence`
2205       - ``sequence``
2206       - Structure with MPEG-2 sequence metadata, merging relevant fields from
2207         the sequence header and sequence extension parts of the bitstream.
2208     * - struct :c:type:`v4l2_mpeg2_picture`
2209       - ``picture``
2210       - Structure with MPEG-2 picture metadata, merging relevant fields from
2211         the picture header and picture coding extension parts of the bitstream.
2212     * - __u64
2213       - ``backward_ref_ts``
2214       - Timestamp of the V4L2 capture buffer to use as backward reference, used
2215         with B-coded and P-coded frames. The timestamp refers to the
2216         ``timestamp`` field in struct :c:type:`v4l2_buffer`. Use the
2217         :c:func:`v4l2_timeval_to_ns()` function to convert the struct
2218         :c:type:`timeval` in struct :c:type:`v4l2_buffer` to a __u64.
2219     * - __u64
2220       - ``forward_ref_ts``
2221       - Timestamp for the V4L2 capture buffer to use as forward reference, used
2222         with B-coded frames. The timestamp refers to the ``timestamp`` field in
2223         struct :c:type:`v4l2_buffer`. Use the :c:func:`v4l2_timeval_to_ns()`
2224         function to convert the struct :c:type:`timeval` in struct
2225         :c:type:`v4l2_buffer` to a __u64.
2226     * - __u32
2227       - ``quantiser_scale_code``
2228       - Code used to determine the quantization scale to use for the IDCT.
2229
2230 .. c:type:: v4l2_mpeg2_sequence
2231
2232 .. cssclass:: longtable
2233
2234 .. tabularcolumns:: |p{1.5cm}|p{6.3cm}|p{9.4cm}|
2235
2236 .. flat-table:: struct v4l2_mpeg2_sequence
2237     :header-rows:  0
2238     :stub-columns: 0
2239     :widths:       1 1 2
2240
2241     * - __u16
2242       - ``horizontal_size``
2243       - The width of the displayable part of the frame's luminance component.
2244     * - __u16
2245       - ``vertical_size``
2246       - The height of the displayable part of the frame's luminance component.
2247     * - __u32
2248       - ``vbv_buffer_size``
2249       - Used to calculate the required size of the video buffering verifier,
2250         defined (in bits) as: 16 * 1024 * vbv_buffer_size.
2251     * - __u16
2252       - ``profile_and_level_indication``
2253       - The current profile and level indication as extracted from the
2254         bitstream.
2255     * - __u8
2256       - ``progressive_sequence``
2257       - Indication that all the frames for the sequence are progressive instead
2258         of interlaced.
2259     * - __u8
2260       - ``chroma_format``
2261       - The chrominance sub-sampling format (1: 4:2:0, 2: 4:2:2, 3: 4:4:4).
2262
2263 .. c:type:: v4l2_mpeg2_picture
2264
2265 .. cssclass:: longtable
2266
2267 .. tabularcolumns:: |p{1.5cm}|p{6.3cm}|p{9.4cm}|
2268
2269 .. flat-table:: struct v4l2_mpeg2_picture
2270     :header-rows:  0
2271     :stub-columns: 0
2272     :widths:       1 1 2
2273
2274     * - __u8
2275       - ``picture_coding_type``
2276       - Picture coding type for the frame covered by the current slice
2277         (V4L2_MPEG2_PICTURE_CODING_TYPE_I, V4L2_MPEG2_PICTURE_CODING_TYPE_P or
2278         V4L2_MPEG2_PICTURE_CODING_TYPE_B).
2279     * - __u8
2280       - ``f_code[2][2]``
2281       - Motion vector codes.
2282     * - __u8
2283       - ``intra_dc_precision``
2284       - Precision of Discrete Cosine transform (0: 8 bits precision,
2285         1: 9 bits precision, 2: 10 bits precision, 3: 11 bits precision).
2286     * - __u8
2287       - ``picture_structure``
2288       - Picture structure (1: interlaced top field, 2: interlaced bottom field,
2289         3: progressive frame).
2290     * - __u8
2291       - ``top_field_first``
2292       - If set to 1 and interlaced stream, top field is output first.
2293     * - __u8
2294       - ``frame_pred_frame_dct``
2295       - If set to 1, only frame-DCT and frame prediction are used.
2296     * - __u8
2297       - ``concealment_motion_vectors``
2298       -  If set to 1, motion vectors are coded for intra macroblocks.
2299     * - __u8
2300       - ``q_scale_type``
2301       - This flag affects the inverse quantization process.
2302     * - __u8
2303       - ``intra_vlc_format``
2304       - This flag affects the decoding of transform coefficient data.
2305     * - __u8
2306       - ``alternate_scan``
2307       - This flag affects the decoding of transform coefficient data.
2308     * - __u8
2309       - ``repeat_first_field``
2310       - This flag affects the decoding process of progressive frames.
2311     * - __u16
2312       - ``progressive_frame``
2313       - Indicates whether the current frame is progressive.
2314
2315 ``V4L2_CID_MPEG_VIDEO_MPEG2_QUANTIZATION (struct)``
2316     Specifies quantization matrices (as extracted from the bitstream) for the
2317     associated MPEG-2 slice data.
2318
2319     .. note::
2320
2321        This compound control is not yet part of the public kernel API and
2322        it is expected to change.
2323
2324 .. c:type:: v4l2_ctrl_mpeg2_quantization
2325
2326 .. cssclass:: longtable
2327
2328 .. tabularcolumns:: |p{1.2cm}|p{8.0cm}|p{7.4cm}|
2329
2330 .. raw:: latex
2331
2332     \small
2333
2334 .. flat-table:: struct v4l2_ctrl_mpeg2_quantization
2335     :header-rows:  0
2336     :stub-columns: 0
2337     :widths:       1 1 2
2338
2339     * - __u8
2340       - ``load_intra_quantiser_matrix``
2341       - One bit to indicate whether to load the ``intra_quantiser_matrix`` data.
2342     * - __u8
2343       - ``load_non_intra_quantiser_matrix``
2344       - One bit to indicate whether to load the ``non_intra_quantiser_matrix``
2345         data.
2346     * - __u8
2347       - ``load_chroma_intra_quantiser_matrix``
2348       - One bit to indicate whether to load the
2349         ``chroma_intra_quantiser_matrix`` data, only relevant for non-4:2:0 YUV
2350         formats.
2351     * - __u8
2352       - ``load_chroma_non_intra_quantiser_matrix``
2353       - One bit to indicate whether to load the
2354         ``chroma_non_intra_quantiser_matrix`` data, only relevant for non-4:2:0
2355         YUV formats.
2356     * - __u8
2357       - ``intra_quantiser_matrix[64]``
2358       - The quantization matrix coefficients for intra-coded frames, in zigzag
2359         scanning order. It is relevant for both luma and chroma components,
2360         although it can be superseded by the chroma-specific matrix for
2361         non-4:2:0 YUV formats.
2362     * - __u8
2363       - ``non_intra_quantiser_matrix[64]``
2364       - The quantization matrix coefficients for non-intra-coded frames, in
2365         zigzag scanning order. It is relevant for both luma and chroma
2366         components, although it can be superseded by the chroma-specific matrix
2367         for non-4:2:0 YUV formats.
2368     * - __u8
2369       - ``chroma_intra_quantiser_matrix[64]``
2370       - The quantization matrix coefficients for the chominance component of
2371         intra-coded frames, in zigzag scanning order. Only relevant for
2372         non-4:2:0 YUV formats.
2373     * - __u8
2374       - ``chroma_non_intra_quantiser_matrix[64]``
2375       - The quantization matrix coefficients for the chrominance component of
2376         non-intra-coded frames, in zigzag scanning order. Only relevant for
2377         non-4:2:0 YUV formats.
2378
2379 ``V4L2_CID_FWHT_I_FRAME_QP (integer)``
2380     Quantization parameter for an I frame for FWHT. Valid range: from 1
2381     to 31.
2382
2383 ``V4L2_CID_FWHT_P_FRAME_QP (integer)``
2384     Quantization parameter for a P frame for FWHT. Valid range: from 1
2385     to 31.
2386
2387 .. _v4l2-mpeg-vp8:
2388
2389 ``V4L2_CID_MPEG_VIDEO_VP8_FRAME_HEADER (struct)``
2390     Specifies the frame parameters for the associated VP8 parsed frame data.
2391     This includes the necessary parameters for
2392     configuring a stateless hardware decoding pipeline for VP8.
2393     The bitstream parameters are defined according to :ref:`vp8`.
2394
2395     .. note::
2396
2397        This compound control is not yet part of the public kernel API and
2398        it is expected to change.
2399
2400 .. c:type:: v4l2_ctrl_vp8_frame_header
2401
2402 .. cssclass:: longtable
2403
2404 .. tabularcolumns:: |p{5.8cm}|p{4.8cm}|p{6.6cm}|
2405
2406 .. flat-table:: struct v4l2_ctrl_vp8_frame_header
2407     :header-rows:  0
2408     :stub-columns: 0
2409     :widths:       1 1 2
2410
2411     * - struct :c:type:`v4l2_vp8_segment_header`
2412       - ``segment_header``
2413       - Structure with segment-based adjustments metadata.
2414     * - struct :c:type:`v4l2_vp8_loopfilter_header`
2415       - ``loopfilter_header``
2416       - Structure with loop filter level adjustments metadata.
2417     * - struct :c:type:`v4l2_vp8_quantization_header`
2418       - ``quant_header``
2419       - Structure with VP8 dequantization indices metadata.
2420     * - struct :c:type:`v4l2_vp8_entropy_header`
2421       - ``entropy_header``
2422       - Structure with VP8 entropy coder probabilities metadata.
2423     * - struct :c:type:`v4l2_vp8_entropy_coder_state`
2424       - ``coder_state``
2425       - Structure with VP8 entropy coder state.
2426     * - __u16
2427       - ``width``
2428       - The width of the frame. Must be set for all frames.
2429     * - __u16
2430       - ``height``
2431       - The height of the frame. Must be set for all frames.
2432     * - __u8
2433       - ``horizontal_scale``
2434       - Horizontal scaling factor.
2435     * - __u8
2436       - ``vertical_scaling factor``
2437       - Vertical scale.
2438     * - __u8
2439       - ``version``
2440       - Bitstream version.
2441     * - __u8
2442       - ``prob_skip_false``
2443       - Indicates the probability that the macroblock is not skipped.
2444     * - __u8
2445       - ``prob_intra``
2446       - Indicates the probability that a macroblock is intra-predicted.
2447     * - __u8
2448       - ``prob_last``
2449       - Indicates the probability that the last reference frame is used
2450         for inter-prediction
2451     * - __u8
2452       - ``prob_gf``
2453       - Indicates the probability that the golden reference frame is used
2454         for inter-prediction
2455     * - __u8
2456       - ``num_dct_parts``
2457       - Number of DCT coefficients partitions. Must be one of: 1, 2, 4, or 8.
2458     * - __u32
2459       - ``first_part_size``
2460       - Size of the first partition, i.e. the control partition.
2461     * - __u32
2462       - ``first_part_header_bits``
2463       - Size in bits of the first partition header portion.
2464     * - __u32
2465       - ``dct_part_sizes[8]``
2466       - DCT coefficients sizes.
2467     * - __u64
2468       - ``last_frame_ts``
2469       - Timestamp for the V4L2 capture buffer to use as last reference frame, used
2470         with inter-coded frames. The timestamp refers to the ``timestamp`` field in
2471         struct :c:type:`v4l2_buffer`. Use the :c:func:`v4l2_timeval_to_ns()`
2472         function to convert the struct :c:type:`timeval` in struct
2473         :c:type:`v4l2_buffer` to a __u64.
2474     * - __u64
2475       - ``golden_frame_ts``
2476       - Timestamp for the V4L2 capture buffer to use as last reference frame, used
2477         with inter-coded frames. The timestamp refers to the ``timestamp`` field in
2478         struct :c:type:`v4l2_buffer`. Use the :c:func:`v4l2_timeval_to_ns()`
2479         function to convert the struct :c:type:`timeval` in struct
2480         :c:type:`v4l2_buffer` to a __u64.
2481     * - __u64
2482       - ``alt_frame_ts``
2483       - Timestamp for the V4L2 capture buffer to use as alternate reference frame, used
2484         with inter-coded frames. The timestamp refers to the ``timestamp`` field in
2485         struct :c:type:`v4l2_buffer`. Use the :c:func:`v4l2_timeval_to_ns()`
2486         function to convert the struct :c:type:`timeval` in struct
2487         :c:type:`v4l2_buffer` to a __u64.
2488     * - __u64
2489       - ``flags``
2490       - See :ref:`Frame Header Flags <vp8_frame_header_flags>`
2491
2492 .. _vp8_frame_header_flags:
2493
2494 ``Frame Header Flags``
2495
2496 .. cssclass:: longtable
2497
2498 .. flat-table::
2499     :header-rows:  0
2500     :stub-columns: 0
2501     :widths:       1 1 2
2502
2503     * - ``V4L2_VP8_FRAME_HEADER_FLAG_KEY_FRAME``
2504       - 0x01
2505       - Indicates if the frame is a key frame.
2506     * - ``V4L2_VP8_FRAME_HEADER_FLAG_EXPERIMENTAL``
2507       - 0x02
2508       - Experimental bitstream.
2509     * - ``V4L2_VP8_FRAME_HEADER_FLAG_SHOW_FRAME``
2510       - 0x04
2511       - Show frame flag, indicates if the frame is for display.
2512     * - ``V4L2_VP8_FRAME_HEADER_FLAG_MB_NO_SKIP_COEFF``
2513       - 0x08
2514       - Enable/disable skipping of macroblocks with no non-zero coefficients.
2515     * - ``V4L2_VP8_FRAME_HEADER_FLAG_SIGN_BIAS_GOLDEN``
2516       - 0x10
2517       - Sign of motion vectors when the golden frame is referenced.
2518     * - ``V4L2_VP8_FRAME_HEADER_FLAG_SIGN_BIAS_ALT``
2519       - 0x20
2520       - Sign of motion vectors when the alt frame is referenced.
2521
2522 .. c:type:: v4l2_vp8_entropy_coder_state
2523
2524 .. cssclass:: longtable
2525
2526 .. tabularcolumns:: |p{1.5cm}|p{6.3cm}|p{9.4cm}|
2527
2528 .. flat-table:: struct v4l2_vp8_entropy_coder_state
2529     :header-rows:  0
2530     :stub-columns: 0
2531     :widths:       1 1 2
2532
2533     * - __u8
2534       - ``range``
2535       -
2536     * - __u8
2537       - ``value``
2538       -
2539     * - __u8
2540       - ``bit_count``
2541       -
2542     * - __u8
2543       - ``padding``
2544       - Applications and drivers must set this to zero.
2545
2546 .. c:type:: v4l2_vp8_segment_header
2547
2548 .. cssclass:: longtable
2549
2550 .. tabularcolumns:: |p{1.5cm}|p{6.3cm}|p{9.4cm}|
2551
2552 .. flat-table:: struct v4l2_vp8_segment_header
2553     :header-rows:  0
2554     :stub-columns: 0
2555     :widths:       1 1 2
2556
2557     * - __s8
2558       - ``quant_update[4]``
2559       - Signed quantizer value update.
2560     * - __s8
2561       - ``lf_update[4]``
2562       - Signed loop filter level value update.
2563     * - __u8
2564       - ``segment_probs[3]``
2565       - Segment probabilities.
2566     * - __u8
2567       - ``padding``
2568       - Applications and drivers must set this to zero.
2569     * - __u32
2570       - ``flags``
2571       - See :ref:`Segment Header Flags <vp8_segment_header_flags>`
2572
2573 .. _vp8_segment_header_flags:
2574
2575 ``Segment Header Flags``
2576
2577 .. cssclass:: longtable
2578
2579 .. flat-table::
2580     :header-rows:  0
2581     :stub-columns: 0
2582     :widths:       1 1 2
2583
2584     * - ``V4L2_VP8_SEGMENT_HEADER_FLAG_ENABLED``
2585       - 0x01
2586       - Enable/disable segment-based adjustments.
2587     * - ``V4L2_VP8_SEGMENT_HEADER_FLAG_UPDATE_MAP``
2588       - 0x02
2589       - Indicates if the macroblock segmentation map is updated in this frame.
2590     * - ``V4L2_VP8_SEGMENT_HEADER_FLAG_UPDATE_FEATURE_DATA``
2591       - 0x04
2592       - Indicates if the segment feature data is updated in this frame.
2593     * - ``V4L2_VP8_SEGMENT_HEADER_FLAG_DELTA_VALUE_MODE``
2594       - 0x08
2595       - If is set, the segment feature data mode is delta-value.
2596         If cleared, it's absolute-value.
2597
2598 .. c:type:: v4l2_vp8_loopfilter_header
2599
2600 .. cssclass:: longtable
2601
2602 .. tabularcolumns:: |p{1.5cm}|p{6.3cm}|p{9.4cm}|
2603
2604 .. flat-table:: struct v4l2_vp8_loopfilter_header
2605     :header-rows:  0
2606     :stub-columns: 0
2607     :widths:       1 1 2
2608
2609     * - __s8
2610       - ``ref_frm_delta[4]``
2611       - Reference adjustment (signed) delta value.
2612     * - __s8
2613       - ``mb_mode_delta[4]``
2614       - Macroblock prediction mode adjustment (signed) delta value.
2615     * - __u8
2616       - ``sharpness_level``
2617       - Sharpness level
2618     * - __u8
2619       - ``level``
2620       - Filter level
2621     * - __u16
2622       - ``padding``
2623       - Applications and drivers must set this to zero.
2624     * - __u32
2625       - ``flags``
2626       - See :ref:`Loopfilter Header Flags <vp8_loopfilter_header_flags>`
2627
2628 .. _vp8_loopfilter_header_flags:
2629
2630 ``Loopfilter Header Flags``
2631
2632 .. cssclass:: longtable
2633
2634 .. flat-table::
2635     :header-rows:  0
2636     :stub-columns: 0
2637     :widths:       1 1 2
2638
2639     * - ``V4L2_VP8_LF_HEADER_ADJ_ENABLE``
2640       - 0x01
2641       - Enable/disable macroblock-level loop filter adjustment.
2642     * - ``V4L2_VP8_LF_HEADER_DELTA_UPDATE``
2643       - 0x02
2644       - Indicates if the delta values used in an adjustment are updated.
2645     * - ``V4L2_VP8_LF_FILTER_TYPE_SIMPLE``
2646       - 0x04
2647       - If set, indicates the filter type is simple.
2648         If cleared, the filter type is normal.
2649
2650 .. c:type:: v4l2_vp8_quantization_header
2651
2652 .. cssclass:: longtable
2653
2654 .. tabularcolumns:: |p{1.5cm}|p{6.3cm}|p{9.4cm}|
2655
2656 .. flat-table:: struct v4l2_vp8_quantization_header
2657     :header-rows:  0
2658     :stub-columns: 0
2659     :widths:       1 1 2
2660
2661     * - __u8
2662       - ``y_ac_qi``
2663       - Luma AC coefficient table index.
2664     * - __s8
2665       - ``y_dc_delta``
2666       - Luma DC delta vaue.
2667     * - __s8
2668       - ``y2_dc_delta``
2669       - Y2 block DC delta value.
2670     * - __s8
2671       - ``y2_ac_delta``
2672       - Y2 block AC delta value.
2673     * - __s8
2674       - ``uv_dc_delta``
2675       - Chroma DC delta value.
2676     * - __s8
2677       - ``uv_ac_delta``
2678       - Chroma AC delta value.
2679     * - __u16
2680       - ``padding``
2681       - Applications and drivers must set this to zero.
2682
2683 .. c:type:: v4l2_vp8_entropy_header
2684
2685 .. cssclass:: longtable
2686
2687 .. tabularcolumns:: |p{1.5cm}|p{6.3cm}|p{9.4cm}|
2688
2689 .. flat-table:: struct v4l2_vp8_entropy_header
2690     :header-rows:  0
2691     :stub-columns: 0
2692     :widths:       1 1 2
2693
2694     * - __u8
2695       - ``coeff_probs[4][8][3][11]``
2696       - Coefficient update probabilities.
2697     * - __u8
2698       - ``y_mode_probs[4]``
2699       - Luma mode update probabilities.
2700     * - __u8
2701       - ``uv_mode_probs[3]``
2702       - Chroma mode update probabilities.
2703     * - __u8
2704       - ``mv_probs[2][19]``
2705       - MV decoding update probabilities.
2706     * - __u8
2707       - ``padding[3]``
2708       - Applications and drivers must set this to zero.
2709
2710 .. raw:: latex
2711
2712     \normalsize
2713
2714
2715 MFC 5.1 MPEG Controls
2716 =====================
2717
2718 The following MPEG class controls deal with MPEG decoding and encoding
2719 settings that are specific to the Multi Format Codec 5.1 device present
2720 in the S5P family of SoCs by Samsung.
2721
2722
2723 .. _mfc51-control-id:
2724
2725 MFC 5.1 Control IDs
2726 -------------------
2727
2728 ``V4L2_CID_MPEG_MFC51_VIDEO_DECODER_H264_DISPLAY_DELAY_ENABLE (boolean)``
2729     If the display delay is enabled then the decoder is forced to return
2730     a CAPTURE buffer (decoded frame) after processing a certain number
2731     of OUTPUT buffers. The delay can be set through
2732     ``V4L2_CID_MPEG_MFC51_VIDEO_DECODER_H264_DISPLAY_DELAY``. This
2733     feature can be used for example for generating thumbnails of videos.
2734     Applicable to the H264 decoder.
2735
2736 ``V4L2_CID_MPEG_MFC51_VIDEO_DECODER_H264_DISPLAY_DELAY (integer)``
2737     Display delay value for H264 decoder. The decoder is forced to
2738     return a decoded frame after the set 'display delay' number of
2739     frames. If this number is low it may result in frames returned out
2740     of display order, in addition the hardware may still be using the
2741     returned buffer as a reference picture for subsequent frames.
2742
2743 ``V4L2_CID_MPEG_MFC51_VIDEO_H264_NUM_REF_PIC_FOR_P (integer)``
2744     The number of reference pictures used for encoding a P picture.
2745     Applicable to the H264 encoder.
2746
2747 ``V4L2_CID_MPEG_MFC51_VIDEO_PADDING (boolean)``
2748     Padding enable in the encoder - use a color instead of repeating
2749     border pixels. Applicable to encoders.
2750
2751 ``V4L2_CID_MPEG_MFC51_VIDEO_PADDING_YUV (integer)``
2752     Padding color in the encoder. Applicable to encoders. The supplied
2753     32-bit integer is interpreted as follows (bit 0 = least significant
2754     bit):
2755
2756
2757
2758 .. flat-table::
2759     :header-rows:  0
2760     :stub-columns: 0
2761
2762     * - Bit 0:7
2763       - V chrominance information
2764     * - Bit 8:15
2765       - U chrominance information
2766     * - Bit 16:23
2767       - Y luminance information
2768     * - Bit 24:31
2769       - Must be zero.
2770
2771
2772
2773 ``V4L2_CID_MPEG_MFC51_VIDEO_RC_REACTION_COEFF (integer)``
2774     Reaction coefficient for MFC rate control. Applicable to encoders.
2775
2776     .. note::
2777
2778        #. Valid only when the frame level RC is enabled.
2779
2780        #. For tight CBR, this field must be small (ex. 2 ~ 10). For
2781           VBR, this field must be large (ex. 100 ~ 1000).
2782
2783        #. It is not recommended to use the greater number than
2784           FRAME_RATE * (10^9 / BIT_RATE).
2785
2786 ``V4L2_CID_MPEG_MFC51_VIDEO_H264_ADAPTIVE_RC_DARK (boolean)``
2787     Adaptive rate control for dark region. Valid only when H.264 and
2788     macroblock level RC is enabled
2789     (``V4L2_CID_MPEG_VIDEO_MB_RC_ENABLE``). Applicable to the H264
2790     encoder.
2791
2792 ``V4L2_CID_MPEG_MFC51_VIDEO_H264_ADAPTIVE_RC_SMOOTH (boolean)``
2793     Adaptive rate control for smooth region. Valid only when H.264 and
2794     macroblock level RC is enabled
2795     (``V4L2_CID_MPEG_VIDEO_MB_RC_ENABLE``). Applicable to the H264
2796     encoder.
2797
2798 ``V4L2_CID_MPEG_MFC51_VIDEO_H264_ADAPTIVE_RC_STATIC (boolean)``
2799     Adaptive rate control for static region. Valid only when H.264 and
2800     macroblock level RC is enabled
2801     (``V4L2_CID_MPEG_VIDEO_MB_RC_ENABLE``). Applicable to the H264
2802     encoder.
2803
2804 ``V4L2_CID_MPEG_MFC51_VIDEO_H264_ADAPTIVE_RC_ACTIVITY (boolean)``
2805     Adaptive rate control for activity region. Valid only when H.264 and
2806     macroblock level RC is enabled
2807     (``V4L2_CID_MPEG_VIDEO_MB_RC_ENABLE``). Applicable to the H264
2808     encoder.
2809
2810 .. _v4l2-mpeg-mfc51-video-frame-skip-mode:
2811
2812 ``V4L2_CID_MPEG_MFC51_VIDEO_FRAME_SKIP_MODE``
2813     (enum)
2814
2815 enum v4l2_mpeg_mfc51_video_frame_skip_mode -
2816     Indicates in what conditions the encoder should skip frames. If
2817     encoding a frame would cause the encoded stream to be larger then a
2818     chosen data limit then the frame will be skipped. Possible values
2819     are:
2820
2821
2822 .. tabularcolumns:: |p{9.2cm}|p{8.3cm}|
2823
2824 .. raw:: latex
2825
2826     \small
2827
2828 .. flat-table::
2829     :header-rows:  0
2830     :stub-columns: 0
2831
2832     * - ``V4L2_MPEG_MFC51_FRAME_SKIP_MODE_DISABLED``
2833       - Frame skip mode is disabled.
2834     * - ``V4L2_MPEG_MFC51_FRAME_SKIP_MODE_LEVEL_LIMIT``
2835       - Frame skip mode enabled and buffer limit is set by the chosen
2836         level and is defined by the standard.
2837     * - ``V4L2_MPEG_MFC51_FRAME_SKIP_MODE_BUF_LIMIT``
2838       - Frame skip mode enabled and buffer limit is set by the VBV
2839         (MPEG1/2/4) or CPB (H264) buffer size control.
2840
2841 .. raw:: latex
2842
2843     \normalsize
2844
2845 ``V4L2_CID_MPEG_MFC51_VIDEO_RC_FIXED_TARGET_BIT (integer)``
2846     Enable rate-control with fixed target bit. If this setting is
2847     enabled, then the rate control logic of the encoder will calculate
2848     the average bitrate for a GOP and keep it below or equal the set
2849     bitrate target. Otherwise the rate control logic calculates the
2850     overall average bitrate for the stream and keeps it below or equal
2851     to the set bitrate. In the first case the average bitrate for the
2852     whole stream will be smaller then the set bitrate. This is caused
2853     because the average is calculated for smaller number of frames, on
2854     the other hand enabling this setting will ensure that the stream
2855     will meet tight bandwidth constraints. Applicable to encoders.
2856
2857 .. _v4l2-mpeg-mfc51-video-force-frame-type:
2858
2859 ``V4L2_CID_MPEG_MFC51_VIDEO_FORCE_FRAME_TYPE``
2860     (enum)
2861
2862 enum v4l2_mpeg_mfc51_video_force_frame_type -
2863     Force a frame type for the next queued buffer. Applicable to
2864     encoders. Possible values are:
2865
2866 .. tabularcolumns:: |p{9.5cm}|p{8.0cm}|
2867
2868 .. flat-table::
2869     :header-rows:  0
2870     :stub-columns: 0
2871
2872     * - ``V4L2_MPEG_MFC51_FORCE_FRAME_TYPE_DISABLED``
2873       - Forcing a specific frame type disabled.
2874     * - ``V4L2_MPEG_MFC51_FORCE_FRAME_TYPE_I_FRAME``
2875       - Force an I-frame.
2876     * - ``V4L2_MPEG_MFC51_FORCE_FRAME_TYPE_NOT_CODED``
2877       - Force a non-coded frame.
2878
2879
2880 .. _v4l2-mpeg-fwht:
2881
2882 ``V4L2_CID_MPEG_VIDEO_FWHT_PARAMS (struct)``
2883     Specifies the fwht parameters (as extracted from the bitstream) for the
2884     associated FWHT data. This includes the necessary parameters for
2885     configuring a stateless hardware decoding pipeline for FWHT.
2886
2887     .. note::
2888
2889        This compound control is not yet part of the public kernel API and
2890        it is expected to change.
2891
2892 .. c:type:: v4l2_ctrl_fwht_params
2893
2894 .. cssclass:: longtable
2895
2896 .. tabularcolumns:: |p{1.4cm}|p{4.3cm}|p{11.8cm}|
2897
2898 .. flat-table:: struct v4l2_ctrl_fwht_params
2899     :header-rows:  0
2900     :stub-columns: 0
2901     :widths:       1 1 2
2902
2903     * - __u64
2904       - ``backward_ref_ts``
2905       - Timestamp of the V4L2 capture buffer to use as backward reference, used
2906         with P-coded frames. The timestamp refers to the
2907         ``timestamp`` field in struct :c:type:`v4l2_buffer`. Use the
2908         :c:func:`v4l2_timeval_to_ns()` function to convert the struct
2909         :c:type:`timeval` in struct :c:type:`v4l2_buffer` to a __u64.
2910     * - __u32
2911       - ``version``
2912       - The version of the codec
2913     * - __u32
2914       - ``width``
2915       - The width of the frame
2916     * - __u32
2917       - ``height``
2918       - The height of the frame
2919     * - __u32
2920       - ``flags``
2921       - The flags of the frame, see :ref:`fwht-flags`.
2922     * - __u32
2923       - ``colorspace``
2924       - The colorspace of the frame, from enum :c:type:`v4l2_colorspace`.
2925     * - __u32
2926       - ``xfer_func``
2927       - The transfer function, from enum :c:type:`v4l2_xfer_func`.
2928     * - __u32
2929       - ``ycbcr_enc``
2930       - The Y'CbCr encoding, from enum :c:type:`v4l2_ycbcr_encoding`.
2931     * - __u32
2932       - ``quantization``
2933       - The quantization range, from enum :c:type:`v4l2_quantization`.
2934
2935
2936
2937 .. _fwht-flags:
2938
2939 FWHT Flags
2940 ============
2941
2942 .. cssclass:: longtable
2943
2944 .. tabularcolumns:: |p{6.8cm}|p{2.4cm}|p{8.3cm}|
2945
2946 .. flat-table::
2947     :header-rows:  0
2948     :stub-columns: 0
2949     :widths:       3 1 4
2950
2951     * - ``FWHT_FL_IS_INTERLACED``
2952       - 0x00000001
2953       - Set if this is an interlaced format
2954     * - ``FWHT_FL_IS_BOTTOM_FIRST``
2955       - 0x00000002
2956       - Set if this is a bottom-first (NTSC) interlaced format
2957     * - ``FWHT_FL_IS_ALTERNATE``
2958       - 0x00000004
2959       - Set if each 'frame' contains just one field
2960     * - ``FWHT_FL_IS_BOTTOM_FIELD``
2961       - 0x00000008
2962       - If FWHT_FL_IS_ALTERNATE was set, then this is set if this 'frame' is the
2963         bottom field, else it is the top field.
2964     * - ``FWHT_FL_LUMA_IS_UNCOMPRESSED``
2965       - 0x00000010
2966       - Set if the luma plane is uncompressed
2967     * - ``FWHT_FL_CB_IS_UNCOMPRESSED``
2968       - 0x00000020
2969       - Set if the cb plane is uncompressed
2970     * - ``FWHT_FL_CR_IS_UNCOMPRESSED``
2971       - 0x00000040
2972       - Set if the cr plane is uncompressed
2973     * - ``FWHT_FL_CHROMA_FULL_HEIGHT``
2974       - 0x00000080
2975       - Set if the chroma plane has the same height as the luma plane,
2976         else the chroma plane is half the height of the luma plane
2977     * - ``FWHT_FL_CHROMA_FULL_WIDTH``
2978       - 0x00000100
2979       - Set if the chroma plane has the same width as the luma plane,
2980         else the chroma plane is half the width of the luma plane
2981     * - ``FWHT_FL_ALPHA_IS_UNCOMPRESSED``
2982       - 0x00000200
2983       - Set if the alpha plane is uncompressed
2984     * - ``FWHT_FL_I_FRAME``
2985       - 0x00000400
2986       - Set if this is an I-frame
2987     * - ``FWHT_FL_COMPONENTS_NUM_MSK``
2988       - 0x00070000
2989       - A 4-values flag - the number of components - 1
2990     * - ``FWHT_FL_PIXENC_YUV``
2991       - 0x00080000
2992       - Set if the pixel encoding is YUV
2993     * - ``FWHT_FL_PIXENC_RGB``
2994       - 0x00100000
2995       - Set if the pixel encoding is RGB
2996     * - ``FWHT_FL_PIXENC_HSV``
2997       - 0x00180000
2998       - Set if the pixel encoding is HSV
2999
3000
3001 CX2341x MPEG Controls
3002 =====================
3003
3004 The following MPEG class controls deal with MPEG encoding settings that
3005 are specific to the Conexant CX23415 and CX23416 MPEG encoding chips.
3006
3007
3008 .. _cx2341x-control-id:
3009
3010 CX2341x Control IDs
3011 -------------------
3012
3013 .. _v4l2-mpeg-cx2341x-video-spatial-filter-mode:
3014
3015 ``V4L2_CID_MPEG_CX2341X_VIDEO_SPATIAL_FILTER_MODE``
3016     (enum)
3017
3018 enum v4l2_mpeg_cx2341x_video_spatial_filter_mode -
3019     Sets the Spatial Filter mode (default ``MANUAL``). Possible values
3020     are:
3021
3022
3023
3024 .. flat-table::
3025     :header-rows:  0
3026     :stub-columns: 0
3027
3028     * - ``V4L2_MPEG_CX2341X_VIDEO_SPATIAL_FILTER_MODE_MANUAL``
3029       - Choose the filter manually
3030     * - ``V4L2_MPEG_CX2341X_VIDEO_SPATIAL_FILTER_MODE_AUTO``
3031       - Choose the filter automatically
3032
3033
3034
3035 ``V4L2_CID_MPEG_CX2341X_VIDEO_SPATIAL_FILTER (integer (0-15))``
3036     The setting for the Spatial Filter. 0 = off, 15 = maximum. (Default
3037     is 0.)
3038
3039 .. _luma-spatial-filter-type:
3040
3041 ``V4L2_CID_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE``
3042     (enum)
3043
3044 enum v4l2_mpeg_cx2341x_video_luma_spatial_filter_type -
3045     Select the algorithm to use for the Luma Spatial Filter (default
3046     ``1D_HOR``). Possible values:
3047
3048 .. tabularcolumns:: |p{14.5cm}|p{3.0cm}|
3049
3050 .. raw:: latex
3051
3052     \small
3053
3054 .. flat-table::
3055     :header-rows:  0
3056     :stub-columns: 0
3057
3058     * - ``V4L2_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE_OFF``
3059       - No filter
3060     * - ``V4L2_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE_1D_HOR``
3061       - One-dimensional horizontal
3062     * - ``V4L2_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE_1D_VERT``
3063       - One-dimensional vertical
3064     * - ``V4L2_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE_2D_HV_SEPARABLE``
3065       - Two-dimensional separable
3066     * - ``V4L2_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE_2D_SYM_NON_SEPARABLE``
3067       - Two-dimensional symmetrical non-separable
3068
3069 .. raw:: latex
3070
3071     \normalsize
3072
3073
3074
3075 .. _chroma-spatial-filter-type:
3076
3077 ``V4L2_CID_MPEG_CX2341X_VIDEO_CHROMA_SPATIAL_FILTER_TYPE``
3078     (enum)
3079
3080 enum v4l2_mpeg_cx2341x_video_chroma_spatial_filter_type -
3081     Select the algorithm for the Chroma Spatial Filter (default
3082     ``1D_HOR``). Possible values are:
3083
3084
3085 .. tabularcolumns:: |p{14.0cm}|p{3.5cm}|
3086
3087 .. flat-table::
3088     :header-rows:  0
3089     :stub-columns: 0
3090
3091     * - ``V4L2_MPEG_CX2341X_VIDEO_CHROMA_SPATIAL_FILTER_TYPE_OFF``
3092       - No filter
3093     * - ``V4L2_MPEG_CX2341X_VIDEO_CHROMA_SPATIAL_FILTER_TYPE_1D_HOR``
3094       - One-dimensional horizontal
3095
3096
3097
3098 .. _v4l2-mpeg-cx2341x-video-temporal-filter-mode:
3099
3100 ``V4L2_CID_MPEG_CX2341X_VIDEO_TEMPORAL_FILTER_MODE``
3101     (enum)
3102
3103 enum v4l2_mpeg_cx2341x_video_temporal_filter_mode -
3104     Sets the Temporal Filter mode (default ``MANUAL``). Possible values
3105     are:
3106
3107
3108
3109 .. flat-table::
3110     :header-rows:  0
3111     :stub-columns: 0
3112
3113     * - ``V4L2_MPEG_CX2341X_VIDEO_TEMPORAL_FILTER_MODE_MANUAL``
3114       - Choose the filter manually
3115     * - ``V4L2_MPEG_CX2341X_VIDEO_TEMPORAL_FILTER_MODE_AUTO``
3116       - Choose the filter automatically
3117
3118
3119
3120 ``V4L2_CID_MPEG_CX2341X_VIDEO_TEMPORAL_FILTER (integer (0-31))``
3121     The setting for the Temporal Filter. 0 = off, 31 = maximum. (Default
3122     is 8 for full-scale capturing and 0 for scaled capturing.)
3123
3124 .. _v4l2-mpeg-cx2341x-video-median-filter-type:
3125
3126 ``V4L2_CID_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE``
3127     (enum)
3128
3129 enum v4l2_mpeg_cx2341x_video_median_filter_type -
3130     Median Filter Type (default ``OFF``). Possible values are:
3131
3132
3133
3134 .. flat-table::
3135     :header-rows:  0
3136     :stub-columns: 0
3137
3138     * - ``V4L2_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE_OFF``
3139       - No filter
3140     * - ``V4L2_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE_HOR``
3141       - Horizontal filter
3142     * - ``V4L2_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE_VERT``
3143       - Vertical filter
3144     * - ``V4L2_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE_HOR_VERT``
3145       - Horizontal and vertical filter
3146     * - ``V4L2_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE_DIAG``
3147       - Diagonal filter
3148
3149
3150
3151 ``V4L2_CID_MPEG_CX2341X_VIDEO_LUMA_MEDIAN_FILTER_BOTTOM (integer (0-255))``
3152     Threshold above which the luminance median filter is enabled
3153     (default 0)
3154
3155 ``V4L2_CID_MPEG_CX2341X_VIDEO_LUMA_MEDIAN_FILTER_TOP (integer (0-255))``
3156     Threshold below which the luminance median filter is enabled
3157     (default 255)
3158
3159 ``V4L2_CID_MPEG_CX2341X_VIDEO_CHROMA_MEDIAN_FILTER_BOTTOM (integer (0-255))``
3160     Threshold above which the chroma median filter is enabled (default
3161     0)
3162
3163 ``V4L2_CID_MPEG_CX2341X_VIDEO_CHROMA_MEDIAN_FILTER_TOP (integer (0-255))``
3164     Threshold below which the chroma median filter is enabled (default
3165     255)
3166
3167 ``V4L2_CID_MPEG_CX2341X_STREAM_INSERT_NAV_PACKETS (boolean)``
3168     The CX2341X MPEG encoder can insert one empty MPEG-2 PES packet into
3169     the stream between every four video frames. The packet size is 2048
3170     bytes, including the packet_start_code_prefix and stream_id
3171     fields. The stream_id is 0xBF (private stream 2). The payload
3172     consists of 0x00 bytes, to be filled in by the application. 0 = do
3173     not insert, 1 = insert packets.
3174
3175
3176 VPX Control Reference
3177 =====================
3178
3179 The VPX controls include controls for encoding parameters of VPx video
3180 codec.
3181
3182
3183 .. _vpx-control-id:
3184
3185 VPX Control IDs
3186 ---------------
3187
3188 .. _v4l2-vpx-num-partitions:
3189
3190 ``V4L2_CID_MPEG_VIDEO_VPX_NUM_PARTITIONS``
3191     (enum)
3192
3193 enum v4l2_vp8_num_partitions -
3194     The number of token partitions to use in VP8 encoder. Possible
3195     values are:
3196
3197
3198
3199 .. flat-table::
3200     :header-rows:  0
3201     :stub-columns: 0
3202
3203     * - ``V4L2_CID_MPEG_VIDEO_VPX_1_PARTITION``
3204       - 1 coefficient partition
3205     * - ``V4L2_CID_MPEG_VIDEO_VPX_2_PARTITIONS``
3206       - 2 coefficient partitions
3207     * - ``V4L2_CID_MPEG_VIDEO_VPX_4_PARTITIONS``
3208       - 4 coefficient partitions
3209     * - ``V4L2_CID_MPEG_VIDEO_VPX_8_PARTITIONS``
3210       - 8 coefficient partitions
3211
3212
3213
3214 ``V4L2_CID_MPEG_VIDEO_VPX_IMD_DISABLE_4X4 (boolean)``
3215     Setting this prevents intra 4x4 mode in the intra mode decision.
3216
3217 .. _v4l2-vpx-num-ref-frames:
3218
3219 ``V4L2_CID_MPEG_VIDEO_VPX_NUM_REF_FRAMES``
3220     (enum)
3221
3222 enum v4l2_vp8_num_ref_frames -
3223     The number of reference pictures for encoding P frames. Possible
3224     values are:
3225
3226 .. tabularcolumns:: |p{7.9cm}|p{9.6cm}|
3227
3228 .. raw:: latex
3229
3230     \small
3231
3232 .. flat-table::
3233     :header-rows:  0
3234     :stub-columns: 0
3235
3236     * - ``V4L2_CID_MPEG_VIDEO_VPX_1_REF_FRAME``
3237       - Last encoded frame will be searched
3238     * - ``V4L2_CID_MPEG_VIDEO_VPX_2_REF_FRAME``
3239       - Two frames will be searched among the last encoded frame, the
3240         golden frame and the alternate reference (altref) frame. The
3241         encoder implementation will decide which two are chosen.
3242     * - ``V4L2_CID_MPEG_VIDEO_VPX_3_REF_FRAME``
3243       - The last encoded frame, the golden frame and the altref frame will
3244         be searched.
3245
3246 .. raw:: latex
3247
3248     \normalsize
3249
3250
3251
3252 ``V4L2_CID_MPEG_VIDEO_VPX_FILTER_LEVEL (integer)``
3253     Indicates the loop filter level. The adjustment of the loop filter
3254     level is done via a delta value against a baseline loop filter
3255     value.
3256
3257 ``V4L2_CID_MPEG_VIDEO_VPX_FILTER_SHARPNESS (integer)``
3258     This parameter affects the loop filter. Anything above zero weakens
3259     the deblocking effect on the loop filter.
3260
3261 ``V4L2_CID_MPEG_VIDEO_VPX_GOLDEN_FRAME_REF_PERIOD (integer)``
3262     Sets the refresh period for the golden frame. The period is defined
3263     in number of frames. For a value of 'n', every nth frame starting
3264     from the first key frame will be taken as a golden frame. For eg.
3265     for encoding sequence of 0, 1, 2, 3, 4, 5, 6, 7 where the golden
3266     frame refresh period is set as 4, the frames 0, 4, 8 etc will be
3267     taken as the golden frames as frame 0 is always a key frame.
3268
3269 .. _v4l2-vpx-golden-frame-sel:
3270
3271 ``V4L2_CID_MPEG_VIDEO_VPX_GOLDEN_FRAME_SEL``
3272     (enum)
3273
3274 enum v4l2_vp8_golden_frame_sel -
3275     Selects the golden frame for encoding. Possible values are:
3276
3277 .. raw:: latex
3278
3279     \scriptsize
3280
3281 .. tabularcolumns:: |p{9.0cm}|p{8.0cm}|
3282
3283 .. flat-table::
3284     :header-rows:  0
3285     :stub-columns: 0
3286
3287     * - ``V4L2_CID_MPEG_VIDEO_VPX_GOLDEN_FRAME_USE_PREV``
3288       - Use the (n-2)th frame as a golden frame, current frame index being
3289         'n'.
3290     * - ``V4L2_CID_MPEG_VIDEO_VPX_GOLDEN_FRAME_USE_REF_PERIOD``
3291       - Use the previous specific frame indicated by
3292         ``V4L2_CID_MPEG_VIDEO_VPX_GOLDEN_FRAME_REF_PERIOD`` as a
3293         golden frame.
3294
3295 .. raw:: latex
3296
3297     \normalsize
3298
3299
3300 ``V4L2_CID_MPEG_VIDEO_VPX_MIN_QP (integer)``
3301     Minimum quantization parameter for VP8.
3302
3303 ``V4L2_CID_MPEG_VIDEO_VPX_MAX_QP (integer)``
3304     Maximum quantization parameter for VP8.
3305
3306 ``V4L2_CID_MPEG_VIDEO_VPX_I_FRAME_QP (integer)``
3307     Quantization parameter for an I frame for VP8.
3308
3309 ``V4L2_CID_MPEG_VIDEO_VPX_P_FRAME_QP (integer)``
3310     Quantization parameter for a P frame for VP8.
3311
3312 .. _v4l2-mpeg-video-vp8-profile:
3313
3314 ``V4L2_CID_MPEG_VIDEO_VP8_PROFILE``
3315     (enum)
3316
3317 enum v4l2_mpeg_video_vp8_profile -
3318     This control allows selecting the profile for VP8 encoder.
3319     This is also used to enumerate supported profiles by VP8 encoder or decoder.
3320     Possible values are:
3321
3322 .. flat-table::
3323     :header-rows:  0
3324     :stub-columns: 0
3325
3326     * - ``V4L2_MPEG_VIDEO_VP8_PROFILE_0``
3327       - Profile 0
3328     * - ``V4L2_MPEG_VIDEO_VP8_PROFILE_1``
3329       - Profile 1
3330     * - ``V4L2_MPEG_VIDEO_VP8_PROFILE_2``
3331       - Profile 2
3332     * - ``V4L2_MPEG_VIDEO_VP8_PROFILE_3``
3333       - Profile 3
3334
3335 .. _v4l2-mpeg-video-vp9-profile:
3336
3337 ``V4L2_CID_MPEG_VIDEO_VP9_PROFILE``
3338     (enum)
3339
3340 enum v4l2_mpeg_video_vp9_profile -
3341     This control allows selecting the profile for VP9 encoder.
3342     This is also used to enumerate supported profiles by VP9 encoder or decoder.
3343     Possible values are:
3344
3345 .. flat-table::
3346     :header-rows:  0
3347     :stub-columns: 0
3348
3349     * - ``V4L2_MPEG_VIDEO_VP9_PROFILE_0``
3350       - Profile 0
3351     * - ``V4L2_MPEG_VIDEO_VP9_PROFILE_1``
3352       - Profile 1
3353     * - ``V4L2_MPEG_VIDEO_VP9_PROFILE_2``
3354       - Profile 2
3355     * - ``V4L2_MPEG_VIDEO_VP9_PROFILE_3``
3356       - Profile 3
3357
3358
3359 High Efficiency Video Coding (HEVC/H.265) Control Reference
3360 ===========================================================
3361
3362 The HEVC/H.265 controls include controls for encoding parameters of HEVC/H.265
3363 video codec.
3364
3365
3366 .. _hevc-control-id:
3367
3368 HEVC/H.265 Control IDs
3369 ----------------------
3370
3371 ``V4L2_CID_MPEG_VIDEO_HEVC_MIN_QP (integer)``
3372     Minimum quantization parameter for HEVC.
3373     Valid range: from 0 to 51.
3374
3375 ``V4L2_CID_MPEG_VIDEO_HEVC_MAX_QP (integer)``
3376     Maximum quantization parameter for HEVC.
3377     Valid range: from 0 to 51.
3378
3379 ``V4L2_CID_MPEG_VIDEO_HEVC_I_FRAME_QP (integer)``
3380     Quantization parameter for an I frame for HEVC.
3381     Valid range: [V4L2_CID_MPEG_VIDEO_HEVC_MIN_QP,
3382     V4L2_CID_MPEG_VIDEO_HEVC_MAX_QP].
3383
3384 ``V4L2_CID_MPEG_VIDEO_HEVC_P_FRAME_QP (integer)``
3385     Quantization parameter for a P frame for HEVC.
3386     Valid range: [V4L2_CID_MPEG_VIDEO_HEVC_MIN_QP,
3387     V4L2_CID_MPEG_VIDEO_HEVC_MAX_QP].
3388
3389 ``V4L2_CID_MPEG_VIDEO_HEVC_B_FRAME_QP (integer)``
3390     Quantization parameter for a B frame for HEVC.
3391     Valid range: [V4L2_CID_MPEG_VIDEO_HEVC_MIN_QP,
3392     V4L2_CID_MPEG_VIDEO_HEVC_MAX_QP].
3393
3394 ``V4L2_CID_MPEG_VIDEO_HEVC_HIER_QP (boolean)``
3395     HIERARCHICAL_QP allows the host to specify the quantization parameter
3396     values for each temporal layer through HIERARCHICAL_QP_LAYER. This is
3397     valid only if HIERARCHICAL_CODING_LAYER is greater than 1. Setting the
3398     control value to 1 enables setting of the QP values for the layers.
3399
3400 .. _v4l2-hevc-hier-coding-type:
3401
3402 ``V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_TYPE``
3403     (enum)
3404
3405 enum v4l2_mpeg_video_hevc_hier_coding_type -
3406     Selects the hierarchical coding type for encoding. Possible values are:
3407
3408 .. raw:: latex
3409
3410     \footnotesize
3411
3412 .. tabularcolumns:: |p{9.0cm}|p{8.0cm}|
3413
3414 .. flat-table::
3415     :header-rows:  0
3416     :stub-columns: 0
3417
3418     * - ``V4L2_MPEG_VIDEO_HEVC_HIERARCHICAL_CODING_B``
3419       - Use the B frame for hierarchical coding.
3420     * - ``V4L2_MPEG_VIDEO_HEVC_HIERARCHICAL_CODING_P``
3421       - Use the P frame for hierarchical coding.
3422
3423 .. raw:: latex
3424
3425     \normalsize
3426
3427
3428 ``V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_LAYER (integer)``
3429     Selects the hierarchical coding layer. In normal encoding
3430     (non-hierarchial coding), it should be zero. Possible values are [0, 6].
3431     0 indicates HIERARCHICAL CODING LAYER 0, 1 indicates HIERARCHICAL CODING
3432     LAYER 1 and so on.
3433
3434 ``V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_L0_QP (integer)``
3435     Indicates quantization parameter for hierarchical coding layer 0.
3436     Valid range: [V4L2_CID_MPEG_VIDEO_HEVC_MIN_QP,
3437     V4L2_CID_MPEG_VIDEO_HEVC_MAX_QP].
3438
3439 ``V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_L1_QP (integer)``
3440     Indicates quantization parameter for hierarchical coding layer 1.
3441     Valid range: [V4L2_CID_MPEG_VIDEO_HEVC_MIN_QP,
3442     V4L2_CID_MPEG_VIDEO_HEVC_MAX_QP].
3443
3444 ``V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_L2_QP (integer)``
3445     Indicates quantization parameter for hierarchical coding layer 2.
3446     Valid range: [V4L2_CID_MPEG_VIDEO_HEVC_MIN_QP,
3447     V4L2_CID_MPEG_VIDEO_HEVC_MAX_QP].
3448
3449 ``V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_L3_QP (integer)``
3450     Indicates quantization parameter for hierarchical coding layer 3.
3451     Valid range: [V4L2_CID_MPEG_VIDEO_HEVC_MIN_QP,
3452     V4L2_CID_MPEG_VIDEO_HEVC_MAX_QP].
3453
3454 ``V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_L4_QP (integer)``
3455     Indicates quantization parameter for hierarchical coding layer 4.
3456     Valid range: [V4L2_CID_MPEG_VIDEO_HEVC_MIN_QP,
3457     V4L2_CID_MPEG_VIDEO_HEVC_MAX_QP].
3458
3459 ``V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_L5_QP (integer)``
3460     Indicates quantization parameter for hierarchical coding layer 5.
3461     Valid range: [V4L2_CID_MPEG_VIDEO_HEVC_MIN_QP,
3462     V4L2_CID_MPEG_VIDEO_HEVC_MAX_QP].
3463
3464 ``V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_L6_QP (integer)``
3465     Indicates quantization parameter for hierarchical coding layer 6.
3466     Valid range: [V4L2_CID_MPEG_VIDEO_HEVC_MIN_QP,
3467     V4L2_CID_MPEG_VIDEO_HEVC_MAX_QP].
3468
3469 .. _v4l2-hevc-profile:
3470
3471 ``V4L2_CID_MPEG_VIDEO_HEVC_PROFILE``
3472     (enum)
3473
3474 enum v4l2_mpeg_video_hevc_profile -
3475     Select the desired profile for HEVC encoder.
3476
3477 .. raw:: latex
3478
3479     \footnotesize
3480
3481 .. tabularcolumns:: |p{9.0cm}|p{8.0cm}|
3482
3483 .. flat-table::
3484     :header-rows:  0
3485     :stub-columns: 0
3486
3487     * - ``V4L2_MPEG_VIDEO_HEVC_PROFILE_MAIN``
3488       - Main profile.
3489     * - ``V4L2_MPEG_VIDEO_HEVC_PROFILE_MAIN_STILL_PICTURE``
3490       - Main still picture profile.
3491     * - ``V4L2_MPEG_VIDEO_HEVC_PROFILE_MAIN_10``
3492       - Main 10 profile.
3493
3494 .. raw:: latex
3495
3496     \normalsize
3497
3498
3499 .. _v4l2-hevc-level:
3500
3501 ``V4L2_CID_MPEG_VIDEO_HEVC_LEVEL``
3502     (enum)
3503
3504 enum v4l2_mpeg_video_hevc_level -
3505     Selects the desired level for HEVC encoder.
3506
3507 .. raw:: latex
3508
3509     \footnotesize
3510
3511 .. tabularcolumns:: |p{9.0cm}|p{8.0cm}|
3512
3513 .. flat-table::
3514     :header-rows:  0
3515     :stub-columns: 0
3516
3517     * - ``V4L2_MPEG_VIDEO_HEVC_LEVEL_1``
3518       - Level 1.0
3519     * - ``V4L2_MPEG_VIDEO_HEVC_LEVEL_2``
3520       - Level 2.0
3521     * - ``V4L2_MPEG_VIDEO_HEVC_LEVEL_2_1``
3522       - Level 2.1
3523     * - ``V4L2_MPEG_VIDEO_HEVC_LEVEL_3``
3524       - Level 3.0
3525     * - ``V4L2_MPEG_VIDEO_HEVC_LEVEL_3_1``
3526       - Level 3.1
3527     * - ``V4L2_MPEG_VIDEO_HEVC_LEVEL_4``
3528       - Level 4.0
3529     * - ``V4L2_MPEG_VIDEO_HEVC_LEVEL_4_1``
3530       - Level 4.1
3531     * - ``V4L2_MPEG_VIDEO_HEVC_LEVEL_5``
3532       - Level 5.0
3533     * - ``V4L2_MPEG_VIDEO_HEVC_LEVEL_5_1``
3534       - Level 5.1
3535     * - ``V4L2_MPEG_VIDEO_HEVC_LEVEL_5_2``
3536       - Level 5.2
3537     * - ``V4L2_MPEG_VIDEO_HEVC_LEVEL_6``
3538       - Level 6.0
3539     * - ``V4L2_MPEG_VIDEO_HEVC_LEVEL_6_1``
3540       - Level 6.1
3541     * - ``V4L2_MPEG_VIDEO_HEVC_LEVEL_6_2``
3542       - Level 6.2
3543
3544 .. raw:: latex
3545
3546     \normalsize
3547
3548
3549 ``V4L2_CID_MPEG_VIDEO_HEVC_FRAME_RATE_RESOLUTION (integer)``
3550     Indicates the number of evenly spaced subintervals, called ticks, within
3551     one second. This is a 16 bit unsigned integer and has a maximum value up to
3552     0xffff and a minimum value of 1.
3553
3554 .. _v4l2-hevc-tier:
3555
3556 ``V4L2_CID_MPEG_VIDEO_HEVC_TIER``
3557     (enum)
3558
3559 enum v4l2_mpeg_video_hevc_tier -
3560     TIER_FLAG specifies tiers information of the HEVC encoded picture. Tier
3561     were made to deal with applications that differ in terms of maximum bit
3562     rate. Setting the flag to 0 selects HEVC tier as Main tier and setting
3563     this flag to 1 indicates High tier. High tier is for applications requiring
3564     high bit rates.
3565
3566 .. raw:: latex
3567
3568     \footnotesize
3569
3570 .. tabularcolumns:: |p{9.0cm}|p{8.0cm}|
3571
3572 .. flat-table::
3573     :header-rows:  0
3574     :stub-columns: 0
3575
3576     * - ``V4L2_MPEG_VIDEO_HEVC_TIER_MAIN``
3577       - Main tier.
3578     * - ``V4L2_MPEG_VIDEO_HEVC_TIER_HIGH``
3579       - High tier.
3580
3581 .. raw:: latex
3582
3583     \normalsize
3584
3585
3586 ``V4L2_CID_MPEG_VIDEO_HEVC_MAX_PARTITION_DEPTH (integer)``
3587     Selects HEVC maximum coding unit depth.
3588
3589 .. _v4l2-hevc-loop-filter-mode:
3590
3591 ``V4L2_CID_MPEG_VIDEO_HEVC_LOOP_FILTER_MODE``
3592     (enum)
3593
3594 enum v4l2_mpeg_video_hevc_loop_filter_mode -
3595     Loop filter mode for HEVC encoder. Possible values are:
3596
3597 .. raw:: latex
3598
3599     \footnotesize
3600
3601 .. tabularcolumns:: |p{12.1cm}|p{5.4cm}|
3602
3603 .. flat-table::
3604     :header-rows:  0
3605     :stub-columns: 0
3606
3607     * - ``V4L2_MPEG_VIDEO_HEVC_LOOP_FILTER_MODE_DISABLED``
3608       - Loop filter is disabled.
3609     * - ``V4L2_MPEG_VIDEO_HEVC_LOOP_FILTER_MODE_ENABLED``
3610       - Loop filter is enabled.
3611     * - ``V4L2_MPEG_VIDEO_HEVC_LOOP_FILTER_MODE_DISABLED_AT_SLICE_BOUNDARY``
3612       - Loop filter is disabled at the slice boundary.
3613
3614 .. raw:: latex
3615
3616     \normalsize
3617
3618
3619 ``V4L2_CID_MPEG_VIDEO_HEVC_LF_BETA_OFFSET_DIV2 (integer)``
3620     Selects HEVC loop filter beta offset. The valid range is [-6, +6].
3621
3622 ``V4L2_CID_MPEG_VIDEO_HEVC_LF_TC_OFFSET_DIV2 (integer)``
3623     Selects HEVC loop filter tc offset. The valid range is [-6, +6].
3624
3625 .. _v4l2-hevc-refresh-type:
3626
3627 ``V4L2_CID_MPEG_VIDEO_HEVC_REFRESH_TYPE``
3628     (enum)
3629
3630 enum v4l2_mpeg_video_hevc_hier_refresh_type -
3631     Selects refresh type for HEVC encoder.
3632     Host has to specify the period into
3633     V4L2_CID_MPEG_VIDEO_HEVC_REFRESH_PERIOD.
3634
3635 .. raw:: latex
3636
3637     \footnotesize
3638
3639 .. tabularcolumns:: |p{8.0cm}|p{9.0cm}|
3640
3641 .. flat-table::
3642     :header-rows:  0
3643     :stub-columns: 0
3644
3645     * - ``V4L2_MPEG_VIDEO_HEVC_REFRESH_NONE``
3646       - Use the B frame for hierarchical coding.
3647     * - ``V4L2_MPEG_VIDEO_HEVC_REFRESH_CRA``
3648       - Use CRA (Clean Random Access Unit) picture encoding.
3649     * - ``V4L2_MPEG_VIDEO_HEVC_REFRESH_IDR``
3650       - Use IDR (Instantaneous Decoding Refresh) picture encoding.
3651
3652 .. raw:: latex
3653
3654     \normalsize
3655
3656
3657 ``V4L2_CID_MPEG_VIDEO_HEVC_REFRESH_PERIOD (integer)``
3658     Selects the refresh period for HEVC encoder.
3659     This specifies the number of I pictures between two CRA/IDR pictures.
3660     This is valid only if REFRESH_TYPE is not 0.
3661
3662 ``V4L2_CID_MPEG_VIDEO_HEVC_LOSSLESS_CU (boolean)``
3663     Indicates HEVC lossless encoding. Setting it to 0 disables lossless
3664     encoding. Setting it to 1 enables lossless encoding.
3665
3666 ``V4L2_CID_MPEG_VIDEO_HEVC_CONST_INTRA_PRED (boolean)``
3667     Indicates constant intra prediction for HEVC encoder. Specifies the
3668     constrained intra prediction in which intra largest coding unit (LCU)
3669     prediction is performed by using residual data and decoded samples of
3670     neighboring intra LCU only. Setting the value to 1 enables constant intra
3671     prediction and setting the value to 0 disables constant intra prediction.
3672
3673 ``V4L2_CID_MPEG_VIDEO_HEVC_WAVEFRONT (boolean)``
3674     Indicates wavefront parallel processing for HEVC encoder. Setting it to 0
3675     disables the feature and setting it to 1 enables the wavefront parallel
3676     processing.
3677
3678 ``V4L2_CID_MPEG_VIDEO_HEVC_GENERAL_PB (boolean)``
3679     Setting the value to 1 enables combination of P and B frame for HEVC
3680     encoder.
3681
3682 ``V4L2_CID_MPEG_VIDEO_HEVC_TEMPORAL_ID (boolean)``
3683     Indicates temporal identifier for HEVC encoder which is enabled by
3684     setting the value to 1.
3685
3686 ``V4L2_CID_MPEG_VIDEO_HEVC_STRONG_SMOOTHING (boolean)``
3687     Indicates bi-linear interpolation is conditionally used in the intra
3688     prediction filtering process in the CVS when set to 1. Indicates bi-linear
3689     interpolation is not used in the CVS when set to 0.
3690
3691 ``V4L2_CID_MPEG_VIDEO_HEVC_MAX_NUM_MERGE_MV_MINUS1 (integer)``
3692     Indicates maximum number of merge candidate motion vectors.
3693     Values are from 0 to 4.
3694
3695 ``V4L2_CID_MPEG_VIDEO_HEVC_TMV_PREDICTION (boolean)``
3696     Indicates temporal motion vector prediction for HEVC encoder. Setting it to
3697     1 enables the prediction. Setting it to 0 disables the prediction.
3698
3699 ``V4L2_CID_MPEG_VIDEO_HEVC_WITHOUT_STARTCODE (boolean)``
3700     Specifies if HEVC generates a stream with a size of the length field
3701     instead of start code pattern. The size of the length field is configurable
3702     through the V4L2_CID_MPEG_VIDEO_HEVC_SIZE_OF_LENGTH_FIELD control. Setting
3703     the value to 0 disables encoding without startcode pattern. Setting the
3704     value to 1 will enables encoding without startcode pattern.
3705
3706 .. _v4l2-hevc-size-of-length-field:
3707
3708 ``V4L2_CID_MPEG_VIDEO_HEVC_SIZE_OF_LENGTH_FIELD``
3709 (enum)
3710
3711 enum v4l2_mpeg_video_hevc_size_of_length_field -
3712     Indicates the size of length field.
3713     This is valid when encoding WITHOUT_STARTCODE_ENABLE is enabled.
3714
3715 .. raw:: latex
3716
3717     \footnotesize
3718
3719 .. tabularcolumns:: |p{6.0cm}|p{11.0cm}|
3720
3721 .. flat-table::
3722     :header-rows:  0
3723     :stub-columns: 0
3724
3725     * - ``V4L2_MPEG_VIDEO_HEVC_SIZE_0``
3726       - Generate start code pattern (Normal).
3727     * - ``V4L2_MPEG_VIDEO_HEVC_SIZE_1``
3728       - Generate size of length field instead of start code pattern and length is 1.
3729     * - ``V4L2_MPEG_VIDEO_HEVC_SIZE_2``
3730       - Generate size of length field instead of start code pattern and length is 2.
3731     * - ``V4L2_MPEG_VIDEO_HEVC_SIZE_4``
3732       - Generate size of length field instead of start code pattern and length is 4.
3733
3734 .. raw:: latex
3735
3736     \normalsize
3737
3738 ``V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_L0_BR (integer)``
3739     Indicates bit rate for hierarchical coding layer 0 for HEVC encoder.
3740
3741 ``V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_L1_BR (integer)``
3742     Indicates bit rate for hierarchical coding layer 1 for HEVC encoder.
3743
3744 ``V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_L2_BR (integer)``
3745     Indicates bit rate for hierarchical coding layer 2 for HEVC encoder.
3746
3747 ``V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_L3_BR (integer)``
3748     Indicates bit rate for hierarchical coding layer 3 for HEVC encoder.
3749
3750 ``V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_L4_BR (integer)``
3751     Indicates bit rate for hierarchical coding layer 4 for HEVC encoder.
3752
3753 ``V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_L5_BR (integer)``
3754     Indicates bit rate for hierarchical coding layer 5 for HEVC encoder.
3755
3756 ``V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_L6_BR (integer)``
3757     Indicates bit rate for hierarchical coding layer 6 for HEVC encoder.
3758
3759 ``V4L2_CID_MPEG_VIDEO_REF_NUMBER_FOR_PFRAMES (integer)``
3760     Selects number of P reference pictures required for HEVC encoder.
3761     P-Frame can use 1 or 2 frames for reference.
3762
3763 ``V4L2_CID_MPEG_VIDEO_PREPEND_SPSPPS_TO_IDR (integer)``
3764     Indicates whether to generate SPS and PPS at every IDR. Setting it to 0
3765     disables generating SPS and PPS at every IDR. Setting it to one enables
3766     generating SPS and PPS at every IDR.
3767
3768 .. _v4l2-mpeg-hevc:
3769
3770 ``V4L2_CID_MPEG_VIDEO_HEVC_SPS (struct)``
3771     Specifies the Sequence Parameter Set fields (as extracted from the
3772     bitstream) for the associated HEVC slice data.
3773     These bitstream parameters are defined according to :ref:`hevc`.
3774     They are described in section 7.4.3.2 "Sequence parameter set RBSP
3775     semantics" of the specification.
3776
3777 .. c:type:: v4l2_ctrl_hevc_sps
3778
3779 .. cssclass:: longtable
3780
3781 .. flat-table:: struct v4l2_ctrl_hevc_sps
3782     :header-rows:  0
3783     :stub-columns: 0
3784     :widths:       1 1 2
3785
3786     * - __u16
3787       - ``pic_width_in_luma_samples``
3788       -
3789     * - __u16
3790       - ``pic_height_in_luma_samples``
3791       -
3792     * - __u8
3793       - ``bit_depth_luma_minus8``
3794       -
3795     * - __u8
3796       - ``bit_depth_chroma_minus8``
3797       -
3798     * - __u8
3799       - ``log2_max_pic_order_cnt_lsb_minus4``
3800       -
3801     * - __u8
3802       - ``sps_max_dec_pic_buffering_minus1``
3803       -
3804     * - __u8
3805       - ``sps_max_num_reorder_pics``
3806       -
3807     * - __u8
3808       - ``sps_max_latency_increase_plus1``
3809       -
3810     * - __u8
3811       - ``log2_min_luma_coding_block_size_minus3``
3812       -
3813     * - __u8
3814       - ``log2_diff_max_min_luma_coding_block_size``
3815       -
3816     * - __u8
3817       - ``log2_min_luma_transform_block_size_minus2``
3818       -
3819     * - __u8
3820       - ``log2_diff_max_min_luma_transform_block_size``
3821       -
3822     * - __u8
3823       - ``max_transform_hierarchy_depth_inter``
3824       -
3825     * - __u8
3826       - ``max_transform_hierarchy_depth_intra``
3827       -
3828     * - __u8
3829       - ``pcm_sample_bit_depth_luma_minus1``
3830       -
3831     * - __u8
3832       - ``pcm_sample_bit_depth_chroma_minus1``
3833       -
3834     * - __u8
3835       - ``log2_min_pcm_luma_coding_block_size_minus3``
3836       -
3837     * - __u8
3838       - ``log2_diff_max_min_pcm_luma_coding_block_size``
3839       -
3840     * - __u8
3841       - ``num_short_term_ref_pic_sets``
3842       -
3843     * - __u8
3844       - ``num_long_term_ref_pics_sps``
3845       -
3846     * - __u8
3847       - ``chroma_format_idc``
3848       -
3849     * - __u64
3850       - ``flags``
3851       - See :ref:`Sequence Parameter Set Flags <hevc_sps_flags>`
3852
3853 .. _hevc_sps_flags:
3854
3855 ``Sequence Parameter Set Flags``
3856
3857 .. cssclass:: longtable
3858
3859 .. flat-table::
3860     :header-rows:  0
3861     :stub-columns: 0
3862     :widths:       1 1 2
3863
3864     * - ``V4L2_HEVC_SPS_FLAG_SEPARATE_COLOUR_PLANE``
3865       - 0x00000001
3866       -
3867     * - ``V4L2_HEVC_SPS_FLAG_SCALING_LIST_ENABLED``
3868       - 0x00000002
3869       -
3870     * - ``V4L2_HEVC_SPS_FLAG_AMP_ENABLED``
3871       - 0x00000004
3872       -
3873     * - ``V4L2_HEVC_SPS_FLAG_SAMPLE_ADAPTIVE_OFFSET``
3874       - 0x00000008
3875       -
3876     * - ``V4L2_HEVC_SPS_FLAG_PCM_ENABLED``
3877       - 0x00000010
3878       -
3879     * - ``V4L2_HEVC_SPS_FLAG_PCM_LOOP_FILTER_DISABLED``
3880       - 0x00000020
3881       -
3882     * - ``V4L2_HEVC_SPS_FLAG_LONG_TERM_REF_PICS_PRESENT``
3883       - 0x00000040
3884       -
3885     * - ``V4L2_HEVC_SPS_FLAG_SPS_TEMPORAL_MVP_ENABLED``
3886       - 0x00000080
3887       -
3888     * - ``V4L2_HEVC_SPS_FLAG_STRONG_INTRA_SMOOTHING_ENABLED``
3889       - 0x00000100
3890       -
3891
3892 ``V4L2_CID_MPEG_VIDEO_HEVC_PPS (struct)``
3893     Specifies the Picture Parameter Set fields (as extracted from the
3894     bitstream) for the associated HEVC slice data.
3895     These bitstream parameters are defined according to :ref:`hevc`.
3896     They are described in section 7.4.3.3 "Picture parameter set RBSP
3897     semantics" of the specification.
3898
3899 .. c:type:: v4l2_ctrl_hevc_pps
3900
3901 .. cssclass:: longtable
3902
3903 .. flat-table:: struct v4l2_ctrl_hevc_pps
3904     :header-rows:  0
3905     :stub-columns: 0
3906     :widths:       1 1 2
3907
3908     * - __u8
3909       - ``num_extra_slice_header_bits``
3910       -
3911     * - __s8
3912       - ``init_qp_minus26``
3913       -
3914     * - __u8
3915       - ``diff_cu_qp_delta_depth``
3916       -
3917     * - __s8
3918       - ``pps_cb_qp_offset``
3919       -
3920     * - __s8
3921       - ``pps_cr_qp_offset``
3922       -
3923     * - __u8
3924       - ``num_tile_columns_minus1``
3925       -
3926     * - __u8
3927       - ``num_tile_rows_minus1``
3928       -
3929     * - __u8
3930       - ``column_width_minus1[20]``
3931       -
3932     * - __u8
3933       - ``row_height_minus1[22]``
3934       -
3935     * - __s8
3936       - ``pps_beta_offset_div2``
3937       -
3938     * - __s8
3939       - ``pps_tc_offset_div2``
3940       -
3941     * - __u8
3942       - ``log2_parallel_merge_level_minus2``
3943       -
3944     * - __u8
3945       - ``padding[4]``
3946       - Applications and drivers must set this to zero.
3947     * - __u64
3948       - ``flags``
3949       - See :ref:`Picture Parameter Set Flags <hevc_pps_flags>`
3950
3951 .. _hevc_pps_flags:
3952
3953 ``Picture Parameter Set Flags``
3954
3955 .. cssclass:: longtable
3956
3957 .. flat-table::
3958     :header-rows:  0
3959     :stub-columns: 0
3960     :widths:       1 1 2
3961
3962     * - ``V4L2_HEVC_PPS_FLAG_DEPENDENT_SLICE_SEGMENT``
3963       - 0x00000001
3964       -
3965     * - ``V4L2_HEVC_PPS_FLAG_OUTPUT_FLAG_PRESENT``
3966       - 0x00000002
3967       -
3968     * - ``V4L2_HEVC_PPS_FLAG_SIGN_DATA_HIDING_ENABLED``
3969       - 0x00000004
3970       -
3971     * - ``V4L2_HEVC_PPS_FLAG_CABAC_INIT_PRESENT``
3972       - 0x00000008
3973       -
3974     * - ``V4L2_HEVC_PPS_FLAG_CONSTRAINED_INTRA_PRED``
3975       - 0x00000010
3976       -
3977     * - ``V4L2_HEVC_PPS_FLAG_TRANSFORM_SKIP_ENABLED``
3978       - 0x00000020
3979       -
3980     * - ``V4L2_HEVC_PPS_FLAG_CU_QP_DELTA_ENABLED``
3981       - 0x00000040
3982       -
3983     * - ``V4L2_HEVC_PPS_FLAG_PPS_SLICE_CHROMA_QP_OFFSETS_PRESENT``
3984       - 0x00000080
3985       -
3986     * - ``V4L2_HEVC_PPS_FLAG_WEIGHTED_PRED``
3987       - 0x00000100
3988       -
3989     * - ``V4L2_HEVC_PPS_FLAG_WEIGHTED_BIPRED``
3990       - 0x00000200
3991       -
3992     * - ``V4L2_HEVC_PPS_FLAG_TRANSQUANT_BYPASS_ENABLED``
3993       - 0x00000400
3994       -
3995     * - ``V4L2_HEVC_PPS_FLAG_TILES_ENABLED``
3996       - 0x00000800
3997       -
3998     * - ``V4L2_HEVC_PPS_FLAG_ENTROPY_CODING_SYNC_ENABLED``
3999       - 0x00001000
4000       -
4001     * - ``V4L2_HEVC_PPS_FLAG_LOOP_FILTER_ACROSS_TILES_ENABLED``
4002       - 0x00002000
4003       -
4004     * - ``V4L2_HEVC_PPS_FLAG_PPS_LOOP_FILTER_ACROSS_SLICES_ENABLED``
4005       - 0x00004000
4006       -
4007     * - ``V4L2_HEVC_PPS_FLAG_DEBLOCKING_FILTER_OVERRIDE_ENABLED``
4008       - 0x00008000
4009       -
4010     * - ``V4L2_HEVC_PPS_FLAG_PPS_DISABLE_DEBLOCKING_FILTER``
4011       - 0x00010000
4012       -
4013     * - ``V4L2_HEVC_PPS_FLAG_LISTS_MODIFICATION_PRESENT``
4014       - 0x00020000
4015       -
4016     * - ``V4L2_HEVC_PPS_FLAG_SLICE_SEGMENT_HEADER_EXTENSION_PRESENT``
4017       - 0x00040000
4018       -
4019
4020 ``V4L2_CID_MPEG_VIDEO_HEVC_SLICE_PARAMS (struct)``
4021     Specifies various slice-specific parameters, especially from the NAL unit
4022     header, general slice segment header and weighted prediction parameter
4023     parts of the bitstream.
4024     These bitstream parameters are defined according to :ref:`hevc`.
4025     They are described in section 7.4.7 "General slice segment header
4026     semantics" of the specification.
4027
4028 .. c:type:: v4l2_ctrl_hevc_slice_params
4029
4030 .. cssclass:: longtable
4031
4032 .. flat-table:: struct v4l2_ctrl_hevc_slice_params
4033     :header-rows:  0
4034     :stub-columns: 0
4035     :widths:       1 1 2
4036
4037     * - __u32
4038       - ``bit_size``
4039       - Size (in bits) of the current slice data.
4040     * - __u32
4041       - ``data_bit_offset``
4042       - Offset (in bits) to the video data in the current slice data.
4043     * - __u8
4044       - ``nal_unit_type``
4045       -
4046     * - __u8
4047       - ``nuh_temporal_id_plus1``
4048       -
4049     * - __u8
4050       - ``slice_type``
4051       -
4052         (V4L2_HEVC_SLICE_TYPE_I, V4L2_HEVC_SLICE_TYPE_P or
4053         V4L2_HEVC_SLICE_TYPE_B).
4054     * - __u8
4055       - ``colour_plane_id``
4056       -
4057     * - __u16
4058       - ``slice_pic_order_cnt``
4059       -
4060     * - __u8
4061       - ``num_ref_idx_l0_active_minus1``
4062       -
4063     * - __u8
4064       - ``num_ref_idx_l1_active_minus1``
4065       -
4066     * - __u8
4067       - ``collocated_ref_idx``
4068       -
4069     * - __u8
4070       - ``five_minus_max_num_merge_cand``
4071       -
4072     * - __s8
4073       - ``slice_qp_delta``
4074       -
4075     * - __s8
4076       - ``slice_cb_qp_offset``
4077       -
4078     * - __s8
4079       - ``slice_cr_qp_offset``
4080       -
4081     * - __s8
4082       - ``slice_act_y_qp_offset``
4083       -
4084     * - __s8
4085       - ``slice_act_cb_qp_offset``
4086       -
4087     * - __s8
4088       - ``slice_act_cr_qp_offset``
4089       -
4090     * - __s8
4091       - ``slice_beta_offset_div2``
4092       -
4093     * - __s8
4094       - ``slice_tc_offset_div2``
4095       -
4096     * - __u8
4097       - ``pic_struct``
4098       -
4099     * - __u8
4100       - ``num_active_dpb_entries``
4101       - The number of entries in ``dpb``.
4102     * - __u8
4103       - ``ref_idx_l0[V4L2_HEVC_DPB_ENTRIES_NUM_MAX]``
4104       - The list of L0 reference elements as indices in the DPB.
4105     * - __u8
4106       - ``ref_idx_l1[V4L2_HEVC_DPB_ENTRIES_NUM_MAX]``
4107       - The list of L1 reference elements as indices in the DPB.
4108     * - __u8
4109       - ``num_rps_poc_st_curr_before``
4110       - The number of reference pictures in the short-term set that come before
4111         the current frame.
4112     * - __u8
4113       - ``num_rps_poc_st_curr_after``
4114       - The number of reference pictures in the short-term set that come after
4115         the current frame.
4116     * - __u8
4117       - ``num_rps_poc_lt_curr``
4118       - The number of reference pictures in the long-term set.
4119     * - __u8
4120       - ``padding[7]``
4121       - Applications and drivers must set this to zero.
4122     * - struct :c:type:`v4l2_hevc_dpb_entry`
4123       - ``dpb[V4L2_HEVC_DPB_ENTRIES_NUM_MAX]``
4124       - The decoded picture buffer, for meta-data about reference frames.
4125     * - struct :c:type:`v4l2_hevc_pred_weight_table`
4126       - ``pred_weight_table``
4127       - The prediction weight coefficients for inter-picture prediction.
4128     * - __u64
4129       - ``flags``
4130       - See :ref:`Slice Parameters Flags <hevc_slice_params_flags>`
4131
4132 .. _hevc_slice_params_flags:
4133
4134 ``Slice Parameters Flags``
4135
4136 .. cssclass:: longtable
4137
4138 .. flat-table::
4139     :header-rows:  0
4140     :stub-columns: 0
4141     :widths:       1 1 2
4142
4143     * - ``V4L2_HEVC_SLICE_PARAMS_FLAG_SLICE_SAO_LUMA``
4144       - 0x00000001
4145       -
4146     * - ``V4L2_HEVC_SLICE_PARAMS_FLAG_SLICE_SAO_CHROMA``
4147       - 0x00000002
4148       -
4149     * - ``V4L2_HEVC_SLICE_PARAMS_FLAG_SLICE_TEMPORAL_MVP_ENABLED``
4150       - 0x00000004
4151       -
4152     * - ``V4L2_HEVC_SLICE_PARAMS_FLAG_MVD_L1_ZERO``
4153       - 0x00000008
4154       -
4155     * - ``V4L2_HEVC_SLICE_PARAMS_FLAG_CABAC_INIT``
4156       - 0x00000010
4157       -
4158     * - ``V4L2_HEVC_SLICE_PARAMS_FLAG_COLLOCATED_FROM_L0``
4159       - 0x00000020
4160       -
4161     * - ``V4L2_HEVC_SLICE_PARAMS_FLAG_USE_INTEGER_MV``
4162       - 0x00000040
4163       -
4164     * - ``V4L2_HEVC_SLICE_PARAMS_FLAG_SLICE_DEBLOCKING_FILTER_DISABLED``
4165       - 0x00000080
4166       -
4167     * - ``V4L2_HEVC_SLICE_PARAMS_FLAG_SLICE_LOOP_FILTER_ACROSS_SLICES_ENABLED``
4168       - 0x00000100
4169       -
4170
4171 .. c:type:: v4l2_hevc_dpb_entry
4172
4173 .. cssclass:: longtable
4174
4175 .. flat-table:: struct v4l2_hevc_dpb_entry
4176     :header-rows:  0
4177     :stub-columns: 0
4178     :widths:       1 1 2
4179
4180     * - __u64
4181       - ``timestamp``
4182       - Timestamp of the V4L2 capture buffer to use as reference, used
4183         with B-coded and P-coded frames. The timestamp refers to the
4184         ``timestamp`` field in struct :c:type:`v4l2_buffer`. Use the
4185         :c:func:`v4l2_timeval_to_ns()` function to convert the struct
4186         :c:type:`timeval` in struct :c:type:`v4l2_buffer` to a __u64.
4187     * - __u8
4188       - ``rps``
4189       - The reference set for the reference frame
4190         (V4L2_HEVC_DPB_ENTRY_RPS_ST_CURR_BEFORE,
4191         V4L2_HEVC_DPB_ENTRY_RPS_ST_CURR_AFTER or
4192         V4L2_HEVC_DPB_ENTRY_RPS_LT_CURR)
4193     * - __u8
4194       - ``field_pic``
4195       - Whether the reference is a field picture or a frame.
4196     * - __u16
4197       - ``pic_order_cnt[2]``
4198       - The picture order count of the reference. Only the first element of the
4199         array is used for frame pictures, while the first element identifies the
4200         top field and the second the bottom field in field-coded pictures.
4201     * - __u8
4202       - ``padding[2]``
4203       - Applications and drivers must set this to zero.
4204
4205 .. c:type:: v4l2_hevc_pred_weight_table
4206
4207 .. cssclass:: longtable
4208
4209 .. flat-table:: struct v4l2_hevc_pred_weight_table
4210     :header-rows:  0
4211     :stub-columns: 0
4212     :widths:       1 1 2
4213
4214     * - __u8
4215       - ``luma_log2_weight_denom``
4216       -
4217     * - __s8
4218       - ``delta_chroma_log2_weight_denom``
4219       -
4220     * - __s8
4221       - ``delta_luma_weight_l0[V4L2_HEVC_DPB_ENTRIES_NUM_MAX]``
4222       -
4223     * - __s8
4224       - ``luma_offset_l0[V4L2_HEVC_DPB_ENTRIES_NUM_MAX]``
4225       -
4226     * - __s8
4227       - ``delta_chroma_weight_l0[V4L2_HEVC_DPB_ENTRIES_NUM_MAX][2]``
4228       -
4229     * - __s8
4230       - ``chroma_offset_l0[V4L2_HEVC_DPB_ENTRIES_NUM_MAX][2]``
4231       -
4232     * - __s8
4233       - ``delta_luma_weight_l1[V4L2_HEVC_DPB_ENTRIES_NUM_MAX]``
4234       -
4235     * - __s8
4236       - ``luma_offset_l1[V4L2_HEVC_DPB_ENTRIES_NUM_MAX]``
4237       -
4238     * - __s8
4239       - ``delta_chroma_weight_l1[V4L2_HEVC_DPB_ENTRIES_NUM_MAX][2]``
4240       -
4241     * - __s8
4242       - ``chroma_offset_l1[V4L2_HEVC_DPB_ENTRIES_NUM_MAX][2]``
4243       -
4244     * - __u8
4245       - ``padding[6]``
4246       - Applications and drivers must set this to zero.
4247
4248 ``V4L2_CID_MPEG_VIDEO_HEVC_DECODE_MODE (enum)``
4249     Specifies the decoding mode to use. Currently exposes slice-based and
4250     frame-based decoding but new modes might be added later on.
4251     This control is used as a modifier for V4L2_PIX_FMT_HEVC_SLICE
4252     pixel format. Applications that support V4L2_PIX_FMT_HEVC_SLICE
4253     are required to set this control in order to specify the decoding mode
4254     that is expected for the buffer.
4255     Drivers may expose a single or multiple decoding modes, depending
4256     on what they can support.
4257
4258     .. note::
4259
4260        This menu control is not yet part of the public kernel API and
4261        it is expected to change.
4262
4263 .. c:type:: v4l2_mpeg_video_hevc_decode_mode
4264
4265 .. cssclass:: longtable
4266
4267 .. flat-table::
4268     :header-rows:  0
4269     :stub-columns: 0
4270     :widths:       1 1 2
4271
4272     * - ``V4L2_MPEG_VIDEO_HEVC_DECODE_MODE_SLICE_BASED``
4273       - 0
4274       - Decoding is done at the slice granularity.
4275         The OUTPUT buffer must contain a single slice.
4276     * - ``V4L2_MPEG_VIDEO_HEVC_DECODE_MODE_FRAME_BASED``
4277       - 1
4278       - Decoding is done at the frame granularity.
4279         The OUTPUT buffer must contain all slices needed to decode the
4280         frame. The OUTPUT buffer must also contain both fields.
4281
4282 ``V4L2_CID_MPEG_VIDEO_HEVC_START_CODE (enum)``
4283     Specifies the HEVC slice start code expected for each slice.
4284     This control is used as a modifier for V4L2_PIX_FMT_HEVC_SLICE
4285     pixel format. Applications that support V4L2_PIX_FMT_HEVC_SLICE
4286     are required to set this control in order to specify the start code
4287     that is expected for the buffer.
4288     Drivers may expose a single or multiple start codes, depending
4289     on what they can support.
4290
4291     .. note::
4292
4293        This menu control is not yet part of the public kernel API and
4294        it is expected to change.
4295
4296 .. c:type:: v4l2_mpeg_video_hevc_start_code
4297
4298 .. cssclass:: longtable
4299
4300 .. flat-table::
4301     :header-rows:  0
4302     :stub-columns: 0
4303     :widths:       1 1 2
4304
4305     * - ``V4L2_MPEG_VIDEO_HEVC_START_CODE_NONE``
4306       - 0
4307       - Selecting this value specifies that HEVC slices are passed
4308         to the driver without any start code.
4309     * - ``V4L2_MPEG_VIDEO_HEVC_START_CODE_ANNEX_B``
4310       - 1
4311       - Selecting this value specifies that HEVC slices are expected
4312         to be prefixed by Annex B start codes. According to :ref:`hevc`
4313         valid start codes can be 3-bytes 0x000001 or 4-bytes 0x00000001.