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