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