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