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