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