blob: dbccae5de940a697c5c4bf82fcc6326328ea93c4 [file] [log] [blame]
Hamsalekha S8d3d3032015-03-13 21:24:58 +05301/******************************************************************************
2 *
3 * Copyright (C) 2015 The Android Open Source Project
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at:
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 *
17 *****************************************************************************
18 * Originally developed and contributed by Ittiam Systems Pvt. Ltd, Bangalore
19*/
20/**
21*******************************************************************************
22* @file
23* iv.h
24*
25* @brief
26* This file contains all the necessary structure and enumeration
27* definitions needed for the Application Program Interface(API) of the
28* Ittiam Video and Image codecs
29*
30* @author
31* 100239(RCY)
32*
33* @par List of Functions:
34*
35* @remarks
36* None
37*
38*******************************************************************************
39*/
40
41
42#ifndef _IV_H
43#define _IV_H
44
45/*****************************************************************************/
46/* Constant Macros */
47/*****************************************************************************/
48
49
50/*****************************************************************************/
51/* Typedefs */
52/*****************************************************************************/
53
54/*****************************************************************************/
55/* Enums */
56/*****************************************************************************/
57
58
59/* IV_API_CALL_STATUS_T:This is only to return the FAIL/PASS status to the */
60/* application for the current API call */
61
62typedef enum {
63 IV_STATUS_NA = 0x7FFFFFFF,
64 IV_SUCCESS = 0x0,
65 IV_FAIL = 0x1,
66}IV_API_CALL_STATUS_T;
67
Hamsalekha S8d3d3032015-03-13 21:24:58 +053068
69/* IV_COLOR_FORMAT_T: This enumeration lists all the color formats which */
70/* finds usage in video/image codecs */
71
72typedef enum {
73 IV_CHROMA_NA = 0x7FFFFFFF,
74 IV_YUV_420P = 0x1,
75 IV_YUV_422P = 0x2,
76 IV_420_UV_INTL = 0x3,
77 IV_YUV_422IBE = 0x4,
78 IV_YUV_422ILE = 0x5,
79 IV_YUV_444P = 0x6,
80 IV_YUV_411P = 0x7,
81 IV_GRAY = 0x8,
82 IV_RGB_565 = 0x9,
83 IV_RGB_24 = 0xa,
84 IV_YUV_420SP_UV = 0xb,
85 IV_YUV_420SP_VU = 0xc,
86 IV_RGBA_8888 = 0xd
87}IV_COLOR_FORMAT_T;
88
89/* IV_PICTURE_CODING_TYPE_T: VOP/Frame coding type Enumeration */
90
91typedef enum {
92 IV_NA_FRAME = 0x7FFFFFFF,
93 IV_I_FRAME = 0x0,
94 IV_P_FRAME = 0x1,
95 IV_B_FRAME = 0x2,
96 IV_IDR_FRAME = 0x3,
97 IV_II_FRAME = 0x4,
98 IV_IP_FRAME = 0x5,
99 IV_IB_FRAME = 0x6,
100 IV_PI_FRAME = 0x7,
101 IV_PP_FRAME = 0x8,
102 IV_PB_FRAME = 0x9,
103 IV_BI_FRAME = 0xa,
104 IV_BP_FRAME = 0xb,
105 IV_BB_FRAME = 0xc,
106 IV_MBAFF_I_FRAME = 0xd,
107 IV_MBAFF_P_FRAME = 0xe,
108 IV_MBAFF_B_FRAME = 0xf,
109 IV_MBAFF_IDR_FRAME = 0x10,
110 IV_NOT_CODED_FRAME = 0x11,
111 IV_FRAMETYPE_DEFAULT = IV_I_FRAME
112}IV_PICTURE_CODING_TYPE_T;
113
114/* IV_FLD_TYPE_T: field type Enumeration */
115
116typedef enum {
117 IV_NA_FLD = 0x7FFFFFFF,
118 IV_TOP_FLD = 0x0,
119 IV_BOT_FLD = 0x1,
120 IV_FLD_TYPE_DEFAULT = IV_TOP_FLD
121}IV_FLD_TYPE_T;
122
123/* IV_CONTENT_TYPE_T: Video content type */
124
125typedef enum {
126 IV_CONTENTTYPE_NA = 0x7FFFFFFF,
127 IV_PROGRESSIVE = 0x0,
128 IV_INTERLACED = 0x1,
129 IV_PROGRESSIVE_FRAME = 0x2,
130 IV_INTERLACED_FRAME = 0x3,
131 IV_INTERLACED_TOPFIELD = 0x4,
132 IV_INTERLACED_BOTTOMFIELD = 0x5,
133 IV_CONTENTTYPE_DEFAULT = IV_PROGRESSIVE,
134}IV_CONTENT_TYPE_T;
135
136/* IV_API_COMMAND_TYPE_T:API command type */
137typedef enum {
138 IV_CMD_NA = 0x7FFFFFFF,
Hamsalekha S8d3d3032015-03-13 21:24:58 +0530139 IV_CMD_DUMMY_ELEMENT = 0x4,
140}IV_API_COMMAND_TYPE_T;
141
142/*****************************************************************************/
143/* Structure */
144/*****************************************************************************/
145
146/* IV_OBJ_T: This structure defines the handle for the codec instance */
147
148typedef struct {
149 /**
150 * u4_size of the structure
151 */
152 UWORD32 u4_size;
153
154 /**
155 * Pointer to the API function pointer table of the codec
156 */
157 void *pv_fxns;
158
159 /**
160 * Pointer to the handle of the codec
161 */
162 void *pv_codec_handle;
163}iv_obj_t;
164
Hamsalekha S8d3d3032015-03-13 21:24:58 +0530165
166/* IV_YUV_BUF_T: This structure defines attributes for the yuv buffer */
167
168typedef struct {
169 /**
170 * u4_size of the structure
171 */
172 UWORD32 u4_size;
173
174 /**
175 * Pointer to Luma (Y) Buffer
176 */
177
178 void *pv_y_buf;
179 /**
180 * Pointer to Chroma (Cb) Buffer
181 */
182 void *pv_u_buf;
183
184 /**
185 * Pointer to Chroma (Cr) Buffer
186 */
187 void *pv_v_buf;
188
189 /**
190 * Width of the Luma (Y) Buffer
191 */
192 UWORD32 u4_y_wd;
193
194 /**
195 * Height of the Luma (Y) Buffer
196 */
197 UWORD32 u4_y_ht;
198
199 /**
200 * Stride/Pitch of the Luma (Y) Buffer
201 */
202 UWORD32 u4_y_strd;
203
204 /**
205 * Width of the Chroma (Cb) Buffer
206 */
207 UWORD32 u4_u_wd;
208
209 /**
210 * Height of the Chroma (Cb) Buffer
211 */
212 UWORD32 u4_u_ht;
213
214 /**
215 * Stride/Pitch of the Chroma (Cb) Buffer
216 */
217 UWORD32 u4_u_strd;
218
219 /**
220 * Width of the Chroma (Cr) Buffer
221 */
222 UWORD32 u4_v_wd;
223
224 /**
225 * Height of the Chroma (Cr) Buffer
226 */
227 UWORD32 u4_v_ht;
228
229 /**
230 * Stride/Pitch of the Chroma (Cr) Buffer
231 */
232 UWORD32 u4_v_strd;
233}iv_yuv_buf_t;
234
Hamsalekha S8d3d3032015-03-13 21:24:58 +0530235
236
237#endif /* _IV_H */
238