• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /* SPDX-License-Identifier: ((GPL-2.0+ WITH Linux-syscall-note) OR BSD-3-Clause) */
2 /*
3  *  Video for Linux Two controls header file
4  *
5  *  Copyright (C) 1999-2012 the contributors
6  *
7  *  This program is free software; you can redistribute it and/or modify
8  *  it under the terms of the GNU General Public License as published by
9  *  the Free Software Foundation; either version 2 of the License, or
10  *  (at your option) any later version.
11  *
12  *  This program is distributed in the hope that it will be useful,
13  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  *  GNU General Public License for more details.
16  *
17  *  Alternatively you can redistribute this file under the terms of the
18  *  BSD license as stated below:
19  *
20  *  Redistribution and use in source and binary forms, with or without
21  *  modification, are permitted provided that the following conditions
22  *  are met:
23  *  1. Redistributions of source code must retain the above copyright
24  *     notice, this list of conditions and the following disclaimer.
25  *  2. Redistributions in binary form must reproduce the above copyright
26  *     notice, this list of conditions and the following disclaimer in
27  *     the documentation and/or other materials provided with the
28  *     distribution.
29  *  3. The names of its contributors may not be used to endorse or promote
30  *     products derived from this software without specific prior written
31  *     permission.
32  *
33  *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
34  *  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
35  *  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
36  *  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
37  *  OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
38  *  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
39  *  TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
40  *  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
41  *  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
42  *  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
43  *  SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
44  *
45  *  The contents of this header was split off from videodev2.h. All control
46  *  definitions should be added to this header, which is included by
47  *  videodev2.h.
48  */
49 
50 #ifndef __LINUX_V4L2_CONTROLS_H
51 #define __LINUX_V4L2_CONTROLS_H
52 
53 #include <linux/types.h>
54 
55 /* Control classes */
56 #define V4L2_CTRL_CLASS_USER		0x00980000	/* Old-style 'user' controls */
57 #define V4L2_CTRL_CLASS_CODEC		0x00990000	/* Stateful codec controls */
58 #define V4L2_CTRL_CLASS_CAMERA		0x009a0000	/* Camera class controls */
59 #define V4L2_CTRL_CLASS_FM_TX		0x009b0000	/* FM Modulator controls */
60 #define V4L2_CTRL_CLASS_FLASH		0x009c0000	/* Camera flash controls */
61 #define V4L2_CTRL_CLASS_JPEG		0x009d0000	/* JPEG-compression controls */
62 #define V4L2_CTRL_CLASS_IMAGE_SOURCE	0x009e0000	/* Image source controls */
63 #define V4L2_CTRL_CLASS_IMAGE_PROC	0x009f0000	/* Image processing controls */
64 #define V4L2_CTRL_CLASS_DV		0x00a00000	/* Digital Video controls */
65 #define V4L2_CTRL_CLASS_FM_RX		0x00a10000	/* FM Receiver controls */
66 #define V4L2_CTRL_CLASS_RF_TUNER	0x00a20000	/* RF tuner controls */
67 #define V4L2_CTRL_CLASS_DETECT		0x00a30000	/* Detection controls */
68 #define V4L2_CTRL_CLASS_CODEC_STATELESS 0x00a40000	/* Stateless codecs controls */
69 
70 /* User-class control IDs */
71 
72 #define V4L2_CID_BASE			(V4L2_CTRL_CLASS_USER | 0x900)
73 #define V4L2_CID_USER_BASE		V4L2_CID_BASE
74 #define V4L2_CID_USER_CLASS		(V4L2_CTRL_CLASS_USER | 1)
75 #define V4L2_CID_BRIGHTNESS		(V4L2_CID_BASE+0)
76 #define V4L2_CID_CONTRAST		(V4L2_CID_BASE+1)
77 #define V4L2_CID_SATURATION		(V4L2_CID_BASE+2)
78 #define V4L2_CID_HUE			(V4L2_CID_BASE+3)
79 #define V4L2_CID_AUDIO_VOLUME		(V4L2_CID_BASE+5)
80 #define V4L2_CID_AUDIO_BALANCE		(V4L2_CID_BASE+6)
81 #define V4L2_CID_AUDIO_BASS		(V4L2_CID_BASE+7)
82 #define V4L2_CID_AUDIO_TREBLE		(V4L2_CID_BASE+8)
83 #define V4L2_CID_AUDIO_MUTE		(V4L2_CID_BASE+9)
84 #define V4L2_CID_AUDIO_LOUDNESS		(V4L2_CID_BASE+10)
85 #define V4L2_CID_BLACK_LEVEL		(V4L2_CID_BASE+11) /* Deprecated */
86 #define V4L2_CID_AUTO_WHITE_BALANCE	(V4L2_CID_BASE+12)
87 #define V4L2_CID_DO_WHITE_BALANCE	(V4L2_CID_BASE+13)
88 #define V4L2_CID_RED_BALANCE		(V4L2_CID_BASE+14)
89 #define V4L2_CID_BLUE_BALANCE		(V4L2_CID_BASE+15)
90 #define V4L2_CID_GAMMA			(V4L2_CID_BASE+16)
91 #define V4L2_CID_WHITENESS		(V4L2_CID_GAMMA) /* Deprecated */
92 #define V4L2_CID_EXPOSURE		(V4L2_CID_BASE+17)
93 #define V4L2_CID_AUTOGAIN		(V4L2_CID_BASE+18)
94 #define V4L2_CID_GAIN			(V4L2_CID_BASE+19)
95 #define V4L2_CID_HFLIP			(V4L2_CID_BASE+20)
96 #define V4L2_CID_VFLIP			(V4L2_CID_BASE+21)
97 
98 #define V4L2_CID_POWER_LINE_FREQUENCY	(V4L2_CID_BASE+24)
99 enum v4l2_power_line_frequency {
100 	V4L2_CID_POWER_LINE_FREQUENCY_DISABLED	= 0,
101 	V4L2_CID_POWER_LINE_FREQUENCY_50HZ	= 1,
102 	V4L2_CID_POWER_LINE_FREQUENCY_60HZ	= 2,
103 	V4L2_CID_POWER_LINE_FREQUENCY_AUTO	= 3,
104 };
105 #define V4L2_CID_HUE_AUTO			(V4L2_CID_BASE+25)
106 #define V4L2_CID_WHITE_BALANCE_TEMPERATURE	(V4L2_CID_BASE+26)
107 #define V4L2_CID_SHARPNESS			(V4L2_CID_BASE+27)
108 #define V4L2_CID_BACKLIGHT_COMPENSATION		(V4L2_CID_BASE+28)
109 #define V4L2_CID_CHROMA_AGC                     (V4L2_CID_BASE+29)
110 #define V4L2_CID_COLOR_KILLER                   (V4L2_CID_BASE+30)
111 #define V4L2_CID_COLORFX			(V4L2_CID_BASE+31)
112 enum v4l2_colorfx {
113 	V4L2_COLORFX_NONE			= 0,
114 	V4L2_COLORFX_BW				= 1,
115 	V4L2_COLORFX_SEPIA			= 2,
116 	V4L2_COLORFX_NEGATIVE			= 3,
117 	V4L2_COLORFX_EMBOSS			= 4,
118 	V4L2_COLORFX_SKETCH			= 5,
119 	V4L2_COLORFX_SKY_BLUE			= 6,
120 	V4L2_COLORFX_GRASS_GREEN		= 7,
121 	V4L2_COLORFX_SKIN_WHITEN		= 8,
122 	V4L2_COLORFX_VIVID			= 9,
123 	V4L2_COLORFX_AQUA			= 10,
124 	V4L2_COLORFX_ART_FREEZE			= 11,
125 	V4L2_COLORFX_SILHOUETTE			= 12,
126 	V4L2_COLORFX_SOLARIZATION		= 13,
127 	V4L2_COLORFX_ANTIQUE			= 14,
128 	V4L2_COLORFX_SET_CBCR			= 15,
129 };
130 #define V4L2_CID_AUTOBRIGHTNESS			(V4L2_CID_BASE+32)
131 #define V4L2_CID_BAND_STOP_FILTER		(V4L2_CID_BASE+33)
132 
133 #define V4L2_CID_ROTATE				(V4L2_CID_BASE+34)
134 #define V4L2_CID_BG_COLOR			(V4L2_CID_BASE+35)
135 
136 #define V4L2_CID_CHROMA_GAIN                    (V4L2_CID_BASE+36)
137 
138 #define V4L2_CID_ILLUMINATORS_1			(V4L2_CID_BASE+37)
139 #define V4L2_CID_ILLUMINATORS_2			(V4L2_CID_BASE+38)
140 
141 #define V4L2_CID_MIN_BUFFERS_FOR_CAPTURE	(V4L2_CID_BASE+39)
142 #define V4L2_CID_MIN_BUFFERS_FOR_OUTPUT		(V4L2_CID_BASE+40)
143 
144 #define V4L2_CID_ALPHA_COMPONENT		(V4L2_CID_BASE+41)
145 #define V4L2_CID_COLORFX_CBCR			(V4L2_CID_BASE+42)
146 
147 /* last CID + 1 */
148 #define V4L2_CID_LASTP1                         (V4L2_CID_BASE+43)
149 
150 /* USER-class private control IDs */
151 
152 /* The base for the meye driver controls. See linux/meye.h for the list
153  * of controls. We reserve 16 controls for this driver. */
154 #define V4L2_CID_USER_MEYE_BASE			(V4L2_CID_USER_BASE + 0x1000)
155 
156 /* The base for the bttv driver controls.
157  * We reserve 32 controls for this driver. */
158 #define V4L2_CID_USER_BTTV_BASE			(V4L2_CID_USER_BASE + 0x1010)
159 
160 
161 /* The base for the s2255 driver controls.
162  * We reserve 16 controls for this driver. */
163 #define V4L2_CID_USER_S2255_BASE		(V4L2_CID_USER_BASE + 0x1030)
164 
165 /*
166  * The base for the si476x driver controls. See include/media/drv-intf/si476x.h
167  * for the list of controls. Total of 16 controls is reserved for this driver
168  */
169 #define V4L2_CID_USER_SI476X_BASE		(V4L2_CID_USER_BASE + 0x1040)
170 
171 /* The base for the TI VPE driver controls. Total of 16 controls is reserved for
172  * this driver */
173 #define V4L2_CID_USER_TI_VPE_BASE		(V4L2_CID_USER_BASE + 0x1050)
174 
175 /* The base for the saa7134 driver controls.
176  * We reserve 16 controls for this driver. */
177 #define V4L2_CID_USER_SAA7134_BASE		(V4L2_CID_USER_BASE + 0x1060)
178 
179 /* The base for the adv7180 driver controls.
180  * We reserve 16 controls for this driver. */
181 #define V4L2_CID_USER_ADV7180_BASE		(V4L2_CID_USER_BASE + 0x1070)
182 
183 /* The base for the tc358743 driver controls.
184  * We reserve 16 controls for this driver. */
185 #define V4L2_CID_USER_TC358743_BASE		(V4L2_CID_USER_BASE + 0x1080)
186 
187 /* The base for the max217x driver controls.
188  * We reserve 32 controls for this driver
189  */
190 #define V4L2_CID_USER_MAX217X_BASE		(V4L2_CID_USER_BASE + 0x1090)
191 
192 /* The base for the imx driver controls.
193  * We reserve 16 controls for this driver. */
194 #define V4L2_CID_USER_IMX_BASE			(V4L2_CID_USER_BASE + 0x10b0)
195 
196 /*
197  * The base for the atmel isc driver controls.
198  * We reserve 32 controls for this driver.
199  */
200 #define V4L2_CID_USER_ATMEL_ISC_BASE		(V4L2_CID_USER_BASE + 0x10c0)
201 
202 /*
203  * The base for the CODA driver controls.
204  * We reserve 16 controls for this driver.
205  */
206 #define V4L2_CID_USER_CODA_BASE			(V4L2_CID_USER_BASE + 0x10e0)
207 /*
208  * The base for MIPI CCS driver controls.
209  * We reserve 128 controls for this driver.
210  */
211 #define V4L2_CID_USER_CCS_BASE			(V4L2_CID_USER_BASE + 0x10f0)
212 
213 /* MPEG-class control IDs */
214 /* The MPEG controls are applicable to all codec controls
215  * and the 'MPEG' part of the define is historical */
216 
217 #define V4L2_CID_CODEC_BASE			(V4L2_CTRL_CLASS_CODEC | 0x900)
218 #define V4L2_CID_CODEC_CLASS			(V4L2_CTRL_CLASS_CODEC | 1)
219 
220 /*  MPEG streams, specific to multiplexed streams */
221 #define V4L2_CID_MPEG_STREAM_TYPE		(V4L2_CID_CODEC_BASE+0)
222 enum v4l2_mpeg_stream_type {
223 	V4L2_MPEG_STREAM_TYPE_MPEG2_PS   = 0, /* MPEG-2 program stream */
224 	V4L2_MPEG_STREAM_TYPE_MPEG2_TS   = 1, /* MPEG-2 transport stream */
225 	V4L2_MPEG_STREAM_TYPE_MPEG1_SS   = 2, /* MPEG-1 system stream */
226 	V4L2_MPEG_STREAM_TYPE_MPEG2_DVD  = 3, /* MPEG-2 DVD-compatible stream */
227 	V4L2_MPEG_STREAM_TYPE_MPEG1_VCD  = 4, /* MPEG-1 VCD-compatible stream */
228 	V4L2_MPEG_STREAM_TYPE_MPEG2_SVCD = 5, /* MPEG-2 SVCD-compatible stream */
229 };
230 #define V4L2_CID_MPEG_STREAM_PID_PMT		(V4L2_CID_CODEC_BASE+1)
231 #define V4L2_CID_MPEG_STREAM_PID_AUDIO		(V4L2_CID_CODEC_BASE+2)
232 #define V4L2_CID_MPEG_STREAM_PID_VIDEO		(V4L2_CID_CODEC_BASE+3)
233 #define V4L2_CID_MPEG_STREAM_PID_PCR		(V4L2_CID_CODEC_BASE+4)
234 #define V4L2_CID_MPEG_STREAM_PES_ID_AUDIO	(V4L2_CID_CODEC_BASE+5)
235 #define V4L2_CID_MPEG_STREAM_PES_ID_VIDEO	(V4L2_CID_CODEC_BASE+6)
236 #define V4L2_CID_MPEG_STREAM_VBI_FMT		(V4L2_CID_CODEC_BASE+7)
237 enum v4l2_mpeg_stream_vbi_fmt {
238 	V4L2_MPEG_STREAM_VBI_FMT_NONE = 0,  /* No VBI in the MPEG stream */
239 	V4L2_MPEG_STREAM_VBI_FMT_IVTV = 1,  /* VBI in private packets, IVTV format */
240 };
241 
242 /*  MPEG audio controls specific to multiplexed streams  */
243 #define V4L2_CID_MPEG_AUDIO_SAMPLING_FREQ	(V4L2_CID_CODEC_BASE+100)
244 enum v4l2_mpeg_audio_sampling_freq {
245 	V4L2_MPEG_AUDIO_SAMPLING_FREQ_44100 = 0,
246 	V4L2_MPEG_AUDIO_SAMPLING_FREQ_48000 = 1,
247 	V4L2_MPEG_AUDIO_SAMPLING_FREQ_32000 = 2,
248 };
249 #define V4L2_CID_MPEG_AUDIO_ENCODING		(V4L2_CID_CODEC_BASE+101)
250 enum v4l2_mpeg_audio_encoding {
251 	V4L2_MPEG_AUDIO_ENCODING_LAYER_1 = 0,
252 	V4L2_MPEG_AUDIO_ENCODING_LAYER_2 = 1,
253 	V4L2_MPEG_AUDIO_ENCODING_LAYER_3 = 2,
254 	V4L2_MPEG_AUDIO_ENCODING_AAC     = 3,
255 	V4L2_MPEG_AUDIO_ENCODING_AC3     = 4,
256 };
257 #define V4L2_CID_MPEG_AUDIO_L1_BITRATE		(V4L2_CID_CODEC_BASE+102)
258 enum v4l2_mpeg_audio_l1_bitrate {
259 	V4L2_MPEG_AUDIO_L1_BITRATE_32K  = 0,
260 	V4L2_MPEG_AUDIO_L1_BITRATE_64K  = 1,
261 	V4L2_MPEG_AUDIO_L1_BITRATE_96K  = 2,
262 	V4L2_MPEG_AUDIO_L1_BITRATE_128K = 3,
263 	V4L2_MPEG_AUDIO_L1_BITRATE_160K = 4,
264 	V4L2_MPEG_AUDIO_L1_BITRATE_192K = 5,
265 	V4L2_MPEG_AUDIO_L1_BITRATE_224K = 6,
266 	V4L2_MPEG_AUDIO_L1_BITRATE_256K = 7,
267 	V4L2_MPEG_AUDIO_L1_BITRATE_288K = 8,
268 	V4L2_MPEG_AUDIO_L1_BITRATE_320K = 9,
269 	V4L2_MPEG_AUDIO_L1_BITRATE_352K = 10,
270 	V4L2_MPEG_AUDIO_L1_BITRATE_384K = 11,
271 	V4L2_MPEG_AUDIO_L1_BITRATE_416K = 12,
272 	V4L2_MPEG_AUDIO_L1_BITRATE_448K = 13,
273 };
274 #define V4L2_CID_MPEG_AUDIO_L2_BITRATE		(V4L2_CID_CODEC_BASE+103)
275 enum v4l2_mpeg_audio_l2_bitrate {
276 	V4L2_MPEG_AUDIO_L2_BITRATE_32K  = 0,
277 	V4L2_MPEG_AUDIO_L2_BITRATE_48K  = 1,
278 	V4L2_MPEG_AUDIO_L2_BITRATE_56K  = 2,
279 	V4L2_MPEG_AUDIO_L2_BITRATE_64K  = 3,
280 	V4L2_MPEG_AUDIO_L2_BITRATE_80K  = 4,
281 	V4L2_MPEG_AUDIO_L2_BITRATE_96K  = 5,
282 	V4L2_MPEG_AUDIO_L2_BITRATE_112K = 6,
283 	V4L2_MPEG_AUDIO_L2_BITRATE_128K = 7,
284 	V4L2_MPEG_AUDIO_L2_BITRATE_160K = 8,
285 	V4L2_MPEG_AUDIO_L2_BITRATE_192K = 9,
286 	V4L2_MPEG_AUDIO_L2_BITRATE_224K = 10,
287 	V4L2_MPEG_AUDIO_L2_BITRATE_256K = 11,
288 	V4L2_MPEG_AUDIO_L2_BITRATE_320K = 12,
289 	V4L2_MPEG_AUDIO_L2_BITRATE_384K = 13,
290 };
291 #define V4L2_CID_MPEG_AUDIO_L3_BITRATE		(V4L2_CID_CODEC_BASE+104)
292 enum v4l2_mpeg_audio_l3_bitrate {
293 	V4L2_MPEG_AUDIO_L3_BITRATE_32K  = 0,
294 	V4L2_MPEG_AUDIO_L3_BITRATE_40K  = 1,
295 	V4L2_MPEG_AUDIO_L3_BITRATE_48K  = 2,
296 	V4L2_MPEG_AUDIO_L3_BITRATE_56K  = 3,
297 	V4L2_MPEG_AUDIO_L3_BITRATE_64K  = 4,
298 	V4L2_MPEG_AUDIO_L3_BITRATE_80K  = 5,
299 	V4L2_MPEG_AUDIO_L3_BITRATE_96K  = 6,
300 	V4L2_MPEG_AUDIO_L3_BITRATE_112K = 7,
301 	V4L2_MPEG_AUDIO_L3_BITRATE_128K = 8,
302 	V4L2_MPEG_AUDIO_L3_BITRATE_160K = 9,
303 	V4L2_MPEG_AUDIO_L3_BITRATE_192K = 10,
304 	V4L2_MPEG_AUDIO_L3_BITRATE_224K = 11,
305 	V4L2_MPEG_AUDIO_L3_BITRATE_256K = 12,
306 	V4L2_MPEG_AUDIO_L3_BITRATE_320K = 13,
307 };
308 #define V4L2_CID_MPEG_AUDIO_MODE		(V4L2_CID_CODEC_BASE+105)
309 enum v4l2_mpeg_audio_mode {
310 	V4L2_MPEG_AUDIO_MODE_STEREO       = 0,
311 	V4L2_MPEG_AUDIO_MODE_JOINT_STEREO = 1,
312 	V4L2_MPEG_AUDIO_MODE_DUAL         = 2,
313 	V4L2_MPEG_AUDIO_MODE_MONO         = 3,
314 };
315 #define V4L2_CID_MPEG_AUDIO_MODE_EXTENSION	(V4L2_CID_CODEC_BASE+106)
316 enum v4l2_mpeg_audio_mode_extension {
317 	V4L2_MPEG_AUDIO_MODE_EXTENSION_BOUND_4  = 0,
318 	V4L2_MPEG_AUDIO_MODE_EXTENSION_BOUND_8  = 1,
319 	V4L2_MPEG_AUDIO_MODE_EXTENSION_BOUND_12 = 2,
320 	V4L2_MPEG_AUDIO_MODE_EXTENSION_BOUND_16 = 3,
321 };
322 #define V4L2_CID_MPEG_AUDIO_EMPHASIS		(V4L2_CID_CODEC_BASE+107)
323 enum v4l2_mpeg_audio_emphasis {
324 	V4L2_MPEG_AUDIO_EMPHASIS_NONE         = 0,
325 	V4L2_MPEG_AUDIO_EMPHASIS_50_DIV_15_uS = 1,
326 	V4L2_MPEG_AUDIO_EMPHASIS_CCITT_J17    = 2,
327 };
328 #define V4L2_CID_MPEG_AUDIO_CRC			(V4L2_CID_CODEC_BASE+108)
329 enum v4l2_mpeg_audio_crc {
330 	V4L2_MPEG_AUDIO_CRC_NONE  = 0,
331 	V4L2_MPEG_AUDIO_CRC_CRC16 = 1,
332 };
333 #define V4L2_CID_MPEG_AUDIO_MUTE		(V4L2_CID_CODEC_BASE+109)
334 #define V4L2_CID_MPEG_AUDIO_AAC_BITRATE		(V4L2_CID_CODEC_BASE+110)
335 #define V4L2_CID_MPEG_AUDIO_AC3_BITRATE		(V4L2_CID_CODEC_BASE+111)
336 enum v4l2_mpeg_audio_ac3_bitrate {
337 	V4L2_MPEG_AUDIO_AC3_BITRATE_32K  = 0,
338 	V4L2_MPEG_AUDIO_AC3_BITRATE_40K  = 1,
339 	V4L2_MPEG_AUDIO_AC3_BITRATE_48K  = 2,
340 	V4L2_MPEG_AUDIO_AC3_BITRATE_56K  = 3,
341 	V4L2_MPEG_AUDIO_AC3_BITRATE_64K  = 4,
342 	V4L2_MPEG_AUDIO_AC3_BITRATE_80K  = 5,
343 	V4L2_MPEG_AUDIO_AC3_BITRATE_96K  = 6,
344 	V4L2_MPEG_AUDIO_AC3_BITRATE_112K = 7,
345 	V4L2_MPEG_AUDIO_AC3_BITRATE_128K = 8,
346 	V4L2_MPEG_AUDIO_AC3_BITRATE_160K = 9,
347 	V4L2_MPEG_AUDIO_AC3_BITRATE_192K = 10,
348 	V4L2_MPEG_AUDIO_AC3_BITRATE_224K = 11,
349 	V4L2_MPEG_AUDIO_AC3_BITRATE_256K = 12,
350 	V4L2_MPEG_AUDIO_AC3_BITRATE_320K = 13,
351 	V4L2_MPEG_AUDIO_AC3_BITRATE_384K = 14,
352 	V4L2_MPEG_AUDIO_AC3_BITRATE_448K = 15,
353 	V4L2_MPEG_AUDIO_AC3_BITRATE_512K = 16,
354 	V4L2_MPEG_AUDIO_AC3_BITRATE_576K = 17,
355 	V4L2_MPEG_AUDIO_AC3_BITRATE_640K = 18,
356 };
357 #define V4L2_CID_MPEG_AUDIO_DEC_PLAYBACK	(V4L2_CID_CODEC_BASE+112)
358 enum v4l2_mpeg_audio_dec_playback {
359 	V4L2_MPEG_AUDIO_DEC_PLAYBACK_AUTO	    = 0,
360 	V4L2_MPEG_AUDIO_DEC_PLAYBACK_STEREO	    = 1,
361 	V4L2_MPEG_AUDIO_DEC_PLAYBACK_LEFT	    = 2,
362 	V4L2_MPEG_AUDIO_DEC_PLAYBACK_RIGHT	    = 3,
363 	V4L2_MPEG_AUDIO_DEC_PLAYBACK_MONO	    = 4,
364 	V4L2_MPEG_AUDIO_DEC_PLAYBACK_SWAPPED_STEREO = 5,
365 };
366 #define V4L2_CID_MPEG_AUDIO_DEC_MULTILINGUAL_PLAYBACK (V4L2_CID_CODEC_BASE+113)
367 
368 /*  MPEG video controls specific to multiplexed streams */
369 #define V4L2_CID_MPEG_VIDEO_ENCODING		(V4L2_CID_CODEC_BASE+200)
370 enum v4l2_mpeg_video_encoding {
371 	V4L2_MPEG_VIDEO_ENCODING_MPEG_1     = 0,
372 	V4L2_MPEG_VIDEO_ENCODING_MPEG_2     = 1,
373 	V4L2_MPEG_VIDEO_ENCODING_MPEG_4_AVC = 2,
374 };
375 #define V4L2_CID_MPEG_VIDEO_ASPECT		(V4L2_CID_CODEC_BASE+201)
376 enum v4l2_mpeg_video_aspect {
377 	V4L2_MPEG_VIDEO_ASPECT_1x1     = 0,
378 	V4L2_MPEG_VIDEO_ASPECT_4x3     = 1,
379 	V4L2_MPEG_VIDEO_ASPECT_16x9    = 2,
380 	V4L2_MPEG_VIDEO_ASPECT_221x100 = 3,
381 };
382 #define V4L2_CID_MPEG_VIDEO_B_FRAMES		(V4L2_CID_CODEC_BASE+202)
383 #define V4L2_CID_MPEG_VIDEO_GOP_SIZE		(V4L2_CID_CODEC_BASE+203)
384 #define V4L2_CID_MPEG_VIDEO_GOP_CLOSURE		(V4L2_CID_CODEC_BASE+204)
385 #define V4L2_CID_MPEG_VIDEO_PULLDOWN		(V4L2_CID_CODEC_BASE+205)
386 #define V4L2_CID_MPEG_VIDEO_BITRATE_MODE	(V4L2_CID_CODEC_BASE+206)
387 enum v4l2_mpeg_video_bitrate_mode {
388 	V4L2_MPEG_VIDEO_BITRATE_MODE_VBR = 0,
389 	V4L2_MPEG_VIDEO_BITRATE_MODE_CBR = 1,
390 	V4L2_MPEG_VIDEO_BITRATE_MODE_CQ  = 2,
391 };
392 #define V4L2_CID_MPEG_VIDEO_BITRATE		(V4L2_CID_CODEC_BASE+207)
393 #define V4L2_CID_MPEG_VIDEO_BITRATE_PEAK	(V4L2_CID_CODEC_BASE+208)
394 #define V4L2_CID_MPEG_VIDEO_TEMPORAL_DECIMATION (V4L2_CID_CODEC_BASE+209)
395 #define V4L2_CID_MPEG_VIDEO_MUTE		(V4L2_CID_CODEC_BASE+210)
396 #define V4L2_CID_MPEG_VIDEO_MUTE_YUV		(V4L2_CID_CODEC_BASE+211)
397 #define V4L2_CID_MPEG_VIDEO_DECODER_SLICE_INTERFACE		(V4L2_CID_CODEC_BASE+212)
398 #define V4L2_CID_MPEG_VIDEO_DECODER_MPEG4_DEBLOCK_FILTER	(V4L2_CID_CODEC_BASE+213)
399 #define V4L2_CID_MPEG_VIDEO_CYCLIC_INTRA_REFRESH_MB		(V4L2_CID_CODEC_BASE+214)
400 #define V4L2_CID_MPEG_VIDEO_FRAME_RC_ENABLE			(V4L2_CID_CODEC_BASE+215)
401 #define V4L2_CID_MPEG_VIDEO_HEADER_MODE				(V4L2_CID_CODEC_BASE+216)
402 enum v4l2_mpeg_video_header_mode {
403 	V4L2_MPEG_VIDEO_HEADER_MODE_SEPARATE			= 0,
404 	V4L2_MPEG_VIDEO_HEADER_MODE_JOINED_WITH_1ST_FRAME	= 1,
405 
406 };
407 #define V4L2_CID_MPEG_VIDEO_MAX_REF_PIC			(V4L2_CID_CODEC_BASE+217)
408 #define V4L2_CID_MPEG_VIDEO_MB_RC_ENABLE		(V4L2_CID_CODEC_BASE+218)
409 #define V4L2_CID_MPEG_VIDEO_MULTI_SLICE_MAX_BYTES	(V4L2_CID_CODEC_BASE+219)
410 #define V4L2_CID_MPEG_VIDEO_MULTI_SLICE_MAX_MB		(V4L2_CID_CODEC_BASE+220)
411 #define V4L2_CID_MPEG_VIDEO_MULTI_SLICE_MODE		(V4L2_CID_CODEC_BASE+221)
412 enum v4l2_mpeg_video_multi_slice_mode {
413 	V4L2_MPEG_VIDEO_MULTI_SLICE_MODE_SINGLE		= 0,
414 	V4L2_MPEG_VIDEO_MULTI_SLICE_MODE_MAX_MB		= 1,
415 	V4L2_MPEG_VIDEO_MULTI_SLICE_MODE_MAX_BYTES	= 2,
416 #ifndef __KERNEL__
417 	/* Kept for backwards compatibility reasons. Stupid typo... */
418 	V4L2_MPEG_VIDEO_MULTI_SICE_MODE_MAX_MB		= 1,
419 	V4L2_MPEG_VIDEO_MULTI_SICE_MODE_MAX_BYTES	= 2,
420 #endif
421 };
422 #define V4L2_CID_MPEG_VIDEO_VBV_SIZE			(V4L2_CID_CODEC_BASE+222)
423 #define V4L2_CID_MPEG_VIDEO_DEC_PTS			(V4L2_CID_CODEC_BASE+223)
424 #define V4L2_CID_MPEG_VIDEO_DEC_FRAME			(V4L2_CID_CODEC_BASE+224)
425 #define V4L2_CID_MPEG_VIDEO_VBV_DELAY			(V4L2_CID_CODEC_BASE+225)
426 #define V4L2_CID_MPEG_VIDEO_REPEAT_SEQ_HEADER		(V4L2_CID_CODEC_BASE+226)
427 #define V4L2_CID_MPEG_VIDEO_MV_H_SEARCH_RANGE		(V4L2_CID_CODEC_BASE+227)
428 #define V4L2_CID_MPEG_VIDEO_MV_V_SEARCH_RANGE		(V4L2_CID_CODEC_BASE+228)
429 #define V4L2_CID_MPEG_VIDEO_FORCE_KEY_FRAME		(V4L2_CID_CODEC_BASE+229)
430 #define V4L2_CID_MPEG_VIDEO_BASELAYER_PRIORITY_ID	(V4L2_CID_CODEC_BASE+230)
431 
432 /* CIDs for the MPEG-2 Part 2 (H.262) codec */
433 #define V4L2_CID_MPEG_VIDEO_MPEG2_LEVEL			(V4L2_CID_CODEC_BASE+270)
434 enum v4l2_mpeg_video_mpeg2_level {
435 	V4L2_MPEG_VIDEO_MPEG2_LEVEL_LOW		= 0,
436 	V4L2_MPEG_VIDEO_MPEG2_LEVEL_MAIN	= 1,
437 	V4L2_MPEG_VIDEO_MPEG2_LEVEL_HIGH_1440	= 2,
438 	V4L2_MPEG_VIDEO_MPEG2_LEVEL_HIGH	= 3,
439 };
440 #define V4L2_CID_MPEG_VIDEO_MPEG2_PROFILE		(V4L2_CID_CODEC_BASE+271)
441 enum v4l2_mpeg_video_mpeg2_profile {
442 	V4L2_MPEG_VIDEO_MPEG2_PROFILE_SIMPLE				= 0,
443 	V4L2_MPEG_VIDEO_MPEG2_PROFILE_MAIN				= 1,
444 	V4L2_MPEG_VIDEO_MPEG2_PROFILE_SNR_SCALABLE			= 2,
445 	V4L2_MPEG_VIDEO_MPEG2_PROFILE_SPATIALLY_SCALABLE		= 3,
446 	V4L2_MPEG_VIDEO_MPEG2_PROFILE_HIGH				= 4,
447 	V4L2_MPEG_VIDEO_MPEG2_PROFILE_MULTIVIEW				= 5,
448 };
449 
450 /* CIDs for the FWHT codec as used by the vicodec driver. */
451 #define V4L2_CID_FWHT_I_FRAME_QP             (V4L2_CID_CODEC_BASE + 290)
452 #define V4L2_CID_FWHT_P_FRAME_QP             (V4L2_CID_CODEC_BASE + 291)
453 
454 #define V4L2_CID_MPEG_VIDEO_H263_I_FRAME_QP		(V4L2_CID_CODEC_BASE+300)
455 #define V4L2_CID_MPEG_VIDEO_H263_P_FRAME_QP		(V4L2_CID_CODEC_BASE+301)
456 #define V4L2_CID_MPEG_VIDEO_H263_B_FRAME_QP		(V4L2_CID_CODEC_BASE+302)
457 #define V4L2_CID_MPEG_VIDEO_H263_MIN_QP			(V4L2_CID_CODEC_BASE+303)
458 #define V4L2_CID_MPEG_VIDEO_H263_MAX_QP			(V4L2_CID_CODEC_BASE+304)
459 #define V4L2_CID_MPEG_VIDEO_H264_I_FRAME_QP		(V4L2_CID_CODEC_BASE+350)
460 #define V4L2_CID_MPEG_VIDEO_H264_P_FRAME_QP		(V4L2_CID_CODEC_BASE+351)
461 #define V4L2_CID_MPEG_VIDEO_H264_B_FRAME_QP		(V4L2_CID_CODEC_BASE+352)
462 #define V4L2_CID_MPEG_VIDEO_H264_MIN_QP			(V4L2_CID_CODEC_BASE+353)
463 #define V4L2_CID_MPEG_VIDEO_H264_MAX_QP			(V4L2_CID_CODEC_BASE+354)
464 #define V4L2_CID_MPEG_VIDEO_H264_8X8_TRANSFORM		(V4L2_CID_CODEC_BASE+355)
465 #define V4L2_CID_MPEG_VIDEO_H264_CPB_SIZE		(V4L2_CID_CODEC_BASE+356)
466 #define V4L2_CID_MPEG_VIDEO_H264_ENTROPY_MODE		(V4L2_CID_CODEC_BASE+357)
467 enum v4l2_mpeg_video_h264_entropy_mode {
468 	V4L2_MPEG_VIDEO_H264_ENTROPY_MODE_CAVLC	= 0,
469 	V4L2_MPEG_VIDEO_H264_ENTROPY_MODE_CABAC	= 1,
470 };
471 #define V4L2_CID_MPEG_VIDEO_H264_I_PERIOD		(V4L2_CID_CODEC_BASE+358)
472 #define V4L2_CID_MPEG_VIDEO_H264_LEVEL			(V4L2_CID_CODEC_BASE+359)
473 enum v4l2_mpeg_video_h264_level {
474 	V4L2_MPEG_VIDEO_H264_LEVEL_1_0	= 0,
475 	V4L2_MPEG_VIDEO_H264_LEVEL_1B	= 1,
476 	V4L2_MPEG_VIDEO_H264_LEVEL_1_1	= 2,
477 	V4L2_MPEG_VIDEO_H264_LEVEL_1_2	= 3,
478 	V4L2_MPEG_VIDEO_H264_LEVEL_1_3	= 4,
479 	V4L2_MPEG_VIDEO_H264_LEVEL_2_0	= 5,
480 	V4L2_MPEG_VIDEO_H264_LEVEL_2_1	= 6,
481 	V4L2_MPEG_VIDEO_H264_LEVEL_2_2	= 7,
482 	V4L2_MPEG_VIDEO_H264_LEVEL_3_0	= 8,
483 	V4L2_MPEG_VIDEO_H264_LEVEL_3_1	= 9,
484 	V4L2_MPEG_VIDEO_H264_LEVEL_3_2	= 10,
485 	V4L2_MPEG_VIDEO_H264_LEVEL_4_0	= 11,
486 	V4L2_MPEG_VIDEO_H264_LEVEL_4_1	= 12,
487 	V4L2_MPEG_VIDEO_H264_LEVEL_4_2	= 13,
488 	V4L2_MPEG_VIDEO_H264_LEVEL_5_0	= 14,
489 	V4L2_MPEG_VIDEO_H264_LEVEL_5_1	= 15,
490 	V4L2_MPEG_VIDEO_H264_LEVEL_5_2	= 16,
491 	V4L2_MPEG_VIDEO_H264_LEVEL_6_0	= 17,
492 	V4L2_MPEG_VIDEO_H264_LEVEL_6_1	= 18,
493 	V4L2_MPEG_VIDEO_H264_LEVEL_6_2	= 19,
494 };
495 #define V4L2_CID_MPEG_VIDEO_H264_LOOP_FILTER_ALPHA	(V4L2_CID_CODEC_BASE+360)
496 #define V4L2_CID_MPEG_VIDEO_H264_LOOP_FILTER_BETA	(V4L2_CID_CODEC_BASE+361)
497 #define V4L2_CID_MPEG_VIDEO_H264_LOOP_FILTER_MODE	(V4L2_CID_CODEC_BASE+362)
498 enum v4l2_mpeg_video_h264_loop_filter_mode {
499 	V4L2_MPEG_VIDEO_H264_LOOP_FILTER_MODE_ENABLED				= 0,
500 	V4L2_MPEG_VIDEO_H264_LOOP_FILTER_MODE_DISABLED				= 1,
501 	V4L2_MPEG_VIDEO_H264_LOOP_FILTER_MODE_DISABLED_AT_SLICE_BOUNDARY	= 2,
502 };
503 #define V4L2_CID_MPEG_VIDEO_H264_PROFILE		(V4L2_CID_CODEC_BASE+363)
504 enum v4l2_mpeg_video_h264_profile {
505 	V4L2_MPEG_VIDEO_H264_PROFILE_BASELINE			= 0,
506 	V4L2_MPEG_VIDEO_H264_PROFILE_CONSTRAINED_BASELINE	= 1,
507 	V4L2_MPEG_VIDEO_H264_PROFILE_MAIN			= 2,
508 	V4L2_MPEG_VIDEO_H264_PROFILE_EXTENDED			= 3,
509 	V4L2_MPEG_VIDEO_H264_PROFILE_HIGH			= 4,
510 	V4L2_MPEG_VIDEO_H264_PROFILE_HIGH_10			= 5,
511 	V4L2_MPEG_VIDEO_H264_PROFILE_HIGH_422			= 6,
512 	V4L2_MPEG_VIDEO_H264_PROFILE_HIGH_444_PREDICTIVE	= 7,
513 	V4L2_MPEG_VIDEO_H264_PROFILE_HIGH_10_INTRA		= 8,
514 	V4L2_MPEG_VIDEO_H264_PROFILE_HIGH_422_INTRA		= 9,
515 	V4L2_MPEG_VIDEO_H264_PROFILE_HIGH_444_INTRA		= 10,
516 	V4L2_MPEG_VIDEO_H264_PROFILE_CAVLC_444_INTRA		= 11,
517 	V4L2_MPEG_VIDEO_H264_PROFILE_SCALABLE_BASELINE		= 12,
518 	V4L2_MPEG_VIDEO_H264_PROFILE_SCALABLE_HIGH		= 13,
519 	V4L2_MPEG_VIDEO_H264_PROFILE_SCALABLE_HIGH_INTRA	= 14,
520 	V4L2_MPEG_VIDEO_H264_PROFILE_STEREO_HIGH		= 15,
521 	V4L2_MPEG_VIDEO_H264_PROFILE_MULTIVIEW_HIGH		= 16,
522 	V4L2_MPEG_VIDEO_H264_PROFILE_CONSTRAINED_HIGH		= 17,
523 };
524 #define V4L2_CID_MPEG_VIDEO_H264_VUI_EXT_SAR_HEIGHT	(V4L2_CID_CODEC_BASE+364)
525 #define V4L2_CID_MPEG_VIDEO_H264_VUI_EXT_SAR_WIDTH	(V4L2_CID_CODEC_BASE+365)
526 #define V4L2_CID_MPEG_VIDEO_H264_VUI_SAR_ENABLE		(V4L2_CID_CODEC_BASE+366)
527 #define V4L2_CID_MPEG_VIDEO_H264_VUI_SAR_IDC		(V4L2_CID_CODEC_BASE+367)
528 enum v4l2_mpeg_video_h264_vui_sar_idc {
529 	V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_UNSPECIFIED	= 0,
530 	V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_1x1		= 1,
531 	V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_12x11		= 2,
532 	V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_10x11		= 3,
533 	V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_16x11		= 4,
534 	V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_40x33		= 5,
535 	V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_24x11		= 6,
536 	V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_20x11		= 7,
537 	V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_32x11		= 8,
538 	V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_80x33		= 9,
539 	V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_18x11		= 10,
540 	V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_15x11		= 11,
541 	V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_64x33		= 12,
542 	V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_160x99		= 13,
543 	V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_4x3		= 14,
544 	V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_3x2		= 15,
545 	V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_2x1		= 16,
546 	V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_EXTENDED	= 17,
547 };
548 #define V4L2_CID_MPEG_VIDEO_H264_SEI_FRAME_PACKING		(V4L2_CID_CODEC_BASE+368)
549 #define V4L2_CID_MPEG_VIDEO_H264_SEI_FP_CURRENT_FRAME_0		(V4L2_CID_CODEC_BASE+369)
550 #define V4L2_CID_MPEG_VIDEO_H264_SEI_FP_ARRANGEMENT_TYPE	(V4L2_CID_CODEC_BASE+370)
551 enum v4l2_mpeg_video_h264_sei_fp_arrangement_type {
552 	V4L2_MPEG_VIDEO_H264_SEI_FP_ARRANGEMENT_TYPE_CHECKERBOARD	= 0,
553 	V4L2_MPEG_VIDEO_H264_SEI_FP_ARRANGEMENT_TYPE_COLUMN		= 1,
554 	V4L2_MPEG_VIDEO_H264_SEI_FP_ARRANGEMENT_TYPE_ROW		= 2,
555 	V4L2_MPEG_VIDEO_H264_SEI_FP_ARRANGEMENT_TYPE_SIDE_BY_SIDE	= 3,
556 	V4L2_MPEG_VIDEO_H264_SEI_FP_ARRANGEMENT_TYPE_TOP_BOTTOM		= 4,
557 	V4L2_MPEG_VIDEO_H264_SEI_FP_ARRANGEMENT_TYPE_TEMPORAL		= 5,
558 };
559 #define V4L2_CID_MPEG_VIDEO_H264_FMO			(V4L2_CID_CODEC_BASE+371)
560 #define V4L2_CID_MPEG_VIDEO_H264_FMO_MAP_TYPE		(V4L2_CID_CODEC_BASE+372)
561 enum v4l2_mpeg_video_h264_fmo_map_type {
562 	V4L2_MPEG_VIDEO_H264_FMO_MAP_TYPE_INTERLEAVED_SLICES		= 0,
563 	V4L2_MPEG_VIDEO_H264_FMO_MAP_TYPE_SCATTERED_SLICES		= 1,
564 	V4L2_MPEG_VIDEO_H264_FMO_MAP_TYPE_FOREGROUND_WITH_LEFT_OVER	= 2,
565 	V4L2_MPEG_VIDEO_H264_FMO_MAP_TYPE_BOX_OUT			= 3,
566 	V4L2_MPEG_VIDEO_H264_FMO_MAP_TYPE_RASTER_SCAN			= 4,
567 	V4L2_MPEG_VIDEO_H264_FMO_MAP_TYPE_WIPE_SCAN			= 5,
568 	V4L2_MPEG_VIDEO_H264_FMO_MAP_TYPE_EXPLICIT			= 6,
569 };
570 #define V4L2_CID_MPEG_VIDEO_H264_FMO_SLICE_GROUP	(V4L2_CID_CODEC_BASE+373)
571 #define V4L2_CID_MPEG_VIDEO_H264_FMO_CHANGE_DIRECTION	(V4L2_CID_CODEC_BASE+374)
572 enum v4l2_mpeg_video_h264_fmo_change_dir {
573 	V4L2_MPEG_VIDEO_H264_FMO_CHANGE_DIR_RIGHT	= 0,
574 	V4L2_MPEG_VIDEO_H264_FMO_CHANGE_DIR_LEFT	= 1,
575 };
576 #define V4L2_CID_MPEG_VIDEO_H264_FMO_CHANGE_RATE	(V4L2_CID_CODEC_BASE+375)
577 #define V4L2_CID_MPEG_VIDEO_H264_FMO_RUN_LENGTH		(V4L2_CID_CODEC_BASE+376)
578 #define V4L2_CID_MPEG_VIDEO_H264_ASO			(V4L2_CID_CODEC_BASE+377)
579 #define V4L2_CID_MPEG_VIDEO_H264_ASO_SLICE_ORDER	(V4L2_CID_CODEC_BASE+378)
580 #define V4L2_CID_MPEG_VIDEO_H264_HIERARCHICAL_CODING		(V4L2_CID_CODEC_BASE+379)
581 #define V4L2_CID_MPEG_VIDEO_H264_HIERARCHICAL_CODING_TYPE	(V4L2_CID_CODEC_BASE+380)
582 enum v4l2_mpeg_video_h264_hierarchical_coding_type {
583 	V4L2_MPEG_VIDEO_H264_HIERARCHICAL_CODING_B	= 0,
584 	V4L2_MPEG_VIDEO_H264_HIERARCHICAL_CODING_P	= 1,
585 };
586 #define V4L2_CID_MPEG_VIDEO_H264_HIERARCHICAL_CODING_LAYER	(V4L2_CID_CODEC_BASE+381)
587 #define V4L2_CID_MPEG_VIDEO_H264_HIERARCHICAL_CODING_LAYER_QP	(V4L2_CID_CODEC_BASE+382)
588 #define V4L2_CID_MPEG_VIDEO_H264_CONSTRAINED_INTRA_PREDICTION	(V4L2_CID_CODEC_BASE+383)
589 #define V4L2_CID_MPEG_VIDEO_H264_CHROMA_QP_INDEX_OFFSET		(V4L2_CID_CODEC_BASE+384)
590 #define V4L2_CID_MPEG_VIDEO_H264_I_FRAME_MIN_QP	(V4L2_CID_CODEC_BASE+385)
591 #define V4L2_CID_MPEG_VIDEO_H264_I_FRAME_MAX_QP	(V4L2_CID_CODEC_BASE+386)
592 #define V4L2_CID_MPEG_VIDEO_H264_P_FRAME_MIN_QP	(V4L2_CID_CODEC_BASE+387)
593 #define V4L2_CID_MPEG_VIDEO_H264_P_FRAME_MAX_QP	(V4L2_CID_CODEC_BASE+388)
594 #define V4L2_CID_MPEG_VIDEO_H264_B_FRAME_MIN_QP	(V4L2_CID_CODEC_BASE+389)
595 #define V4L2_CID_MPEG_VIDEO_H264_B_FRAME_MAX_QP	(V4L2_CID_CODEC_BASE+390)
596 #define V4L2_CID_MPEG_VIDEO_H264_HIER_CODING_L0_BR	(V4L2_CID_CODEC_BASE+391)
597 #define V4L2_CID_MPEG_VIDEO_H264_HIER_CODING_L1_BR	(V4L2_CID_CODEC_BASE+392)
598 #define V4L2_CID_MPEG_VIDEO_H264_HIER_CODING_L2_BR	(V4L2_CID_CODEC_BASE+393)
599 #define V4L2_CID_MPEG_VIDEO_H264_HIER_CODING_L3_BR	(V4L2_CID_CODEC_BASE+394)
600 #define V4L2_CID_MPEG_VIDEO_H264_HIER_CODING_L4_BR	(V4L2_CID_CODEC_BASE+395)
601 #define V4L2_CID_MPEG_VIDEO_H264_HIER_CODING_L5_BR	(V4L2_CID_CODEC_BASE+396)
602 #define V4L2_CID_MPEG_VIDEO_H264_HIER_CODING_L6_BR	(V4L2_CID_CODEC_BASE+397)
603 #define V4L2_CID_MPEG_VIDEO_MPEG4_I_FRAME_QP	(V4L2_CID_CODEC_BASE+400)
604 #define V4L2_CID_MPEG_VIDEO_MPEG4_P_FRAME_QP	(V4L2_CID_CODEC_BASE+401)
605 #define V4L2_CID_MPEG_VIDEO_MPEG4_B_FRAME_QP	(V4L2_CID_CODEC_BASE+402)
606 #define V4L2_CID_MPEG_VIDEO_MPEG4_MIN_QP	(V4L2_CID_CODEC_BASE+403)
607 #define V4L2_CID_MPEG_VIDEO_MPEG4_MAX_QP	(V4L2_CID_CODEC_BASE+404)
608 #define V4L2_CID_MPEG_VIDEO_MPEG4_LEVEL		(V4L2_CID_CODEC_BASE+405)
609 enum v4l2_mpeg_video_mpeg4_level {
610 	V4L2_MPEG_VIDEO_MPEG4_LEVEL_0	= 0,
611 	V4L2_MPEG_VIDEO_MPEG4_LEVEL_0B	= 1,
612 	V4L2_MPEG_VIDEO_MPEG4_LEVEL_1	= 2,
613 	V4L2_MPEG_VIDEO_MPEG4_LEVEL_2	= 3,
614 	V4L2_MPEG_VIDEO_MPEG4_LEVEL_3	= 4,
615 	V4L2_MPEG_VIDEO_MPEG4_LEVEL_3B	= 5,
616 	V4L2_MPEG_VIDEO_MPEG4_LEVEL_4	= 6,
617 	V4L2_MPEG_VIDEO_MPEG4_LEVEL_5	= 7,
618 };
619 #define V4L2_CID_MPEG_VIDEO_MPEG4_PROFILE	(V4L2_CID_CODEC_BASE+406)
620 enum v4l2_mpeg_video_mpeg4_profile {
621 	V4L2_MPEG_VIDEO_MPEG4_PROFILE_SIMPLE				= 0,
622 	V4L2_MPEG_VIDEO_MPEG4_PROFILE_ADVANCED_SIMPLE			= 1,
623 	V4L2_MPEG_VIDEO_MPEG4_PROFILE_CORE				= 2,
624 	V4L2_MPEG_VIDEO_MPEG4_PROFILE_SIMPLE_SCALABLE			= 3,
625 	V4L2_MPEG_VIDEO_MPEG4_PROFILE_ADVANCED_CODING_EFFICIENCY	= 4,
626 };
627 #define V4L2_CID_MPEG_VIDEO_MPEG4_QPEL		(V4L2_CID_CODEC_BASE+407)
628 
629 /*  Control IDs for VP8 streams
630  *  Although VP8 is not part of MPEG we add these controls to the MPEG class
631  *  as that class is already handling other video compression standards
632  */
633 #define V4L2_CID_MPEG_VIDEO_VPX_NUM_PARTITIONS		(V4L2_CID_CODEC_BASE+500)
634 enum v4l2_vp8_num_partitions {
635 	V4L2_CID_MPEG_VIDEO_VPX_1_PARTITION	= 0,
636 	V4L2_CID_MPEG_VIDEO_VPX_2_PARTITIONS	= 1,
637 	V4L2_CID_MPEG_VIDEO_VPX_4_PARTITIONS	= 2,
638 	V4L2_CID_MPEG_VIDEO_VPX_8_PARTITIONS	= 3,
639 };
640 #define V4L2_CID_MPEG_VIDEO_VPX_IMD_DISABLE_4X4		(V4L2_CID_CODEC_BASE+501)
641 #define V4L2_CID_MPEG_VIDEO_VPX_NUM_REF_FRAMES		(V4L2_CID_CODEC_BASE+502)
642 enum v4l2_vp8_num_ref_frames {
643 	V4L2_CID_MPEG_VIDEO_VPX_1_REF_FRAME	= 0,
644 	V4L2_CID_MPEG_VIDEO_VPX_2_REF_FRAME	= 1,
645 	V4L2_CID_MPEG_VIDEO_VPX_3_REF_FRAME	= 2,
646 };
647 #define V4L2_CID_MPEG_VIDEO_VPX_FILTER_LEVEL		(V4L2_CID_CODEC_BASE+503)
648 #define V4L2_CID_MPEG_VIDEO_VPX_FILTER_SHARPNESS	(V4L2_CID_CODEC_BASE+504)
649 #define V4L2_CID_MPEG_VIDEO_VPX_GOLDEN_FRAME_REF_PERIOD	(V4L2_CID_CODEC_BASE+505)
650 #define V4L2_CID_MPEG_VIDEO_VPX_GOLDEN_FRAME_SEL	(V4L2_CID_CODEC_BASE+506)
651 enum v4l2_vp8_golden_frame_sel {
652 	V4L2_CID_MPEG_VIDEO_VPX_GOLDEN_FRAME_USE_PREV		= 0,
653 	V4L2_CID_MPEG_VIDEO_VPX_GOLDEN_FRAME_USE_REF_PERIOD	= 1,
654 };
655 #define V4L2_CID_MPEG_VIDEO_VPX_MIN_QP			(V4L2_CID_CODEC_BASE+507)
656 #define V4L2_CID_MPEG_VIDEO_VPX_MAX_QP			(V4L2_CID_CODEC_BASE+508)
657 #define V4L2_CID_MPEG_VIDEO_VPX_I_FRAME_QP		(V4L2_CID_CODEC_BASE+509)
658 #define V4L2_CID_MPEG_VIDEO_VPX_P_FRAME_QP		(V4L2_CID_CODEC_BASE+510)
659 
660 #define V4L2_CID_MPEG_VIDEO_VP8_PROFILE			(V4L2_CID_CODEC_BASE+511)
661 enum v4l2_mpeg_video_vp8_profile {
662 	V4L2_MPEG_VIDEO_VP8_PROFILE_0				= 0,
663 	V4L2_MPEG_VIDEO_VP8_PROFILE_1				= 1,
664 	V4L2_MPEG_VIDEO_VP8_PROFILE_2				= 2,
665 	V4L2_MPEG_VIDEO_VP8_PROFILE_3				= 3,
666 };
667 /* Deprecated alias for compatibility reasons. */
668 #define V4L2_CID_MPEG_VIDEO_VPX_PROFILE	V4L2_CID_MPEG_VIDEO_VP8_PROFILE
669 #define V4L2_CID_MPEG_VIDEO_VP9_PROFILE			(V4L2_CID_CODEC_BASE+512)
670 enum v4l2_mpeg_video_vp9_profile {
671 	V4L2_MPEG_VIDEO_VP9_PROFILE_0				= 0,
672 	V4L2_MPEG_VIDEO_VP9_PROFILE_1				= 1,
673 	V4L2_MPEG_VIDEO_VP9_PROFILE_2				= 2,
674 	V4L2_MPEG_VIDEO_VP9_PROFILE_3				= 3,
675 };
676 #define V4L2_CID_MPEG_VIDEO_VP9_LEVEL			(V4L2_CID_CODEC_BASE+513)
677 enum v4l2_mpeg_video_vp9_level {
678 	V4L2_MPEG_VIDEO_VP9_LEVEL_1_0	= 0,
679 	V4L2_MPEG_VIDEO_VP9_LEVEL_1_1	= 1,
680 	V4L2_MPEG_VIDEO_VP9_LEVEL_2_0	= 2,
681 	V4L2_MPEG_VIDEO_VP9_LEVEL_2_1	= 3,
682 	V4L2_MPEG_VIDEO_VP9_LEVEL_3_0	= 4,
683 	V4L2_MPEG_VIDEO_VP9_LEVEL_3_1	= 5,
684 	V4L2_MPEG_VIDEO_VP9_LEVEL_4_0	= 6,
685 	V4L2_MPEG_VIDEO_VP9_LEVEL_4_1	= 7,
686 	V4L2_MPEG_VIDEO_VP9_LEVEL_5_0	= 8,
687 	V4L2_MPEG_VIDEO_VP9_LEVEL_5_1	= 9,
688 	V4L2_MPEG_VIDEO_VP9_LEVEL_5_2	= 10,
689 	V4L2_MPEG_VIDEO_VP9_LEVEL_6_0	= 11,
690 	V4L2_MPEG_VIDEO_VP9_LEVEL_6_1	= 12,
691 	V4L2_MPEG_VIDEO_VP9_LEVEL_6_2	= 13,
692 };
693 
694 /* CIDs for HEVC encoding. */
695 
696 #define V4L2_CID_MPEG_VIDEO_HEVC_MIN_QP		(V4L2_CID_CODEC_BASE + 600)
697 #define V4L2_CID_MPEG_VIDEO_HEVC_MAX_QP		(V4L2_CID_CODEC_BASE + 601)
698 #define V4L2_CID_MPEG_VIDEO_HEVC_I_FRAME_QP	(V4L2_CID_CODEC_BASE + 602)
699 #define V4L2_CID_MPEG_VIDEO_HEVC_P_FRAME_QP	(V4L2_CID_CODEC_BASE + 603)
700 #define V4L2_CID_MPEG_VIDEO_HEVC_B_FRAME_QP	(V4L2_CID_CODEC_BASE + 604)
701 #define V4L2_CID_MPEG_VIDEO_HEVC_HIER_QP	(V4L2_CID_CODEC_BASE + 605)
702 #define V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_TYPE (V4L2_CID_CODEC_BASE + 606)
703 enum v4l2_mpeg_video_hevc_hier_coding_type {
704 	V4L2_MPEG_VIDEO_HEVC_HIERARCHICAL_CODING_B	= 0,
705 	V4L2_MPEG_VIDEO_HEVC_HIERARCHICAL_CODING_P	= 1,
706 };
707 #define V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_LAYER	(V4L2_CID_CODEC_BASE + 607)
708 #define V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_L0_QP	(V4L2_CID_CODEC_BASE + 608)
709 #define V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_L1_QP	(V4L2_CID_CODEC_BASE + 609)
710 #define V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_L2_QP	(V4L2_CID_CODEC_BASE + 610)
711 #define V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_L3_QP	(V4L2_CID_CODEC_BASE + 611)
712 #define V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_L4_QP	(V4L2_CID_CODEC_BASE + 612)
713 #define V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_L5_QP	(V4L2_CID_CODEC_BASE + 613)
714 #define V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_L6_QP	(V4L2_CID_CODEC_BASE + 614)
715 #define V4L2_CID_MPEG_VIDEO_HEVC_PROFILE	(V4L2_CID_CODEC_BASE + 615)
716 enum v4l2_mpeg_video_hevc_profile {
717 	V4L2_MPEG_VIDEO_HEVC_PROFILE_MAIN = 0,
718 	V4L2_MPEG_VIDEO_HEVC_PROFILE_MAIN_STILL_PICTURE = 1,
719 	V4L2_MPEG_VIDEO_HEVC_PROFILE_MAIN_10 = 2,
720 };
721 #define V4L2_CID_MPEG_VIDEO_HEVC_LEVEL		(V4L2_CID_CODEC_BASE + 616)
722 enum v4l2_mpeg_video_hevc_level {
723 	V4L2_MPEG_VIDEO_HEVC_LEVEL_1	= 0,
724 	V4L2_MPEG_VIDEO_HEVC_LEVEL_2	= 1,
725 	V4L2_MPEG_VIDEO_HEVC_LEVEL_2_1	= 2,
726 	V4L2_MPEG_VIDEO_HEVC_LEVEL_3	= 3,
727 	V4L2_MPEG_VIDEO_HEVC_LEVEL_3_1	= 4,
728 	V4L2_MPEG_VIDEO_HEVC_LEVEL_4	= 5,
729 	V4L2_MPEG_VIDEO_HEVC_LEVEL_4_1	= 6,
730 	V4L2_MPEG_VIDEO_HEVC_LEVEL_5	= 7,
731 	V4L2_MPEG_VIDEO_HEVC_LEVEL_5_1	= 8,
732 	V4L2_MPEG_VIDEO_HEVC_LEVEL_5_2	= 9,
733 	V4L2_MPEG_VIDEO_HEVC_LEVEL_6	= 10,
734 	V4L2_MPEG_VIDEO_HEVC_LEVEL_6_1	= 11,
735 	V4L2_MPEG_VIDEO_HEVC_LEVEL_6_2	= 12,
736 };
737 #define V4L2_CID_MPEG_VIDEO_HEVC_FRAME_RATE_RESOLUTION	(V4L2_CID_CODEC_BASE + 617)
738 #define V4L2_CID_MPEG_VIDEO_HEVC_TIER			(V4L2_CID_CODEC_BASE + 618)
739 enum v4l2_mpeg_video_hevc_tier {
740 	V4L2_MPEG_VIDEO_HEVC_TIER_MAIN = 0,
741 	V4L2_MPEG_VIDEO_HEVC_TIER_HIGH = 1,
742 };
743 #define V4L2_CID_MPEG_VIDEO_HEVC_MAX_PARTITION_DEPTH	(V4L2_CID_CODEC_BASE + 619)
744 #define V4L2_CID_MPEG_VIDEO_HEVC_LOOP_FILTER_MODE	(V4L2_CID_CODEC_BASE + 620)
745 enum v4l2_cid_mpeg_video_hevc_loop_filter_mode {
746 	V4L2_MPEG_VIDEO_HEVC_LOOP_FILTER_MODE_DISABLED			 = 0,
747 	V4L2_MPEG_VIDEO_HEVC_LOOP_FILTER_MODE_ENABLED			 = 1,
748 	V4L2_MPEG_VIDEO_HEVC_LOOP_FILTER_MODE_DISABLED_AT_SLICE_BOUNDARY = 2,
749 };
750 #define V4L2_CID_MPEG_VIDEO_HEVC_LF_BETA_OFFSET_DIV2	(V4L2_CID_CODEC_BASE + 621)
751 #define V4L2_CID_MPEG_VIDEO_HEVC_LF_TC_OFFSET_DIV2	(V4L2_CID_CODEC_BASE + 622)
752 #define V4L2_CID_MPEG_VIDEO_HEVC_REFRESH_TYPE		(V4L2_CID_CODEC_BASE + 623)
753 enum v4l2_cid_mpeg_video_hevc_refresh_type {
754 	V4L2_MPEG_VIDEO_HEVC_REFRESH_NONE		= 0,
755 	V4L2_MPEG_VIDEO_HEVC_REFRESH_CRA		= 1,
756 	V4L2_MPEG_VIDEO_HEVC_REFRESH_IDR		= 2,
757 };
758 #define V4L2_CID_MPEG_VIDEO_HEVC_REFRESH_PERIOD		(V4L2_CID_CODEC_BASE + 624)
759 #define V4L2_CID_MPEG_VIDEO_HEVC_LOSSLESS_CU		(V4L2_CID_CODEC_BASE + 625)
760 #define V4L2_CID_MPEG_VIDEO_HEVC_CONST_INTRA_PRED	(V4L2_CID_CODEC_BASE + 626)
761 #define V4L2_CID_MPEG_VIDEO_HEVC_WAVEFRONT		(V4L2_CID_CODEC_BASE + 627)
762 #define V4L2_CID_MPEG_VIDEO_HEVC_GENERAL_PB		(V4L2_CID_CODEC_BASE + 628)
763 #define V4L2_CID_MPEG_VIDEO_HEVC_TEMPORAL_ID		(V4L2_CID_CODEC_BASE + 629)
764 #define V4L2_CID_MPEG_VIDEO_HEVC_STRONG_SMOOTHING	(V4L2_CID_CODEC_BASE + 630)
765 #define V4L2_CID_MPEG_VIDEO_HEVC_MAX_NUM_MERGE_MV_MINUS1	(V4L2_CID_CODEC_BASE + 631)
766 #define V4L2_CID_MPEG_VIDEO_HEVC_INTRA_PU_SPLIT		(V4L2_CID_CODEC_BASE + 632)
767 #define V4L2_CID_MPEG_VIDEO_HEVC_TMV_PREDICTION		(V4L2_CID_CODEC_BASE + 633)
768 #define V4L2_CID_MPEG_VIDEO_HEVC_WITHOUT_STARTCODE	(V4L2_CID_CODEC_BASE + 634)
769 #define V4L2_CID_MPEG_VIDEO_HEVC_SIZE_OF_LENGTH_FIELD	(V4L2_CID_CODEC_BASE + 635)
770 enum v4l2_cid_mpeg_video_hevc_size_of_length_field {
771 	V4L2_MPEG_VIDEO_HEVC_SIZE_0		= 0,
772 	V4L2_MPEG_VIDEO_HEVC_SIZE_1		= 1,
773 	V4L2_MPEG_VIDEO_HEVC_SIZE_2		= 2,
774 	V4L2_MPEG_VIDEO_HEVC_SIZE_4		= 3,
775 };
776 #define V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_L0_BR	(V4L2_CID_CODEC_BASE + 636)
777 #define V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_L1_BR	(V4L2_CID_CODEC_BASE + 637)
778 #define V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_L2_BR	(V4L2_CID_CODEC_BASE + 638)
779 #define V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_L3_BR	(V4L2_CID_CODEC_BASE + 639)
780 #define V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_L4_BR	(V4L2_CID_CODEC_BASE + 640)
781 #define V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_L5_BR	(V4L2_CID_CODEC_BASE + 641)
782 #define V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_L6_BR	(V4L2_CID_CODEC_BASE + 642)
783 #define V4L2_CID_MPEG_VIDEO_REF_NUMBER_FOR_PFRAMES	(V4L2_CID_CODEC_BASE + 643)
784 #define V4L2_CID_MPEG_VIDEO_PREPEND_SPSPPS_TO_IDR	(V4L2_CID_CODEC_BASE + 644)
785 #define V4L2_CID_MPEG_VIDEO_CONSTANT_QUALITY		(V4L2_CID_CODEC_BASE + 645)
786 #define V4L2_CID_MPEG_VIDEO_FRAME_SKIP_MODE		(V4L2_CID_CODEC_BASE + 646)
787 enum v4l2_mpeg_video_frame_skip_mode {
788 	V4L2_MPEG_VIDEO_FRAME_SKIP_MODE_DISABLED	= 0,
789 	V4L2_MPEG_VIDEO_FRAME_SKIP_MODE_LEVEL_LIMIT	= 1,
790 	V4L2_MPEG_VIDEO_FRAME_SKIP_MODE_BUF_LIMIT	= 2,
791 };
792 
793 #define V4L2_CID_MPEG_VIDEO_HEVC_I_FRAME_MIN_QP        (V4L2_CID_CODEC_BASE + 647)
794 #define V4L2_CID_MPEG_VIDEO_HEVC_I_FRAME_MAX_QP        (V4L2_CID_CODEC_BASE + 648)
795 #define V4L2_CID_MPEG_VIDEO_HEVC_P_FRAME_MIN_QP        (V4L2_CID_CODEC_BASE + 649)
796 #define V4L2_CID_MPEG_VIDEO_HEVC_P_FRAME_MAX_QP        (V4L2_CID_CODEC_BASE + 650)
797 #define V4L2_CID_MPEG_VIDEO_HEVC_B_FRAME_MIN_QP        (V4L2_CID_CODEC_BASE + 651)
798 #define V4L2_CID_MPEG_VIDEO_HEVC_B_FRAME_MAX_QP        (V4L2_CID_CODEC_BASE + 652)
799 
800 /*  MPEG-class control IDs specific to the CX2341x driver as defined by V4L2 */
801 #define V4L2_CID_CODEC_CX2341X_BASE				(V4L2_CTRL_CLASS_CODEC | 0x1000)
802 #define V4L2_CID_MPEG_CX2341X_VIDEO_SPATIAL_FILTER_MODE		(V4L2_CID_CODEC_CX2341X_BASE+0)
803 enum v4l2_mpeg_cx2341x_video_spatial_filter_mode {
804 	V4L2_MPEG_CX2341X_VIDEO_SPATIAL_FILTER_MODE_MANUAL = 0,
805 	V4L2_MPEG_CX2341X_VIDEO_SPATIAL_FILTER_MODE_AUTO   = 1,
806 };
807 #define V4L2_CID_MPEG_CX2341X_VIDEO_SPATIAL_FILTER		(V4L2_CID_CODEC_CX2341X_BASE+1)
808 #define V4L2_CID_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE	(V4L2_CID_CODEC_CX2341X_BASE+2)
809 enum v4l2_mpeg_cx2341x_video_luma_spatial_filter_type {
810 	V4L2_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE_OFF                  = 0,
811 	V4L2_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE_1D_HOR               = 1,
812 	V4L2_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE_1D_VERT              = 2,
813 	V4L2_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE_2D_HV_SEPARABLE      = 3,
814 	V4L2_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE_2D_SYM_NON_SEPARABLE = 4,
815 };
816 #define V4L2_CID_MPEG_CX2341X_VIDEO_CHROMA_SPATIAL_FILTER_TYPE	(V4L2_CID_CODEC_CX2341X_BASE+3)
817 enum v4l2_mpeg_cx2341x_video_chroma_spatial_filter_type {
818 	V4L2_MPEG_CX2341X_VIDEO_CHROMA_SPATIAL_FILTER_TYPE_OFF    = 0,
819 	V4L2_MPEG_CX2341X_VIDEO_CHROMA_SPATIAL_FILTER_TYPE_1D_HOR = 1,
820 };
821 #define V4L2_CID_MPEG_CX2341X_VIDEO_TEMPORAL_FILTER_MODE	(V4L2_CID_CODEC_CX2341X_BASE+4)
822 enum v4l2_mpeg_cx2341x_video_temporal_filter_mode {
823 	V4L2_MPEG_CX2341X_VIDEO_TEMPORAL_FILTER_MODE_MANUAL = 0,
824 	V4L2_MPEG_CX2341X_VIDEO_TEMPORAL_FILTER_MODE_AUTO   = 1,
825 };
826 #define V4L2_CID_MPEG_CX2341X_VIDEO_TEMPORAL_FILTER		(V4L2_CID_CODEC_CX2341X_BASE+5)
827 #define V4L2_CID_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE		(V4L2_CID_CODEC_CX2341X_BASE+6)
828 enum v4l2_mpeg_cx2341x_video_median_filter_type {
829 	V4L2_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE_OFF      = 0,
830 	V4L2_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE_HOR      = 1,
831 	V4L2_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE_VERT     = 2,
832 	V4L2_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE_HOR_VERT = 3,
833 	V4L2_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE_DIAG     = 4,
834 };
835 #define V4L2_CID_MPEG_CX2341X_VIDEO_LUMA_MEDIAN_FILTER_BOTTOM	(V4L2_CID_CODEC_CX2341X_BASE+7)
836 #define V4L2_CID_MPEG_CX2341X_VIDEO_LUMA_MEDIAN_FILTER_TOP	(V4L2_CID_CODEC_CX2341X_BASE+8)
837 #define V4L2_CID_MPEG_CX2341X_VIDEO_CHROMA_MEDIAN_FILTER_BOTTOM	(V4L2_CID_CODEC_CX2341X_BASE+9)
838 #define V4L2_CID_MPEG_CX2341X_VIDEO_CHROMA_MEDIAN_FILTER_TOP	(V4L2_CID_CODEC_CX2341X_BASE+10)
839 #define V4L2_CID_MPEG_CX2341X_STREAM_INSERT_NAV_PACKETS		(V4L2_CID_CODEC_CX2341X_BASE+11)
840 
841 /*  MPEG-class control IDs specific to the Samsung MFC 5.1 driver as defined by V4L2 */
842 #define V4L2_CID_CODEC_MFC51_BASE				(V4L2_CTRL_CLASS_CODEC | 0x1100)
843 
844 #define V4L2_CID_MPEG_MFC51_VIDEO_DECODER_H264_DISPLAY_DELAY		(V4L2_CID_CODEC_MFC51_BASE+0)
845 #define V4L2_CID_MPEG_MFC51_VIDEO_DECODER_H264_DISPLAY_DELAY_ENABLE	(V4L2_CID_CODEC_MFC51_BASE+1)
846 #define V4L2_CID_MPEG_MFC51_VIDEO_FRAME_SKIP_MODE			(V4L2_CID_CODEC_MFC51_BASE+2)
847 enum v4l2_mpeg_mfc51_video_frame_skip_mode {
848 	V4L2_MPEG_MFC51_VIDEO_FRAME_SKIP_MODE_DISABLED		= 0,
849 	V4L2_MPEG_MFC51_VIDEO_FRAME_SKIP_MODE_LEVEL_LIMIT	= 1,
850 	V4L2_MPEG_MFC51_VIDEO_FRAME_SKIP_MODE_BUF_LIMIT		= 2,
851 };
852 #define V4L2_CID_MPEG_MFC51_VIDEO_FORCE_FRAME_TYPE			(V4L2_CID_CODEC_MFC51_BASE+3)
853 enum v4l2_mpeg_mfc51_video_force_frame_type {
854 	V4L2_MPEG_MFC51_VIDEO_FORCE_FRAME_TYPE_DISABLED		= 0,
855 	V4L2_MPEG_MFC51_VIDEO_FORCE_FRAME_TYPE_I_FRAME		= 1,
856 	V4L2_MPEG_MFC51_VIDEO_FORCE_FRAME_TYPE_NOT_CODED	= 2,
857 };
858 #define V4L2_CID_MPEG_MFC51_VIDEO_PADDING				(V4L2_CID_CODEC_MFC51_BASE+4)
859 #define V4L2_CID_MPEG_MFC51_VIDEO_PADDING_YUV				(V4L2_CID_CODEC_MFC51_BASE+5)
860 #define V4L2_CID_MPEG_MFC51_VIDEO_RC_FIXED_TARGET_BIT			(V4L2_CID_CODEC_MFC51_BASE+6)
861 #define V4L2_CID_MPEG_MFC51_VIDEO_RC_REACTION_COEFF			(V4L2_CID_CODEC_MFC51_BASE+7)
862 #define V4L2_CID_MPEG_MFC51_VIDEO_H264_ADAPTIVE_RC_ACTIVITY		(V4L2_CID_CODEC_MFC51_BASE+50)
863 #define V4L2_CID_MPEG_MFC51_VIDEO_H264_ADAPTIVE_RC_DARK			(V4L2_CID_CODEC_MFC51_BASE+51)
864 #define V4L2_CID_MPEG_MFC51_VIDEO_H264_ADAPTIVE_RC_SMOOTH		(V4L2_CID_CODEC_MFC51_BASE+52)
865 #define V4L2_CID_MPEG_MFC51_VIDEO_H264_ADAPTIVE_RC_STATIC		(V4L2_CID_CODEC_MFC51_BASE+53)
866 #define V4L2_CID_MPEG_MFC51_VIDEO_H264_NUM_REF_PIC_FOR_P		(V4L2_CID_CODEC_MFC51_BASE+54)
867 
868 /*  Camera class control IDs */
869 
870 #define V4L2_CID_CAMERA_CLASS_BASE	(V4L2_CTRL_CLASS_CAMERA | 0x900)
871 #define V4L2_CID_CAMERA_CLASS		(V4L2_CTRL_CLASS_CAMERA | 1)
872 
873 #define V4L2_CID_EXPOSURE_AUTO			(V4L2_CID_CAMERA_CLASS_BASE+1)
874 enum  v4l2_exposure_auto_type {
875 	V4L2_EXPOSURE_AUTO = 0,
876 	V4L2_EXPOSURE_MANUAL = 1,
877 	V4L2_EXPOSURE_SHUTTER_PRIORITY = 2,
878 	V4L2_EXPOSURE_APERTURE_PRIORITY = 3
879 };
880 #define V4L2_CID_EXPOSURE_ABSOLUTE		(V4L2_CID_CAMERA_CLASS_BASE+2)
881 #define V4L2_CID_EXPOSURE_AUTO_PRIORITY		(V4L2_CID_CAMERA_CLASS_BASE+3)
882 
883 #define V4L2_CID_PAN_RELATIVE			(V4L2_CID_CAMERA_CLASS_BASE+4)
884 #define V4L2_CID_TILT_RELATIVE			(V4L2_CID_CAMERA_CLASS_BASE+5)
885 #define V4L2_CID_PAN_RESET			(V4L2_CID_CAMERA_CLASS_BASE+6)
886 #define V4L2_CID_TILT_RESET			(V4L2_CID_CAMERA_CLASS_BASE+7)
887 
888 #define V4L2_CID_PAN_ABSOLUTE			(V4L2_CID_CAMERA_CLASS_BASE+8)
889 #define V4L2_CID_TILT_ABSOLUTE			(V4L2_CID_CAMERA_CLASS_BASE+9)
890 
891 #define V4L2_CID_FOCUS_ABSOLUTE			(V4L2_CID_CAMERA_CLASS_BASE+10)
892 #define V4L2_CID_FOCUS_RELATIVE			(V4L2_CID_CAMERA_CLASS_BASE+11)
893 #define V4L2_CID_FOCUS_AUTO			(V4L2_CID_CAMERA_CLASS_BASE+12)
894 
895 #define V4L2_CID_ZOOM_ABSOLUTE			(V4L2_CID_CAMERA_CLASS_BASE+13)
896 #define V4L2_CID_ZOOM_RELATIVE			(V4L2_CID_CAMERA_CLASS_BASE+14)
897 #define V4L2_CID_ZOOM_CONTINUOUS		(V4L2_CID_CAMERA_CLASS_BASE+15)
898 
899 #define V4L2_CID_PRIVACY			(V4L2_CID_CAMERA_CLASS_BASE+16)
900 
901 #define V4L2_CID_IRIS_ABSOLUTE			(V4L2_CID_CAMERA_CLASS_BASE+17)
902 #define V4L2_CID_IRIS_RELATIVE			(V4L2_CID_CAMERA_CLASS_BASE+18)
903 
904 #define V4L2_CID_AUTO_EXPOSURE_BIAS		(V4L2_CID_CAMERA_CLASS_BASE+19)
905 
906 #define V4L2_CID_AUTO_N_PRESET_WHITE_BALANCE	(V4L2_CID_CAMERA_CLASS_BASE+20)
907 enum v4l2_auto_n_preset_white_balance {
908 	V4L2_WHITE_BALANCE_MANUAL		= 0,
909 	V4L2_WHITE_BALANCE_AUTO			= 1,
910 	V4L2_WHITE_BALANCE_INCANDESCENT		= 2,
911 	V4L2_WHITE_BALANCE_FLUORESCENT		= 3,
912 	V4L2_WHITE_BALANCE_FLUORESCENT_H	= 4,
913 	V4L2_WHITE_BALANCE_HORIZON		= 5,
914 	V4L2_WHITE_BALANCE_DAYLIGHT		= 6,
915 	V4L2_WHITE_BALANCE_FLASH		= 7,
916 	V4L2_WHITE_BALANCE_CLOUDY		= 8,
917 	V4L2_WHITE_BALANCE_SHADE		= 9,
918 };
919 
920 #define V4L2_CID_WIDE_DYNAMIC_RANGE		(V4L2_CID_CAMERA_CLASS_BASE+21)
921 #define V4L2_CID_IMAGE_STABILIZATION		(V4L2_CID_CAMERA_CLASS_BASE+22)
922 
923 #define V4L2_CID_ISO_SENSITIVITY		(V4L2_CID_CAMERA_CLASS_BASE+23)
924 #define V4L2_CID_ISO_SENSITIVITY_AUTO		(V4L2_CID_CAMERA_CLASS_BASE+24)
925 enum v4l2_iso_sensitivity_auto_type {
926 	V4L2_ISO_SENSITIVITY_MANUAL		= 0,
927 	V4L2_ISO_SENSITIVITY_AUTO		= 1,
928 };
929 
930 #define V4L2_CID_EXPOSURE_METERING		(V4L2_CID_CAMERA_CLASS_BASE+25)
931 enum v4l2_exposure_metering {
932 	V4L2_EXPOSURE_METERING_AVERAGE		= 0,
933 	V4L2_EXPOSURE_METERING_CENTER_WEIGHTED	= 1,
934 	V4L2_EXPOSURE_METERING_SPOT		= 2,
935 	V4L2_EXPOSURE_METERING_MATRIX		= 3,
936 };
937 
938 #define V4L2_CID_SCENE_MODE			(V4L2_CID_CAMERA_CLASS_BASE+26)
939 enum v4l2_scene_mode {
940 	V4L2_SCENE_MODE_NONE			= 0,
941 	V4L2_SCENE_MODE_BACKLIGHT		= 1,
942 	V4L2_SCENE_MODE_BEACH_SNOW		= 2,
943 	V4L2_SCENE_MODE_CANDLE_LIGHT		= 3,
944 	V4L2_SCENE_MODE_DAWN_DUSK		= 4,
945 	V4L2_SCENE_MODE_FALL_COLORS		= 5,
946 	V4L2_SCENE_MODE_FIREWORKS		= 6,
947 	V4L2_SCENE_MODE_LANDSCAPE		= 7,
948 	V4L2_SCENE_MODE_NIGHT			= 8,
949 	V4L2_SCENE_MODE_PARTY_INDOOR		= 9,
950 	V4L2_SCENE_MODE_PORTRAIT		= 10,
951 	V4L2_SCENE_MODE_SPORTS			= 11,
952 	V4L2_SCENE_MODE_SUNSET			= 12,
953 	V4L2_SCENE_MODE_TEXT			= 13,
954 };
955 
956 #define V4L2_CID_3A_LOCK			(V4L2_CID_CAMERA_CLASS_BASE+27)
957 #define V4L2_LOCK_EXPOSURE			(1 << 0)
958 #define V4L2_LOCK_WHITE_BALANCE			(1 << 1)
959 #define V4L2_LOCK_FOCUS				(1 << 2)
960 
961 #define V4L2_CID_AUTO_FOCUS_START		(V4L2_CID_CAMERA_CLASS_BASE+28)
962 #define V4L2_CID_AUTO_FOCUS_STOP		(V4L2_CID_CAMERA_CLASS_BASE+29)
963 #define V4L2_CID_AUTO_FOCUS_STATUS		(V4L2_CID_CAMERA_CLASS_BASE+30)
964 #define V4L2_AUTO_FOCUS_STATUS_IDLE		(0 << 0)
965 #define V4L2_AUTO_FOCUS_STATUS_BUSY		(1 << 0)
966 #define V4L2_AUTO_FOCUS_STATUS_REACHED		(1 << 1)
967 #define V4L2_AUTO_FOCUS_STATUS_FAILED		(1 << 2)
968 
969 #define V4L2_CID_AUTO_FOCUS_RANGE		(V4L2_CID_CAMERA_CLASS_BASE+31)
970 enum v4l2_auto_focus_range {
971 	V4L2_AUTO_FOCUS_RANGE_AUTO		= 0,
972 	V4L2_AUTO_FOCUS_RANGE_NORMAL		= 1,
973 	V4L2_AUTO_FOCUS_RANGE_MACRO		= 2,
974 	V4L2_AUTO_FOCUS_RANGE_INFINITY		= 3,
975 };
976 
977 #define V4L2_CID_PAN_SPEED			(V4L2_CID_CAMERA_CLASS_BASE+32)
978 #define V4L2_CID_TILT_SPEED			(V4L2_CID_CAMERA_CLASS_BASE+33)
979 
980 #define V4L2_CID_CAMERA_ORIENTATION		(V4L2_CID_CAMERA_CLASS_BASE+34)
981 #define V4L2_CAMERA_ORIENTATION_FRONT		0
982 #define V4L2_CAMERA_ORIENTATION_BACK		1
983 #define V4L2_CAMERA_ORIENTATION_EXTERNAL	2
984 
985 #define V4L2_CID_CAMERA_SENSOR_ROTATION		(V4L2_CID_CAMERA_CLASS_BASE+35)
986 
987 /* FM Modulator class control IDs */
988 
989 #define V4L2_CID_FM_TX_CLASS_BASE		(V4L2_CTRL_CLASS_FM_TX | 0x900)
990 #define V4L2_CID_FM_TX_CLASS			(V4L2_CTRL_CLASS_FM_TX | 1)
991 
992 #define V4L2_CID_RDS_TX_DEVIATION		(V4L2_CID_FM_TX_CLASS_BASE + 1)
993 #define V4L2_CID_RDS_TX_PI			(V4L2_CID_FM_TX_CLASS_BASE + 2)
994 #define V4L2_CID_RDS_TX_PTY			(V4L2_CID_FM_TX_CLASS_BASE + 3)
995 #define V4L2_CID_RDS_TX_PS_NAME			(V4L2_CID_FM_TX_CLASS_BASE + 5)
996 #define V4L2_CID_RDS_TX_RADIO_TEXT		(V4L2_CID_FM_TX_CLASS_BASE + 6)
997 #define V4L2_CID_RDS_TX_MONO_STEREO		(V4L2_CID_FM_TX_CLASS_BASE + 7)
998 #define V4L2_CID_RDS_TX_ARTIFICIAL_HEAD		(V4L2_CID_FM_TX_CLASS_BASE + 8)
999 #define V4L2_CID_RDS_TX_COMPRESSED		(V4L2_CID_FM_TX_CLASS_BASE + 9)
1000 #define V4L2_CID_RDS_TX_DYNAMIC_PTY		(V4L2_CID_FM_TX_CLASS_BASE + 10)
1001 #define V4L2_CID_RDS_TX_TRAFFIC_ANNOUNCEMENT	(V4L2_CID_FM_TX_CLASS_BASE + 11)
1002 #define V4L2_CID_RDS_TX_TRAFFIC_PROGRAM		(V4L2_CID_FM_TX_CLASS_BASE + 12)
1003 #define V4L2_CID_RDS_TX_MUSIC_SPEECH		(V4L2_CID_FM_TX_CLASS_BASE + 13)
1004 #define V4L2_CID_RDS_TX_ALT_FREQS_ENABLE	(V4L2_CID_FM_TX_CLASS_BASE + 14)
1005 #define V4L2_CID_RDS_TX_ALT_FREQS		(V4L2_CID_FM_TX_CLASS_BASE + 15)
1006 
1007 #define V4L2_CID_AUDIO_LIMITER_ENABLED		(V4L2_CID_FM_TX_CLASS_BASE + 64)
1008 #define V4L2_CID_AUDIO_LIMITER_RELEASE_TIME	(V4L2_CID_FM_TX_CLASS_BASE + 65)
1009 #define V4L2_CID_AUDIO_LIMITER_DEVIATION	(V4L2_CID_FM_TX_CLASS_BASE + 66)
1010 
1011 #define V4L2_CID_AUDIO_COMPRESSION_ENABLED	(V4L2_CID_FM_TX_CLASS_BASE + 80)
1012 #define V4L2_CID_AUDIO_COMPRESSION_GAIN		(V4L2_CID_FM_TX_CLASS_BASE + 81)
1013 #define V4L2_CID_AUDIO_COMPRESSION_THRESHOLD	(V4L2_CID_FM_TX_CLASS_BASE + 82)
1014 #define V4L2_CID_AUDIO_COMPRESSION_ATTACK_TIME	(V4L2_CID_FM_TX_CLASS_BASE + 83)
1015 #define V4L2_CID_AUDIO_COMPRESSION_RELEASE_TIME	(V4L2_CID_FM_TX_CLASS_BASE + 84)
1016 
1017 #define V4L2_CID_PILOT_TONE_ENABLED		(V4L2_CID_FM_TX_CLASS_BASE + 96)
1018 #define V4L2_CID_PILOT_TONE_DEVIATION		(V4L2_CID_FM_TX_CLASS_BASE + 97)
1019 #define V4L2_CID_PILOT_TONE_FREQUENCY		(V4L2_CID_FM_TX_CLASS_BASE + 98)
1020 
1021 #define V4L2_CID_TUNE_PREEMPHASIS		(V4L2_CID_FM_TX_CLASS_BASE + 112)
1022 enum v4l2_preemphasis {
1023 	V4L2_PREEMPHASIS_DISABLED	= 0,
1024 	V4L2_PREEMPHASIS_50_uS		= 1,
1025 	V4L2_PREEMPHASIS_75_uS		= 2,
1026 };
1027 #define V4L2_CID_TUNE_POWER_LEVEL		(V4L2_CID_FM_TX_CLASS_BASE + 113)
1028 #define V4L2_CID_TUNE_ANTENNA_CAPACITOR		(V4L2_CID_FM_TX_CLASS_BASE + 114)
1029 
1030 
1031 /* Flash and privacy (indicator) light controls */
1032 
1033 #define V4L2_CID_FLASH_CLASS_BASE		(V4L2_CTRL_CLASS_FLASH | 0x900)
1034 #define V4L2_CID_FLASH_CLASS			(V4L2_CTRL_CLASS_FLASH | 1)
1035 
1036 #define V4L2_CID_FLASH_LED_MODE			(V4L2_CID_FLASH_CLASS_BASE + 1)
1037 enum v4l2_flash_led_mode {
1038 	V4L2_FLASH_LED_MODE_NONE,
1039 	V4L2_FLASH_LED_MODE_FLASH,
1040 	V4L2_FLASH_LED_MODE_TORCH,
1041 };
1042 
1043 #define V4L2_CID_FLASH_STROBE_SOURCE		(V4L2_CID_FLASH_CLASS_BASE + 2)
1044 enum v4l2_flash_strobe_source {
1045 	V4L2_FLASH_STROBE_SOURCE_SOFTWARE,
1046 	V4L2_FLASH_STROBE_SOURCE_EXTERNAL,
1047 };
1048 
1049 #define V4L2_CID_FLASH_STROBE			(V4L2_CID_FLASH_CLASS_BASE + 3)
1050 #define V4L2_CID_FLASH_STROBE_STOP		(V4L2_CID_FLASH_CLASS_BASE + 4)
1051 #define V4L2_CID_FLASH_STROBE_STATUS		(V4L2_CID_FLASH_CLASS_BASE + 5)
1052 
1053 #define V4L2_CID_FLASH_TIMEOUT			(V4L2_CID_FLASH_CLASS_BASE + 6)
1054 #define V4L2_CID_FLASH_INTENSITY		(V4L2_CID_FLASH_CLASS_BASE + 7)
1055 #define V4L2_CID_FLASH_TORCH_INTENSITY		(V4L2_CID_FLASH_CLASS_BASE + 8)
1056 #define V4L2_CID_FLASH_INDICATOR_INTENSITY	(V4L2_CID_FLASH_CLASS_BASE + 9)
1057 
1058 #define V4L2_CID_FLASH_FAULT			(V4L2_CID_FLASH_CLASS_BASE + 10)
1059 #define V4L2_FLASH_FAULT_OVER_VOLTAGE		(1 << 0)
1060 #define V4L2_FLASH_FAULT_TIMEOUT		(1 << 1)
1061 #define V4L2_FLASH_FAULT_OVER_TEMPERATURE	(1 << 2)
1062 #define V4L2_FLASH_FAULT_SHORT_CIRCUIT		(1 << 3)
1063 #define V4L2_FLASH_FAULT_OVER_CURRENT		(1 << 4)
1064 #define V4L2_FLASH_FAULT_INDICATOR		(1 << 5)
1065 #define V4L2_FLASH_FAULT_UNDER_VOLTAGE		(1 << 6)
1066 #define V4L2_FLASH_FAULT_INPUT_VOLTAGE		(1 << 7)
1067 #define V4L2_FLASH_FAULT_LED_OVER_TEMPERATURE	(1 << 8)
1068 
1069 #define V4L2_CID_FLASH_CHARGE			(V4L2_CID_FLASH_CLASS_BASE + 11)
1070 #define V4L2_CID_FLASH_READY			(V4L2_CID_FLASH_CLASS_BASE + 12)
1071 
1072 
1073 /* JPEG-class control IDs */
1074 
1075 #define V4L2_CID_JPEG_CLASS_BASE		(V4L2_CTRL_CLASS_JPEG | 0x900)
1076 #define V4L2_CID_JPEG_CLASS			(V4L2_CTRL_CLASS_JPEG | 1)
1077 
1078 #define	V4L2_CID_JPEG_CHROMA_SUBSAMPLING	(V4L2_CID_JPEG_CLASS_BASE + 1)
1079 enum v4l2_jpeg_chroma_subsampling {
1080 	V4L2_JPEG_CHROMA_SUBSAMPLING_444	= 0,
1081 	V4L2_JPEG_CHROMA_SUBSAMPLING_422	= 1,
1082 	V4L2_JPEG_CHROMA_SUBSAMPLING_420	= 2,
1083 	V4L2_JPEG_CHROMA_SUBSAMPLING_411	= 3,
1084 	V4L2_JPEG_CHROMA_SUBSAMPLING_410	= 4,
1085 	V4L2_JPEG_CHROMA_SUBSAMPLING_GRAY	= 5,
1086 };
1087 #define	V4L2_CID_JPEG_RESTART_INTERVAL		(V4L2_CID_JPEG_CLASS_BASE + 2)
1088 #define	V4L2_CID_JPEG_COMPRESSION_QUALITY	(V4L2_CID_JPEG_CLASS_BASE + 3)
1089 
1090 #define	V4L2_CID_JPEG_ACTIVE_MARKER		(V4L2_CID_JPEG_CLASS_BASE + 4)
1091 #define	V4L2_JPEG_ACTIVE_MARKER_APP0		(1 << 0)
1092 #define	V4L2_JPEG_ACTIVE_MARKER_APP1		(1 << 1)
1093 #define	V4L2_JPEG_ACTIVE_MARKER_COM		(1 << 16)
1094 #define	V4L2_JPEG_ACTIVE_MARKER_DQT		(1 << 17)
1095 #define	V4L2_JPEG_ACTIVE_MARKER_DHT		(1 << 18)
1096 
1097 
1098 /* Image source controls */
1099 #define V4L2_CID_IMAGE_SOURCE_CLASS_BASE	(V4L2_CTRL_CLASS_IMAGE_SOURCE | 0x900)
1100 #define V4L2_CID_IMAGE_SOURCE_CLASS		(V4L2_CTRL_CLASS_IMAGE_SOURCE | 1)
1101 
1102 #define V4L2_CID_VBLANK				(V4L2_CID_IMAGE_SOURCE_CLASS_BASE + 1)
1103 #define V4L2_CID_HBLANK				(V4L2_CID_IMAGE_SOURCE_CLASS_BASE + 2)
1104 #define V4L2_CID_ANALOGUE_GAIN			(V4L2_CID_IMAGE_SOURCE_CLASS_BASE + 3)
1105 #define V4L2_CID_TEST_PATTERN_RED		(V4L2_CID_IMAGE_SOURCE_CLASS_BASE + 4)
1106 #define V4L2_CID_TEST_PATTERN_GREENR		(V4L2_CID_IMAGE_SOURCE_CLASS_BASE + 5)
1107 #define V4L2_CID_TEST_PATTERN_BLUE		(V4L2_CID_IMAGE_SOURCE_CLASS_BASE + 6)
1108 #define V4L2_CID_TEST_PATTERN_GREENB		(V4L2_CID_IMAGE_SOURCE_CLASS_BASE + 7)
1109 #define V4L2_CID_UNIT_CELL_SIZE			(V4L2_CID_IMAGE_SOURCE_CLASS_BASE + 8)
1110 
1111 
1112 /* Image processing controls */
1113 
1114 #define V4L2_CID_IMAGE_PROC_CLASS_BASE		(V4L2_CTRL_CLASS_IMAGE_PROC | 0x900)
1115 #define V4L2_CID_IMAGE_PROC_CLASS		(V4L2_CTRL_CLASS_IMAGE_PROC | 1)
1116 
1117 #define V4L2_CID_LINK_FREQ			(V4L2_CID_IMAGE_PROC_CLASS_BASE + 1)
1118 #define V4L2_CID_PIXEL_RATE			(V4L2_CID_IMAGE_PROC_CLASS_BASE + 2)
1119 #define V4L2_CID_TEST_PATTERN			(V4L2_CID_IMAGE_PROC_CLASS_BASE + 3)
1120 #define V4L2_CID_DEINTERLACING_MODE		(V4L2_CID_IMAGE_PROC_CLASS_BASE + 4)
1121 #define V4L2_CID_DIGITAL_GAIN			(V4L2_CID_IMAGE_PROC_CLASS_BASE + 5)
1122 
1123 /*  DV-class control IDs defined by V4L2 */
1124 #define V4L2_CID_DV_CLASS_BASE			(V4L2_CTRL_CLASS_DV | 0x900)
1125 #define V4L2_CID_DV_CLASS			(V4L2_CTRL_CLASS_DV | 1)
1126 
1127 #define	V4L2_CID_DV_TX_HOTPLUG			(V4L2_CID_DV_CLASS_BASE + 1)
1128 #define	V4L2_CID_DV_TX_RXSENSE			(V4L2_CID_DV_CLASS_BASE + 2)
1129 #define	V4L2_CID_DV_TX_EDID_PRESENT		(V4L2_CID_DV_CLASS_BASE + 3)
1130 #define	V4L2_CID_DV_TX_MODE			(V4L2_CID_DV_CLASS_BASE + 4)
1131 enum v4l2_dv_tx_mode {
1132 	V4L2_DV_TX_MODE_DVI_D	= 0,
1133 	V4L2_DV_TX_MODE_HDMI	= 1,
1134 };
1135 #define V4L2_CID_DV_TX_RGB_RANGE		(V4L2_CID_DV_CLASS_BASE + 5)
1136 enum v4l2_dv_rgb_range {
1137 	V4L2_DV_RGB_RANGE_AUTO	  = 0,
1138 	V4L2_DV_RGB_RANGE_LIMITED = 1,
1139 	V4L2_DV_RGB_RANGE_FULL	  = 2,
1140 };
1141 
1142 #define V4L2_CID_DV_TX_IT_CONTENT_TYPE		(V4L2_CID_DV_CLASS_BASE + 6)
1143 enum v4l2_dv_it_content_type {
1144 	V4L2_DV_IT_CONTENT_TYPE_GRAPHICS  = 0,
1145 	V4L2_DV_IT_CONTENT_TYPE_PHOTO	  = 1,
1146 	V4L2_DV_IT_CONTENT_TYPE_CINEMA	  = 2,
1147 	V4L2_DV_IT_CONTENT_TYPE_GAME	  = 3,
1148 	V4L2_DV_IT_CONTENT_TYPE_NO_ITC	  = 4,
1149 };
1150 
1151 #define	V4L2_CID_DV_RX_POWER_PRESENT		(V4L2_CID_DV_CLASS_BASE + 100)
1152 #define V4L2_CID_DV_RX_RGB_RANGE		(V4L2_CID_DV_CLASS_BASE + 101)
1153 #define V4L2_CID_DV_RX_IT_CONTENT_TYPE		(V4L2_CID_DV_CLASS_BASE + 102)
1154 
1155 #define V4L2_CID_FM_RX_CLASS_BASE		(V4L2_CTRL_CLASS_FM_RX | 0x900)
1156 #define V4L2_CID_FM_RX_CLASS			(V4L2_CTRL_CLASS_FM_RX | 1)
1157 
1158 #define V4L2_CID_TUNE_DEEMPHASIS		(V4L2_CID_FM_RX_CLASS_BASE + 1)
1159 enum v4l2_deemphasis {
1160 	V4L2_DEEMPHASIS_DISABLED	= V4L2_PREEMPHASIS_DISABLED,
1161 	V4L2_DEEMPHASIS_50_uS		= V4L2_PREEMPHASIS_50_uS,
1162 	V4L2_DEEMPHASIS_75_uS		= V4L2_PREEMPHASIS_75_uS,
1163 };
1164 
1165 #define V4L2_CID_RDS_RECEPTION			(V4L2_CID_FM_RX_CLASS_BASE + 2)
1166 #define V4L2_CID_RDS_RX_PTY			(V4L2_CID_FM_RX_CLASS_BASE + 3)
1167 #define V4L2_CID_RDS_RX_PS_NAME			(V4L2_CID_FM_RX_CLASS_BASE + 4)
1168 #define V4L2_CID_RDS_RX_RADIO_TEXT		(V4L2_CID_FM_RX_CLASS_BASE + 5)
1169 #define V4L2_CID_RDS_RX_TRAFFIC_ANNOUNCEMENT	(V4L2_CID_FM_RX_CLASS_BASE + 6)
1170 #define V4L2_CID_RDS_RX_TRAFFIC_PROGRAM		(V4L2_CID_FM_RX_CLASS_BASE + 7)
1171 #define V4L2_CID_RDS_RX_MUSIC_SPEECH		(V4L2_CID_FM_RX_CLASS_BASE + 8)
1172 
1173 #define V4L2_CID_RF_TUNER_CLASS_BASE		(V4L2_CTRL_CLASS_RF_TUNER | 0x900)
1174 #define V4L2_CID_RF_TUNER_CLASS			(V4L2_CTRL_CLASS_RF_TUNER | 1)
1175 
1176 #define V4L2_CID_RF_TUNER_BANDWIDTH_AUTO	(V4L2_CID_RF_TUNER_CLASS_BASE + 11)
1177 #define V4L2_CID_RF_TUNER_BANDWIDTH		(V4L2_CID_RF_TUNER_CLASS_BASE + 12)
1178 #define V4L2_CID_RF_TUNER_RF_GAIN		(V4L2_CID_RF_TUNER_CLASS_BASE + 32)
1179 #define V4L2_CID_RF_TUNER_LNA_GAIN_AUTO		(V4L2_CID_RF_TUNER_CLASS_BASE + 41)
1180 #define V4L2_CID_RF_TUNER_LNA_GAIN		(V4L2_CID_RF_TUNER_CLASS_BASE + 42)
1181 #define V4L2_CID_RF_TUNER_MIXER_GAIN_AUTO	(V4L2_CID_RF_TUNER_CLASS_BASE + 51)
1182 #define V4L2_CID_RF_TUNER_MIXER_GAIN		(V4L2_CID_RF_TUNER_CLASS_BASE + 52)
1183 #define V4L2_CID_RF_TUNER_IF_GAIN_AUTO		(V4L2_CID_RF_TUNER_CLASS_BASE + 61)
1184 #define V4L2_CID_RF_TUNER_IF_GAIN		(V4L2_CID_RF_TUNER_CLASS_BASE + 62)
1185 #define V4L2_CID_RF_TUNER_PLL_LOCK			(V4L2_CID_RF_TUNER_CLASS_BASE + 91)
1186 
1187 
1188 /*  Detection-class control IDs defined by V4L2 */
1189 #define V4L2_CID_DETECT_CLASS_BASE		(V4L2_CTRL_CLASS_DETECT | 0x900)
1190 #define V4L2_CID_DETECT_CLASS			(V4L2_CTRL_CLASS_DETECT | 1)
1191 
1192 #define V4L2_CID_DETECT_MD_MODE			(V4L2_CID_DETECT_CLASS_BASE + 1)
1193 enum v4l2_detect_md_mode {
1194 	V4L2_DETECT_MD_MODE_DISABLED		= 0,
1195 	V4L2_DETECT_MD_MODE_GLOBAL		= 1,
1196 	V4L2_DETECT_MD_MODE_THRESHOLD_GRID	= 2,
1197 	V4L2_DETECT_MD_MODE_REGION_GRID		= 3,
1198 };
1199 #define V4L2_CID_DETECT_MD_GLOBAL_THRESHOLD	(V4L2_CID_DETECT_CLASS_BASE + 2)
1200 #define V4L2_CID_DETECT_MD_THRESHOLD_GRID	(V4L2_CID_DETECT_CLASS_BASE + 3)
1201 #define V4L2_CID_DETECT_MD_REGION_GRID		(V4L2_CID_DETECT_CLASS_BASE + 4)
1202 
1203 
1204 /*  Stateless CODECs controls */
1205 #define V4L2_CID_CODEC_STATELESS_BASE          (V4L2_CTRL_CLASS_CODEC_STATELESS | 0x900)
1206 #define V4L2_CID_CODEC_STATELESS_CLASS         (V4L2_CTRL_CLASS_CODEC_STATELESS | 1)
1207 
1208 #define V4L2_CID_STATELESS_H264_DECODE_MODE	(V4L2_CID_CODEC_STATELESS_BASE + 0)
1209 /**
1210  * enum v4l2_stateless_h264_decode_mode - Decoding mode
1211  *
1212  * @V4L2_STATELESS_H264_DECODE_MODE_SLICE_BASED: indicates that decoding
1213  * is performed one slice at a time. In this mode,
1214  * V4L2_CID_STATELESS_H264_SLICE_PARAMS must contain the parsed slice
1215  * parameters and the OUTPUT buffer must contain a single slice.
1216  * V4L2_BUF_CAP_SUPPORTS_M2M_HOLD_CAPTURE_BUF feature is used
1217  * in order to support multislice frames.
1218  * @V4L2_STATELESS_H264_DECODE_MODE_FRAME_BASED: indicates that
1219  * decoding is performed per frame. The OUTPUT buffer must contain
1220  * all slices and also both fields. This mode is typically supported
1221  * by device drivers that are able to parse the slice(s) header(s)
1222  * in hardware. When this mode is selected,
1223  * V4L2_CID_STATELESS_H264_SLICE_PARAMS is not used.
1224  */
1225 enum v4l2_stateless_h264_decode_mode {
1226 	V4L2_STATELESS_H264_DECODE_MODE_SLICE_BASED,
1227 	V4L2_STATELESS_H264_DECODE_MODE_FRAME_BASED,
1228 };
1229 
1230 #define V4L2_CID_STATELESS_H264_START_CODE	(V4L2_CID_CODEC_STATELESS_BASE + 1)
1231 /**
1232  * enum v4l2_stateless_h264_start_code - Start code
1233  *
1234  * @V4L2_STATELESS_H264_START_CODE_NONE: slices are passed
1235  * to the driver without any start code.
1236  * @V4L2_STATELESS_H264_START_CODE_ANNEX_B: slices are passed
1237  * to the driver with an Annex B start code prefix
1238  * (legal start codes can be 3-bytes 0x000001 or 4-bytes 0x00000001).
1239  * This mode is typically supported by device drivers that parse
1240  * the start code in hardware.
1241  */
1242 enum v4l2_stateless_h264_start_code {
1243 	V4L2_STATELESS_H264_START_CODE_NONE,
1244 	V4L2_STATELESS_H264_START_CODE_ANNEX_B,
1245 };
1246 
1247 #define V4L2_H264_SPS_CONSTRAINT_SET0_FLAG			0x01
1248 #define V4L2_H264_SPS_CONSTRAINT_SET1_FLAG			0x02
1249 #define V4L2_H264_SPS_CONSTRAINT_SET2_FLAG			0x04
1250 #define V4L2_H264_SPS_CONSTRAINT_SET3_FLAG			0x08
1251 #define V4L2_H264_SPS_CONSTRAINT_SET4_FLAG			0x10
1252 #define V4L2_H264_SPS_CONSTRAINT_SET5_FLAG			0x20
1253 
1254 #define V4L2_H264_SPS_FLAG_SEPARATE_COLOUR_PLANE		0x01
1255 #define V4L2_H264_SPS_FLAG_QPPRIME_Y_ZERO_TRANSFORM_BYPASS	0x02
1256 #define V4L2_H264_SPS_FLAG_DELTA_PIC_ORDER_ALWAYS_ZERO		0x04
1257 #define V4L2_H264_SPS_FLAG_GAPS_IN_FRAME_NUM_VALUE_ALLOWED	0x08
1258 #define V4L2_H264_SPS_FLAG_FRAME_MBS_ONLY			0x10
1259 #define V4L2_H264_SPS_FLAG_MB_ADAPTIVE_FRAME_FIELD		0x20
1260 #define V4L2_H264_SPS_FLAG_DIRECT_8X8_INFERENCE			0x40
1261 
1262 #define V4L2_H264_SPS_HAS_CHROMA_FORMAT(sps) \
1263 	((sps)->profile_idc == 100 || (sps)->profile_idc == 110 || \
1264 	 (sps)->profile_idc == 122 || (sps)->profile_idc == 244 || \
1265 	 (sps)->profile_idc == 44  || (sps)->profile_idc == 83  || \
1266 	 (sps)->profile_idc == 86  || (sps)->profile_idc == 118 || \
1267 	 (sps)->profile_idc == 128 || (sps)->profile_idc == 138 || \
1268 	 (sps)->profile_idc == 139 || (sps)->profile_idc == 134 || \
1269 	 (sps)->profile_idc == 135)
1270 
1271 #define V4L2_CID_STATELESS_H264_SPS		(V4L2_CID_CODEC_STATELESS_BASE + 2)
1272 /**
1273  * struct v4l2_ctrl_h264_sps - H264 sequence parameter set
1274  *
1275  * All the members on this sequence parameter set structure match the
1276  * sequence parameter set syntax as specified by the H264 specification.
1277  *
1278  * @profile_idc: see H264 specification.
1279  * @constraint_set_flags: see H264 specification.
1280  * @level_idc: see H264 specification.
1281  * @seq_parameter_set_id: see H264 specification.
1282  * @chroma_format_idc: see H264 specification.
1283  * @bit_depth_luma_minus8: see H264 specification.
1284  * @bit_depth_chroma_minus8: see H264 specification.
1285  * @log2_max_frame_num_minus4: see H264 specification.
1286  * @pic_order_cnt_type: see H264 specification.
1287  * @log2_max_pic_order_cnt_lsb_minus4: see H264 specification.
1288  * @max_num_ref_frames: see H264 specification.
1289  * @num_ref_frames_in_pic_order_cnt_cycle: see H264 specification.
1290  * @offset_for_ref_frame: see H264 specification.
1291  * @offset_for_non_ref_pic: see H264 specification.
1292  * @offset_for_top_to_bottom_field: see H264 specification.
1293  * @pic_width_in_mbs_minus1: see H264 specification.
1294  * @pic_height_in_map_units_minus1: see H264 specification.
1295  * @flags: see V4L2_H264_SPS_FLAG_{}.
1296  */
1297 struct v4l2_ctrl_h264_sps {
1298 	__u8 profile_idc;
1299 	__u8 constraint_set_flags;
1300 	__u8 level_idc;
1301 	__u8 seq_parameter_set_id;
1302 	__u8 chroma_format_idc;
1303 	__u8 bit_depth_luma_minus8;
1304 	__u8 bit_depth_chroma_minus8;
1305 	__u8 log2_max_frame_num_minus4;
1306 	__u8 pic_order_cnt_type;
1307 	__u8 log2_max_pic_order_cnt_lsb_minus4;
1308 	__u8 max_num_ref_frames;
1309 	__u8 num_ref_frames_in_pic_order_cnt_cycle;
1310 	__s32 offset_for_ref_frame[255];
1311 	__s32 offset_for_non_ref_pic;
1312 	__s32 offset_for_top_to_bottom_field;
1313 	__u16 pic_width_in_mbs_minus1;
1314 	__u16 pic_height_in_map_units_minus1;
1315 	__u32 flags;
1316 };
1317 
1318 #define V4L2_H264_PPS_FLAG_ENTROPY_CODING_MODE				0x0001
1319 #define V4L2_H264_PPS_FLAG_BOTTOM_FIELD_PIC_ORDER_IN_FRAME_PRESENT	0x0002
1320 #define V4L2_H264_PPS_FLAG_WEIGHTED_PRED				0x0004
1321 #define V4L2_H264_PPS_FLAG_DEBLOCKING_FILTER_CONTROL_PRESENT		0x0008
1322 #define V4L2_H264_PPS_FLAG_CONSTRAINED_INTRA_PRED			0x0010
1323 #define V4L2_H264_PPS_FLAG_REDUNDANT_PIC_CNT_PRESENT			0x0020
1324 #define V4L2_H264_PPS_FLAG_TRANSFORM_8X8_MODE				0x0040
1325 #define V4L2_H264_PPS_FLAG_SCALING_MATRIX_PRESENT			0x0080
1326 
1327 #define V4L2_CID_STATELESS_H264_PPS		(V4L2_CID_CODEC_STATELESS_BASE + 3)
1328 /**
1329  * struct v4l2_ctrl_h264_pps - H264 picture parameter set
1330  *
1331  * Except where noted, all the members on this picture parameter set
1332  * structure match the sequence parameter set syntax as specified
1333  * by the H264 specification.
1334  *
1335  * In particular, V4L2_H264_PPS_FLAG_SCALING_MATRIX_PRESENT flag
1336  * has a specific meaning. This flag should be set if a non-flat
1337  * scaling matrix applies to the picture. In this case, applications
1338  * are expected to use V4L2_CID_STATELESS_H264_SCALING_MATRIX,
1339  * to pass the values of the non-flat matrices.
1340  *
1341  * @pic_parameter_set_id: see H264 specification.
1342  * @seq_parameter_set_id: see H264 specification.
1343  * @num_slice_groups_minus1: see H264 specification.
1344  * @num_ref_idx_l0_default_active_minus1: see H264 specification.
1345  * @num_ref_idx_l1_default_active_minus1: see H264 specification.
1346  * @weighted_bipred_idc: see H264 specification.
1347  * @pic_init_qp_minus26: see H264 specification.
1348  * @pic_init_qs_minus26: see H264 specification.
1349  * @chroma_qp_index_offset: see H264 specification.
1350  * @second_chroma_qp_index_offset: see H264 specification.
1351  * @flags: see V4L2_H264_PPS_FLAG_{}.
1352  */
1353 struct v4l2_ctrl_h264_pps {
1354 	__u8 pic_parameter_set_id;
1355 	__u8 seq_parameter_set_id;
1356 	__u8 num_slice_groups_minus1;
1357 	__u8 num_ref_idx_l0_default_active_minus1;
1358 	__u8 num_ref_idx_l1_default_active_minus1;
1359 	__u8 weighted_bipred_idc;
1360 	__s8 pic_init_qp_minus26;
1361 	__s8 pic_init_qs_minus26;
1362 	__s8 chroma_qp_index_offset;
1363 	__s8 second_chroma_qp_index_offset;
1364 	__u16 flags;
1365 };
1366 
1367 #define V4L2_CID_STATELESS_H264_SCALING_MATRIX	(V4L2_CID_CODEC_STATELESS_BASE + 4)
1368 /**
1369  * struct v4l2_ctrl_h264_scaling_matrix - H264 scaling matrices
1370  *
1371  * @scaling_list_4x4: scaling matrix after applying the inverse
1372  * scanning process. Expected list order is Intra Y, Intra Cb,
1373  * Intra Cr, Inter Y, Inter Cb, Inter Cr. The values on each
1374  * scaling list are expected in raster scan order.
1375  * @scaling_list_8x8: scaling matrix after applying the inverse
1376  * scanning process. Expected list order is Intra Y, Inter Y,
1377  * Intra Cb, Inter Cb, Intra Cr, Inter Cr. The values on each
1378  * scaling list are expected in raster scan order.
1379  *
1380  * Note that the list order is different for the 4x4 and 8x8
1381  * matrices as per the H264 specification, see table 7-2 "Assignment
1382  * of mnemonic names to scaling list indices and specification of
1383  * fall-back rule".
1384  */
1385 struct v4l2_ctrl_h264_scaling_matrix {
1386 	__u8 scaling_list_4x4[6][16];
1387 	__u8 scaling_list_8x8[6][64];
1388 };
1389 
1390 struct v4l2_h264_weight_factors {
1391 	__s16 luma_weight[32];
1392 	__s16 luma_offset[32];
1393 	__s16 chroma_weight[32][2];
1394 	__s16 chroma_offset[32][2];
1395 };
1396 
1397 #define V4L2_H264_CTRL_PRED_WEIGHTS_REQUIRED(pps, slice) \
1398 	((((pps)->flags & V4L2_H264_PPS_FLAG_WEIGHTED_PRED) && \
1399 	 ((slice)->slice_type == V4L2_H264_SLICE_TYPE_P || \
1400 	  (slice)->slice_type == V4L2_H264_SLICE_TYPE_SP)) || \
1401 	 ((pps)->weighted_bipred_idc == 1 && \
1402 	  (slice)->slice_type == V4L2_H264_SLICE_TYPE_B))
1403 
1404 #define V4L2_CID_STATELESS_H264_PRED_WEIGHTS	(V4L2_CID_CODEC_STATELESS_BASE + 5)
1405 /**
1406  * struct v4l2_ctrl_h264_pred_weights - Prediction weight table
1407  *
1408  * Prediction weight table, which matches the syntax specified
1409  * by the H264 specification.
1410  *
1411  * @luma_log2_weight_denom: see H264 specification.
1412  * @chroma_log2_weight_denom: see H264 specification.
1413  * @weight_factors: luma and chroma weight factors.
1414  */
1415 struct v4l2_ctrl_h264_pred_weights {
1416 	__u16 luma_log2_weight_denom;
1417 	__u16 chroma_log2_weight_denom;
1418 	struct v4l2_h264_weight_factors weight_factors[2];
1419 };
1420 
1421 #define V4L2_H264_SLICE_TYPE_P				0
1422 #define V4L2_H264_SLICE_TYPE_B				1
1423 #define V4L2_H264_SLICE_TYPE_I				2
1424 #define V4L2_H264_SLICE_TYPE_SP				3
1425 #define V4L2_H264_SLICE_TYPE_SI				4
1426 
1427 #define V4L2_H264_SLICE_FLAG_DIRECT_SPATIAL_MV_PRED	0x01
1428 #define V4L2_H264_SLICE_FLAG_SP_FOR_SWITCH		0x02
1429 
1430 #define V4L2_H264_TOP_FIELD_REF				0x1
1431 #define V4L2_H264_BOTTOM_FIELD_REF			0x2
1432 #define V4L2_H264_FRAME_REF				0x3
1433 
1434 /**
1435  * struct v4l2_h264_reference - H264 picture reference
1436  *
1437  * @fields: indicates how the picture is referenced.
1438  * Valid values are V4L2_H264_{}_REF.
1439  * @index: index into v4l2_ctrl_h264_decode_params.dpb[].
1440  */
1441 struct v4l2_h264_reference {
1442 	__u8 fields;
1443 	__u8 index;
1444 };
1445 
1446 /*
1447  * Maximum DPB size, as specified by section 'A.3.1 Level limits
1448  * common to the Baseline, Main, and Extended profiles'.
1449  */
1450 #define V4L2_H264_NUM_DPB_ENTRIES 16
1451 #define V4L2_H264_REF_LIST_LEN (2 * V4L2_H264_NUM_DPB_ENTRIES)
1452 
1453 #define V4L2_CID_STATELESS_H264_SLICE_PARAMS	(V4L2_CID_CODEC_STATELESS_BASE + 6)
1454 /**
1455  * struct v4l2_ctrl_h264_slice_params - H264 slice parameters
1456  *
1457  * This structure holds the H264 syntax elements that are specified
1458  * as non-invariant for the slices in a given frame.
1459  *
1460  * Slice invariant syntax elements are contained in struct
1461  * v4l2_ctrl_h264_decode_params. This is done to reduce the API surface
1462  * on frame-based decoders, where slice header parsing is done by the
1463  * hardware.
1464  *
1465  * Slice invariant syntax elements are specified in specification section
1466  * "7.4.3 Slice header semantics".
1467  *
1468  * Except where noted, the members on this struct match the slice header syntax.
1469  *
1470  * @header_bit_size: offset in bits to slice_data() from the beginning of this slice.
1471  * @first_mb_in_slice: see H264 specification.
1472  * @slice_type: see H264 specification.
1473  * @colour_plane_id: see H264 specification.
1474  * @redundant_pic_cnt: see H264 specification.
1475  * @cabac_init_idc: see H264 specification.
1476  * @slice_qp_delta: see H264 specification.
1477  * @slice_qs_delta: see H264 specification.
1478  * @disable_deblocking_filter_idc: see H264 specification.
1479  * @slice_alpha_c0_offset_div2: see H264 specification.
1480  * @slice_beta_offset_div2: see H264 specification.
1481  * @num_ref_idx_l0_active_minus1: see H264 specification.
1482  * @num_ref_idx_l1_active_minus1: see H264 specification.
1483  * @reserved: padding field. Should be zeroed by applications.
1484  * @ref_pic_list0: reference picture list 0 after applying the per-slice modifications.
1485  * @ref_pic_list1: reference picture list 1 after applying the per-slice modifications.
1486  * @flags: see V4L2_H264_SLICE_FLAG_{}.
1487  */
1488 struct v4l2_ctrl_h264_slice_params {
1489 	__u32 header_bit_size;
1490 	__u32 first_mb_in_slice;
1491 	__u8 slice_type;
1492 	__u8 colour_plane_id;
1493 	__u8 redundant_pic_cnt;
1494 	__u8 cabac_init_idc;
1495 	__s8 slice_qp_delta;
1496 	__s8 slice_qs_delta;
1497 	__u8 disable_deblocking_filter_idc;
1498 	__s8 slice_alpha_c0_offset_div2;
1499 	__s8 slice_beta_offset_div2;
1500 	__u8 num_ref_idx_l0_active_minus1;
1501 	__u8 num_ref_idx_l1_active_minus1;
1502 
1503 	__u8 reserved;
1504 
1505 	struct v4l2_h264_reference ref_pic_list0[V4L2_H264_REF_LIST_LEN];
1506 	struct v4l2_h264_reference ref_pic_list1[V4L2_H264_REF_LIST_LEN];
1507 
1508 	__u32 flags;
1509 };
1510 
1511 #define V4L2_H264_DPB_ENTRY_FLAG_VALID		0x01
1512 #define V4L2_H264_DPB_ENTRY_FLAG_ACTIVE		0x02
1513 #define V4L2_H264_DPB_ENTRY_FLAG_LONG_TERM	0x04
1514 #define V4L2_H264_DPB_ENTRY_FLAG_FIELD		0x08
1515 
1516 /**
1517  * struct v4l2_h264_dpb_entry - H264 decoded picture buffer entry
1518  *
1519  * @reference_ts: timestamp of the V4L2 capture buffer to use as reference.
1520  * The timestamp refers to the timestamp field in struct v4l2_buffer.
1521  * Use v4l2_timeval_to_ns() to convert the struct timeval to a __u64.
1522  * @pic_num: matches PicNum variable assigned during the reference
1523  * picture lists construction process.
1524  * @frame_num: frame identifier which matches frame_num syntax element.
1525  * @fields: indicates how the DPB entry is referenced. Valid values are
1526  * V4L2_H264_{}_REF.
1527  * @reserved: padding field. Should be zeroed by applications.
1528  * @top_field_order_cnt: matches TopFieldOrderCnt picture value.
1529  * @bottom_field_order_cnt: matches BottomFieldOrderCnt picture value.
1530  * Note that picture field is indicated by v4l2_buffer.field.
1531  * @flags: see V4L2_H264_DPB_ENTRY_FLAG_{}.
1532  */
1533 struct v4l2_h264_dpb_entry {
1534 	__u64 reference_ts;
1535 	__u32 pic_num;
1536 	__u16 frame_num;
1537 	__u8 fields;
1538 	__u8 reserved[5];
1539 	__s32 top_field_order_cnt;
1540 	__s32 bottom_field_order_cnt;
1541 	__u32 flags;
1542 };
1543 
1544 #define V4L2_H264_DECODE_PARAM_FLAG_IDR_PIC		0x01
1545 #define V4L2_H264_DECODE_PARAM_FLAG_FIELD_PIC		0x02
1546 #define V4L2_H264_DECODE_PARAM_FLAG_BOTTOM_FIELD	0x04
1547 
1548 #define V4L2_CID_STATELESS_H264_DECODE_PARAMS	(V4L2_CID_CODEC_STATELESS_BASE + 7)
1549 /**
1550  * struct v4l2_ctrl_h264_decode_params - H264 decoding parameters
1551  *
1552  * @dpb: decoded picture buffer.
1553  * @nal_ref_idc: slice header syntax element.
1554  * @frame_num: slice header syntax element.
1555  * @top_field_order_cnt: matches TopFieldOrderCnt picture value.
1556  * @bottom_field_order_cnt: matches BottomFieldOrderCnt picture value.
1557  * Note that picture field is indicated by v4l2_buffer.field.
1558  * @idr_pic_id: slice header syntax element.
1559  * @pic_order_cnt_lsb: slice header syntax element.
1560  * @delta_pic_order_cnt_bottom: slice header syntax element.
1561  * @delta_pic_order_cnt0: slice header syntax element.
1562  * @delta_pic_order_cnt1: slice header syntax element.
1563  * @dec_ref_pic_marking_bit_size: size in bits of dec_ref_pic_marking()
1564  * syntax element.
1565  * @pic_order_cnt_bit_size: size in bits of pic order count syntax.
1566  * @slice_group_change_cycle: slice header syntax element.
1567  * @reserved: padding field. Should be zeroed by applications.
1568  * @flags: see V4L2_H264_DECODE_PARAM_FLAG_{}.
1569  */
1570 struct v4l2_ctrl_h264_decode_params {
1571 	struct v4l2_h264_dpb_entry dpb[V4L2_H264_NUM_DPB_ENTRIES];
1572 	__u16 nal_ref_idc;
1573 	__u16 frame_num;
1574 	__s32 top_field_order_cnt;
1575 	__s32 bottom_field_order_cnt;
1576 	__u16 idr_pic_id;
1577 	__u16 pic_order_cnt_lsb;
1578 	__s32 delta_pic_order_cnt_bottom;
1579 	__s32 delta_pic_order_cnt0;
1580 	__s32 delta_pic_order_cnt1;
1581 	__u32 dec_ref_pic_marking_bit_size;
1582 	__u32 pic_order_cnt_bit_size;
1583 	__u32 slice_group_change_cycle;
1584 
1585 	__u32 reserved;
1586 	__u32 flags;
1587 };
1588 
1589 
1590 /* Stateless FWHT control, used by the vicodec driver */
1591 
1592 /* Current FWHT version */
1593 #define V4L2_FWHT_VERSION			3
1594 
1595 /* Set if this is an interlaced format */
1596 #define V4L2_FWHT_FL_IS_INTERLACED		BIT(0)
1597 /* Set if this is a bottom-first (NTSC) interlaced format */
1598 #define V4L2_FWHT_FL_IS_BOTTOM_FIRST		BIT(1)
1599 /* Set if each 'frame' contains just one field */
1600 #define V4L2_FWHT_FL_IS_ALTERNATE		BIT(2)
1601 /*
1602  * If V4L2_FWHT_FL_IS_ALTERNATE was set, then this is set if this
1603  * 'frame' is the bottom field, else it is the top field.
1604  */
1605 #define V4L2_FWHT_FL_IS_BOTTOM_FIELD		BIT(3)
1606 /* Set if the Y' plane is uncompressed */
1607 #define V4L2_FWHT_FL_LUMA_IS_UNCOMPRESSED	BIT(4)
1608 /* Set if the Cb plane is uncompressed */
1609 #define V4L2_FWHT_FL_CB_IS_UNCOMPRESSED		BIT(5)
1610 /* Set if the Cr plane is uncompressed */
1611 #define V4L2_FWHT_FL_CR_IS_UNCOMPRESSED		BIT(6)
1612 /* Set if the chroma plane is full height, if cleared it is half height */
1613 #define V4L2_FWHT_FL_CHROMA_FULL_HEIGHT		BIT(7)
1614 /* Set if the chroma plane is full width, if cleared it is half width */
1615 #define V4L2_FWHT_FL_CHROMA_FULL_WIDTH		BIT(8)
1616 /* Set if the alpha plane is uncompressed */
1617 #define V4L2_FWHT_FL_ALPHA_IS_UNCOMPRESSED	BIT(9)
1618 /* Set if this is an I Frame */
1619 #define V4L2_FWHT_FL_I_FRAME			BIT(10)
1620 
1621 /* A 4-values flag - the number of components - 1 */
1622 #define V4L2_FWHT_FL_COMPONENTS_NUM_MSK		GENMASK(18, 16)
1623 #define V4L2_FWHT_FL_COMPONENTS_NUM_OFFSET	16
1624 
1625 /* A 4-values flag - the pixel encoding type */
1626 #define V4L2_FWHT_FL_PIXENC_MSK			GENMASK(20, 19)
1627 #define V4L2_FWHT_FL_PIXENC_OFFSET		19
1628 #define V4L2_FWHT_FL_PIXENC_YUV			(1 << V4L2_FWHT_FL_PIXENC_OFFSET)
1629 #define V4L2_FWHT_FL_PIXENC_RGB			(2 << V4L2_FWHT_FL_PIXENC_OFFSET)
1630 #define V4L2_FWHT_FL_PIXENC_HSV			(3 << V4L2_FWHT_FL_PIXENC_OFFSET)
1631 
1632 #define V4L2_CID_STATELESS_FWHT_PARAMS		(V4L2_CID_CODEC_STATELESS_BASE + 100)
1633 /**
1634  * struct v4l2_ctrl_fwht_params - FWHT parameters
1635  *
1636  * @backward_ref_ts: timestamp of the V4L2 capture buffer to use as reference.
1637  * The timestamp refers to the timestamp field in struct v4l2_buffer.
1638  * Use v4l2_timeval_to_ns() to convert the struct timeval to a __u64.
1639  * @version: must be V4L2_FWHT_VERSION.
1640  * @width: width of frame.
1641  * @height: height of frame.
1642  * @flags: FWHT flags (see V4L2_FWHT_FL_*).
1643  * @colorspace: the colorspace (enum v4l2_colorspace).
1644  * @xfer_func: the transfer function (enum v4l2_xfer_func).
1645  * @ycbcr_enc: the Y'CbCr encoding (enum v4l2_ycbcr_encoding).
1646  * @quantization: the quantization (enum v4l2_quantization).
1647  */
1648 struct v4l2_ctrl_fwht_params {
1649 	__u64 backward_ref_ts;
1650 	__u32 version;
1651 	__u32 width;
1652 	__u32 height;
1653 	__u32 flags;
1654 	__u32 colorspace;
1655 	__u32 xfer_func;
1656 	__u32 ycbcr_enc;
1657 	__u32 quantization;
1658 };
1659 
1660 /* MPEG-compression definitions kept for backwards compatibility */
1661 #ifndef __KERNEL__
1662 #define V4L2_CTRL_CLASS_MPEG            V4L2_CTRL_CLASS_CODEC
1663 #define V4L2_CID_MPEG_CLASS             V4L2_CID_CODEC_CLASS
1664 #define V4L2_CID_MPEG_BASE              V4L2_CID_CODEC_BASE
1665 #define V4L2_CID_MPEG_CX2341X_BASE      V4L2_CID_CODEC_CX2341X_BASE
1666 #define V4L2_CID_MPEG_MFC51_BASE        V4L2_CID_CODEC_MFC51_BASE
1667 #endif
1668 
1669 #endif
1670