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