1 /****************************************************************************** 2 * 3 * Copyright (C) 2012 Ittiam Systems Pvt Ltd, Bangalore 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 /** 19 ******************************************************************************* 20 * @file 21 * iv.h 22 * 23 * @brief 24 * This file contains all the necessary structure and enumeration 25 * definitions needed for the Application Program Interface(API) of the 26 * Ittiam Video and Image codecs 27 * 28 * @author 29 * 100239(RCY) 30 * 31 * @par List of Functions: 32 * 33 * @remarks 34 * None 35 * 36 ******************************************************************************* 37 */ 38 39 40 #ifndef _IV_H 41 #define _IV_H 42 43 /*****************************************************************************/ 44 /* Constant Macros */ 45 /*****************************************************************************/ 46 47 48 /*****************************************************************************/ 49 /* Typedefs */ 50 /*****************************************************************************/ 51 52 /*****************************************************************************/ 53 /* Enums */ 54 /*****************************************************************************/ 55 56 57 /* IV_API_CALL_STATUS_T:This is only to return the FAIL/PASS status to the */ 58 /* application for the current API call */ 59 60 typedef enum { 61 IV_STATUS_NA = 0x7FFFFFFF, 62 IV_SUCCESS = 0x0, 63 IV_FAIL = 0x1, 64 }IV_API_CALL_STATUS_T; 65 66 67 /* IV_COLOR_FORMAT_T: This enumeration lists all the color formats which */ 68 /* finds usage in video/image codecs */ 69 70 typedef enum { 71 IV_CHROMA_NA = 0x7FFFFFFF, 72 IV_YUV_420P = 0x1, 73 IV_YUV_422P = 0x2, 74 IV_420_UV_INTL = 0x3, 75 IV_YUV_422IBE = 0x4, 76 IV_YUV_422ILE = 0x5, 77 IV_YUV_444P = 0x6, 78 IV_YUV_411P = 0x7, 79 IV_GRAY = 0x8, 80 IV_RGB_565 = 0x9, 81 IV_RGB_24 = 0xa, 82 IV_YUV_420SP_UV = 0xb, 83 IV_YUV_420SP_VU = 0xc, 84 IV_RGBA_8888 = 0xd 85 }IV_COLOR_FORMAT_T; 86 87 /* IV_PICTURE_CODING_TYPE_T: VOP/Frame coding type Enumeration */ 88 89 typedef enum { 90 IV_NA_FRAME = 0x7FFFFFFF, 91 IV_I_FRAME = 0x0, 92 IV_P_FRAME = 0x1, 93 IV_B_FRAME = 0x2, 94 IV_IDR_FRAME = 0x3, 95 IV_II_FRAME = 0x4, 96 IV_IP_FRAME = 0x5, 97 IV_IB_FRAME = 0x6, 98 IV_PI_FRAME = 0x7, 99 IV_PP_FRAME = 0x8, 100 IV_PB_FRAME = 0x9, 101 IV_BI_FRAME = 0xa, 102 IV_BP_FRAME = 0xb, 103 IV_BB_FRAME = 0xc, 104 IV_MBAFF_I_FRAME = 0xd, 105 IV_MBAFF_P_FRAME = 0xe, 106 IV_MBAFF_B_FRAME = 0xf, 107 IV_MBAFF_IDR_FRAME = 0x10, 108 IV_NOT_CODED_FRAME = 0x11, 109 IV_FRAMETYPE_DEFAULT = IV_I_FRAME 110 }IV_PICTURE_CODING_TYPE_T; 111 112 /* IV_FLD_TYPE_T: field type Enumeration */ 113 114 typedef enum { 115 IV_NA_FLD = 0x7FFFFFFF, 116 IV_TOP_FLD = 0x0, 117 IV_BOT_FLD = 0x1, 118 IV_FLD_TYPE_DEFAULT = IV_TOP_FLD 119 }IV_FLD_TYPE_T; 120 121 /* IV_CONTENT_TYPE_T: Video content type */ 122 123 typedef enum { 124 IV_CONTENTTYPE_NA = 0x7FFFFFFF, 125 IV_PROGRESSIVE = 0x0, 126 IV_INTERLACED = 0x1, 127 IV_PROGRESSIVE_FRAME = 0x2, 128 IV_INTERLACED_FRAME = 0x3, 129 IV_INTERLACED_TOPFIELD = 0x4, 130 IV_INTERLACED_BOTTOMFIELD = 0x5, 131 IV_CONTENTTYPE_DEFAULT = IV_PROGRESSIVE, 132 }IV_CONTENT_TYPE_T; 133 134 /* IV_API_COMMAND_TYPE_T:API command type */ 135 typedef enum { 136 IV_CMD_NA = 0x7FFFFFFF, 137 IV_CMD_DUMMY_ELEMENT = 0x4, 138 }IV_API_COMMAND_TYPE_T; 139 140 /*****************************************************************************/ 141 /* Structure */ 142 /*****************************************************************************/ 143 144 /* IV_OBJ_T: This structure defines the handle for the codec instance */ 145 146 typedef struct { 147 /** 148 * u4_size of the structure 149 */ 150 UWORD32 u4_size; 151 152 /** 153 * Pointer to the API function pointer table of the codec 154 */ 155 void *pv_fxns; 156 157 /** 158 * Pointer to the handle of the codec 159 */ 160 void *pv_codec_handle; 161 }iv_obj_t; 162 163 164 /* IV_YUV_BUF_T: This structure defines attributes for the yuv buffer */ 165 166 typedef struct { 167 /** 168 * u4_size of the structure 169 */ 170 UWORD32 u4_size; 171 172 /** 173 * Pointer to Luma (Y) Buffer 174 */ 175 176 void *pv_y_buf; 177 /** 178 * Pointer to Chroma (Cb) Buffer 179 */ 180 void *pv_u_buf; 181 182 /** 183 * Pointer to Chroma (Cr) Buffer 184 */ 185 void *pv_v_buf; 186 187 /** 188 * Width of the Luma (Y) Buffer 189 */ 190 UWORD32 u4_y_wd; 191 192 /** 193 * Height of the Luma (Y) Buffer 194 */ 195 UWORD32 u4_y_ht; 196 197 /** 198 * Stride/Pitch of the Luma (Y) Buffer 199 */ 200 UWORD32 u4_y_strd; 201 202 /** 203 * Width of the Chroma (Cb) Buffer 204 */ 205 UWORD32 u4_u_wd; 206 207 /** 208 * Height of the Chroma (Cb) Buffer 209 */ 210 UWORD32 u4_u_ht; 211 212 /** 213 * Stride/Pitch of the Chroma (Cb) Buffer 214 */ 215 UWORD32 u4_u_strd; 216 217 /** 218 * Width of the Chroma (Cr) Buffer 219 */ 220 UWORD32 u4_v_wd; 221 222 /** 223 * Height of the Chroma (Cr) Buffer 224 */ 225 UWORD32 u4_v_ht; 226 227 /** 228 * Stride/Pitch of the Chroma (Cr) Buffer 229 */ 230 UWORD32 u4_v_strd; 231 }iv_yuv_buf_t; 232 233 234 235 #endif /* _IV_H */ 236 237