blob: 484d08f5cc93126bc1fb86ce11966c7fd9502ce9 [file] [log] [blame]
Vinay Kaliab5598742011-12-21 16:52:33 -08001/* Copyright (c) 2010-2012, Code Aurora Forum. All rights reserved.
2 *
3 * This program is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License version 2 and
5 * only version 2 as published by the Free Software Foundation.
6 *
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
11 *
12 */
13#ifndef _VCD_DRIVER_PROPERTY_H_
14#define _VCD_DRIVER_PROPERTY_H_
15
16#define VCD_START_BASE 0x0
17#define VCD_I_LIVE (VCD_START_BASE + 0x1)
18#define VCD_I_CODEC (VCD_START_BASE + 0x2)
19#define VCD_I_FRAME_SIZE (VCD_START_BASE + 0x3)
20#define VCD_I_METADATA_ENABLE (VCD_START_BASE + 0x4)
21#define VCD_I_METADATA_HEADER (VCD_START_BASE + 0x5)
22#define VCD_I_PROFILE (VCD_START_BASE + 0x6)
23#define VCD_I_LEVEL (VCD_START_BASE + 0x7)
24#define VCD_I_BUFFER_FORMAT (VCD_START_BASE + 0x8)
25#define VCD_I_FRAME_RATE (VCD_START_BASE + 0x9)
26#define VCD_I_TARGET_BITRATE (VCD_START_BASE + 0xA)
27#define VCD_I_MULTI_SLICE (VCD_START_BASE + 0xB)
28#define VCD_I_ENTROPY_CTRL (VCD_START_BASE + 0xC)
29#define VCD_I_DEBLOCKING (VCD_START_BASE + 0xD)
30#define VCD_I_RATE_CONTROL (VCD_START_BASE + 0xE)
31#define VCD_I_QP_RANGE (VCD_START_BASE + 0xF)
32#define VCD_I_SESSION_QP (VCD_START_BASE + 0x10)
33#define VCD_I_INTRA_PERIOD (VCD_START_BASE + 0x11)
34#define VCD_I_VOP_TIMING (VCD_START_BASE + 0x12)
35#define VCD_I_SHORT_HEADER (VCD_START_BASE + 0x13)
36#define VCD_I_SEQ_HEADER (VCD_START_BASE + 0x14)
37#define VCD_I_HEADER_EXTENSION (VCD_START_BASE + 0x15)
38#define VCD_I_INTRA_REFRESH (VCD_START_BASE + 0x16)
39#define VCD_I_POST_FILTER (VCD_START_BASE + 0x17)
40#define VCD_I_PROGRESSIVE_ONLY (VCD_START_BASE + 0x18)
41#define VCD_I_OUTPUT_ORDER (VCD_START_BASE + 0x19)
42#define VCD_I_RECON_BUFFERS (VCD_START_BASE + 0x1A)
43#define VCD_I_FREE_RECON_BUFFERS (VCD_START_BASE + 0x1B)
44#define VCD_I_GET_RECON_BUFFER_SIZE (VCD_START_BASE + 0x1C)
45#define VCD_I_H264_MV_BUFFER (VCD_START_BASE + 0x1D)
46#define VCD_I_FREE_H264_MV_BUFFER (VCD_START_BASE + 0x1E)
47#define VCD_I_GET_H264_MV_SIZE (VCD_START_BASE + 0x1F)
48#define VCD_I_DEC_PICTYPE (VCD_START_BASE + 0x20)
49#define VCD_I_CONT_ON_RECONFIG (VCD_START_BASE + 0x21)
50#define VCD_I_META_BUFFER_MODE (VCD_START_BASE + 0x22)
51#define VCD_I_DISABLE_DMX (VCD_START_BASE + 0x23)
52#define VCD_I_DISABLE_DMX_SUPPORT (VCD_START_BASE + 0x24)
Arun Menon4093ccc2012-03-09 12:19:22 -080053#define VCD_I_ENABLE_SPS_PPS_FOR_IDR (VCD_START_BASE + 0x25)
Vinay Kalia700f5c22012-03-28 17:35:28 -070054#define VCD_REQ_PERF_LEVEL (VCD_START_BASE + 0x26)
Pradnya Chaphekarcd681bf2012-02-18 23:05:56 -080055#define VCD_I_SLICE_DELIVERY_MODE (VCD_START_BASE + 0x27)
Deva Ramasubramanian4947d8c2012-04-03 12:41:06 -070056#define VCD_I_VOP_TIMING_CONSTANT_DELTA (VCD_START_BASE + 0x28)
Arun Menon152c3c72012-06-20 11:50:08 -070057#define VCD_I_SET_TURBO_CLK (VCD_START_BASE + 0x29)
Vinay Kaliab5598742011-12-21 16:52:33 -080058
59#define VCD_START_REQ (VCD_START_BASE + 0x1000)
60#define VCD_I_REQ_IFRAME (VCD_START_REQ + 0x1)
61
62#define VCD_I_RESERVED_BASE (VCD_START_BASE + 0x10000)
63
64struct vcd_property_hdr {
65 u32 prop_id;
66 size_t sz;
67};
68
69struct vcd_property_live {
70 u32 live;
71};
72
73enum vcd_codec {
74 VCD_CODEC_H264 = 0x1,
75 VCD_CODEC_H263 = 0x2,
76 VCD_CODEC_MPEG1 = 0x3,
77 VCD_CODEC_MPEG2 = 0x4,
78 VCD_CODEC_MPEG4 = 0x5,
79 VCD_CODEC_DIVX_3 = 0x6,
80 VCD_CODEC_DIVX_4 = 0x7,
81 VCD_CODEC_DIVX_5 = 0x8,
82 VCD_CODEC_DIVX_6 = 0x9,
83 VCD_CODEC_XVID = 0xA,
84 VCD_CODEC_VC1 = 0xB,
85 VCD_CODEC_VC1_RCV = 0xC
86};
87
88struct vcd_property_codec {
89 enum vcd_codec codec;
90};
91
92struct vcd_property_frame_size {
93 u32 width;
94 u32 height;
95 u32 stride;
96 u32 scan_lines;
97};
98
Vinay Kalia700f5c22012-03-28 17:35:28 -070099enum vcd_perf_level {
100 VCD_PERF_LEVEL0,
101 VCD_PERF_LEVEL1,
102 VCD_PERF_LEVEL2,
Deva Ramasubramanian837ae362012-05-12 23:26:53 -0700103 VCD_PERF_LEVEL_TURBO,
Vinay Kalia700f5c22012-03-28 17:35:28 -0700104};
Vinay Kaliab5598742011-12-21 16:52:33 -0800105
106#define VCD_METADATA_DATANONE 0x001
107#define VCD_METADATA_QCOMFILLER 0x002
108#define VCD_METADATA_QPARRAY 0x004
109#define VCD_METADATA_CONCEALMB 0x008
110#define VCD_METADATA_SEI 0x010
111#define VCD_METADATA_VUI 0x020
112#define VCD_METADATA_VC1 0x040
113#define VCD_METADATA_PASSTHROUGH 0x080
114#define VCD_METADATA_ENC_SLICE 0x100
115
Shobhit Pandey833942e2012-08-01 14:02:20 +0530116#define VCD_METADATA_EXT_DATA 0x0800
117#define VCD_METADATA_USER_DATA 0x1000
118
Vinay Kaliab5598742011-12-21 16:52:33 -0800119struct vcd_property_meta_data_enable {
120 u32 meta_data_enable_flag;
121};
122
123struct vcd_property_metadata_hdr {
124 u32 meta_data_id;
125 u32 version;
126 u32 port_index;
127 u32 type;
128};
129
130struct vcd_property_frame_rate {
131 u32 fps_denominator;
132 u32 fps_numerator;
133};
134
135struct vcd_property_target_bitrate {
136 u32 target_bitrate;
137};
138
Vinay Kalia700f5c22012-03-28 17:35:28 -0700139struct vcd_property_perf_level {
140 enum vcd_perf_level level;
141};
142
Vinay Kaliab5598742011-12-21 16:52:33 -0800143enum vcd_yuv_buffer_format {
144 VCD_BUFFER_FORMAT_NV12 = 0x1,
145 VCD_BUFFER_FORMAT_TILE_4x2 = 0x2,
146 VCD_BUFFER_FORMAT_NV12_16M2KA = 0x3,
147 VCD_BUFFER_FORMAT_TILE_1x1 = 0x4
148};
149
150struct vcd_property_buffer_format {
151 enum vcd_yuv_buffer_format buffer_format;
152};
153
154struct vcd_property_post_filter {
155 u32 post_filter;
156};
157
158enum vcd_codec_profile {
159 VCD_PROFILE_UNKNOWN = 0x0,
160 VCD_PROFILE_MPEG4_SP = 0x1,
161 VCD_PROFILE_MPEG4_ASP = 0x2,
162 VCD_PROFILE_H264_BASELINE = 0x3,
163 VCD_PROFILE_H264_MAIN = 0x4,
164 VCD_PROFILE_H264_HIGH = 0x5,
165 VCD_PROFILE_H263_BASELINE = 0x6,
166 VCD_PROFILE_VC1_SIMPLE = 0x7,
167 VCD_PROFILE_VC1_MAIN = 0x8,
168 VCD_PROFILE_VC1_ADVANCE = 0x9,
169 VCD_PROFILE_MPEG2_MAIN = 0xA,
170 VCD_PROFILE_MPEG2_SIMPLE = 0xB
171};
172
173struct vcd_property_profile {
174 enum vcd_codec_profile profile;
175};
176
177enum vcd_codec_level {
178 VCD_LEVEL_UNKNOWN = 0x0,
179 VCD_LEVEL_MPEG4_0 = 0x1,
180 VCD_LEVEL_MPEG4_0b = 0x2,
181 VCD_LEVEL_MPEG4_1 = 0x3,
182 VCD_LEVEL_MPEG4_2 = 0x4,
183 VCD_LEVEL_MPEG4_3 = 0x5,
184 VCD_LEVEL_MPEG4_3b = 0x6,
185 VCD_LEVEL_MPEG4_4 = 0x7,
186 VCD_LEVEL_MPEG4_4a = 0x8,
187 VCD_LEVEL_MPEG4_5 = 0x9,
188 VCD_LEVEL_MPEG4_6 = 0xA,
189 VCD_LEVEL_MPEG4_7 = 0xB,
190 VCD_LEVEL_MPEG4_X = 0xC,
191 VCD_LEVEL_H264_1 = 0x10,
192 VCD_LEVEL_H264_1b = 0x11,
193 VCD_LEVEL_H264_1p1 = 0x12,
194 VCD_LEVEL_H264_1p2 = 0x13,
195 VCD_LEVEL_H264_1p3 = 0x14,
196 VCD_LEVEL_H264_2 = 0x15,
197 VCD_LEVEL_H264_2p1 = 0x16,
198 VCD_LEVEL_H264_2p2 = 0x17,
199 VCD_LEVEL_H264_3 = 0x18,
200 VCD_LEVEL_H264_3p1 = 0x19,
201 VCD_LEVEL_H264_3p2 = 0x1A,
202 VCD_LEVEL_H264_4 = 0x1B,
203 VCD_LEVEL_H264_4p1 = 0x1C,
204 VCD_LEVEL_H264_4p2 = 0x1D,
205 VCD_LEVEL_H264_5 = 0x1E,
206 VCD_LEVEL_H264_5p1 = 0x1F,
207 VCD_LEVEL_H263_10 = 0x20,
208 VCD_LEVEL_H263_20 = 0x21,
209 VCD_LEVEL_H263_30 = 0x22,
210 VCD_LEVEL_H263_40 = 0x23,
211 VCD_LEVEL_H263_45 = 0x24,
212 VCD_LEVEL_H263_50 = 0x25,
213 VCD_LEVEL_H263_60 = 0x26,
214 VCD_LEVEL_H263_70 = 0x27,
215 VCD_LEVEL_H263_X = 0x28,
216 VCD_LEVEL_MPEG2_LOW = 0x30,
217 VCD_LEVEL_MPEG2_MAIN = 0x31,
218 VCD_LEVEL_MPEG2_HIGH_14 = 0x32,
219 VCD_LEVEL_MPEG2_HIGH = 0x33,
220 VCD_LEVEL_MPEG2_X = 0x34,
221 VCD_LEVEL_VC1_S_LOW = 0x40,
222 VCD_LEVEL_VC1_S_MEDIUM = 0x41,
223 VCD_LEVEL_VC1_M_LOW = 0x42,
224 VCD_LEVEL_VC1_M_MEDIUM = 0x43,
225 VCD_LEVEL_VC1_M_HIGH = 0x44,
226 VCD_LEVEL_VC1_A_0 = 0x45,
227 VCD_LEVEL_VC1_A_1 = 0x46,
228 VCD_LEVEL_VC1_A_2 = 0x47,
229 VCD_LEVEL_VC1_A_3 = 0x48,
230 VCD_LEVEL_VC1_A_4 = 0x49,
231 VCD_LEVEL_VC1_X = 0x4A
232};
233
234struct vcd_property_level {
235 enum vcd_codec_level level;
236};
237
238enum vcd_m_slice_sel {
239 VCD_MSLICE_OFF = 0x1,
240 VCD_MSLICE_BY_MB_COUNT = 0x2,
241 VCD_MSLICE_BY_BYTE_COUNT = 0x3,
242 VCD_MSLICE_BY_GOB = 0x4
243};
244
245struct vcd_property_multi_slice {
246 enum vcd_m_slice_sel m_slice_sel;
247 u32 m_slice_size;
248};
249
250enum vcd_entropy_sel {
251 VCD_ENTROPY_SEL_CAVLC = 0x1,
252 VCD_ENTROPY_SEL_CABAC = 0x2
253};
254
255enum vcd_cabac_model {
256 VCD_CABAC_MODEL_NUMBER_0 = 0x1,
257 VCD_CABAC_MODEL_NUMBER_1 = 0x2,
258 VCD_CABAC_MODEL_NUMBER_2 = 0x3
259};
260
261struct vcd_property_entropy_control {
262 enum vcd_entropy_sel entropy_sel;
263 enum vcd_cabac_model cabac_model;
264};
265
266enum vcd_db_config {
267 VCD_DB_ALL_BLOCKING_BOUNDARY = 0x1,
268 VCD_DB_DISABLE = 0x2,
269 VCD_DB_SKIP_SLICE_BOUNDARY = 0x3
270};
271struct vcd_property_db_config {
272 enum vcd_db_config db_config;
273 u32 slice_alpha_offset;
274 u32 slice_beta_offset;
275};
276
277enum vcd_rate_control {
278 VCD_RATE_CONTROL_OFF = 0x1,
279 VCD_RATE_CONTROL_VBR_VFR = 0x2,
280 VCD_RATE_CONTROL_VBR_CFR = 0x3,
281 VCD_RATE_CONTROL_CBR_VFR = 0x4,
282 VCD_RATE_CONTROL_CBR_CFR = 0x5
283};
284
285struct vcd_property_rate_control {
286 enum vcd_rate_control rate_control;
287};
288
289struct vcd_property_qp_range {
290 u32 max_qp;
291 u32 min_qp;
292};
293
294struct vcd_property_session_qp {
295 u32 i_frame_qp;
296 u32 p_frame_qp;
297 u32 b_frame_qp;
298};
299
300struct vcd_property_i_period {
301 u32 p_frames;
302 u32 b_frames;
303};
304
305struct vcd_property_vop_timing {
306 u32 vop_time_resolution;
307};
308
Deva Ramasubramanian4947d8c2012-04-03 12:41:06 -0700309struct vcd_property_vop_timing_constant_delta {
310 u32 constant_delta; /*In usecs */
311};
312
Vinay Kaliab5598742011-12-21 16:52:33 -0800313struct vcd_property_short_header {
314 u32 short_header;
315};
316
317struct vcd_property_intra_refresh_mb_number {
318 u32 cir_mb_number;
319};
320
321struct vcd_property_req_i_frame {
322 u32 req_i_frame;
323};
324
325struct vcd_frame_rect {
326 u32 left;
327 u32 top;
328 u32 right;
329 u32 bottom;
330};
331
332struct vcd_property_dec_output_buffer {
333 struct vcd_frame_rect disp_frm;
334 struct vcd_property_frame_size frm_size;
335};
336
337enum vcd_output_order {
338 VCD_DEC_ORDER_DISPLAY = 0x0,
339 VCD_DEC_ORDER_DECODE = 0x1
340};
341
342struct vcd_property_enc_recon_buffer {
343 u8 *user_virtual_addr;
344 u8 *kernel_virtual_addr;
345 u8 *physical_addr;
346 u8 *dev_addr;
347 u32 buffer_size;
348 u32 ysize;
349 int pmem_fd;
350 u32 offset;
351 void *client_data;
352};
353
354struct vcd_property_h264_mv_buffer {
355 u8 *kernel_virtual_addr;
356 u8 *physical_addr;
357 u32 size;
358 u32 count;
359 int pmem_fd;
360 u32 offset;
361 u8 *dev_addr;
362 void *client_data;
363};
364
365struct vcd_property_buffer_size {
366 int width;
367 int height;
368 int size;
369 int alignment;
370};
371
Arun Menon4093ccc2012-03-09 12:19:22 -0800372struct vcd_property_sps_pps_for_idr_enable {
373 u32 sps_pps_for_idr_enable_flag;
374};
375
Vinay Kaliab5598742011-12-21 16:52:33 -0800376#endif