• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 #ifndef _MSM_VIDC_ENC_H_
2 #define _MSM_VIDC_ENC_H_
3 
4 #include <linux/types.h>
5 #include <linux/ioctl.h>
6 
7 /** STATUS CODES*/
8 /* Base value for status codes */
9 #define VEN_S_BASE	0x00000000
10 #define VEN_S_SUCCESS	(VEN_S_BASE)/* Success */
11 #define VEN_S_EFAIL	(VEN_S_BASE+1)/* General failure */
12 #define VEN_S_EFATAL	(VEN_S_BASE+2)/* Fatal irrecoverable failure*/
13 #define VEN_S_EBADPARAM	(VEN_S_BASE+3)/* Error passed parameters*/
14 /*Command called in invalid state*/
15 #define VEN_S_EINVALSTATE	(VEN_S_BASE+4)
16 #define VEN_S_ENOSWRES	(VEN_S_BASE+5)/* Insufficient OS resources*/
17 #define VEN_S_ENOHWRES	(VEN_S_BASE+6)/*Insufficient HW resources */
18 #define VEN_S_EBUFFREQ	(VEN_S_BASE+7)/* Buffer requirements were not met*/
19 #define VEN_S_EINVALCMD	(VEN_S_BASE+8)/* Invalid command called */
20 #define VEN_S_ETIMEOUT	(VEN_S_BASE+9)/* Command timeout. */
21 /*Re-attempt was made when multiple invocation not supported for API.*/
22 #define VEN_S_ENOREATMPT	(VEN_S_BASE+10)
23 #define VEN_S_ENOPREREQ	(VEN_S_BASE+11)/*Pre-requirement is not met for API*/
24 #define VEN_S_ECMDQFULL	(VEN_S_BASE+12)/*Command queue is full*/
25 #define VEN_S_ENOTSUPP	(VEN_S_BASE+13)/*Command not supported*/
26 #define VEN_S_ENOTIMPL	(VEN_S_BASE+14)/*Command not implemented.*/
27 #define VEN_S_ENOTPMEM	(VEN_S_BASE+15)/*Buffer is not from PMEM*/
28 #define VEN_S_EFLUSHED	(VEN_S_BASE+16)/*returned buffer was flushed*/
29 #define VEN_S_EINSUFBUF	(VEN_S_BASE+17)/*provided buffer size insufficient*/
30 #define VEN_S_ESAMESTATE	(VEN_S_BASE+18)
31 #define VEN_S_EINVALTRANS	(VEN_S_BASE+19)
32 
33 #define VEN_INTF_VER			 1
34 
35 /*Asynchronous messages from driver*/
36 #define VEN_MSG_INDICATION	0
37 #define VEN_MSG_INPUT_BUFFER_DONE	1
38 #define VEN_MSG_OUTPUT_BUFFER_DONE	2
39 #define VEN_MSG_NEED_OUTPUT_BUFFER	3
40 #define VEN_MSG_FLUSH_INPUT_DONE	4
41 #define VEN_MSG_FLUSH_OUPUT_DONE	5
42 #define VEN_MSG_START	6
43 #define VEN_MSG_STOP	7
44 #define VEN_MSG_PAUSE	8
45 #define VEN_MSG_RESUME	9
46 #define VEN_MSG_STOP_READING_MSG	10
47 
48 /*Buffer flags bits masks*/
49 #define VEN_BUFFLAG_EOS	0x00000001
50 #define VEN_BUFFLAG_ENDOFFRAME	0x00000010
51 #define VEN_BUFFLAG_SYNCFRAME	0x00000020
52 #define VEN_BUFFLAG_EXTRADATA	0x00000040
53 #define VEN_BUFFLAG_CODECCONFIG	0x00000080
54 
55 /*Post processing flags bit masks*/
56 #define VEN_EXTRADATA_NONE          0x001
57 #define VEN_EXTRADATA_QCOMFILLER    0x002
58 #define VEN_EXTRADATA_SLICEINFO     0x100
59 
60 /*ENCODER CONFIGURATION CONSTANTS*/
61 
62 /*Encoded video frame types*/
63 #define VEN_FRAME_TYPE_I	1/* I frame type */
64 #define VEN_FRAME_TYPE_P	2/* P frame type */
65 #define VEN_FRAME_TYPE_B	3/* B frame type */
66 
67 /*Video codec types*/
68 #define VEN_CODEC_MPEG4	1/* MPEG4 Codec */
69 #define VEN_CODEC_H264	2/* H.264 Codec */
70 #define VEN_CODEC_H263	3/* H.263 Codec */
71 
72 /*Video codec profile types.*/
73 #define VEN_PROFILE_MPEG4_SP      1/* 1 - MPEG4 SP profile      */
74 #define VEN_PROFILE_MPEG4_ASP     2/* 2 - MPEG4 ASP profile     */
75 #define VEN_PROFILE_H264_BASELINE 3/* 3 - H264 Baseline profile	*/
76 #define VEN_PROFILE_H264_MAIN     4/* 4 - H264 Main profile     */
77 #define VEN_PROFILE_H264_HIGH     5/* 5 - H264 High profile     */
78 #define VEN_PROFILE_H263_BASELINE 6/* 6 - H263 Baseline profile */
79 
80 /*Video codec profile level types.*/
81 #define VEN_LEVEL_MPEG4_0	 0x1/* MPEG4 Level 0  */
82 #define VEN_LEVEL_MPEG4_1	 0x2/* MPEG4 Level 1  */
83 #define VEN_LEVEL_MPEG4_2	 0x3/* MPEG4 Level 2  */
84 #define VEN_LEVEL_MPEG4_3	 0x4/* MPEG4 Level 3  */
85 #define VEN_LEVEL_MPEG4_4	 0x5/* MPEG4 Level 4  */
86 #define VEN_LEVEL_MPEG4_5	 0x6/* MPEG4 Level 5  */
87 #define VEN_LEVEL_MPEG4_3b	 0x7/* MPEG4 Level 3b */
88 #define VEN_LEVEL_MPEG4_6	 0x8/* MPEG4 Level 6  */
89 
90 #define VEN_LEVEL_H264_1	 0x9/* H.264 Level 1   */
91 #define VEN_LEVEL_H264_1b        0xA/* H.264 Level 1b  */
92 #define VEN_LEVEL_H264_1p1	 0xB/* H.264 Level 1.1 */
93 #define VEN_LEVEL_H264_1p2	 0xC/* H.264 Level 1.2 */
94 #define VEN_LEVEL_H264_1p3	 0xD/* H.264 Level 1.3 */
95 #define VEN_LEVEL_H264_2	 0xE/* H.264 Level 2   */
96 #define VEN_LEVEL_H264_2p1	 0xF/* H.264 Level 2.1 */
97 #define VEN_LEVEL_H264_2p2	0x10/* H.264 Level 2.2 */
98 #define VEN_LEVEL_H264_3	0x11/* H.264 Level 3   */
99 #define VEN_LEVEL_H264_3p1	0x12/* H.264 Level 3.1 */
100 #define VEN_LEVEL_H264_3p2	0x13/* H.264 Level 3.2 */
101 #define VEN_LEVEL_H264_4	0x14/* H.264 Level 4   */
102 
103 #define VEN_LEVEL_H263_10	0x15/* H.263 Level 10  */
104 #define VEN_LEVEL_H263_20	0x16/* H.263 Level 20  */
105 #define VEN_LEVEL_H263_30	0x17/* H.263 Level 30  */
106 #define VEN_LEVEL_H263_40	0x18/* H.263 Level 40  */
107 #define VEN_LEVEL_H263_45	0x19/* H.263 Level 45  */
108 #define VEN_LEVEL_H263_50	0x1A/* H.263 Level 50  */
109 #define VEN_LEVEL_H263_60	0x1B/* H.263 Level 60  */
110 #define VEN_LEVEL_H263_70	0x1C/* H.263 Level 70  */
111 
112 /*Entropy coding model selection for H.264 encoder.*/
113 #define VEN_ENTROPY_MODEL_CAVLC	1
114 #define VEN_ENTROPY_MODEL_CABAC	2
115 /*Cabac model number (0,1,2) for encoder.*/
116 #define VEN_CABAC_MODEL_0	1/* CABAC Model 0. */
117 #define VEN_CABAC_MODEL_1	2/* CABAC Model 1. */
118 #define VEN_CABAC_MODEL_2	3/* CABAC Model 2. */
119 
120 /*Deblocking filter control type for encoder.*/
121 #define VEN_DB_DISABLE	1/* 1 - Disable deblocking filter*/
122 #define VEN_DB_ALL_BLKG_BNDRY	2/* 2 - All blocking boundary filtering*/
123 #define VEN_DB_SKIP_SLICE_BNDRY	3/* 3 - Filtering except sliceboundary*/
124 
125 /*Different methods of Multi slice selection.*/
126 #define VEN_MSLICE_OFF	1
127 #define VEN_MSLICE_CNT_MB	2 /*number of MBscount per slice*/
128 #define VEN_MSLICE_CNT_BYTE	3 /*number of bytes count per slice.*/
129 #define VEN_MSLICE_GOB	4 /*Multi slice by GOB for H.263 only.*/
130 
131 /*Different modes for Rate Control.*/
132 #define VEN_RC_OFF	1
133 #define VEN_RC_VBR_VFR	2
134 #define VEN_RC_VBR_CFR	3
135 #define VEN_RC_CBR_VFR	4
136 #define VEN_RC_CBR_CFR	5
137 
138 /*Different modes for flushing buffers*/
139 #define VEN_FLUSH_INPUT	1
140 #define VEN_FLUSH_OUTPUT	2
141 #define VEN_FLUSH_ALL	3
142 
143 /*Different input formats for YUV data.*/
144 #define VEN_INPUTFMT_NV12	1/* NV12 Linear */
145 #define VEN_INPUTFMT_NV21	2/* NV21 Linear */
146 #define VEN_INPUTFMT_NV12_16M2KA	3/* NV12 Linear */
147 #define VEN_INPUTFMT_NV21_16M2KA	4
148 
149 
150 /*Different allowed rotation modes.*/
151 #define VEN_ROTATION_0	1/* 0 degrees */
152 #define VEN_ROTATION_90	2/* 90 degrees */
153 #define VEN_ROTATION_180	3/* 180 degrees */
154 #define VEN_ROTATION_270	4/* 270 degrees */
155 
156 /*IOCTL timeout values*/
157 #define VEN_TIMEOUT_INFINITE	0xffffffff
158 
159 /*Different allowed intra refresh modes.*/
160 #define VEN_IR_OFF	1
161 #define VEN_IR_CYCLIC	2
162 #define VEN_IR_RANDOM	3
163 
164 /*IOCTL BASE CODES Not to be used directly by the client.*/
165 /* Base value for ioctls that are not related to encoder configuration.*/
166 #define VEN_IOCTLBASE_NENC	0x800
167 /* Base value for encoder configuration ioctls*/
168 #define VEN_IOCTLBASE_ENC	0x850
169 
170 struct venc_ioctl_msg{
171 	void __user *in;
172 	void __user *out;
173 };
174 
175 /*NON ENCODER CONFIGURATION IOCTLs*/
176 
177 /*IOCTL params:SET: InputData - unsigned long, OutputData - NULL*/
178 #define VEN_IOCTL_SET_INTF_VERSION \
179 	_IOW(VEN_IOCTLBASE_NENC, 0, struct venc_ioctl_msg)
180 
181 /*IOCTL params:CMD: InputData - venc_timeout, OutputData - venc_msg*/
182 #define VEN_IOCTL_CMD_READ_NEXT_MSG \
183 	_IOWR(VEN_IOCTLBASE_NENC, 1, struct venc_ioctl_msg)
184 
185 /*IOCTL params:CMD: InputData - NULL, OutputData - NULL*/
186 #define VEN_IOCTL_CMD_STOP_READ_MSG	_IO(VEN_IOCTLBASE_NENC, 2)
187 
188 /*IOCTL params:SET: InputData - venc_allocatorproperty, OutputData - NULL
189  GET: InputData - NULL, OutputData - venc_allocatorproperty*/
190 #define VEN_IOCTL_SET_INPUT_BUFFER_REQ \
191 	_IOW(VEN_IOCTLBASE_NENC, 3, struct venc_ioctl_msg)
192 #define VEN_IOCTL_GET_INPUT_BUFFER_REQ \
193 	_IOR(VEN_IOCTLBASE_NENC, 4, struct venc_ioctl_msg)
194 
195 /*IOCTL params:CMD: InputData - venc_bufferpayload, OutputData - NULL*/
196 #define VEN_IOCTL_CMD_ALLOC_INPUT_BUFFER \
197 	_IOW(VEN_IOCTLBASE_NENC, 5, struct venc_ioctl_msg)
198 
199 /*IOCTL params:CMD: InputData - venc_bufferpayload, OutputData - NULL*/
200 #define VEN_IOCTL_SET_INPUT_BUFFER \
201 	_IOW(VEN_IOCTLBASE_NENC, 6, struct venc_ioctl_msg)
202 
203 /*IOCTL params: CMD: InputData - venc_bufferpayload, OutputData - NULL*/
204 #define VEN_IOCTL_CMD_FREE_INPUT_BUFFER \
205 	_IOW(VEN_IOCTLBASE_NENC, 7, struct venc_ioctl_msg)
206 
207 /*IOCTL params:SET: InputData - venc_allocatorproperty, OutputData - NULL
208  GET: InputData - NULL, OutputData - venc_allocatorproperty*/
209 #define VEN_IOCTL_SET_OUTPUT_BUFFER_REQ \
210 	_IOW(VEN_IOCTLBASE_NENC, 8, struct venc_ioctl_msg)
211 #define VEN_IOCTL_GET_OUTPUT_BUFFER_REQ \
212 	_IOR(VEN_IOCTLBASE_NENC, 9, struct venc_ioctl_msg)
213 
214 /*IOCTL params:CMD: InputData - venc_bufferpayload, OutputData - NULL*/
215 #define VEN_IOCTL_CMD_ALLOC_OUTPUT_BUFFER \
216 	_IOW(VEN_IOCTLBASE_NENC, 10, struct venc_ioctl_msg)
217 
218 
219 /*IOCTL params:CMD: InputData - venc_bufferpayload, OutputData - NULL*/
220 #define VEN_IOCTL_SET_OUTPUT_BUFFER \
221 	_IOW(VEN_IOCTLBASE_NENC, 11, struct venc_ioctl_msg)
222 
223 /*IOCTL params:CMD: InputData - venc_bufferpayload, OutputData - NULL.*/
224 #define VEN_IOCTL_CMD_FREE_OUTPUT_BUFFER \
225 	_IOW(VEN_IOCTLBASE_NENC, 12, struct venc_ioctl_msg)
226 
227 
228 /* Asynchronous respone message code:* VEN_MSG_START*/
229 #define VEN_IOCTL_CMD_START	_IO(VEN_IOCTLBASE_NENC, 13)
230 
231 
232 /*IOCTL params:CMD: InputData - venc_buffer, OutputData - NULL
233  Asynchronous respone message code:VEN_MSG_INPUT_BUFFER_DONE*/
234 #define VEN_IOCTL_CMD_ENCODE_FRAME \
235 	_IOW(VEN_IOCTLBASE_NENC, 14, struct venc_ioctl_msg)
236 
237 
238 /*IOCTL params:CMD: InputData - venc_buffer, OutputData - NULL
239  Asynchronous response message code:VEN_MSG_OUTPUT_BUFFER_DONE*/
240 #define VEN_IOCTL_CMD_FILL_OUTPUT_BUFFER \
241 	_IOW(VEN_IOCTLBASE_NENC, 15, struct venc_ioctl_msg)
242 
243 /*IOCTL params:CMD: InputData - venc_bufferflush, OutputData - NULL
244  * Asynchronous response message code:VEN_MSG_INPUT_BUFFER_DONE*/
245 #define VEN_IOCTL_CMD_FLUSH \
246 	_IOW(VEN_IOCTLBASE_NENC, 16, struct venc_ioctl_msg)
247 
248 
249 /*Asynchronous respone message code:VEN_MSG_PAUSE*/
250 #define VEN_IOCTL_CMD_PAUSE	_IO(VEN_IOCTLBASE_NENC, 17)
251 
252 /*Asynchronous respone message code:VEN_MSG_RESUME*/
253 #define VEN_IOCTL_CMD_RESUME _IO(VEN_IOCTLBASE_NENC, 18)
254 
255 /* Asynchronous respone message code:VEN_MSG_STOP*/
256 #define VEN_IOCTL_CMD_STOP _IO(VEN_IOCTLBASE_NENC, 19)
257 
258 #define VEN_IOCTL_SET_RECON_BUFFER \
259 	_IOW(VEN_IOCTLBASE_NENC, 20, struct venc_ioctl_msg)
260 
261 #define VEN_IOCTL_FREE_RECON_BUFFER \
262 	_IOW(VEN_IOCTLBASE_NENC, 21, struct venc_ioctl_msg)
263 
264 #define VEN_IOCTL_GET_RECON_BUFFER_SIZE \
265 	_IOW(VEN_IOCTLBASE_NENC, 22, struct venc_ioctl_msg)
266 
267 
268 
269 /*ENCODER PROPERTY CONFIGURATION & CAPABILITY IOCTLs*/
270 
271 /*IOCTL params:SET: InputData - venc_basecfg, OutputData - NULL
272  GET: InputData - NULL, OutputData - venc_basecfg*/
273 #define VEN_IOCTL_SET_BASE_CFG \
274 	_IOW(VEN_IOCTLBASE_ENC, 1, struct venc_ioctl_msg)
275 #define VEN_IOCTL_GET_BASE_CFG \
276 	_IOR(VEN_IOCTLBASE_ENC, 2, struct venc_ioctl_msg)
277 
278 /*IOCTL params:SET: InputData - venc_switch, OutputData - NULL
279   GET: InputData - NULL, OutputData - venc_switch*/
280 #define VEN_IOCTL_SET_LIVE_MODE \
281 	_IOW(VEN_IOCTLBASE_ENC, 3, struct venc_ioctl_msg)
282 #define VEN_IOCTL_GET_LIVE_MODE \
283 	_IOR(VEN_IOCTLBASE_ENC, 4, struct venc_ioctl_msg)
284 
285 
286 /*IOCTL params:SET: InputData - venc_profile, OutputData - NULL
287   GET: InputData - NULL, OutputData - venc_profile*/
288 #define VEN_IOCTL_SET_CODEC_PROFILE \
289 	_IOW(VEN_IOCTLBASE_ENC, 5, struct venc_ioctl_msg)
290 #define VEN_IOCTL_GET_CODEC_PROFILE \
291 	_IOR(VEN_IOCTLBASE_ENC, 6, struct venc_ioctl_msg)
292 
293 
294 /*IOCTL params:SET: InputData - ven_profilelevel, OutputData - NULL
295   GET: InputData - NULL, OutputData - ven_profilelevel*/
296 #define VEN_IOCTL_SET_PROFILE_LEVEL \
297 	_IOW(VEN_IOCTLBASE_ENC, 7, struct venc_ioctl_msg)
298 
299 #define VEN_IOCTL_GET_PROFILE_LEVEL \
300 	_IOR(VEN_IOCTLBASE_ENC, 8, struct venc_ioctl_msg)
301 
302 /*IOCTL params:SET: InputData - venc_switch, OutputData - NULL
303  GET: InputData - NULL, OutputData - venc_switch*/
304 #define VEN_IOCTL_SET_SHORT_HDR \
305 	_IOW(VEN_IOCTLBASE_ENC, 9, struct venc_ioctl_msg)
306 #define VEN_IOCTL_GET_SHORT_HDR \
307 	_IOR(VEN_IOCTLBASE_ENC, 10, struct venc_ioctl_msg)
308 
309 
310 /*IOCTL params: SET: InputData - venc_sessionqp, OutputData - NULL
311   GET: InputData - NULL, OutputData - venc_sessionqp*/
312 #define VEN_IOCTL_SET_SESSION_QP \
313 	_IOW(VEN_IOCTLBASE_ENC, 11, struct venc_ioctl_msg)
314 #define VEN_IOCTL_GET_SESSION_QP \
315 	_IOR(VEN_IOCTLBASE_ENC, 12, struct venc_ioctl_msg)
316 
317 
318 /*IOCTL params:SET: InputData - venc_intraperiod, OutputData - NULL
319   GET: InputData - NULL, OutputData - venc_intraperiod*/
320 #define VEN_IOCTL_SET_INTRA_PERIOD \
321 	_IOW(VEN_IOCTLBASE_ENC, 13, struct venc_ioctl_msg)
322 #define VEN_IOCTL_GET_INTRA_PERIOD \
323 	_IOR(VEN_IOCTLBASE_ENC, 14, struct venc_ioctl_msg)
324 
325 
326 /* Request an Iframe*/
327 #define VEN_IOCTL_CMD_REQUEST_IFRAME _IO(VEN_IOCTLBASE_ENC, 15)
328 
329 /*IOCTL params:GET: InputData - NULL, OutputData - venc_capability*/
330 #define VEN_IOCTL_GET_CAPABILITY \
331 	_IOR(VEN_IOCTLBASE_ENC, 16, struct venc_ioctl_msg)
332 
333 
334 /*IOCTL params:GET: InputData - NULL, OutputData - venc_seqheader*/
335 #define VEN_IOCTL_GET_SEQUENCE_HDR \
336 	_IOR(VEN_IOCTLBASE_ENC, 17, struct venc_ioctl_msg)
337 
338 /*IOCTL params:SET: InputData - venc_entropycfg, OutputData - NULL
339  GET: InputData - NULL, OutputData - venc_entropycfg*/
340 #define VEN_IOCTL_SET_ENTROPY_CFG \
341 	_IOW(VEN_IOCTLBASE_ENC, 18, struct venc_ioctl_msg)
342 #define VEN_IOCTL_GET_ENTROPY_CFG \
343 	_IOR(VEN_IOCTLBASE_ENC, 19, struct venc_ioctl_msg)
344 
345 /*IOCTL params:SET: InputData - venc_dbcfg, OutputData - NULL
346  GET: InputData - NULL, OutputData - venc_dbcfg*/
347 #define VEN_IOCTL_SET_DEBLOCKING_CFG \
348 	_IOW(VEN_IOCTLBASE_ENC, 20, struct venc_ioctl_msg)
349 #define VEN_IOCTL_GET_DEBLOCKING_CFG \
350 	_IOR(VEN_IOCTLBASE_ENC, 21, struct venc_ioctl_msg)
351 
352 
353 /*IOCTL params:SET: InputData - venc_intrarefresh, OutputData - NULL
354   GET: InputData - NULL, OutputData - venc_intrarefresh*/
355 #define VEN_IOCTL_SET_INTRA_REFRESH \
356 	_IOW(VEN_IOCTLBASE_ENC, 22, struct venc_ioctl_msg)
357 #define VEN_IOCTL_GET_INTRA_REFRESH \
358 	_IOR(VEN_IOCTLBASE_ENC, 23, struct venc_ioctl_msg)
359 
360 
361 /*IOCTL params:SET: InputData - venc_multiclicecfg, OutputData - NULL
362   GET: InputData - NULL, OutputData - venc_multiclicecfg*/
363 #define VEN_IOCTL_SET_MULTI_SLICE_CFG \
364 	_IOW(VEN_IOCTLBASE_ENC, 24, struct venc_ioctl_msg)
365 #define VEN_IOCTL_GET_MULTI_SLICE_CFG \
366 	_IOR(VEN_IOCTLBASE_ENC, 25, struct venc_ioctl_msg)
367 
368 /*IOCTL params:SET: InputData - venc_ratectrlcfg, OutputData - NULL
369  GET: InputData - NULL, OutputData - venc_ratectrlcfg*/
370 #define VEN_IOCTL_SET_RATE_CTRL_CFG \
371 	_IOW(VEN_IOCTLBASE_ENC, 26, struct venc_ioctl_msg)
372 #define VEN_IOCTL_GET_RATE_CTRL_CFG \
373 	_IOR(VEN_IOCTLBASE_ENC, 27, struct venc_ioctl_msg)
374 
375 
376 /*IOCTL params:SET: InputData - venc_voptimingcfg, OutputData - NULL
377   GET: InputData - NULL, OutputData - venc_voptimingcfg*/
378 #define VEN_IOCTL_SET_VOP_TIMING_CFG \
379 	_IOW(VEN_IOCTLBASE_ENC, 28, struct venc_ioctl_msg)
380 #define VEN_IOCTL_GET_VOP_TIMING_CFG \
381 	_IOR(VEN_IOCTLBASE_ENC, 29, struct venc_ioctl_msg)
382 
383 
384 /*IOCTL params:SET: InputData - venc_framerate, OutputData - NULL
385  GET: InputData - NULL, OutputData - venc_framerate*/
386 #define VEN_IOCTL_SET_FRAME_RATE \
387 	_IOW(VEN_IOCTLBASE_ENC, 30, struct venc_ioctl_msg)
388 #define VEN_IOCTL_GET_FRAME_RATE \
389 	_IOR(VEN_IOCTLBASE_ENC, 31, struct venc_ioctl_msg)
390 
391 
392 /*IOCTL params:SET: InputData - venc_targetbitrate, OutputData - NULL
393  GET: InputData - NULL, OutputData - venc_targetbitrate*/
394 #define VEN_IOCTL_SET_TARGET_BITRATE \
395 	_IOW(VEN_IOCTLBASE_ENC, 32, struct venc_ioctl_msg)
396 #define VEN_IOCTL_GET_TARGET_BITRATE \
397 	_IOR(VEN_IOCTLBASE_ENC, 33, struct venc_ioctl_msg)
398 
399 
400 /*IOCTL params:SET: InputData - venc_rotation, OutputData - NULL
401   GET: InputData - NULL, OutputData - venc_rotation*/
402 #define VEN_IOCTL_SET_ROTATION \
403 	_IOW(VEN_IOCTLBASE_ENC, 34, struct venc_ioctl_msg)
404 #define VEN_IOCTL_GET_ROTATION \
405 	_IOR(VEN_IOCTLBASE_ENC, 35, struct venc_ioctl_msg)
406 
407 
408 /*IOCTL params:SET: InputData - venc_headerextension, OutputData - NULL
409  GET: InputData - NULL, OutputData - venc_headerextension*/
410 #define VEN_IOCTL_SET_HEC \
411 	_IOW(VEN_IOCTLBASE_ENC, 36, struct venc_ioctl_msg)
412 #define VEN_IOCTL_GET_HEC \
413 	_IOR(VEN_IOCTLBASE_ENC, 37, struct venc_ioctl_msg)
414 
415 /*IOCTL params:SET: InputData - venc_switch, OutputData - NULL
416  GET: InputData - NULL, OutputData - venc_switch*/
417 #define VEN_IOCTL_SET_DATA_PARTITION \
418 	_IOW(VEN_IOCTLBASE_ENC, 38, struct venc_ioctl_msg)
419 #define VEN_IOCTL_GET_DATA_PARTITION \
420 	_IOR(VEN_IOCTLBASE_ENC, 39, struct venc_ioctl_msg)
421 
422 /*IOCTL params:SET: InputData - venc_switch, OutputData - NULL
423  GET: InputData - NULL, OutputData - venc_switch*/
424 #define VEN_IOCTL_SET_RVLC \
425 	_IOW(VEN_IOCTLBASE_ENC, 40, struct venc_ioctl_msg)
426 #define VEN_IOCTL_GET_RVLC \
427 	_IOR(VEN_IOCTLBASE_ENC, 41, struct venc_ioctl_msg)
428 
429 
430 /*IOCTL params:SET: InputData - venc_switch, OutputData - NULL
431  GET: InputData - NULL, OutputData - venc_switch*/
432 #define VEN_IOCTL_SET_AC_PREDICTION \
433 	_IOW(VEN_IOCTLBASE_ENC, 42, struct venc_ioctl_msg)
434 #define VEN_IOCTL_GET_AC_PREDICTION \
435 	_IOR(VEN_IOCTLBASE_ENC, 43, struct venc_ioctl_msg)
436 
437 
438 /*IOCTL params:SET: InputData - venc_qprange, OutputData - NULL
439  GET: InputData - NULL, OutputData - venc_qprange*/
440 #define VEN_IOCTL_SET_QP_RANGE \
441 	_IOW(VEN_IOCTLBASE_ENC, 44, struct venc_ioctl_msg)
442 #define VEN_IOCTL_GET_QP_RANGE \
443 	_IOR(VEN_IOCTLBASE_ENC, 45, struct venc_ioctl_msg)
444 
445 #define VEN_IOCTL_GET_NUMBER_INSTANCES \
446 	_IOR(VEN_IOCTLBASE_ENC, 46, struct venc_ioctl_msg)
447 
448 #define VEN_IOCTL_SET_METABUFFER_MODE \
449 	_IOW(VEN_IOCTLBASE_ENC, 47, struct venc_ioctl_msg)
450 
451 
452 /*IOCTL params:SET: InputData - unsigned int, OutputData - NULL.*/
453 #define VEN_IOCTL_SET_EXTRADATA \
454 	_IOW(VEN_IOCTLBASE_ENC, 48, struct venc_ioctl_msg)
455 /*IOCTL params:GET: InputData - NULL, OutputData - unsigned int.*/
456 #define VEN_IOCTL_GET_EXTRADATA \
457 	_IOR(VEN_IOCTLBASE_ENC, 49, struct venc_ioctl_msg)
458 
459 /*IOCTL params:SET: InputData - NULL, OutputData - NULL.*/
460 #define VEN_IOCTL_SET_SLICE_DELIVERY_MODE \
461 	_IO(VEN_IOCTLBASE_ENC, 50)
462 
463 /*IOCTL params:SET: InputData - unsigned int, OutputData - NULL*/
464 #define VEN_IOCTL_SET_SPS_PPS_FOR_IDR \
465 	_IOW(VEN_IOCTLBASE_ENC, 51, struct venc_ioctl_msg)
466 
467 /*IOCTL params:SET: InputData - NULL, OutputData - NULL.*/
468 #define VEN_IOCTL_SET_VUI_BITSTREAM_RESTRICT_FLAG \
469 	_IO(VEN_IOCTLBASE_ENC, 52)
470 
471 struct venc_switch{
472 	unsigned char	status;
473 };
474 
475 struct venc_allocatorproperty{
476 	unsigned long	 mincount;
477 	unsigned long	 maxcount;
478 	unsigned long	 actualcount;
479 	unsigned long	 datasize;
480 	unsigned long	 suffixsize;
481 	unsigned long	 alignment;
482 	unsigned long	 bufpoolid;
483 };
484 
485 struct venc_bufferpayload{
486 	unsigned char *pbuffer;
487 	size_t	sz;
488 	int	fd;
489 	unsigned int	offset;
490 	unsigned int	maped_size;
491 	unsigned long	filled_len;
492 };
493 
494 struct venc_buffer{
495  unsigned char *ptrbuffer;
496  unsigned long	sz;
497  unsigned long	len;
498  unsigned long	offset;
499  long long	timestamp;
500  unsigned long	flags;
501  void	*clientdata;
502 };
503 
504 struct venc_basecfg{
505 	unsigned long	input_width;
506 	unsigned long	input_height;
507 	unsigned long	dvs_width;
508 	unsigned long	dvs_height;
509 	unsigned long	codectype;
510 	unsigned long	fps_num;
511 	unsigned long	fps_den;
512 	unsigned long	targetbitrate;
513 	unsigned long	inputformat;
514 };
515 
516 struct venc_profile{
517 	unsigned long	profile;
518 };
519 struct ven_profilelevel{
520 	unsigned long	level;
521 };
522 
523 struct venc_sessionqp{
524 	unsigned long	iframeqp;
525 	unsigned long	pframqp;
526 };
527 
528 struct venc_qprange{
529 	unsigned long	maxqp;
530 	unsigned long	minqp;
531 };
532 struct venc_intraperiod{
533 	unsigned long	num_pframes;
534 	unsigned long	num_bframes;
535 };
536 struct venc_seqheader{
537 	unsigned char *hdrbufptr;
538 	unsigned long	bufsize;
539 	unsigned long	hdrlen;
540 };
541 
542 struct venc_capability{
543 	unsigned long	codec_types;
544 	unsigned long	maxframe_width;
545 	unsigned long	maxframe_height;
546 	unsigned long	maxtarget_bitrate;
547 	unsigned long	maxframe_rate;
548 	unsigned long	input_formats;
549 	unsigned char	dvs;
550 };
551 
552 struct venc_entropycfg{
553 	unsigned longentropysel;
554 	unsigned long	cabacmodel;
555 };
556 
557 struct venc_dbcfg{
558 	unsigned long	db_mode;
559 	unsigned long	slicealpha_offset;
560 	unsigned long	slicebeta_offset;
561 };
562 
563 struct venc_intrarefresh{
564 	unsigned long	irmode;
565 	unsigned long	mbcount;
566 };
567 
568 struct venc_multiclicecfg{
569 	unsigned long	mslice_mode;
570 	unsigned long	mslice_size;
571 };
572 
573 struct venc_bufferflush{
574 	unsigned long	flush_mode;
575 };
576 
577 struct venc_ratectrlcfg{
578 	unsigned long	rcmode;
579 };
580 
581 struct	venc_voptimingcfg{
582 	unsigned long	voptime_resolution;
583 };
584 struct venc_framerate{
585 	unsigned long	fps_denominator;
586 	unsigned long	fps_numerator;
587 };
588 
589 struct venc_targetbitrate{
590 	unsigned long	target_bitrate;
591 };
592 
593 
594 struct venc_rotation{
595 	unsigned long	rotation;
596 };
597 
598 struct venc_timeout{
599 	 unsigned long	millisec;
600 };
601 
602 struct venc_headerextension{
603 	 unsigned long	header_extension;
604 };
605 
606 struct venc_msg{
607 	unsigned long	statuscode;
608 	unsigned long	msgcode;
609 	struct venc_buffer	buf;
610 	unsigned long	msgdata_size;
611 };
612 
613 struct venc_recon_addr{
614 	unsigned char *pbuffer;
615 	unsigned long buffer_size;
616 	unsigned long pmem_fd;
617 	unsigned long offset;
618 };
619 
620 struct venc_recon_buff_size{
621 	int width;
622 	int height;
623 	int size;
624 	int alignment;
625 };
626 
627 #endif /* _MSM_VIDC_ENC_H_ */
628