PageRenderTime 19ms CodeModel.GetById 7ms app.highlight 8ms RepoModel.GetById 0ms app.codeStats 0ms

/include/linux/msm_vidc_enc.h

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