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.. tabularcolumns:: |p{9.1cm}|p{8.4cm}|
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{8.2cm}|p{9.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.. raw:: latex
877
878    \small
879
880.. tabularcolumns:: |p{10.2cm}|p{7.3cm}|
881
882.. flat-table::
883    :header-rows:  0
884    :stub-columns: 0
885
886    * - ``V4L2_MPEG_VIDEO_H264_PROFILE_BASELINE``
887      - Baseline profile
888    * - ``V4L2_MPEG_VIDEO_H264_PROFILE_CONSTRAINED_BASELINE``
889      - Constrained Baseline profile
890    * - ``V4L2_MPEG_VIDEO_H264_PROFILE_MAIN``
891      - Main profile
892    * - ``V4L2_MPEG_VIDEO_H264_PROFILE_EXTENDED``
893      - Extended profile
894    * - ``V4L2_MPEG_VIDEO_H264_PROFILE_HIGH``
895      - High profile
896    * - ``V4L2_MPEG_VIDEO_H264_PROFILE_HIGH_10``
897      - High 10 profile
898    * - ``V4L2_MPEG_VIDEO_H264_PROFILE_HIGH_422``
899      - High 422 profile
900    * - ``V4L2_MPEG_VIDEO_H264_PROFILE_HIGH_444_PREDICTIVE``
901      - High 444 Predictive profile
902    * - ``V4L2_MPEG_VIDEO_H264_PROFILE_HIGH_10_INTRA``
903      - High 10 Intra profile
904    * - ``V4L2_MPEG_VIDEO_H264_PROFILE_HIGH_422_INTRA``
905      - High 422 Intra profile
906    * - ``V4L2_MPEG_VIDEO_H264_PROFILE_HIGH_444_INTRA``
907      - High 444 Intra profile
908    * - ``V4L2_MPEG_VIDEO_H264_PROFILE_CAVLC_444_INTRA``
909      - CAVLC 444 Intra profile
910    * - ``V4L2_MPEG_VIDEO_H264_PROFILE_SCALABLE_BASELINE``
911      - Scalable Baseline profile
912    * - ``V4L2_MPEG_VIDEO_H264_PROFILE_SCALABLE_HIGH``
913      - Scalable High profile
914    * - ``V4L2_MPEG_VIDEO_H264_PROFILE_SCALABLE_HIGH_INTRA``
915      - Scalable High Intra profile
916    * - ``V4L2_MPEG_VIDEO_H264_PROFILE_STEREO_HIGH``
917      - Stereo High profile
918    * - ``V4L2_MPEG_VIDEO_H264_PROFILE_MULTIVIEW_HIGH``
919      - Multiview High profile
920    * - ``V4L2_MPEG_VIDEO_H264_PROFILE_CONSTRAINED_HIGH``
921      - Constrained High profile
922
923.. raw:: latex
924
925    \normalsize
926
927.. _v4l2-mpeg-video-mpeg2-profile:
928
929``V4L2_CID_MPEG_VIDEO_MPEG2_PROFILE``
930    (enum)
931
932enum v4l2_mpeg_video_mpeg2_profile -
933    The profile information for MPEG2. Applicable to MPEG2 codecs.
934    Possible values are:
935
936.. raw:: latex
937
938    \small
939
940.. tabularcolumns:: |p{10.2cm}|p{7.3cm}|
941
942.. flat-table::
943    :header-rows:  0
944    :stub-columns: 0
945
946    * - ``V4L2_MPEG_VIDEO_MPEG2_PROFILE_SIMPLE``
947      - Simple profile (SP)
948    * - ``V4L2_MPEG_VIDEO_MPEG2_PROFILE_MAIN``
949      - Main profile (MP)
950    * - ``V4L2_MPEG_VIDEO_MPEG2_PROFILE_SNR_SCALABLE``
951      - SNR Scalable profile (SNR)
952    * - ``V4L2_MPEG_VIDEO_MPEG2_PROFILE_SPATIALLY_SCALABLE``
953      - Spatially Scalable profile (Spt)
954    * - ``V4L2_MPEG_VIDEO_MPEG2_PROFILE_HIGH``
955      - High profile (HP)
956    * - ``V4L2_MPEG_VIDEO_MPEG2_PROFILE_MULTIVIEW``
957      - Multi-view profile (MVP)
958
959
960.. raw:: latex
961
962    \normalsize
963
964.. _v4l2-mpeg-video-mpeg4-profile:
965
966``V4L2_CID_MPEG_VIDEO_MPEG4_PROFILE``
967    (enum)
968
969enum v4l2_mpeg_video_mpeg4_profile -
970    The profile information for MPEG4. Applicable to the MPEG4 encoder.
971    Possible values are:
972
973.. raw:: latex
974
975    \small
976
977.. tabularcolumns:: |p{11.8cm}|p{5.7cm}|
978
979.. flat-table::
980    :header-rows:  0
981    :stub-columns: 0
982
983    * - ``V4L2_MPEG_VIDEO_MPEG4_PROFILE_SIMPLE``
984      - Simple profile
985    * - ``V4L2_MPEG_VIDEO_MPEG4_PROFILE_ADVANCED_SIMPLE``
986      - Advanced Simple profile
987    * - ``V4L2_MPEG_VIDEO_MPEG4_PROFILE_CORE``
988      - Core profile
989    * - ``V4L2_MPEG_VIDEO_MPEG4_PROFILE_SIMPLE_SCALABLE``
990      - Simple Scalable profile
991    * - ``V4L2_MPEG_VIDEO_MPEG4_PROFILE_ADVANCED_CODING_EFFICIENCY``
992      - Advanced Coding Efficiency profile
993
994.. raw:: latex
995
996    \normalsize
997
998``V4L2_CID_MPEG_VIDEO_MAX_REF_PIC (integer)``
999    The maximum number of reference pictures used for encoding.
1000    Applicable to the encoder.
1001
1002.. _v4l2-mpeg-video-multi-slice-mode:
1003
1004``V4L2_CID_MPEG_VIDEO_MULTI_SLICE_MODE``
1005    (enum)
1006
1007enum v4l2_mpeg_video_multi_slice_mode -
1008    Determines how the encoder should handle division of frame into
1009    slices. Applicable to the encoder. Possible values are:
1010
1011
1012
1013.. tabularcolumns:: |p{9.6cm}|p{7.9cm}|
1014
1015.. flat-table::
1016    :header-rows:  0
1017    :stub-columns: 0
1018
1019    * - ``V4L2_MPEG_VIDEO_MULTI_SLICE_MODE_SINGLE``
1020      - Single slice per frame.
1021    * - ``V4L2_MPEG_VIDEO_MULTI_SLICE_MODE_MAX_MB``
1022      - Multiple slices with set maximum number of macroblocks per slice.
1023    * - ``V4L2_MPEG_VIDEO_MULTI_SLICE_MODE_MAX_BYTES``
1024      - Multiple slice with set maximum size in bytes per slice.
1025
1026
1027
1028``V4L2_CID_MPEG_VIDEO_MULTI_SLICE_MAX_MB (integer)``
1029    The maximum number of macroblocks in a slice. Used when
1030    ``V4L2_CID_MPEG_VIDEO_MULTI_SLICE_MODE`` is set to
1031    ``V4L2_MPEG_VIDEO_MULTI_SLICE_MODE_MAX_MB``. Applicable to the
1032    encoder.
1033
1034``V4L2_CID_MPEG_VIDEO_MULTI_SLICE_MAX_BYTES (integer)``
1035    The maximum size of a slice in bytes. Used when
1036    ``V4L2_CID_MPEG_VIDEO_MULTI_SLICE_MODE`` is set to
1037    ``V4L2_MPEG_VIDEO_MULTI_SLICE_MODE_MAX_BYTES``. Applicable to the
1038    encoder.
1039
1040.. _v4l2-mpeg-video-h264-loop-filter-mode:
1041
1042``V4L2_CID_MPEG_VIDEO_H264_LOOP_FILTER_MODE``
1043    (enum)
1044
1045enum v4l2_mpeg_video_h264_loop_filter_mode -
1046    Loop filter mode for H264 encoder. Possible values are:
1047
1048.. raw:: latex
1049
1050    \small
1051
1052.. tabularcolumns:: |p{13.5cm}|p{4.0cm}|
1053
1054.. flat-table::
1055    :header-rows:  0
1056    :stub-columns: 0
1057
1058    * - ``V4L2_MPEG_VIDEO_H264_LOOP_FILTER_MODE_ENABLED``
1059      - Loop filter is enabled.
1060    * - ``V4L2_MPEG_VIDEO_H264_LOOP_FILTER_MODE_DISABLED``
1061      - Loop filter is disabled.
1062    * - ``V4L2_MPEG_VIDEO_H264_LOOP_FILTER_MODE_DISABLED_AT_SLICE_BOUNDARY``
1063      - Loop filter is disabled at the slice boundary.
1064
1065.. raw:: latex
1066
1067    \normalsize
1068
1069
1070``V4L2_CID_MPEG_VIDEO_H264_LOOP_FILTER_ALPHA (integer)``
1071    Loop filter alpha coefficient, defined in the H264 standard.
1072    This value corresponds to the slice_alpha_c0_offset_div2 slice header
1073    field, and should be in the range of -6 to +6, inclusive. The actual alpha
1074    offset FilterOffsetA is twice this value.
1075    Applicable to the H264 encoder.
1076
1077``V4L2_CID_MPEG_VIDEO_H264_LOOP_FILTER_BETA (integer)``
1078    Loop filter beta coefficient, defined in the H264 standard.
1079    This corresponds to the slice_beta_offset_div2 slice header field, and
1080    should be in the range of -6 to +6, inclusive. The actual beta offset
1081    FilterOffsetB is twice this value.
1082    Applicable to the H264 encoder.
1083
1084.. _v4l2-mpeg-video-h264-entropy-mode:
1085
1086``V4L2_CID_MPEG_VIDEO_H264_ENTROPY_MODE``
1087    (enum)
1088
1089enum v4l2_mpeg_video_h264_entropy_mode -
1090    Entropy coding mode for H264 - CABAC/CAVALC. Applicable to the H264
1091    encoder. Possible values are:
1092
1093
1094.. tabularcolumns:: |p{9.0cm}|p{8.5cm}|
1095
1096
1097.. flat-table::
1098    :header-rows:  0
1099    :stub-columns: 0
1100
1101    * - ``V4L2_MPEG_VIDEO_H264_ENTROPY_MODE_CAVLC``
1102      - Use CAVLC entropy coding.
1103    * - ``V4L2_MPEG_VIDEO_H264_ENTROPY_MODE_CABAC``
1104      - Use CABAC entropy coding.
1105
1106
1107
1108``V4L2_CID_MPEG_VIDEO_H264_8X8_TRANSFORM (boolean)``
1109    Enable 8X8 transform for H264. Applicable to the H264 encoder.
1110
1111``V4L2_CID_MPEG_VIDEO_H264_CONSTRAINED_INTRA_PREDICTION (boolean)``
1112    Enable constrained intra prediction for H264. Applicable to the H264
1113    encoder.
1114
1115``V4L2_CID_MPEG_VIDEO_H264_CHROMA_QP_INDEX_OFFSET (integer)``
1116    Specify the offset that should be added to the luma quantization
1117    parameter to determine the chroma quantization parameter. Applicable
1118    to the H264 encoder.
1119
1120``V4L2_CID_MPEG_VIDEO_CYCLIC_INTRA_REFRESH_MB (integer)``
1121    Cyclic intra macroblock refresh. This is the number of continuous
1122    macroblocks refreshed every frame. Each frame a successive set of
1123    macroblocks is refreshed until the cycle completes and starts from
1124    the top of the frame. Applicable to H264, H263 and MPEG4 encoder.
1125
1126``V4L2_CID_MPEG_VIDEO_FRAME_RC_ENABLE (boolean)``
1127    Frame level rate control enable. If this control is disabled then
1128    the quantization parameter for each frame type is constant and set
1129    with appropriate controls (e.g.
1130    ``V4L2_CID_MPEG_VIDEO_H263_I_FRAME_QP``). If frame rate control is
1131    enabled then quantization parameter is adjusted to meet the chosen
1132    bitrate. Minimum and maximum value for the quantization parameter
1133    can be set with appropriate controls (e.g.
1134    ``V4L2_CID_MPEG_VIDEO_H263_MIN_QP``). Applicable to encoders.
1135
1136``V4L2_CID_MPEG_VIDEO_MB_RC_ENABLE (boolean)``
1137    Macroblock level rate control enable. Applicable to the MPEG4 and
1138    H264 encoders.
1139
1140``V4L2_CID_MPEG_VIDEO_MPEG4_QPEL (boolean)``
1141    Quarter pixel motion estimation for MPEG4. Applicable to the MPEG4
1142    encoder.
1143
1144``V4L2_CID_MPEG_VIDEO_H263_I_FRAME_QP (integer)``
1145    Quantization parameter for an I frame for H263. Valid range: from 1
1146    to 31.
1147
1148``V4L2_CID_MPEG_VIDEO_H263_MIN_QP (integer)``
1149    Minimum quantization parameter for H263. Valid range: from 1 to 31.
1150
1151``V4L2_CID_MPEG_VIDEO_H263_MAX_QP (integer)``
1152    Maximum quantization parameter for H263. Valid range: from 1 to 31.
1153
1154``V4L2_CID_MPEG_VIDEO_H263_P_FRAME_QP (integer)``
1155    Quantization parameter for an P frame for H263. Valid range: from 1
1156    to 31.
1157
1158``V4L2_CID_MPEG_VIDEO_H263_B_FRAME_QP (integer)``
1159    Quantization parameter for an B frame for H263. Valid range: from 1
1160    to 31.
1161
1162``V4L2_CID_MPEG_VIDEO_H264_I_FRAME_QP (integer)``
1163    Quantization parameter for an I frame for H264. Valid range: from 0
1164    to 51.
1165
1166``V4L2_CID_MPEG_VIDEO_H264_MIN_QP (integer)``
1167    Minimum quantization parameter for H264. Valid range: from 0 to 51.
1168
1169``V4L2_CID_MPEG_VIDEO_H264_MAX_QP (integer)``
1170    Maximum quantization parameter for H264. Valid range: from 0 to 51.
1171
1172``V4L2_CID_MPEG_VIDEO_H264_P_FRAME_QP (integer)``
1173    Quantization parameter for an P frame for H264. Valid range: from 0
1174    to 51.
1175
1176``V4L2_CID_MPEG_VIDEO_H264_B_FRAME_QP (integer)``
1177    Quantization parameter for an B frame for H264. Valid range: from 0
1178    to 51.
1179
1180``V4L2_CID_MPEG_VIDEO_H264_I_FRAME_MIN_QP (integer)``
1181    Minimum quantization parameter for the H264 I frame to limit I frame
1182    quality to a range. Valid range: from 0 to 51. If
1183    V4L2_CID_MPEG_VIDEO_H264_MIN_QP is also set, the quantization parameter
1184    should be chosen to meet both requirements.
1185
1186``V4L2_CID_MPEG_VIDEO_H264_I_FRAME_MAX_QP (integer)``
1187    Maximum quantization parameter for the H264 I frame to limit I frame
1188    quality to a range. Valid range: from 0 to 51. If
1189    V4L2_CID_MPEG_VIDEO_H264_MAX_QP is also set, the quantization parameter
1190    should be chosen to meet both requirements.
1191
1192``V4L2_CID_MPEG_VIDEO_H264_P_FRAME_MIN_QP (integer)``
1193    Minimum quantization parameter for the H264 P frame to limit P frame
1194    quality to a range. Valid range: from 0 to 51. If
1195    V4L2_CID_MPEG_VIDEO_H264_MIN_QP is also set, the quantization parameter
1196    should be chosen to meet both requirements.
1197
1198``V4L2_CID_MPEG_VIDEO_H264_P_FRAME_MAX_QP (integer)``
1199    Maximum quantization parameter for the H264 P frame to limit P frame
1200    quality to a range. Valid range: from 0 to 51. If
1201    V4L2_CID_MPEG_VIDEO_H264_MAX_QP is also set, the quantization parameter
1202    should be chosen to meet both requirements.
1203
1204``V4L2_CID_MPEG_VIDEO_H264_B_FRAME_MIN_QP (integer)``
1205    Minimum quantization parameter for the H264 B frame to limit B frame
1206    quality to a range. Valid range: from 0 to 51. If
1207    V4L2_CID_MPEG_VIDEO_H264_MIN_QP is also set, the quantization parameter
1208    should be chosen to meet both requirements.
1209
1210``V4L2_CID_MPEG_VIDEO_H264_B_FRAME_MAX_QP (integer)``
1211    Maximum quantization parameter for the H264 B frame to limit B frame
1212    quality to a range. Valid range: from 0 to 51. If
1213    V4L2_CID_MPEG_VIDEO_H264_MAX_QP is also set, the quantization parameter
1214    should be chosen to meet both requirements.
1215
1216``V4L2_CID_MPEG_VIDEO_MPEG4_I_FRAME_QP (integer)``
1217    Quantization parameter for an I frame for MPEG4. Valid range: from 1
1218    to 31.
1219
1220``V4L2_CID_MPEG_VIDEO_MPEG4_MIN_QP (integer)``
1221    Minimum quantization parameter for MPEG4. Valid range: from 1 to 31.
1222
1223``V4L2_CID_MPEG_VIDEO_MPEG4_MAX_QP (integer)``
1224    Maximum quantization parameter for MPEG4. Valid range: from 1 to 31.
1225
1226``V4L2_CID_MPEG_VIDEO_MPEG4_P_FRAME_QP (integer)``
1227    Quantization parameter for an P frame for MPEG4. Valid range: from 1
1228    to 31.
1229
1230``V4L2_CID_MPEG_VIDEO_MPEG4_B_FRAME_QP (integer)``
1231    Quantization parameter for an B frame for MPEG4. Valid range: from 1
1232    to 31.
1233
1234.. _v4l2-mpeg-video-vbv-size:
1235
1236``V4L2_CID_MPEG_VIDEO_VBV_SIZE (integer)``
1237    The Video Buffer Verifier size in kilobytes, it is used as a
1238    limitation of frame skip. The VBV is defined in the standard as a
1239    mean to verify that the produced stream will be successfully
1240    decoded. The standard describes it as "Part of a hypothetical
1241    decoder that is conceptually connected to the output of the encoder.
1242    Its purpose is to provide a constraint on the variability of the
1243    data rate that an encoder or editing process may produce.".
1244    Applicable to the MPEG1, MPEG2, MPEG4 encoders.
1245
1246.. _v4l2-mpeg-video-vbv-delay:
1247
1248``V4L2_CID_MPEG_VIDEO_VBV_DELAY (integer)``
1249    Sets the initial delay in milliseconds for VBV buffer control.
1250
1251.. _v4l2-mpeg-video-hor-search-range:
1252
1253``V4L2_CID_MPEG_VIDEO_MV_H_SEARCH_RANGE (integer)``
1254    Horizontal search range defines maximum horizontal search area in
1255    pixels to search and match for the present Macroblock (MB) in the
1256    reference picture. This V4L2 control macro is used to set horizontal
1257    search range for motion estimation module in video encoder.
1258
1259.. _v4l2-mpeg-video-vert-search-range:
1260
1261``V4L2_CID_MPEG_VIDEO_MV_V_SEARCH_RANGE (integer)``
1262    Vertical search range defines maximum vertical search area in pixels
1263    to search and match for the present Macroblock (MB) in the reference
1264    picture. This V4L2 control macro is used to set vertical search
1265    range for motion estimation module in video encoder.
1266
1267.. _v4l2-mpeg-video-force-key-frame:
1268
1269``V4L2_CID_MPEG_VIDEO_FORCE_KEY_FRAME (button)``
1270    Force a key frame for the next queued buffer. Applicable to
1271    encoders. This is a general, codec-agnostic keyframe control.
1272
1273.. _v4l2-mpeg-video-h264-cpb-size:
1274
1275``V4L2_CID_MPEG_VIDEO_H264_CPB_SIZE (integer)``
1276    The Coded Picture Buffer size in kilobytes, it is used as a
1277    limitation of frame skip. The CPB is defined in the H264 standard as
1278    a mean to verify that the produced stream will be successfully
1279    decoded. Applicable to the H264 encoder.
1280
1281``V4L2_CID_MPEG_VIDEO_H264_I_PERIOD (integer)``
1282    Period between I-frames in the open GOP for H264. In case of an open
1283    GOP this is the period between two I-frames. The period between IDR
1284    (Instantaneous Decoding Refresh) frames is taken from the GOP_SIZE
1285    control. An IDR frame, which stands for Instantaneous Decoding
1286    Refresh is an I-frame after which no prior frames are referenced.
1287    This means that a stream can be restarted from an IDR frame without
1288    the need to store or decode any previous frames. Applicable to the
1289    H264 encoder.
1290
1291.. _v4l2-mpeg-video-header-mode:
1292
1293``V4L2_CID_MPEG_VIDEO_HEADER_MODE``
1294    (enum)
1295
1296enum v4l2_mpeg_video_header_mode -
1297    Determines whether the header is returned as the first buffer or is
1298    it returned together with the first frame. Applicable to encoders.
1299    Possible values are:
1300
1301.. raw:: latex
1302
1303    \small
1304
1305.. tabularcolumns:: |p{10.3cm}|p{7.2cm}|
1306
1307.. flat-table::
1308    :header-rows:  0
1309    :stub-columns: 0
1310
1311    * - ``V4L2_MPEG_VIDEO_HEADER_MODE_SEPARATE``
1312      - The stream header is returned separately in the first buffer.
1313    * - ``V4L2_MPEG_VIDEO_HEADER_MODE_JOINED_WITH_1ST_FRAME``
1314      - The stream header is returned together with the first encoded
1315	frame.
1316
1317.. raw:: latex
1318
1319    \normalsize
1320
1321
1322``V4L2_CID_MPEG_VIDEO_REPEAT_SEQ_HEADER (boolean)``
1323    Repeat the video sequence headers. Repeating these headers makes
1324    random access to the video stream easier. Applicable to the MPEG1, 2
1325    and 4 encoder.
1326
1327``V4L2_CID_MPEG_VIDEO_DECODER_MPEG4_DEBLOCK_FILTER (boolean)``
1328    Enabled the deblocking post processing filter for MPEG4 decoder.
1329    Applicable to the MPEG4 decoder.
1330
1331``V4L2_CID_MPEG_VIDEO_MPEG4_VOP_TIME_RES (integer)``
1332    vop_time_increment_resolution value for MPEG4. Applicable to the
1333    MPEG4 encoder.
1334
1335``V4L2_CID_MPEG_VIDEO_MPEG4_VOP_TIME_INC (integer)``
1336    vop_time_increment value for MPEG4. Applicable to the MPEG4
1337    encoder.
1338
1339``V4L2_CID_MPEG_VIDEO_H264_SEI_FRAME_PACKING (boolean)``
1340    Enable generation of frame packing supplemental enhancement
1341    information in the encoded bitstream. The frame packing SEI message
1342    contains the arrangement of L and R planes for 3D viewing.
1343    Applicable to the H264 encoder.
1344
1345``V4L2_CID_MPEG_VIDEO_H264_SEI_FP_CURRENT_FRAME_0 (boolean)``
1346    Sets current frame as frame0 in frame packing SEI. Applicable to the
1347    H264 encoder.
1348
1349.. _v4l2-mpeg-video-h264-sei-fp-arrangement-type:
1350
1351``V4L2_CID_MPEG_VIDEO_H264_SEI_FP_ARRANGEMENT_TYPE``
1352    (enum)
1353
1354enum v4l2_mpeg_video_h264_sei_fp_arrangement_type -
1355    Frame packing arrangement type for H264 SEI. Applicable to the H264
1356    encoder. Possible values are:
1357
1358.. raw:: latex
1359
1360    \small
1361
1362.. tabularcolumns:: |p{12cm}|p{5.5cm}|
1363
1364.. flat-table::
1365    :header-rows:  0
1366    :stub-columns: 0
1367
1368    * - ``V4L2_MPEG_VIDEO_H264_SEI_FP_ARRANGEMENT_TYPE_CHEKERBOARD``
1369      - Pixels are alternatively from L and R.
1370    * - ``V4L2_MPEG_VIDEO_H264_SEI_FP_ARRANGEMENT_TYPE_COLUMN``
1371      - L and R are interlaced by column.
1372    * - ``V4L2_MPEG_VIDEO_H264_SEI_FP_ARRANGEMENT_TYPE_ROW``
1373      - L and R are interlaced by row.
1374    * - ``V4L2_MPEG_VIDEO_H264_SEI_FP_ARRANGEMENT_TYPE_SIDE_BY_SIDE``
1375      - L is on the left, R on the right.
1376    * - ``V4L2_MPEG_VIDEO_H264_SEI_FP_ARRANGEMENT_TYPE_TOP_BOTTOM``
1377      - L is on top, R on bottom.
1378    * - ``V4L2_MPEG_VIDEO_H264_SEI_FP_ARRANGEMENT_TYPE_TEMPORAL``
1379      - One view per frame.
1380
1381.. raw:: latex
1382
1383    \normalsize
1384
1385
1386
1387``V4L2_CID_MPEG_VIDEO_H264_FMO (boolean)``
1388    Enables flexible macroblock ordering in the encoded bitstream. It is
1389    a technique used for restructuring the ordering of macroblocks in
1390    pictures. Applicable to the H264 encoder.
1391
1392.. _v4l2-mpeg-video-h264-fmo-map-type:
1393
1394``V4L2_CID_MPEG_VIDEO_H264_FMO_MAP_TYPE``
1395   (enum)
1396
1397enum v4l2_mpeg_video_h264_fmo_map_type -
1398    When using FMO, the map type divides the image in different scan
1399    patterns of macroblocks. Applicable to the H264 encoder. Possible
1400    values are:
1401
1402.. raw:: latex
1403
1404    \small
1405
1406.. tabularcolumns:: |p{12.5cm}|p{5.0cm}|
1407
1408.. flat-table::
1409    :header-rows:  0
1410    :stub-columns: 0
1411
1412    * - ``V4L2_MPEG_VIDEO_H264_FMO_MAP_TYPE_INTERLEAVED_SLICES``
1413      - Slices are interleaved one after other with macroblocks in run
1414	length order.
1415    * - ``V4L2_MPEG_VIDEO_H264_FMO_MAP_TYPE_SCATTERED_SLICES``
1416      - Scatters the macroblocks based on a mathematical function known to
1417	both encoder and decoder.
1418    * - ``V4L2_MPEG_VIDEO_H264_FMO_MAP_TYPE_FOREGROUND_WITH_LEFT_OVER``
1419      - Macroblocks arranged in rectangular areas or regions of interest.
1420    * - ``V4L2_MPEG_VIDEO_H264_FMO_MAP_TYPE_BOX_OUT``
1421      - Slice groups grow in a cyclic way from centre to outwards.
1422    * - ``V4L2_MPEG_VIDEO_H264_FMO_MAP_TYPE_RASTER_SCAN``
1423      - Slice groups grow in raster scan pattern from left to right.
1424    * - ``V4L2_MPEG_VIDEO_H264_FMO_MAP_TYPE_WIPE_SCAN``
1425      - Slice groups grow in wipe scan pattern from top to bottom.
1426    * - ``V4L2_MPEG_VIDEO_H264_FMO_MAP_TYPE_EXPLICIT``
1427      - User defined map type.
1428
1429.. raw:: latex
1430
1431    \normalsize
1432
1433
1434
1435``V4L2_CID_MPEG_VIDEO_H264_FMO_SLICE_GROUP (integer)``
1436    Number of slice groups in FMO. Applicable to the H264 encoder.
1437
1438.. _v4l2-mpeg-video-h264-fmo-change-direction:
1439
1440``V4L2_CID_MPEG_VIDEO_H264_FMO_CHANGE_DIRECTION``
1441    (enum)
1442
1443enum v4l2_mpeg_video_h264_fmo_change_dir -
1444    Specifies a direction of the slice group change for raster and wipe
1445    maps. Applicable to the H264 encoder. Possible values are:
1446
1447.. tabularcolumns:: |p{9.6cm}|p{7.9cm}|
1448
1449.. flat-table::
1450    :header-rows:  0
1451    :stub-columns: 0
1452
1453    * - ``V4L2_MPEG_VIDEO_H264_FMO_CHANGE_DIR_RIGHT``
1454      - Raster scan or wipe right.
1455    * - ``V4L2_MPEG_VIDEO_H264_FMO_CHANGE_DIR_LEFT``
1456      - Reverse raster scan or wipe left.
1457
1458
1459
1460``V4L2_CID_MPEG_VIDEO_H264_FMO_CHANGE_RATE (integer)``
1461    Specifies the size of the first slice group for raster and wipe map.
1462    Applicable to the H264 encoder.
1463
1464``V4L2_CID_MPEG_VIDEO_H264_FMO_RUN_LENGTH (integer)``
1465    Specifies the number of consecutive macroblocks for the interleaved
1466    map. Applicable to the H264 encoder.
1467
1468``V4L2_CID_MPEG_VIDEO_H264_ASO (boolean)``
1469    Enables arbitrary slice ordering in encoded bitstream. Applicable to
1470    the H264 encoder.
1471
1472``V4L2_CID_MPEG_VIDEO_H264_ASO_SLICE_ORDER (integer)``
1473    Specifies the slice order in ASO. Applicable to the H264 encoder.
1474    The supplied 32-bit integer is interpreted as follows (bit 0 = least
1475    significant bit):
1476
1477
1478
1479.. flat-table::
1480    :header-rows:  0
1481    :stub-columns: 0
1482
1483    * - Bit 0:15
1484      - Slice ID
1485    * - Bit 16:32
1486      - Slice position or order
1487
1488
1489
1490``V4L2_CID_MPEG_VIDEO_H264_HIERARCHICAL_CODING (boolean)``
1491    Enables H264 hierarchical coding. Applicable to the H264 encoder.
1492
1493.. _v4l2-mpeg-video-h264-hierarchical-coding-type:
1494
1495``V4L2_CID_MPEG_VIDEO_H264_HIERARCHICAL_CODING_TYPE``
1496    (enum)
1497
1498enum v4l2_mpeg_video_h264_hierarchical_coding_type -
1499    Specifies the hierarchical coding type. Applicable to the H264
1500    encoder. Possible values are:
1501
1502
1503
1504.. flat-table::
1505    :header-rows:  0
1506    :stub-columns: 0
1507
1508    * - ``V4L2_MPEG_VIDEO_H264_HIERARCHICAL_CODING_B``
1509      - Hierarchical B coding.
1510    * - ``V4L2_MPEG_VIDEO_H264_HIERARCHICAL_CODING_P``
1511      - Hierarchical P coding.
1512
1513
1514
1515``V4L2_CID_MPEG_VIDEO_H264_HIERARCHICAL_CODING_LAYER (integer)``
1516    Specifies the number of hierarchical coding layers. Applicable to
1517    the H264 encoder.
1518
1519``V4L2_CID_MPEG_VIDEO_H264_HIERARCHICAL_CODING_LAYER_QP (integer)``
1520    Specifies a user defined QP for each layer. Applicable to the H264
1521    encoder. The supplied 32-bit integer is interpreted as follows (bit
1522    0 = least significant bit):
1523
1524
1525
1526.. flat-table::
1527    :header-rows:  0
1528    :stub-columns: 0
1529
1530    * - Bit 0:15
1531      - QP value
1532    * - Bit 16:32
1533      - Layer number
1534
1535``V4L2_CID_MPEG_VIDEO_H264_HIER_CODING_L0_BR (integer)``
1536    Indicates bit rate (bps) for hierarchical coding layer 0 for H264 encoder.
1537
1538``V4L2_CID_MPEG_VIDEO_H264_HIER_CODING_L1_BR (integer)``
1539    Indicates bit rate (bps) for hierarchical coding layer 1 for H264 encoder.
1540
1541``V4L2_CID_MPEG_VIDEO_H264_HIER_CODING_L2_BR (integer)``
1542    Indicates bit rate (bps) for hierarchical coding layer 2 for H264 encoder.
1543
1544``V4L2_CID_MPEG_VIDEO_H264_HIER_CODING_L3_BR (integer)``
1545    Indicates bit rate (bps) for hierarchical coding layer 3 for H264 encoder.
1546
1547``V4L2_CID_MPEG_VIDEO_H264_HIER_CODING_L4_BR (integer)``
1548    Indicates bit rate (bps) for hierarchical coding layer 4 for H264 encoder.
1549
1550``V4L2_CID_MPEG_VIDEO_H264_HIER_CODING_L5_BR (integer)``
1551    Indicates bit rate (bps) for hierarchical coding layer 5 for H264 encoder.
1552
1553``V4L2_CID_MPEG_VIDEO_H264_HIER_CODING_L6_BR (integer)``
1554    Indicates bit rate (bps) for hierarchical coding layer 6 for H264 encoder.
1555
1556.. _v4l2-mpeg-mpeg2:
1557
1558``V4L2_CID_MPEG_VIDEO_MPEG2_SLICE_PARAMS (struct)``
1559    Specifies the slice parameters (as extracted from the bitstream) for the
1560    associated MPEG-2 slice data. This includes the necessary parameters for
1561    configuring a stateless hardware decoding pipeline for MPEG-2.
1562    The bitstream parameters are defined according to :ref:`mpeg2part2`.
1563
1564    .. note::
1565
1566       This compound control is not yet part of the public kernel API and
1567       it is expected to change.
1568
1569.. c:type:: v4l2_ctrl_mpeg2_slice_params
1570
1571.. tabularcolumns:: |p{5.6cm}|p{4.6cm}|p{7.1cm}|
1572
1573.. cssclass:: longtable
1574
1575.. flat-table:: struct v4l2_ctrl_mpeg2_slice_params
1576    :header-rows:  0
1577    :stub-columns: 0
1578    :widths:       1 1 2
1579
1580    * - __u32
1581      - ``bit_size``
1582      - Size (in bits) of the current slice data.
1583    * - __u32
1584      - ``data_bit_offset``
1585      - Offset (in bits) to the video data in the current slice data.
1586    * - struct :c:type:`v4l2_mpeg2_sequence`
1587      - ``sequence``
1588      - Structure with MPEG-2 sequence metadata, merging relevant fields from
1589	the sequence header and sequence extension parts of the bitstream.
1590    * - struct :c:type:`v4l2_mpeg2_picture`
1591      - ``picture``
1592      - Structure with MPEG-2 picture metadata, merging relevant fields from
1593	the picture header and picture coding extension parts of the bitstream.
1594    * - __u64
1595      - ``backward_ref_ts``
1596      - Timestamp of the V4L2 capture buffer to use as backward reference, used
1597        with B-coded and P-coded frames. The timestamp refers to the
1598	``timestamp`` field in struct :c:type:`v4l2_buffer`. Use the
1599	:c:func:`v4l2_timeval_to_ns()` function to convert the struct
1600	:c:type:`timeval` in struct :c:type:`v4l2_buffer` to a __u64.
1601    * - __u64
1602      - ``forward_ref_ts``
1603      - Timestamp for the V4L2 capture buffer to use as forward reference, used
1604        with B-coded frames. The timestamp refers to the ``timestamp`` field in
1605	struct :c:type:`v4l2_buffer`. Use the :c:func:`v4l2_timeval_to_ns()`
1606	function to convert the struct :c:type:`timeval` in struct
1607	:c:type:`v4l2_buffer` to a __u64.
1608    * - __u32
1609      - ``quantiser_scale_code``
1610      - Code used to determine the quantization scale to use for the IDCT.
1611
1612.. c:type:: v4l2_mpeg2_sequence
1613
1614.. cssclass:: longtable
1615
1616.. tabularcolumns:: |p{1.4cm}|p{6.5cm}|p{9.4cm}|
1617
1618.. flat-table:: struct v4l2_mpeg2_sequence
1619    :header-rows:  0
1620    :stub-columns: 0
1621    :widths:       1 1 2
1622
1623    * - __u16
1624      - ``horizontal_size``
1625      - The width of the displayable part of the frame's luminance component.
1626    * - __u16
1627      - ``vertical_size``
1628      - The height of the displayable part of the frame's luminance component.
1629    * - __u32
1630      - ``vbv_buffer_size``
1631      - Used to calculate the required size of the video buffering verifier,
1632	defined (in bits) as: 16 * 1024 * vbv_buffer_size.
1633    * - __u16
1634      - ``profile_and_level_indication``
1635      - The current profile and level indication as extracted from the
1636	bitstream.
1637    * - __u8
1638      - ``progressive_sequence``
1639      - Indication that all the frames for the sequence are progressive instead
1640	of interlaced.
1641    * - __u8
1642      - ``chroma_format``
1643      - The chrominance sub-sampling format (1: 4:2:0, 2: 4:2:2, 3: 4:4:4).
1644
1645.. c:type:: v4l2_mpeg2_picture
1646
1647.. raw:: latex
1648
1649    \small
1650
1651.. cssclass:: longtable
1652
1653.. tabularcolumns:: |p{1.0cm}|p{5.6cm}|p{10.7cm}|
1654
1655.. flat-table:: struct v4l2_mpeg2_picture
1656    :header-rows:  0
1657    :stub-columns: 0
1658    :widths:       1 1 2
1659
1660    * - __u8
1661      - ``picture_coding_type``
1662      - Picture coding type for the frame covered by the current slice
1663	(V4L2_MPEG2_PICTURE_CODING_TYPE_I, V4L2_MPEG2_PICTURE_CODING_TYPE_P or
1664	V4L2_MPEG2_PICTURE_CODING_TYPE_B).
1665    * - __u8
1666      - ``f_code[2][2]``
1667      - Motion vector codes.
1668    * - __u8
1669      - ``intra_dc_precision``
1670      - Precision of Discrete Cosine transform (0: 8 bits precision,
1671	1: 9 bits precision, 2: 10 bits precision, 3: 11 bits precision).
1672    * - __u8
1673      - ``picture_structure``
1674      - Picture structure (1: interlaced top field, 2: interlaced bottom field,
1675	3: progressive frame).
1676    * - __u8
1677      - ``top_field_first``
1678      - If set to 1 and interlaced stream, top field is output first.
1679    * - __u8
1680      - ``frame_pred_frame_dct``
1681      - If set to 1, only frame-DCT and frame prediction are used.
1682    * - __u8
1683      - ``concealment_motion_vectors``
1684      -  If set to 1, motion vectors are coded for intra macroblocks.
1685    * - __u8
1686      - ``q_scale_type``
1687      - This flag affects the inverse quantization process.
1688    * - __u8
1689      - ``intra_vlc_format``
1690      - This flag affects the decoding of transform coefficient data.
1691    * - __u8
1692      - ``alternate_scan``
1693      - This flag affects the decoding of transform coefficient data.
1694    * - __u8
1695      - ``repeat_first_field``
1696      - This flag affects the decoding process of progressive frames.
1697    * - __u16
1698      - ``progressive_frame``
1699      - Indicates whether the current frame is progressive.
1700
1701.. raw:: latex
1702
1703    \normalsize
1704
1705``V4L2_CID_MPEG_VIDEO_MPEG2_QUANTIZATION (struct)``
1706    Specifies quantization matrices (as extracted from the bitstream) for the
1707    associated MPEG-2 slice data.
1708
1709    .. note::
1710
1711       This compound control is not yet part of the public kernel API and
1712       it is expected to change.
1713
1714.. c:type:: v4l2_ctrl_mpeg2_quantization
1715
1716.. tabularcolumns:: |p{0.8cm}|p{8.0cm}|p{8.5cm}|
1717
1718.. cssclass:: longtable
1719
1720.. raw:: latex
1721
1722    \small
1723
1724.. flat-table:: struct v4l2_ctrl_mpeg2_quantization
1725    :header-rows:  0
1726    :stub-columns: 0
1727    :widths:       1 1 2
1728
1729    * - __u8
1730      - ``load_intra_quantiser_matrix``
1731      - One bit to indicate whether to load the ``intra_quantiser_matrix`` data.
1732    * - __u8
1733      - ``load_non_intra_quantiser_matrix``
1734      - One bit to indicate whether to load the ``non_intra_quantiser_matrix``
1735	data.
1736    * - __u8
1737      - ``load_chroma_intra_quantiser_matrix``
1738      - One bit to indicate whether to load the
1739	``chroma_intra_quantiser_matrix`` data, only relevant for non-4:2:0 YUV
1740	formats.
1741    * - __u8
1742      - ``load_chroma_non_intra_quantiser_matrix``
1743      - One bit to indicate whether to load the
1744	``chroma_non_intra_quantiser_matrix`` data, only relevant for non-4:2:0
1745	YUV formats.
1746    * - __u8
1747      - ``intra_quantiser_matrix[64]``
1748      - The quantization matrix coefficients for intra-coded frames, in zigzag
1749	scanning order. It is relevant for both luma and chroma components,
1750	although it can be superseded by the chroma-specific matrix for
1751	non-4:2:0 YUV formats.
1752    * - __u8
1753      - ``non_intra_quantiser_matrix[64]``
1754      - The quantization matrix coefficients for non-intra-coded frames, in
1755	zigzag scanning order. It is relevant for both luma and chroma
1756	components, although it can be superseded by the chroma-specific matrix
1757	for non-4:2:0 YUV formats.
1758    * - __u8
1759      - ``chroma_intra_quantiser_matrix[64]``
1760      - The quantization matrix coefficients for the chominance component of
1761	intra-coded frames, in zigzag scanning order. Only relevant for
1762	non-4:2:0 YUV formats.
1763    * - __u8
1764      - ``chroma_non_intra_quantiser_matrix[64]``
1765      - The quantization matrix coefficients for the chrominance component of
1766	non-intra-coded frames, in zigzag scanning order. Only relevant for
1767	non-4:2:0 YUV formats.
1768
1769.. raw:: latex
1770
1771    \normalsize
1772
1773``V4L2_CID_FWHT_I_FRAME_QP (integer)``
1774    Quantization parameter for an I frame for FWHT. Valid range: from 1
1775    to 31.
1776
1777``V4L2_CID_FWHT_P_FRAME_QP (integer)``
1778    Quantization parameter for a P frame for FWHT. Valid range: from 1
1779    to 31.
1780
1781.. _v4l2-mpeg-vp8:
1782
1783``V4L2_CID_MPEG_VIDEO_VP8_FRAME_HEADER (struct)``
1784    Specifies the frame parameters for the associated VP8 parsed frame data.
1785    This includes the necessary parameters for
1786    configuring a stateless hardware decoding pipeline for VP8.
1787    The bitstream parameters are defined according to :ref:`vp8`.
1788
1789    .. note::
1790
1791       This compound control is not yet part of the public kernel API and
1792       it is expected to change.
1793
1794.. c:type:: v4l2_ctrl_vp8_frame_header
1795
1796.. raw:: latex
1797
1798    \small
1799
1800.. tabularcolumns:: |p{7.0cm}|p{4.6cm}|p{5.7cm}|
1801
1802.. cssclass:: longtable
1803
1804.. flat-table:: struct v4l2_ctrl_vp8_frame_header
1805    :header-rows:  0
1806    :stub-columns: 0
1807    :widths:       1 1 2
1808
1809    * - struct :c:type:`v4l2_vp8_segment_header`
1810      - ``segment_header``
1811      - Structure with segment-based adjustments metadata.
1812    * - struct :c:type:`v4l2_vp8_loopfilter_header`
1813      - ``loopfilter_header``
1814      - Structure with loop filter level adjustments metadata.
1815    * - struct :c:type:`v4l2_vp8_quantization_header`
1816      - ``quant_header``
1817      - Structure with VP8 dequantization indices metadata.
1818    * - struct :c:type:`v4l2_vp8_entropy_header`
1819      - ``entropy_header``
1820      - Structure with VP8 entropy coder probabilities metadata.
1821    * - struct :c:type:`v4l2_vp8_entropy_coder_state`
1822      - ``coder_state``
1823      - Structure with VP8 entropy coder state.
1824    * - __u16
1825      - ``width``
1826      - The width of the frame. Must be set for all frames.
1827    * - __u16
1828      - ``height``
1829      - The height of the frame. Must be set for all frames.
1830    * - __u8
1831      - ``horizontal_scale``
1832      - Horizontal scaling factor.
1833    * - __u8
1834      - ``vertical_scaling factor``
1835      - Vertical scale.
1836    * - __u8
1837      - ``version``
1838      - Bitstream version.
1839    * - __u8
1840      - ``prob_skip_false``
1841      - Indicates the probability that the macroblock is not skipped.
1842    * - __u8
1843      - ``prob_intra``
1844      - Indicates the probability that a macroblock is intra-predicted.
1845    * - __u8
1846      - ``prob_last``
1847      - Indicates the probability that the last reference frame is used
1848        for inter-prediction
1849    * - __u8
1850      - ``prob_gf``
1851      - Indicates the probability that the golden reference frame is used
1852        for inter-prediction
1853    * - __u8
1854      - ``num_dct_parts``
1855      - Number of DCT coefficients partitions. Must be one of: 1, 2, 4, or 8.
1856    * - __u32
1857      - ``first_part_size``
1858      - Size of the first partition, i.e. the control partition.
1859    * - __u32
1860      - ``first_part_header_bits``
1861      - Size in bits of the first partition header portion.
1862    * - __u32
1863      - ``dct_part_sizes[8]``
1864      - DCT coefficients sizes.
1865    * - __u64
1866      - ``last_frame_ts``
1867      - Timestamp for the V4L2 capture buffer to use as last reference frame, used
1868        with inter-coded frames. The timestamp refers to the ``timestamp`` field in
1869	struct :c:type:`v4l2_buffer`. Use the :c:func:`v4l2_timeval_to_ns()`
1870	function to convert the struct :c:type:`timeval` in struct
1871	:c:type:`v4l2_buffer` to a __u64.
1872    * - __u64
1873      - ``golden_frame_ts``
1874      - Timestamp for the V4L2 capture buffer to use as last reference frame, used
1875        with inter-coded frames. The timestamp refers to the ``timestamp`` field in
1876	struct :c:type:`v4l2_buffer`. Use the :c:func:`v4l2_timeval_to_ns()`
1877	function to convert the struct :c:type:`timeval` in struct
1878	:c:type:`v4l2_buffer` to a __u64.
1879    * - __u64
1880      - ``alt_frame_ts``
1881      - Timestamp for the V4L2 capture buffer to use as alternate reference frame, used
1882        with inter-coded frames. The timestamp refers to the ``timestamp`` field in
1883	struct :c:type:`v4l2_buffer`. Use the :c:func:`v4l2_timeval_to_ns()`
1884	function to convert the struct :c:type:`timeval` in struct
1885	:c:type:`v4l2_buffer` to a __u64.
1886    * - __u64
1887      - ``flags``
1888      - See :ref:`Frame Header Flags <vp8_frame_header_flags>`
1889
1890.. raw:: latex
1891
1892    \normalsize
1893
1894.. _vp8_frame_header_flags:
1895
1896``Frame Header Flags``
1897
1898.. tabularcolumns:: |p{9.8cm}|p{0.8cm}|p{6.7cm}|
1899
1900.. cssclass:: longtable
1901
1902.. flat-table::
1903    :header-rows:  0
1904    :stub-columns: 0
1905    :widths:       1 1 2
1906
1907    * - ``V4L2_VP8_FRAME_HEADER_FLAG_KEY_FRAME``
1908      - 0x01
1909      - Indicates if the frame is a key frame.
1910    * - ``V4L2_VP8_FRAME_HEADER_FLAG_EXPERIMENTAL``
1911      - 0x02
1912      - Experimental bitstream.
1913    * - ``V4L2_VP8_FRAME_HEADER_FLAG_SHOW_FRAME``
1914      - 0x04
1915      - Show frame flag, indicates if the frame is for display.
1916    * - ``V4L2_VP8_FRAME_HEADER_FLAG_MB_NO_SKIP_COEFF``
1917      - 0x08
1918      - Enable/disable skipping of macroblocks with no non-zero coefficients.
1919    * - ``V4L2_VP8_FRAME_HEADER_FLAG_SIGN_BIAS_GOLDEN``
1920      - 0x10
1921      - Sign of motion vectors when the golden frame is referenced.
1922    * - ``V4L2_VP8_FRAME_HEADER_FLAG_SIGN_BIAS_ALT``
1923      - 0x20
1924      - Sign of motion vectors when the alt frame is referenced.
1925
1926.. c:type:: v4l2_vp8_entropy_coder_state
1927
1928.. cssclass:: longtable
1929
1930.. tabularcolumns:: |p{1.0cm}|p{2.0cm}|p{14.3cm}|
1931
1932.. flat-table:: struct v4l2_vp8_entropy_coder_state
1933    :header-rows:  0
1934    :stub-columns: 0
1935    :widths:       1 1 2
1936
1937    * - __u8
1938      - ``range``
1939      -
1940    * - __u8
1941      - ``value``
1942      -
1943    * - __u8
1944      - ``bit_count``
1945      -
1946    * - __u8
1947      - ``padding``
1948      - Applications and drivers must set this to zero.
1949
1950.. c:type:: v4l2_vp8_segment_header
1951
1952.. cssclass:: longtable
1953
1954.. tabularcolumns:: |p{1.2cm}|p{4.0cm}|p{12.1cm}|
1955
1956.. flat-table:: struct v4l2_vp8_segment_header
1957    :header-rows:  0
1958    :stub-columns: 0
1959    :widths:       1 1 2
1960
1961    * - __s8
1962      - ``quant_update[4]``
1963      - Signed quantizer value update.
1964    * - __s8
1965      - ``lf_update[4]``
1966      - Signed loop filter level value update.
1967    * - __u8
1968      - ``segment_probs[3]``
1969      - Segment probabilities.
1970    * - __u8
1971      - ``padding``
1972      - Applications and drivers must set this to zero.
1973    * - __u32
1974      - ``flags``
1975      - See :ref:`Segment Header Flags <vp8_segment_header_flags>`
1976
1977.. _vp8_segment_header_flags:
1978
1979``Segment Header Flags``
1980
1981.. raw:: latex
1982
1983    \small
1984
1985.. tabularcolumns:: |p{10cm}|p{1.0cm}|p{6.3cm}|
1986
1987.. flat-table::
1988    :header-rows:  0
1989    :stub-columns: 0
1990    :widths:       1 1 2
1991
1992    * - ``V4L2_VP8_SEGMENT_HEADER_FLAG_ENABLED``
1993      - 0x01
1994      - Enable/disable segment-based adjustments.
1995    * - ``V4L2_VP8_SEGMENT_HEADER_FLAG_UPDATE_MAP``
1996      - 0x02
1997      - Indicates if the macroblock segmentation map is updated in this frame.
1998    * - ``V4L2_VP8_SEGMENT_HEADER_FLAG_UPDATE_FEATURE_DATA``
1999      - 0x04
2000      - Indicates if the segment feature data is updated in this frame.
2001    * - ``V4L2_VP8_SEGMENT_HEADER_FLAG_DELTA_VALUE_MODE``
2002      - 0x08
2003      - If is set, the segment feature data mode is delta-value.
2004        If cleared, it's absolute-value.
2005
2006.. raw:: latex
2007
2008    \normalsize
2009
2010.. c:type:: v4l2_vp8_loopfilter_header
2011
2012.. cssclass:: longtable
2013
2014.. tabularcolumns:: |p{1.5cm}|p{3.9cm}|p{11.9cm}|
2015
2016.. flat-table:: struct v4l2_vp8_loopfilter_header
2017    :header-rows:  0
2018    :stub-columns: 0
2019    :widths:       1 1 2
2020
2021    * - __s8
2022      - ``ref_frm_delta[4]``
2023      - Reference adjustment (signed) delta value.
2024    * - __s8
2025      - ``mb_mode_delta[4]``
2026      - Macroblock prediction mode adjustment (signed) delta value.
2027    * - __u8
2028      - ``sharpness_level``
2029      - Sharpness level
2030    * - __u8
2031      - ``level``
2032      - Filter level
2033    * - __u16
2034      - ``padding``
2035      - Applications and drivers must set this to zero.
2036    * - __u32
2037      - ``flags``
2038      - See :ref:`Loopfilter Header Flags <vp8_loopfilter_header_flags>`
2039
2040.. _vp8_loopfilter_header_flags:
2041
2042``Loopfilter Header Flags``
2043
2044.. tabularcolumns:: |p{7.0cm}|p{1.2cm}|p{9.1cm}|
2045
2046.. flat-table::
2047    :header-rows:  0
2048    :stub-columns: 0
2049    :widths:       1 1 2
2050
2051    * - ``V4L2_VP8_LF_HEADER_ADJ_ENABLE``
2052      - 0x01
2053      - Enable/disable macroblock-level loop filter adjustment.
2054    * - ``V4L2_VP8_LF_HEADER_DELTA_UPDATE``
2055      - 0x02
2056      - Indicates if the delta values used in an adjustment are updated.
2057    * - ``V4L2_VP8_LF_FILTER_TYPE_SIMPLE``
2058      - 0x04
2059      - If set, indicates the filter type is simple.
2060        If cleared, the filter type is normal.
2061
2062.. c:type:: v4l2_vp8_quantization_header
2063
2064.. tabularcolumns:: |p{1.5cm}|p{3.5cm}|p{12.3cm}|
2065
2066.. flat-table:: struct v4l2_vp8_quantization_header
2067    :header-rows:  0
2068    :stub-columns: 0
2069    :widths:       1 1 2
2070
2071    * - __u8
2072      - ``y_ac_qi``
2073      - Luma AC coefficient table index.
2074    * - __s8
2075      - ``y_dc_delta``
2076      - Luma DC delta vaue.
2077    * - __s8
2078      - ``y2_dc_delta``
2079      - Y2 block DC delta value.
2080    * - __s8
2081      - ``y2_ac_delta``
2082      - Y2 block AC delta value.
2083    * - __s8
2084      - ``uv_dc_delta``
2085      - Chroma DC delta value.
2086    * - __s8
2087      - ``uv_ac_delta``
2088      - Chroma AC delta value.
2089    * - __u16
2090      - ``padding``
2091      - Applications and drivers must set this to zero.
2092
2093.. c:type:: v4l2_vp8_entropy_header
2094
2095.. cssclass:: longtable
2096
2097.. tabularcolumns:: |p{1.5cm}|p{5.8cm}|p{10.0cm}|
2098
2099.. flat-table:: struct v4l2_vp8_entropy_header
2100    :header-rows:  0
2101    :stub-columns: 0
2102    :widths:       1 1 2
2103
2104    * - __u8
2105      - ``coeff_probs[4][8][3][11]``
2106      - Coefficient update probabilities.
2107    * - __u8
2108      - ``y_mode_probs[4]``
2109      - Luma mode update probabilities.
2110    * - __u8
2111      - ``uv_mode_probs[3]``
2112      - Chroma mode update probabilities.
2113    * - __u8
2114      - ``mv_probs[2][19]``
2115      - MV decoding update probabilities.
2116    * - __u8
2117      - ``padding[3]``
2118      - Applications and drivers must set this to zero.
2119
2120.. raw:: latex
2121
2122    \normalsize
2123
2124
2125MFC 5.1 MPEG Controls
2126=====================
2127
2128The following MPEG class controls deal with MPEG decoding and encoding
2129settings that are specific to the Multi Format Codec 5.1 device present
2130in the S5P family of SoCs by Samsung.
2131
2132
2133.. _mfc51-control-id:
2134
2135MFC 5.1 Control IDs
2136-------------------
2137
2138``V4L2_CID_MPEG_MFC51_VIDEO_DECODER_H264_DISPLAY_DELAY_ENABLE (boolean)``
2139    If the display delay is enabled then the decoder is forced to return
2140    a CAPTURE buffer (decoded frame) after processing a certain number
2141    of OUTPUT buffers. The delay can be set through
2142    ``V4L2_CID_MPEG_MFC51_VIDEO_DECODER_H264_DISPLAY_DELAY``. This
2143    feature can be used for example for generating thumbnails of videos.
2144    Applicable to the H264 decoder.
2145
2146``V4L2_CID_MPEG_MFC51_VIDEO_DECODER_H264_DISPLAY_DELAY (integer)``
2147    Display delay value for H264 decoder. The decoder is forced to
2148    return a decoded frame after the set 'display delay' number of
2149    frames. If this number is low it may result in frames returned out
2150    of display order, in addition the hardware may still be using the
2151    returned buffer as a reference picture for subsequent frames.
2152
2153``V4L2_CID_MPEG_MFC51_VIDEO_H264_NUM_REF_PIC_FOR_P (integer)``
2154    The number of reference pictures used for encoding a P picture.
2155    Applicable to the H264 encoder.
2156
2157``V4L2_CID_MPEG_MFC51_VIDEO_PADDING (boolean)``
2158    Padding enable in the encoder - use a color instead of repeating
2159    border pixels. Applicable to encoders.
2160
2161``V4L2_CID_MPEG_MFC51_VIDEO_PADDING_YUV (integer)``
2162    Padding color in the encoder. Applicable to encoders. The supplied
2163    32-bit integer is interpreted as follows (bit 0 = least significant
2164    bit):
2165
2166
2167
2168.. flat-table::
2169    :header-rows:  0
2170    :stub-columns: 0
2171
2172    * - Bit 0:7
2173      - V chrominance information
2174    * - Bit 8:15
2175      - U chrominance information
2176    * - Bit 16:23
2177      - Y luminance information
2178    * - Bit 24:31
2179      - Must be zero.
2180
2181
2182
2183``V4L2_CID_MPEG_MFC51_VIDEO_RC_REACTION_COEFF (integer)``
2184    Reaction coefficient for MFC rate control. Applicable to encoders.
2185
2186    .. note::
2187
2188       #. Valid only when the frame level RC is enabled.
2189
2190       #. For tight CBR, this field must be small (ex. 2 ~ 10). For
2191	  VBR, this field must be large (ex. 100 ~ 1000).
2192
2193       #. It is not recommended to use the greater number than
2194	  FRAME_RATE * (10^9 / BIT_RATE).
2195
2196``V4L2_CID_MPEG_MFC51_VIDEO_H264_ADAPTIVE_RC_DARK (boolean)``
2197    Adaptive rate control for dark region. Valid only when H.264 and
2198    macroblock level RC is enabled
2199    (``V4L2_CID_MPEG_VIDEO_MB_RC_ENABLE``). Applicable to the H264
2200    encoder.
2201
2202``V4L2_CID_MPEG_MFC51_VIDEO_H264_ADAPTIVE_RC_SMOOTH (boolean)``
2203    Adaptive rate control for smooth region. Valid only when H.264 and
2204    macroblock level RC is enabled
2205    (``V4L2_CID_MPEG_VIDEO_MB_RC_ENABLE``). Applicable to the H264
2206    encoder.
2207
2208``V4L2_CID_MPEG_MFC51_VIDEO_H264_ADAPTIVE_RC_STATIC (boolean)``
2209    Adaptive rate control for static region. Valid only when H.264 and
2210    macroblock level RC is enabled
2211    (``V4L2_CID_MPEG_VIDEO_MB_RC_ENABLE``). Applicable to the H264
2212    encoder.
2213
2214``V4L2_CID_MPEG_MFC51_VIDEO_H264_ADAPTIVE_RC_ACTIVITY (boolean)``
2215    Adaptive rate control for activity region. Valid only when H.264 and
2216    macroblock level RC is enabled
2217    (``V4L2_CID_MPEG_VIDEO_MB_RC_ENABLE``). Applicable to the H264
2218    encoder.
2219
2220.. _v4l2-mpeg-mfc51-video-frame-skip-mode:
2221
2222``V4L2_CID_MPEG_MFC51_VIDEO_FRAME_SKIP_MODE``
2223    (enum)
2224
2225    .. note::
2226
2227       This control is deprecated. Use the standard
2228       ``V4L2_CID_MPEG_VIDEO_FRAME_SKIP_MODE`` control instead.
2229
2230enum v4l2_mpeg_mfc51_video_frame_skip_mode -
2231    Indicates in what conditions the encoder should skip frames. If
2232    encoding a frame would cause the encoded stream to be larger then a
2233    chosen data limit then the frame will be skipped. Possible values
2234    are:
2235
2236
2237.. tabularcolumns:: |p{9.4cm}|p{8.1cm}|
2238
2239.. raw:: latex
2240
2241    \small
2242
2243.. flat-table::
2244    :header-rows:  0
2245    :stub-columns: 0
2246
2247    * - ``V4L2_MPEG_MFC51_FRAME_SKIP_MODE_DISABLED``
2248      - Frame skip mode is disabled.
2249    * - ``V4L2_MPEG_MFC51_FRAME_SKIP_MODE_LEVEL_LIMIT``
2250      - Frame skip mode enabled and buffer limit is set by the chosen
2251	level and is defined by the standard.
2252    * - ``V4L2_MPEG_MFC51_FRAME_SKIP_MODE_BUF_LIMIT``
2253      - Frame skip mode enabled and buffer limit is set by the VBV
2254	(MPEG1/2/4) or CPB (H264) buffer size control.
2255
2256.. raw:: latex
2257
2258    \normalsize
2259
2260``V4L2_CID_MPEG_MFC51_VIDEO_RC_FIXED_TARGET_BIT (integer)``
2261    Enable rate-control with fixed target bit. If this setting is
2262    enabled, then the rate control logic of the encoder will calculate
2263    the average bitrate for a GOP and keep it below or equal the set
2264    bitrate target. Otherwise the rate control logic calculates the
2265    overall average bitrate for the stream and keeps it below or equal
2266    to the set bitrate. In the first case the average bitrate for the
2267    whole stream will be smaller then the set bitrate. This is caused
2268    because the average is calculated for smaller number of frames, on
2269    the other hand enabling this setting will ensure that the stream
2270    will meet tight bandwidth constraints. Applicable to encoders.
2271
2272.. _v4l2-mpeg-mfc51-video-force-frame-type:
2273
2274``V4L2_CID_MPEG_MFC51_VIDEO_FORCE_FRAME_TYPE``
2275    (enum)
2276
2277enum v4l2_mpeg_mfc51_video_force_frame_type -
2278    Force a frame type for the next queued buffer. Applicable to
2279    encoders. Possible values are:
2280
2281.. tabularcolumns:: |p{9.9cm}|p{7.6cm}|
2282
2283.. flat-table::
2284    :header-rows:  0
2285    :stub-columns: 0
2286
2287    * - ``V4L2_MPEG_MFC51_FORCE_FRAME_TYPE_DISABLED``
2288      - Forcing a specific frame type disabled.
2289    * - ``V4L2_MPEG_MFC51_FORCE_FRAME_TYPE_I_FRAME``
2290      - Force an I-frame.
2291    * - ``V4L2_MPEG_MFC51_FORCE_FRAME_TYPE_NOT_CODED``
2292      - Force a non-coded frame.
2293
2294
2295CX2341x MPEG Controls
2296=====================
2297
2298The following MPEG class controls deal with MPEG encoding settings that
2299are specific to the Conexant CX23415 and CX23416 MPEG encoding chips.
2300
2301
2302.. _cx2341x-control-id:
2303
2304CX2341x Control IDs
2305-------------------
2306
2307.. _v4l2-mpeg-cx2341x-video-spatial-filter-mode:
2308
2309``V4L2_CID_MPEG_CX2341X_VIDEO_SPATIAL_FILTER_MODE``
2310    (enum)
2311
2312enum v4l2_mpeg_cx2341x_video_spatial_filter_mode -
2313    Sets the Spatial Filter mode (default ``MANUAL``). Possible values
2314    are:
2315
2316
2317.. tabularcolumns:: |p{11.5cm}|p{6.0cm}|
2318
2319.. flat-table::
2320    :header-rows:  0
2321    :stub-columns: 0
2322
2323    * - ``V4L2_MPEG_CX2341X_VIDEO_SPATIAL_FILTER_MODE_MANUAL``
2324      - Choose the filter manually
2325    * - ``V4L2_MPEG_CX2341X_VIDEO_SPATIAL_FILTER_MODE_AUTO``
2326      - Choose the filter automatically
2327
2328
2329
2330``V4L2_CID_MPEG_CX2341X_VIDEO_SPATIAL_FILTER (integer (0-15))``
2331    The setting for the Spatial Filter. 0 = off, 15 = maximum. (Default
2332    is 0.)
2333
2334.. _luma-spatial-filter-type:
2335
2336``V4L2_CID_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE``
2337    (enum)
2338
2339enum v4l2_mpeg_cx2341x_video_luma_spatial_filter_type -
2340    Select the algorithm to use for the Luma Spatial Filter (default
2341    ``1D_HOR``). Possible values:
2342
2343.. tabularcolumns:: |p{13.1cm}|p{4.4cm}|
2344
2345.. raw:: latex
2346
2347    \footnotesize
2348
2349.. flat-table::
2350    :header-rows:  0
2351    :stub-columns: 0
2352
2353    * - ``V4L2_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE_OFF``
2354      - No filter
2355    * - ``V4L2_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE_1D_HOR``
2356      - One-dimensional horizontal
2357    * - ``V4L2_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE_1D_VERT``
2358      - One-dimensional vertical
2359    * - ``V4L2_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE_2D_HV_SEPARABLE``
2360      - Two-dimensional separable
2361    * - ``V4L2_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE_2D_SYM_NON_SEPARABLE``
2362      - Two-dimensional symmetrical non-separable
2363
2364.. raw:: latex
2365
2366    \normalsize
2367
2368.. _chroma-spatial-filter-type:
2369
2370``V4L2_CID_MPEG_CX2341X_VIDEO_CHROMA_SPATIAL_FILTER_TYPE``
2371    (enum)
2372
2373enum v4l2_mpeg_cx2341x_video_chroma_spatial_filter_type -
2374    Select the algorithm for the Chroma Spatial Filter (default
2375    ``1D_HOR``). Possible values are:
2376
2377.. raw:: latex
2378
2379    \footnotesize
2380
2381.. tabularcolumns:: |p{11.0cm}|p{6.5cm}|
2382
2383.. flat-table::
2384    :header-rows:  0
2385    :stub-columns: 0
2386
2387    * - ``V4L2_MPEG_CX2341X_VIDEO_CHROMA_SPATIAL_FILTER_TYPE_OFF``
2388      - No filter
2389    * - ``V4L2_MPEG_CX2341X_VIDEO_CHROMA_SPATIAL_FILTER_TYPE_1D_HOR``
2390      - One-dimensional horizontal
2391
2392.. raw:: latex
2393
2394    \normalsize
2395
2396.. _v4l2-mpeg-cx2341x-video-temporal-filter-mode:
2397
2398``V4L2_CID_MPEG_CX2341X_VIDEO_TEMPORAL_FILTER_MODE``
2399    (enum)
2400
2401enum v4l2_mpeg_cx2341x_video_temporal_filter_mode -
2402    Sets the Temporal Filter mode (default ``MANUAL``). Possible values
2403    are:
2404
2405.. raw:: latex
2406
2407    \footnotesize
2408
2409.. flat-table::
2410    :header-rows:  0
2411    :stub-columns: 0
2412
2413    * - ``V4L2_MPEG_CX2341X_VIDEO_TEMPORAL_FILTER_MODE_MANUAL``
2414      - Choose the filter manually
2415    * - ``V4L2_MPEG_CX2341X_VIDEO_TEMPORAL_FILTER_MODE_AUTO``
2416      - Choose the filter automatically
2417
2418.. raw:: latex
2419
2420    \normalsize
2421
2422``V4L2_CID_MPEG_CX2341X_VIDEO_TEMPORAL_FILTER (integer (0-31))``
2423    The setting for the Temporal Filter. 0 = off, 31 = maximum. (Default
2424    is 8 for full-scale capturing and 0 for scaled capturing.)
2425
2426.. _v4l2-mpeg-cx2341x-video-median-filter-type:
2427
2428``V4L2_CID_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE``
2429    (enum)
2430
2431enum v4l2_mpeg_cx2341x_video_median_filter_type -
2432    Median Filter Type (default ``OFF``). Possible values are:
2433
2434
2435.. raw:: latex
2436
2437    \small
2438
2439.. tabularcolumns:: |p{11.0cm}|p{6.5cm}|
2440
2441.. flat-table::
2442    :header-rows:  0
2443    :stub-columns: 0
2444
2445    * - ``V4L2_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE_OFF``
2446      - No filter
2447    * - ``V4L2_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE_HOR``
2448      - Horizontal filter
2449    * - ``V4L2_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE_VERT``
2450      - Vertical filter
2451    * - ``V4L2_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE_HOR_VERT``
2452      - Horizontal and vertical filter
2453    * - ``V4L2_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE_DIAG``
2454      - Diagonal filter
2455
2456.. raw:: latex
2457
2458    \normalsize
2459
2460``V4L2_CID_MPEG_CX2341X_VIDEO_LUMA_MEDIAN_FILTER_BOTTOM (integer (0-255))``
2461    Threshold above which the luminance median filter is enabled
2462    (default 0)
2463
2464``V4L2_CID_MPEG_CX2341X_VIDEO_LUMA_MEDIAN_FILTER_TOP (integer (0-255))``
2465    Threshold below which the luminance median filter is enabled
2466    (default 255)
2467
2468``V4L2_CID_MPEG_CX2341X_VIDEO_CHROMA_MEDIAN_FILTER_BOTTOM (integer (0-255))``
2469    Threshold above which the chroma median filter is enabled (default
2470    0)
2471
2472``V4L2_CID_MPEG_CX2341X_VIDEO_CHROMA_MEDIAN_FILTER_TOP (integer (0-255))``
2473    Threshold below which the chroma median filter is enabled (default
2474    255)
2475
2476``V4L2_CID_MPEG_CX2341X_STREAM_INSERT_NAV_PACKETS (boolean)``
2477    The CX2341X MPEG encoder can insert one empty MPEG-2 PES packet into
2478    the stream between every four video frames. The packet size is 2048
2479    bytes, including the packet_start_code_prefix and stream_id
2480    fields. The stream_id is 0xBF (private stream 2). The payload
2481    consists of 0x00 bytes, to be filled in by the application. 0 = do
2482    not insert, 1 = insert packets.
2483
2484
2485VPX Control Reference
2486=====================
2487
2488The VPX controls include controls for encoding parameters of VPx video
2489codec.
2490
2491
2492.. _vpx-control-id:
2493
2494VPX Control IDs
2495---------------
2496
2497.. _v4l2-vpx-num-partitions:
2498
2499``V4L2_CID_MPEG_VIDEO_VPX_NUM_PARTITIONS``
2500    (enum)
2501
2502enum v4l2_vp8_num_partitions -
2503    The number of token partitions to use in VP8 encoder. Possible
2504    values are:
2505
2506
2507
2508.. flat-table::
2509    :header-rows:  0
2510    :stub-columns: 0
2511
2512    * - ``V4L2_CID_MPEG_VIDEO_VPX_1_PARTITION``
2513      - 1 coefficient partition
2514    * - ``V4L2_CID_MPEG_VIDEO_VPX_2_PARTITIONS``
2515      - 2 coefficient partitions
2516    * - ``V4L2_CID_MPEG_VIDEO_VPX_4_PARTITIONS``
2517      - 4 coefficient partitions
2518    * - ``V4L2_CID_MPEG_VIDEO_VPX_8_PARTITIONS``
2519      - 8 coefficient partitions
2520
2521
2522
2523``V4L2_CID_MPEG_VIDEO_VPX_IMD_DISABLE_4X4 (boolean)``
2524    Setting this prevents intra 4x4 mode in the intra mode decision.
2525
2526.. _v4l2-vpx-num-ref-frames:
2527
2528``V4L2_CID_MPEG_VIDEO_VPX_NUM_REF_FRAMES``
2529    (enum)
2530
2531enum v4l2_vp8_num_ref_frames -
2532    The number of reference pictures for encoding P frames. Possible
2533    values are:
2534
2535.. tabularcolumns:: |p{7.5cm}|p{7.5cm}|
2536
2537.. raw:: latex
2538
2539    \small
2540
2541.. flat-table::
2542    :header-rows:  0
2543    :stub-columns: 0
2544
2545    * - ``V4L2_CID_MPEG_VIDEO_VPX_1_REF_FRAME``
2546      - Last encoded frame will be searched
2547    * - ``V4L2_CID_MPEG_VIDEO_VPX_2_REF_FRAME``
2548      - Two frames will be searched among the last encoded frame, the
2549	golden frame and the alternate reference (altref) frame. The
2550	encoder implementation will decide which two are chosen.
2551    * - ``V4L2_CID_MPEG_VIDEO_VPX_3_REF_FRAME``
2552      - The last encoded frame, the golden frame and the altref frame will
2553	be searched.
2554
2555.. raw:: latex
2556
2557    \normalsize
2558
2559
2560
2561``V4L2_CID_MPEG_VIDEO_VPX_FILTER_LEVEL (integer)``
2562    Indicates the loop filter level. The adjustment of the loop filter
2563    level is done via a delta value against a baseline loop filter
2564    value.
2565
2566``V4L2_CID_MPEG_VIDEO_VPX_FILTER_SHARPNESS (integer)``
2567    This parameter affects the loop filter. Anything above zero weakens
2568    the deblocking effect on the loop filter.
2569
2570``V4L2_CID_MPEG_VIDEO_VPX_GOLDEN_FRAME_REF_PERIOD (integer)``
2571    Sets the refresh period for the golden frame. The period is defined
2572    in number of frames. For a value of 'n', every nth frame starting
2573    from the first key frame will be taken as a golden frame. For eg.
2574    for encoding sequence of 0, 1, 2, 3, 4, 5, 6, 7 where the golden
2575    frame refresh period is set as 4, the frames 0, 4, 8 etc will be
2576    taken as the golden frames as frame 0 is always a key frame.
2577
2578.. _v4l2-vpx-golden-frame-sel:
2579
2580``V4L2_CID_MPEG_VIDEO_VPX_GOLDEN_FRAME_SEL``
2581    (enum)
2582
2583enum v4l2_vp8_golden_frame_sel -
2584    Selects the golden frame for encoding. Possible values are:
2585
2586.. raw:: latex
2587
2588    \scriptsize
2589
2590.. tabularcolumns:: |p{8.6cm}|p{8.9cm}|
2591
2592.. flat-table::
2593    :header-rows:  0
2594    :stub-columns: 0
2595
2596    * - ``V4L2_CID_MPEG_VIDEO_VPX_GOLDEN_FRAME_USE_PREV``
2597      - Use the (n-2)th frame as a golden frame, current frame index being
2598	'n'.
2599    * - ``V4L2_CID_MPEG_VIDEO_VPX_GOLDEN_FRAME_USE_REF_PERIOD``
2600      - Use the previous specific frame indicated by
2601	``V4L2_CID_MPEG_VIDEO_VPX_GOLDEN_FRAME_REF_PERIOD`` as a
2602	golden frame.
2603
2604.. raw:: latex
2605
2606    \normalsize
2607
2608
2609``V4L2_CID_MPEG_VIDEO_VPX_MIN_QP (integer)``
2610    Minimum quantization parameter for VP8.
2611
2612``V4L2_CID_MPEG_VIDEO_VPX_MAX_QP (integer)``
2613    Maximum quantization parameter for VP8.
2614
2615``V4L2_CID_MPEG_VIDEO_VPX_I_FRAME_QP (integer)``
2616    Quantization parameter for an I frame for VP8.
2617
2618``V4L2_CID_MPEG_VIDEO_VPX_P_FRAME_QP (integer)``
2619    Quantization parameter for a P frame for VP8.
2620
2621.. _v4l2-mpeg-video-vp8-profile:
2622
2623``V4L2_CID_MPEG_VIDEO_VP8_PROFILE``
2624    (enum)
2625
2626enum v4l2_mpeg_video_vp8_profile -
2627    This control allows selecting the profile for VP8 encoder.
2628    This is also used to enumerate supported profiles by VP8 encoder or decoder.
2629    Possible values are:
2630
2631.. flat-table::
2632    :header-rows:  0
2633    :stub-columns: 0
2634
2635    * - ``V4L2_MPEG_VIDEO_VP8_PROFILE_0``
2636      - Profile 0
2637    * - ``V4L2_MPEG_VIDEO_VP8_PROFILE_1``
2638      - Profile 1
2639    * - ``V4L2_MPEG_VIDEO_VP8_PROFILE_2``
2640      - Profile 2
2641    * - ``V4L2_MPEG_VIDEO_VP8_PROFILE_3``
2642      - Profile 3
2643
2644.. _v4l2-mpeg-video-vp9-profile:
2645
2646``V4L2_CID_MPEG_VIDEO_VP9_PROFILE``
2647    (enum)
2648
2649enum v4l2_mpeg_video_vp9_profile -
2650    This control allows selecting the profile for VP9 encoder.
2651    This is also used to enumerate supported profiles by VP9 encoder or decoder.
2652    Possible values are:
2653
2654.. flat-table::
2655    :header-rows:  0
2656    :stub-columns: 0
2657
2658    * - ``V4L2_MPEG_VIDEO_VP9_PROFILE_0``
2659      - Profile 0
2660    * - ``V4L2_MPEG_VIDEO_VP9_PROFILE_1``
2661      - Profile 1
2662    * - ``V4L2_MPEG_VIDEO_VP9_PROFILE_2``
2663      - Profile 2
2664    * - ``V4L2_MPEG_VIDEO_VP9_PROFILE_3``
2665      - Profile 3
2666
2667.. _v4l2-mpeg-video-vp9-level:
2668
2669``V4L2_CID_MPEG_VIDEO_VP9_LEVEL (enum)``
2670
2671enum v4l2_mpeg_video_vp9_level -
2672    This control allows selecting the level for VP9 encoder.
2673    This is also used to enumerate supported levels by VP9 encoder or decoder.
2674    More information can be found at
2675    `webmproject <https://www.webmproject.org/vp9/levels/>`__. Possible values are:
2676
2677.. flat-table::
2678    :header-rows:  0
2679    :stub-columns: 0
2680
2681    * - ``V4L2_MPEG_VIDEO_VP9_LEVEL_1_0``
2682      - Level 1
2683    * - ``V4L2_MPEG_VIDEO_VP9_LEVEL_1_1``
2684      - Level 1.1
2685    * - ``V4L2_MPEG_VIDEO_VP9_LEVEL_2_0``
2686      - Level 2
2687    * - ``V4L2_MPEG_VIDEO_VP9_LEVEL_2_1``
2688      - Level 2.1
2689    * - ``V4L2_MPEG_VIDEO_VP9_LEVEL_3_0``
2690      - Level 3
2691    * - ``V4L2_MPEG_VIDEO_VP9_LEVEL_3_1``
2692      - Level 3.1
2693    * - ``V4L2_MPEG_VIDEO_VP9_LEVEL_4_0``
2694      - Level 4
2695    * - ``V4L2_MPEG_VIDEO_VP9_LEVEL_4_1``
2696      - Level 4.1
2697    * - ``V4L2_MPEG_VIDEO_VP9_LEVEL_5_0``
2698      - Level 5
2699    * - ``V4L2_MPEG_VIDEO_VP9_LEVEL_5_1``
2700      - Level 5.1
2701    * - ``V4L2_MPEG_VIDEO_VP9_LEVEL_5_2``
2702      - Level 5.2
2703    * - ``V4L2_MPEG_VIDEO_VP9_LEVEL_6_0``
2704      - Level 6
2705    * - ``V4L2_MPEG_VIDEO_VP9_LEVEL_6_1``
2706      - Level 6.1
2707    * - ``V4L2_MPEG_VIDEO_VP9_LEVEL_6_2``
2708      - Level 6.2
2709
2710
2711High Efficiency Video Coding (HEVC/H.265) Control Reference
2712===========================================================
2713
2714The HEVC/H.265 controls include controls for encoding parameters of HEVC/H.265
2715video codec.
2716
2717
2718.. _hevc-control-id:
2719
2720HEVC/H.265 Control IDs
2721----------------------
2722
2723``V4L2_CID_MPEG_VIDEO_HEVC_MIN_QP (integer)``
2724    Minimum quantization parameter for HEVC.
2725    Valid range: from 0 to 51 for 8 bit and from 0 to 63 for 10 bit.
2726
2727``V4L2_CID_MPEG_VIDEO_HEVC_MAX_QP (integer)``
2728    Maximum quantization parameter for HEVC.
2729    Valid range: from 0 to 51 for 8 bit and from 0 to 63 for 10 bit.
2730
2731``V4L2_CID_MPEG_VIDEO_HEVC_I_FRAME_QP (integer)``
2732    Quantization parameter for an I frame for HEVC.
2733    Valid range: [V4L2_CID_MPEG_VIDEO_HEVC_MIN_QP,
2734    V4L2_CID_MPEG_VIDEO_HEVC_MAX_QP].
2735
2736``V4L2_CID_MPEG_VIDEO_HEVC_P_FRAME_QP (integer)``
2737    Quantization parameter for a P frame for HEVC.
2738    Valid range: [V4L2_CID_MPEG_VIDEO_HEVC_MIN_QP,
2739    V4L2_CID_MPEG_VIDEO_HEVC_MAX_QP].
2740
2741``V4L2_CID_MPEG_VIDEO_HEVC_B_FRAME_QP (integer)``
2742    Quantization parameter for a B frame for HEVC.
2743    Valid range: [V4L2_CID_MPEG_VIDEO_HEVC_MIN_QP,
2744    V4L2_CID_MPEG_VIDEO_HEVC_MAX_QP].
2745
2746``V4L2_CID_MPEG_VIDEO_HEVC_I_FRAME_MIN_QP (integer)``
2747    Minimum quantization parameter for the HEVC I frame to limit I frame
2748    quality to a range. Valid range: from 0 to 51 for 8 bit and from 0 to 63 for 10 bit.
2749    If V4L2_CID_MPEG_VIDEO_HEVC_MIN_QP is also set, the quantization parameter
2750    should be chosen to meet both requirements.
2751
2752``V4L2_CID_MPEG_VIDEO_HEVC_I_FRAME_MAX_QP (integer)``
2753    Maximum quantization parameter for the HEVC I frame to limit I frame
2754    quality to a range. Valid range: from 0 to 51 for 8 bit and from 0 to 63 for 10 bit.
2755    If V4L2_CID_MPEG_VIDEO_HEVC_MAX_QP is also set, the quantization parameter
2756    should be chosen to meet both requirements.
2757
2758``V4L2_CID_MPEG_VIDEO_HEVC_P_FRAME_MIN_QP (integer)``
2759    Minimum quantization parameter for the HEVC P frame to limit P frame
2760    quality to a range. Valid range: from 0 to 51 for 8 bit and from 0 to 63 for 10 bit.
2761    If V4L2_CID_MPEG_VIDEO_HEVC_MIN_QP is also set, the quantization parameter
2762    should be chosen to meet both requirements.
2763
2764``V4L2_CID_MPEG_VIDEO_HEVC_P_FRAME_MAX_QP (integer)``
2765    Maximum quantization parameter for the HEVC P frame to limit P frame
2766    quality to a range. Valid range: from 0 to 51 for 8 bit and from 0 to 63 for 10 bit.
2767    If V4L2_CID_MPEG_VIDEO_HEVC_MAX_QP is also set, the quantization parameter
2768    should be chosen to meet both requirements.
2769
2770``V4L2_CID_MPEG_VIDEO_HEVC_B_FRAME_MIN_QP (integer)``
2771    Minimum quantization parameter for the HEVC B frame to limit B frame
2772    quality to a range. Valid range: from 0 to 51 for 8 bit and from 0 to 63 for 10 bit.
2773    If V4L2_CID_MPEG_VIDEO_HEVC_MIN_QP is also set, the quantization parameter
2774    should be chosen to meet both requirements.
2775
2776``V4L2_CID_MPEG_VIDEO_HEVC_B_FRAME_MAX_QP (integer)``
2777    Maximum quantization parameter for the HEVC B frame to limit B frame
2778    quality to a range. Valid range: from 0 to 51 for 8 bit and from 0 to 63 for 10 bit.
2779    If V4L2_CID_MPEG_VIDEO_HEVC_MAX_QP is also set, the quantization parameter
2780    should be chosen to meet both requirements.
2781
2782``V4L2_CID_MPEG_VIDEO_HEVC_HIER_QP (boolean)``
2783    HIERARCHICAL_QP allows the host to specify the quantization parameter
2784    values for each temporal layer through HIERARCHICAL_QP_LAYER. This is
2785    valid only if HIERARCHICAL_CODING_LAYER is greater than 1. Setting the
2786    control value to 1 enables setting of the QP values for the layers.
2787
2788.. _v4l2-hevc-hier-coding-type:
2789
2790``V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_TYPE``
2791    (enum)
2792
2793enum v4l2_mpeg_video_hevc_hier_coding_type -
2794    Selects the hierarchical coding type for encoding. Possible values are:
2795
2796.. raw:: latex
2797
2798    \footnotesize
2799
2800.. tabularcolumns:: |p{8.2cm}|p{9.3cm}|
2801
2802.. flat-table::
2803    :header-rows:  0
2804    :stub-columns: 0
2805
2806    * - ``V4L2_MPEG_VIDEO_HEVC_HIERARCHICAL_CODING_B``
2807      - Use the B frame for hierarchical coding.
2808    * - ``V4L2_MPEG_VIDEO_HEVC_HIERARCHICAL_CODING_P``
2809      - Use the P frame for hierarchical coding.
2810
2811.. raw:: latex
2812
2813    \normalsize
2814
2815
2816``V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_LAYER (integer)``
2817    Selects the hierarchical coding layer. In normal encoding
2818    (non-hierarchial coding), it should be zero. Possible values are [0, 6].
2819    0 indicates HIERARCHICAL CODING LAYER 0, 1 indicates HIERARCHICAL CODING
2820    LAYER 1 and so on.
2821
2822``V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_L0_QP (integer)``
2823    Indicates quantization parameter for hierarchical coding layer 0.
2824    Valid range: [V4L2_CID_MPEG_VIDEO_HEVC_MIN_QP,
2825    V4L2_CID_MPEG_VIDEO_HEVC_MAX_QP].
2826
2827``V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_L1_QP (integer)``
2828    Indicates quantization parameter for hierarchical coding layer 1.
2829    Valid range: [V4L2_CID_MPEG_VIDEO_HEVC_MIN_QP,
2830    V4L2_CID_MPEG_VIDEO_HEVC_MAX_QP].
2831
2832``V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_L2_QP (integer)``
2833    Indicates quantization parameter for hierarchical coding layer 2.
2834    Valid range: [V4L2_CID_MPEG_VIDEO_HEVC_MIN_QP,
2835    V4L2_CID_MPEG_VIDEO_HEVC_MAX_QP].
2836
2837``V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_L3_QP (integer)``
2838    Indicates quantization parameter for hierarchical coding layer 3.
2839    Valid range: [V4L2_CID_MPEG_VIDEO_HEVC_MIN_QP,
2840    V4L2_CID_MPEG_VIDEO_HEVC_MAX_QP].
2841
2842``V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_L4_QP (integer)``
2843    Indicates quantization parameter for hierarchical coding layer 4.
2844    Valid range: [V4L2_CID_MPEG_VIDEO_HEVC_MIN_QP,
2845    V4L2_CID_MPEG_VIDEO_HEVC_MAX_QP].
2846
2847``V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_L5_QP (integer)``
2848    Indicates quantization parameter for hierarchical coding layer 5.
2849    Valid range: [V4L2_CID_MPEG_VIDEO_HEVC_MIN_QP,
2850    V4L2_CID_MPEG_VIDEO_HEVC_MAX_QP].
2851
2852``V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_L6_QP (integer)``
2853    Indicates quantization parameter for hierarchical coding layer 6.
2854    Valid range: [V4L2_CID_MPEG_VIDEO_HEVC_MIN_QP,
2855    V4L2_CID_MPEG_VIDEO_HEVC_MAX_QP].
2856
2857.. _v4l2-hevc-profile:
2858
2859``V4L2_CID_MPEG_VIDEO_HEVC_PROFILE``
2860    (enum)
2861
2862enum v4l2_mpeg_video_hevc_profile -
2863    Select the desired profile for HEVC encoder.
2864
2865.. raw:: latex
2866
2867    \footnotesize
2868
2869.. tabularcolumns:: |p{9.0cm}|p{8.5cm}|
2870
2871.. flat-table::
2872    :header-rows:  0
2873    :stub-columns: 0
2874
2875    * - ``V4L2_MPEG_VIDEO_HEVC_PROFILE_MAIN``
2876      - Main profile.
2877    * - ``V4L2_MPEG_VIDEO_HEVC_PROFILE_MAIN_STILL_PICTURE``
2878      - Main still picture profile.
2879    * - ``V4L2_MPEG_VIDEO_HEVC_PROFILE_MAIN_10``
2880      - Main 10 profile.
2881
2882.. raw:: latex
2883
2884    \normalsize
2885
2886
2887.. _v4l2-hevc-level:
2888
2889``V4L2_CID_MPEG_VIDEO_HEVC_LEVEL``
2890    (enum)
2891
2892enum v4l2_mpeg_video_hevc_level -
2893    Selects the desired level for HEVC encoder.
2894
2895==================================	=========
2896``V4L2_MPEG_VIDEO_HEVC_LEVEL_1``	Level 1.0
2897``V4L2_MPEG_VIDEO_HEVC_LEVEL_2``	Level 2.0
2898``V4L2_MPEG_VIDEO_HEVC_LEVEL_2_1``	Level 2.1
2899``V4L2_MPEG_VIDEO_HEVC_LEVEL_3``	Level 3.0
2900``V4L2_MPEG_VIDEO_HEVC_LEVEL_3_1``	Level 3.1
2901``V4L2_MPEG_VIDEO_HEVC_LEVEL_4``	Level 4.0
2902``V4L2_MPEG_VIDEO_HEVC_LEVEL_4_1``	Level 4.1
2903``V4L2_MPEG_VIDEO_HEVC_LEVEL_5``	Level 5.0
2904``V4L2_MPEG_VIDEO_HEVC_LEVEL_5_1``	Level 5.1
2905``V4L2_MPEG_VIDEO_HEVC_LEVEL_5_2``	Level 5.2
2906``V4L2_MPEG_VIDEO_HEVC_LEVEL_6``	Level 6.0
2907``V4L2_MPEG_VIDEO_HEVC_LEVEL_6_1``	Level 6.1
2908``V4L2_MPEG_VIDEO_HEVC_LEVEL_6_2``	Level 6.2
2909==================================	=========
2910
2911``V4L2_CID_MPEG_VIDEO_HEVC_FRAME_RATE_RESOLUTION (integer)``
2912    Indicates the number of evenly spaced subintervals, called ticks, within
2913    one second. This is a 16 bit unsigned integer and has a maximum value up to
2914    0xffff and a minimum value of 1.
2915
2916.. _v4l2-hevc-tier:
2917
2918``V4L2_CID_MPEG_VIDEO_HEVC_TIER``
2919    (enum)
2920
2921enum v4l2_mpeg_video_hevc_tier -
2922    TIER_FLAG specifies tiers information of the HEVC encoded picture. Tier
2923    were made to deal with applications that differ in terms of maximum bit
2924    rate. Setting the flag to 0 selects HEVC tier as Main tier and setting
2925    this flag to 1 indicates High tier. High tier is for applications requiring
2926    high bit rates.
2927
2928==================================	==========
2929``V4L2_MPEG_VIDEO_HEVC_TIER_MAIN``	Main tier.
2930``V4L2_MPEG_VIDEO_HEVC_TIER_HIGH``	High tier.
2931==================================	==========
2932
2933
2934``V4L2_CID_MPEG_VIDEO_HEVC_MAX_PARTITION_DEPTH (integer)``
2935    Selects HEVC maximum coding unit depth.
2936
2937.. _v4l2-hevc-loop-filter-mode:
2938
2939``V4L2_CID_MPEG_VIDEO_HEVC_LOOP_FILTER_MODE``
2940    (enum)
2941
2942enum v4l2_mpeg_video_hevc_loop_filter_mode -
2943    Loop filter mode for HEVC encoder. Possible values are:
2944
2945.. raw:: latex
2946
2947    \footnotesize
2948
2949.. tabularcolumns:: |p{12.1cm}|p{5.4cm}|
2950
2951.. flat-table::
2952    :header-rows:  0
2953    :stub-columns: 0
2954
2955    * - ``V4L2_MPEG_VIDEO_HEVC_LOOP_FILTER_MODE_DISABLED``
2956      - Loop filter is disabled.
2957    * - ``V4L2_MPEG_VIDEO_HEVC_LOOP_FILTER_MODE_ENABLED``
2958      - Loop filter is enabled.
2959    * - ``V4L2_MPEG_VIDEO_HEVC_LOOP_FILTER_MODE_DISABLED_AT_SLICE_BOUNDARY``
2960      - Loop filter is disabled at the slice boundary.
2961
2962.. raw:: latex
2963
2964    \normalsize
2965
2966
2967``V4L2_CID_MPEG_VIDEO_HEVC_LF_BETA_OFFSET_DIV2 (integer)``
2968    Selects HEVC loop filter beta offset. The valid range is [-6, +6].
2969
2970``V4L2_CID_MPEG_VIDEO_HEVC_LF_TC_OFFSET_DIV2 (integer)``
2971    Selects HEVC loop filter tc offset. The valid range is [-6, +6].
2972
2973.. _v4l2-hevc-refresh-type:
2974
2975``V4L2_CID_MPEG_VIDEO_HEVC_REFRESH_TYPE``
2976    (enum)
2977
2978enum v4l2_mpeg_video_hevc_hier_refresh_type -
2979    Selects refresh type for HEVC encoder.
2980    Host has to specify the period into
2981    V4L2_CID_MPEG_VIDEO_HEVC_REFRESH_PERIOD.
2982
2983.. raw:: latex
2984
2985    \footnotesize
2986
2987.. tabularcolumns:: |p{6.2cm}|p{11.3cm}|
2988
2989.. flat-table::
2990    :header-rows:  0
2991    :stub-columns: 0
2992
2993    * - ``V4L2_MPEG_VIDEO_HEVC_REFRESH_NONE``
2994      - Use the B frame for hierarchical coding.
2995    * - ``V4L2_MPEG_VIDEO_HEVC_REFRESH_CRA``
2996      - Use CRA (Clean Random Access Unit) picture encoding.
2997    * - ``V4L2_MPEG_VIDEO_HEVC_REFRESH_IDR``
2998      - Use IDR (Instantaneous Decoding Refresh) picture encoding.
2999
3000.. raw:: latex
3001
3002    \normalsize
3003
3004
3005``V4L2_CID_MPEG_VIDEO_HEVC_REFRESH_PERIOD (integer)``
3006    Selects the refresh period for HEVC encoder.
3007    This specifies the number of I pictures between two CRA/IDR pictures.
3008    This is valid only if REFRESH_TYPE is not 0.
3009
3010``V4L2_CID_MPEG_VIDEO_HEVC_LOSSLESS_CU (boolean)``
3011    Indicates HEVC lossless encoding. Setting it to 0 disables lossless
3012    encoding. Setting it to 1 enables lossless encoding.
3013
3014``V4L2_CID_MPEG_VIDEO_HEVC_CONST_INTRA_PRED (boolean)``
3015    Indicates constant intra prediction for HEVC encoder. Specifies the
3016    constrained intra prediction in which intra largest coding unit (LCU)
3017    prediction is performed by using residual data and decoded samples of
3018    neighboring intra LCU only. Setting the value to 1 enables constant intra
3019    prediction and setting the value to 0 disables constant intra prediction.
3020
3021``V4L2_CID_MPEG_VIDEO_HEVC_WAVEFRONT (boolean)``
3022    Indicates wavefront parallel processing for HEVC encoder. Setting it to 0
3023    disables the feature and setting it to 1 enables the wavefront parallel
3024    processing.
3025
3026``V4L2_CID_MPEG_VIDEO_HEVC_GENERAL_PB (boolean)``
3027    Setting the value to 1 enables combination of P and B frame for HEVC
3028    encoder.
3029
3030``V4L2_CID_MPEG_VIDEO_HEVC_TEMPORAL_ID (boolean)``
3031    Indicates temporal identifier for HEVC encoder which is enabled by
3032    setting the value to 1.
3033
3034``V4L2_CID_MPEG_VIDEO_HEVC_STRONG_SMOOTHING (boolean)``
3035    Indicates bi-linear interpolation is conditionally used in the intra
3036    prediction filtering process in the CVS when set to 1. Indicates bi-linear
3037    interpolation is not used in the CVS when set to 0.
3038
3039``V4L2_CID_MPEG_VIDEO_HEVC_MAX_NUM_MERGE_MV_MINUS1 (integer)``
3040    Indicates maximum number of merge candidate motion vectors.
3041    Values are from 0 to 4.
3042
3043``V4L2_CID_MPEG_VIDEO_HEVC_TMV_PREDICTION (boolean)``
3044    Indicates temporal motion vector prediction for HEVC encoder. Setting it to
3045    1 enables the prediction. Setting it to 0 disables the prediction.
3046
3047``V4L2_CID_MPEG_VIDEO_HEVC_WITHOUT_STARTCODE (boolean)``
3048    Specifies if HEVC generates a stream with a size of the length field
3049    instead of start code pattern. The size of the length field is configurable
3050    through the V4L2_CID_MPEG_VIDEO_HEVC_SIZE_OF_LENGTH_FIELD control. Setting
3051    the value to 0 disables encoding without startcode pattern. Setting the
3052    value to 1 will enables encoding without startcode pattern.
3053
3054.. _v4l2-hevc-size-of-length-field:
3055
3056``V4L2_CID_MPEG_VIDEO_HEVC_SIZE_OF_LENGTH_FIELD``
3057(enum)
3058
3059enum v4l2_mpeg_video_hevc_size_of_length_field -
3060    Indicates the size of length field.
3061    This is valid when encoding WITHOUT_STARTCODE_ENABLE is enabled.
3062
3063.. raw:: latex
3064
3065    \footnotesize
3066
3067.. tabularcolumns:: |p{5.5cm}|p{12.0cm}|
3068
3069.. flat-table::
3070    :header-rows:  0
3071    :stub-columns: 0
3072
3073    * - ``V4L2_MPEG_VIDEO_HEVC_SIZE_0``
3074      - Generate start code pattern (Normal).
3075    * - ``V4L2_MPEG_VIDEO_HEVC_SIZE_1``
3076      - Generate size of length field instead of start code pattern and length is 1.
3077    * - ``V4L2_MPEG_VIDEO_HEVC_SIZE_2``
3078      - Generate size of length field instead of start code pattern and length is 2.
3079    * - ``V4L2_MPEG_VIDEO_HEVC_SIZE_4``
3080      - Generate size of length field instead of start code pattern and length is 4.
3081
3082.. raw:: latex
3083
3084    \normalsize
3085
3086``V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_L0_BR (integer)``
3087    Indicates bit rate for hierarchical coding layer 0 for HEVC encoder.
3088
3089``V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_L1_BR (integer)``
3090    Indicates bit rate for hierarchical coding layer 1 for HEVC encoder.
3091
3092``V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_L2_BR (integer)``
3093    Indicates bit rate for hierarchical coding layer 2 for HEVC encoder.
3094
3095``V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_L3_BR (integer)``
3096    Indicates bit rate for hierarchical coding layer 3 for HEVC encoder.
3097
3098``V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_L4_BR (integer)``
3099    Indicates bit rate for hierarchical coding layer 4 for HEVC encoder.
3100
3101``V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_L5_BR (integer)``
3102    Indicates bit rate for hierarchical coding layer 5 for HEVC encoder.
3103
3104``V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_L6_BR (integer)``
3105    Indicates bit rate for hierarchical coding layer 6 for HEVC encoder.
3106
3107``V4L2_CID_MPEG_VIDEO_REF_NUMBER_FOR_PFRAMES (integer)``
3108    Selects number of P reference pictures required for HEVC encoder.
3109    P-Frame can use 1 or 2 frames for reference.
3110
3111``V4L2_CID_MPEG_VIDEO_PREPEND_SPSPPS_TO_IDR (integer)``
3112    Indicates whether to generate SPS and PPS at every IDR. Setting it to 0
3113    disables generating SPS and PPS at every IDR. Setting it to one enables
3114    generating SPS and PPS at every IDR.
3115
3116.. _v4l2-mpeg-hevc:
3117
3118``V4L2_CID_MPEG_VIDEO_HEVC_SPS (struct)``
3119    Specifies the Sequence Parameter Set fields (as extracted from the
3120    bitstream) for the associated HEVC slice data.
3121    These bitstream parameters are defined according to :ref:`hevc`.
3122    They are described in section 7.4.3.2 "Sequence parameter set RBSP
3123    semantics" of the specification.
3124
3125.. c:type:: v4l2_ctrl_hevc_sps
3126
3127.. raw:: latex
3128
3129    \small
3130
3131.. tabularcolumns:: |p{1.2cm}|p{9.2cm}|p{6.9cm}|
3132
3133.. cssclass:: longtable
3134
3135.. flat-table:: struct v4l2_ctrl_hevc_sps
3136    :header-rows:  0
3137    :stub-columns: 0
3138    :widths:       1 1 2
3139
3140    * - __u16
3141      - ``pic_width_in_luma_samples``
3142      -
3143    * - __u16
3144      - ``pic_height_in_luma_samples``
3145      -
3146    * - __u8
3147      - ``bit_depth_luma_minus8``
3148      -
3149    * - __u8
3150      - ``bit_depth_chroma_minus8``
3151      -
3152    * - __u8
3153      - ``log2_max_pic_order_cnt_lsb_minus4``
3154      -
3155    * - __u8
3156      - ``sps_max_dec_pic_buffering_minus1``
3157      -
3158    * - __u8
3159      - ``sps_max_num_reorder_pics``
3160      -
3161    * - __u8
3162      - ``sps_max_latency_increase_plus1``
3163      -
3164    * - __u8
3165      - ``log2_min_luma_coding_block_size_minus3``
3166      -
3167    * - __u8
3168      - ``log2_diff_max_min_luma_coding_block_size``
3169      -
3170    * - __u8
3171      - ``log2_min_luma_transform_block_size_minus2``
3172      -
3173    * - __u8
3174      - ``log2_diff_max_min_luma_transform_block_size``
3175      -
3176    * - __u8
3177      - ``max_transform_hierarchy_depth_inter``
3178      -
3179    * - __u8
3180      - ``max_transform_hierarchy_depth_intra``
3181      -
3182    * - __u8
3183      - ``pcm_sample_bit_depth_luma_minus1``
3184      -
3185    * - __u8
3186      - ``pcm_sample_bit_depth_chroma_minus1``
3187      -
3188    * - __u8
3189      - ``log2_min_pcm_luma_coding_block_size_minus3``
3190      -
3191    * - __u8
3192      - ``log2_diff_max_min_pcm_luma_coding_block_size``
3193      -
3194    * - __u8
3195      - ``num_short_term_ref_pic_sets``
3196      -
3197    * - __u8
3198      - ``num_long_term_ref_pics_sps``
3199      -
3200    * - __u8
3201      - ``chroma_format_idc``
3202      -
3203    * - __u64
3204      - ``flags``
3205      - See :ref:`Sequence Parameter Set Flags <hevc_sps_flags>`
3206
3207.. raw:: latex
3208
3209    \normalsize
3210
3211.. _hevc_sps_flags:
3212
3213``Sequence Parameter Set Flags``
3214
3215.. raw:: latex
3216
3217    \small
3218
3219.. cssclass:: longtable
3220
3221.. flat-table::
3222    :header-rows:  0
3223    :stub-columns: 0
3224    :widths:       1 1 2
3225
3226    * - ``V4L2_HEVC_SPS_FLAG_SEPARATE_COLOUR_PLANE``
3227      - 0x00000001
3228      -
3229    * - ``V4L2_HEVC_SPS_FLAG_SCALING_LIST_ENABLED``
3230      - 0x00000002
3231      -
3232    * - ``V4L2_HEVC_SPS_FLAG_AMP_ENABLED``
3233      - 0x00000004
3234      -
3235    * - ``V4L2_HEVC_SPS_FLAG_SAMPLE_ADAPTIVE_OFFSET``
3236      - 0x00000008
3237      -
3238    * - ``V4L2_HEVC_SPS_FLAG_PCM_ENABLED``
3239      - 0x00000010
3240      -
3241    * - ``V4L2_HEVC_SPS_FLAG_PCM_LOOP_FILTER_DISABLED``
3242      - 0x00000020
3243      -
3244    * - ``V4L2_HEVC_SPS_FLAG_LONG_TERM_REF_PICS_PRESENT``
3245      - 0x00000040
3246      -
3247    * - ``V4L2_HEVC_SPS_FLAG_SPS_TEMPORAL_MVP_ENABLED``
3248      - 0x00000080
3249      -
3250    * - ``V4L2_HEVC_SPS_FLAG_STRONG_INTRA_SMOOTHING_ENABLED``
3251      - 0x00000100
3252      -
3253
3254.. raw:: latex
3255
3256    \normalsize
3257
3258``V4L2_CID_MPEG_VIDEO_HEVC_PPS (struct)``
3259    Specifies the Picture Parameter Set fields (as extracted from the
3260    bitstream) for the associated HEVC slice data.
3261    These bitstream parameters are defined according to :ref:`hevc`.
3262    They are described in section 7.4.3.3 "Picture parameter set RBSP
3263    semantics" of the specification.
3264
3265.. c:type:: v4l2_ctrl_hevc_pps
3266
3267.. tabularcolumns:: |p{1.2cm}|p{8.6cm}|p{7.5cm}|
3268
3269.. cssclass:: longtable
3270
3271.. flat-table:: struct v4l2_ctrl_hevc_pps
3272    :header-rows:  0
3273    :stub-columns: 0
3274    :widths:       1 1 2
3275
3276    * - __u8
3277      - ``num_extra_slice_header_bits``
3278      -
3279    * - __s8
3280      - ``init_qp_minus26``
3281      -
3282    * - __u8
3283      - ``diff_cu_qp_delta_depth``
3284      -
3285    * - __s8
3286      - ``pps_cb_qp_offset``
3287      -
3288    * - __s8
3289      - ``pps_cr_qp_offset``
3290      -
3291    * - __u8
3292      - ``num_tile_columns_minus1``
3293      -
3294    * - __u8
3295      - ``num_tile_rows_minus1``
3296      -
3297    * - __u8
3298      - ``column_width_minus1[20]``
3299      -
3300    * - __u8
3301      - ``row_height_minus1[22]``
3302      -
3303    * - __s8
3304      - ``pps_beta_offset_div2``
3305      -
3306    * - __s8
3307      - ``pps_tc_offset_div2``
3308      -
3309    * - __u8
3310      - ``log2_parallel_merge_level_minus2``
3311      -
3312    * - __u8
3313      - ``padding[4]``
3314      - Applications and drivers must set this to zero.
3315    * - __u64
3316      - ``flags``
3317      - See :ref:`Picture Parameter Set Flags <hevc_pps_flags>`
3318
3319.. _hevc_pps_flags:
3320
3321``Picture Parameter Set Flags``
3322
3323.. raw:: latex
3324
3325    \small
3326
3327.. flat-table::
3328    :header-rows:  0
3329    :stub-columns: 0
3330    :widths:       1 1 2
3331
3332    * - ``V4L2_HEVC_PPS_FLAG_DEPENDENT_SLICE_SEGMENT``
3333      - 0x00000001
3334      -
3335    * - ``V4L2_HEVC_PPS_FLAG_OUTPUT_FLAG_PRESENT``
3336      - 0x00000002
3337      -
3338    * - ``V4L2_HEVC_PPS_FLAG_SIGN_DATA_HIDING_ENABLED``
3339      - 0x00000004
3340      -
3341    * - ``V4L2_HEVC_PPS_FLAG_CABAC_INIT_PRESENT``
3342      - 0x00000008
3343      -
3344    * - ``V4L2_HEVC_PPS_FLAG_CONSTRAINED_INTRA_PRED``
3345      - 0x00000010
3346      -
3347    * - ``V4L2_HEVC_PPS_FLAG_TRANSFORM_SKIP_ENABLED``
3348      - 0x00000020
3349      -
3350    * - ``V4L2_HEVC_PPS_FLAG_CU_QP_DELTA_ENABLED``
3351      - 0x00000040
3352      -
3353    * - ``V4L2_HEVC_PPS_FLAG_PPS_SLICE_CHROMA_QP_OFFSETS_PRESENT``
3354      - 0x00000080
3355      -
3356    * - ``V4L2_HEVC_PPS_FLAG_WEIGHTED_PRED``
3357      - 0x00000100
3358      -
3359    * - ``V4L2_HEVC_PPS_FLAG_WEIGHTED_BIPRED``
3360      - 0x00000200
3361      -
3362    * - ``V4L2_HEVC_PPS_FLAG_TRANSQUANT_BYPASS_ENABLED``
3363      - 0x00000400
3364      -
3365    * - ``V4L2_HEVC_PPS_FLAG_TILES_ENABLED``
3366      - 0x00000800
3367      -
3368    * - ``V4L2_HEVC_PPS_FLAG_ENTROPY_CODING_SYNC_ENABLED``
3369      - 0x00001000
3370      -
3371    * - ``V4L2_HEVC_PPS_FLAG_LOOP_FILTER_ACROSS_TILES_ENABLED``
3372      - 0x00002000
3373      -
3374    * - ``V4L2_HEVC_PPS_FLAG_PPS_LOOP_FILTER_ACROSS_SLICES_ENABLED``
3375      - 0x00004000
3376      -
3377    * - ``V4L2_HEVC_PPS_FLAG_DEBLOCKING_FILTER_OVERRIDE_ENABLED``
3378      - 0x00008000
3379      -
3380    * - ``V4L2_HEVC_PPS_FLAG_PPS_DISABLE_DEBLOCKING_FILTER``
3381      - 0x00010000
3382      -
3383    * - ``V4L2_HEVC_PPS_FLAG_LISTS_MODIFICATION_PRESENT``
3384      - 0x00020000
3385      -
3386    * - ``V4L2_HEVC_PPS_FLAG_SLICE_SEGMENT_HEADER_EXTENSION_PRESENT``
3387      - 0x00040000
3388      -
3389
3390.. raw:: latex
3391
3392    \normalsize
3393
3394``V4L2_CID_MPEG_VIDEO_HEVC_SLICE_PARAMS (struct)``
3395    Specifies various slice-specific parameters, especially from the NAL unit
3396    header, general slice segment header and weighted prediction parameter
3397    parts of the bitstream.
3398    These bitstream parameters are defined according to :ref:`hevc`.
3399    They are described in section 7.4.7 "General slice segment header
3400    semantics" of the specification.
3401
3402.. c:type:: v4l2_ctrl_hevc_slice_params
3403
3404.. raw:: latex
3405
3406    \scriptsize
3407
3408.. tabularcolumns:: |p{5.4cm}|p{6.8cm}|p{5.1cm}|
3409
3410.. cssclass:: longtable
3411
3412.. flat-table:: struct v4l2_ctrl_hevc_slice_params
3413    :header-rows:  0
3414    :stub-columns: 0
3415    :widths:       1 1 2
3416
3417    * - __u32
3418      - ``bit_size``
3419      - Size (in bits) of the current slice data.
3420    * - __u32
3421      - ``data_bit_offset``
3422      - Offset (in bits) to the video data in the current slice data.
3423    * - __u8
3424      - ``nal_unit_type``
3425      -
3426    * - __u8
3427      - ``nuh_temporal_id_plus1``
3428      -
3429    * - __u8
3430      - ``slice_type``
3431      -
3432	(V4L2_HEVC_SLICE_TYPE_I, V4L2_HEVC_SLICE_TYPE_P or
3433	V4L2_HEVC_SLICE_TYPE_B).
3434    * - __u8
3435      - ``colour_plane_id``
3436      -
3437    * - __u16
3438      - ``slice_pic_order_cnt``
3439      -
3440    * - __u8
3441      - ``num_ref_idx_l0_active_minus1``
3442      -
3443    * - __u8
3444      - ``num_ref_idx_l1_active_minus1``
3445      -
3446    * - __u8
3447      - ``collocated_ref_idx``
3448      -
3449    * - __u8
3450      - ``five_minus_max_num_merge_cand``
3451      -
3452    * - __s8
3453      - ``slice_qp_delta``
3454      -
3455    * - __s8
3456      - ``slice_cb_qp_offset``
3457      -
3458    * - __s8
3459      - ``slice_cr_qp_offset``
3460      -
3461    * - __s8
3462      - ``slice_act_y_qp_offset``
3463      -
3464    * - __s8
3465      - ``slice_act_cb_qp_offset``
3466      -
3467    * - __s8
3468      - ``slice_act_cr_qp_offset``
3469      -
3470    * - __s8
3471      - ``slice_beta_offset_div2``
3472      -
3473    * - __s8
3474      - ``slice_tc_offset_div2``
3475      -
3476    * - __u8
3477      - ``pic_struct``
3478      -
3479    * - __u8
3480      - ``num_active_dpb_entries``
3481      - The number of entries in ``dpb``.
3482    * - __u8
3483      - ``ref_idx_l0[V4L2_HEVC_DPB_ENTRIES_NUM_MAX]``
3484      - The list of L0 reference elements as indices in the DPB.
3485    * - __u8
3486      - ``ref_idx_l1[V4L2_HEVC_DPB_ENTRIES_NUM_MAX]``
3487      - The list of L1 reference elements as indices in the DPB.
3488    * - __u8
3489      - ``num_rps_poc_st_curr_before``
3490      - The number of reference pictures in the short-term set that come before
3491        the current frame.
3492    * - __u8
3493      - ``num_rps_poc_st_curr_after``
3494      - The number of reference pictures in the short-term set that come after
3495        the current frame.
3496    * - __u8
3497      - ``num_rps_poc_lt_curr``
3498      - The number of reference pictures in the long-term set.
3499    * - __u8
3500      - ``padding[7]``
3501      - Applications and drivers must set this to zero.
3502    * - struct :c:type:`v4l2_hevc_dpb_entry`
3503      - ``dpb[V4L2_HEVC_DPB_ENTRIES_NUM_MAX]``
3504      - The decoded picture buffer, for meta-data about reference frames.
3505    * - struct :c:type:`v4l2_hevc_pred_weight_table`
3506      - ``pred_weight_table``
3507      - The prediction weight coefficients for inter-picture prediction.
3508    * - __u64
3509      - ``flags``
3510      - See :ref:`Slice Parameters Flags <hevc_slice_params_flags>`
3511
3512.. raw:: latex
3513
3514    \normalsize
3515
3516.. _hevc_slice_params_flags:
3517
3518``Slice Parameters Flags``
3519
3520.. raw:: latex
3521
3522    \scriptsize
3523
3524.. flat-table::
3525    :header-rows:  0
3526    :stub-columns: 0
3527    :widths:       1 1 2
3528
3529    * - ``V4L2_HEVC_SLICE_PARAMS_FLAG_SLICE_SAO_LUMA``
3530      - 0x00000001
3531      -
3532    * - ``V4L2_HEVC_SLICE_PARAMS_FLAG_SLICE_SAO_CHROMA``
3533      - 0x00000002
3534      -
3535    * - ``V4L2_HEVC_SLICE_PARAMS_FLAG_SLICE_TEMPORAL_MVP_ENABLED``
3536      - 0x00000004
3537      -
3538    * - ``V4L2_HEVC_SLICE_PARAMS_FLAG_MVD_L1_ZERO``
3539      - 0x00000008
3540      -
3541    * - ``V4L2_HEVC_SLICE_PARAMS_FLAG_CABAC_INIT``
3542      - 0x00000010
3543      -
3544    * - ``V4L2_HEVC_SLICE_PARAMS_FLAG_COLLOCATED_FROM_L0``
3545      - 0x00000020
3546      -
3547    * - ``V4L2_HEVC_SLICE_PARAMS_FLAG_USE_INTEGER_MV``
3548      - 0x00000040
3549      -
3550    * - ``V4L2_HEVC_SLICE_PARAMS_FLAG_SLICE_DEBLOCKING_FILTER_DISABLED``
3551      - 0x00000080
3552      -
3553    * - ``V4L2_HEVC_SLICE_PARAMS_FLAG_SLICE_LOOP_FILTER_ACROSS_SLICES_ENABLED``
3554      - 0x00000100
3555      -
3556
3557.. raw:: latex
3558
3559    \normalsize
3560
3561.. c:type:: v4l2_hevc_dpb_entry
3562
3563.. raw:: latex
3564
3565    \small
3566
3567.. tabularcolumns:: |p{1.0cm}|p{4.2cm}|p{12.1cm}|
3568
3569.. flat-table:: struct v4l2_hevc_dpb_entry
3570    :header-rows:  0
3571    :stub-columns: 0
3572    :widths:       1 1 2
3573
3574    * - __u64
3575      - ``timestamp``
3576      - Timestamp of the V4L2 capture buffer to use as reference, used
3577        with B-coded and P-coded frames. The timestamp refers to the
3578	``timestamp`` field in struct :c:type:`v4l2_buffer`. Use the
3579	:c:func:`v4l2_timeval_to_ns()` function to convert the struct
3580	:c:type:`timeval` in struct :c:type:`v4l2_buffer` to a __u64.
3581    * - __u8
3582      - ``rps``
3583      - The reference set for the reference frame
3584        (V4L2_HEVC_DPB_ENTRY_RPS_ST_CURR_BEFORE,
3585        V4L2_HEVC_DPB_ENTRY_RPS_ST_CURR_AFTER or
3586        V4L2_HEVC_DPB_ENTRY_RPS_LT_CURR)
3587    * - __u8
3588      - ``field_pic``
3589      - Whether the reference is a field picture or a frame.
3590    * - __u16
3591      - ``pic_order_cnt[2]``
3592      - The picture order count of the reference. Only the first element of the
3593        array is used for frame pictures, while the first element identifies the
3594        top field and the second the bottom field in field-coded pictures.
3595    * - __u8
3596      - ``padding[2]``
3597      - Applications and drivers must set this to zero.
3598
3599.. raw:: latex
3600
3601    \normalsize
3602
3603.. c:type:: v4l2_hevc_pred_weight_table
3604
3605.. raw:: latex
3606
3607    \footnotesize
3608
3609.. tabularcolumns:: |p{0.8cm}|p{10.6cm}|p{5.9cm}|
3610
3611.. flat-table:: struct v4l2_hevc_pred_weight_table
3612    :header-rows:  0
3613    :stub-columns: 0
3614    :widths:       1 1 2
3615
3616    * - __u8
3617      - ``luma_log2_weight_denom``
3618      -
3619    * - __s8
3620      - ``delta_chroma_log2_weight_denom``
3621      -
3622    * - __s8
3623      - ``delta_luma_weight_l0[V4L2_HEVC_DPB_ENTRIES_NUM_MAX]``
3624      -
3625    * - __s8
3626      - ``luma_offset_l0[V4L2_HEVC_DPB_ENTRIES_NUM_MAX]``
3627      -
3628    * - __s8
3629      - ``delta_chroma_weight_l0[V4L2_HEVC_DPB_ENTRIES_NUM_MAX][2]``
3630      -
3631    * - __s8
3632      - ``chroma_offset_l0[V4L2_HEVC_DPB_ENTRIES_NUM_MAX][2]``
3633      -
3634    * - __s8
3635      - ``delta_luma_weight_l1[V4L2_HEVC_DPB_ENTRIES_NUM_MAX]``
3636      -
3637    * - __s8
3638      - ``luma_offset_l1[V4L2_HEVC_DPB_ENTRIES_NUM_MAX]``
3639      -
3640    * - __s8
3641      - ``delta_chroma_weight_l1[V4L2_HEVC_DPB_ENTRIES_NUM_MAX][2]``
3642      -
3643    * - __s8
3644      - ``chroma_offset_l1[V4L2_HEVC_DPB_ENTRIES_NUM_MAX][2]``
3645      -
3646    * - __u8
3647      - ``padding[6]``
3648      - Applications and drivers must set this to zero.
3649
3650.. raw:: latex
3651
3652    \normalsize
3653
3654``V4L2_CID_MPEG_VIDEO_HEVC_DECODE_MODE (enum)``
3655    Specifies the decoding mode to use. Currently exposes slice-based and
3656    frame-based decoding but new modes might be added later on.
3657    This control is used as a modifier for V4L2_PIX_FMT_HEVC_SLICE
3658    pixel format. Applications that support V4L2_PIX_FMT_HEVC_SLICE
3659    are required to set this control in order to specify the decoding mode
3660    that is expected for the buffer.
3661    Drivers may expose a single or multiple decoding modes, depending
3662    on what they can support.
3663
3664    .. note::
3665
3666       This menu control is not yet part of the public kernel API and
3667       it is expected to change.
3668
3669.. c:type:: v4l2_mpeg_video_hevc_decode_mode
3670
3671.. raw:: latex
3672
3673    \small
3674
3675.. tabularcolumns:: |p{9.4cm}|p{0.6cm}|p{7.3cm}|
3676
3677.. flat-table::
3678    :header-rows:  0
3679    :stub-columns: 0
3680    :widths:       1 1 2
3681
3682    * - ``V4L2_MPEG_VIDEO_HEVC_DECODE_MODE_SLICE_BASED``
3683      - 0
3684      - Decoding is done at the slice granularity.
3685        The OUTPUT buffer must contain a single slice.
3686    * - ``V4L2_MPEG_VIDEO_HEVC_DECODE_MODE_FRAME_BASED``
3687      - 1
3688      - Decoding is done at the frame granularity.
3689        The OUTPUT buffer must contain all slices needed to decode the
3690        frame. The OUTPUT buffer must also contain both fields.
3691
3692.. raw:: latex
3693
3694    \normalsize
3695
3696``V4L2_CID_MPEG_VIDEO_HEVC_START_CODE (enum)``
3697    Specifies the HEVC slice start code expected for each slice.
3698    This control is used as a modifier for V4L2_PIX_FMT_HEVC_SLICE
3699    pixel format. Applications that support V4L2_PIX_FMT_HEVC_SLICE
3700    are required to set this control in order to specify the start code
3701    that is expected for the buffer.
3702    Drivers may expose a single or multiple start codes, depending
3703    on what they can support.
3704
3705    .. note::
3706
3707       This menu control is not yet part of the public kernel API and
3708       it is expected to change.
3709
3710.. c:type:: v4l2_mpeg_video_hevc_start_code
3711
3712.. tabularcolumns:: |p{9.2cm}|p{0.6cm}|p{7.5cm}|
3713
3714.. flat-table::
3715    :header-rows:  0
3716    :stub-columns: 0
3717    :widths:       1 1 2
3718
3719    * - ``V4L2_MPEG_VIDEO_HEVC_START_CODE_NONE``
3720      - 0
3721      - Selecting this value specifies that HEVC slices are passed
3722        to the driver without any start code. The bitstream data should be
3723        according to :ref:`hevc` 7.3.1.1 General NAL unit syntax, hence
3724        contains emulation prevention bytes when required.
3725    * - ``V4L2_MPEG_VIDEO_HEVC_START_CODE_ANNEX_B``
3726      - 1
3727      - Selecting this value specifies that HEVC slices are expected
3728        to be prefixed by Annex B start codes. According to :ref:`hevc`
3729        valid start codes can be 3-bytes 0x000001 or 4-bytes 0x00000001.
3730
3731``V4L2_CID_MPEG_VIDEO_BASELAYER_PRIORITY_ID (integer)``
3732    Specifies a priority identifier for the NAL unit, which will be applied to
3733    the base layer. By default this value is set to 0 for the base layer,
3734    and the next layer will have the priority ID assigned as 1, 2, 3 and so on.
3735    The video encoder can't decide the priority id to be applied to a layer,
3736    so this has to come from client.
3737    This is applicable to H264 and valid Range is from 0 to 63.
3738    Source Rec. ITU-T H.264 (06/2019); G.7.4.1.1, G.8.8.1.
3739