Home | History | Annotate | Download | only in api
      1 /**
      2  * File: omxtypes.h
      3  * Brief: Defines basic Data types used in OpenMAX v1.0.2 header files.
      4  *
      5  * Copyright  2005-2008 The Khronos Group Inc. All Rights Reserved.
      6  *
      7  * These materials are protected by copyright laws and contain material
      8  * proprietary to the Khronos Group, Inc.  You may use these materials
      9  * for implementing Khronos specifications, without altering or removing
     10  * any trademark, copyright or other notice from the specification.
     11  *
     12  * Khronos Group makes no, and expressly disclaims any, representations
     13  * or warranties, express or implied, regarding these materials, including,
     14  * without limitation, any implied warranties of merchantability or fitness
     15  * for a particular purpose or non-infringement of any intellectual property.
     16  * Khronos Group makes no, and expressly disclaims any, warranties, express
     17  * or implied, regarding the correctness, accuracy, completeness, timeliness,
     18  * and reliability of these materials.
     19  *
     20  * Under no circumstances will the Khronos Group, or any of its Promoters,
     21  * Contributors or Members or their respective partners, officers, directors,
     22  * employees, agents or representatives be liable for any damages, whether
     23  * direct, indirect, special or consequential damages for lost revenues,
     24  * lost profits, or otherwise, arising from or in connection with these
     25  * materials.
     26  *
     27  * Khronos and OpenMAX are trademarks of the Khronos Group Inc.
     28  *
     29  */
     30 
     31 #ifndef _OMXTYPES_H_
     32 #define _OMXTYPES_H_
     33 
     34 #include <limits.h>
     35 
     36 #ifdef __cplusplus
     37 extern "C" {
     38 #endif
     39 
     40 /*
     41  * Maximum FFT order supported by the twiddle table.  Only used by the
     42  * float FFT routines. Must be consistent with the table in
     43  * armSP_FFT_F32TwiddleTable.c.
     44  */
     45 #ifdef BIG_FFT_TABLE
     46 #define TWIDDLE_TABLE_ORDER 15
     47 #else
     48 #define TWIDDLE_TABLE_ORDER 12
     49 #endif
     50 
     51 #define OMX_IN
     52 #define OMX_OUT
     53 #define OMX_INOUT
     54 
     55 
     56 typedef enum {
     57 
     58     /* Mandatory return codes - use cases are explicitly described for each function */
     59     OMX_Sts_NoErr                    =  0,    /* No error, the function completed successfully */
     60     OMX_Sts_Err                      = -2,    /* Unknown/unspecified error */
     61     OMX_Sts_InvalidBitstreamValErr   = -182,  /* Invalid value detected during bitstream processing */
     62     OMX_Sts_MemAllocErr              = -9,    /* Not enough memory allocated for the operation */
     63     OMX_StsACAAC_GainCtrErr    	     = -159,  /* AAC: Unsupported gain control data detected */
     64     OMX_StsACAAC_PrgNumErr           = -167,  /* AAC: Invalid number of elements for one program   */
     65     OMX_StsACAAC_CoefValErr          = -163,  /* AAC: Invalid quantized coefficient value          */
     66     OMX_StsACAAC_MaxSfbErr           = -162,  /* AAC: Invalid maxSfb value in relation to numSwb */
     67 	OMX_StsACAAC_PlsDataErr		     = -160,  /* AAC: pulse escape sequence data error */
     68 
     69     /* Optional return codes - use cases are explicitly described for each function*/
     70     OMX_Sts_BadArgErr                = -5,    /* Bad Arguments */
     71 
     72     OMX_StsACAAC_TnsNumFiltErr       = -157,  /* AAC: Invalid number of TNS filters  */
     73     OMX_StsACAAC_TnsLenErr           = -156,  /* AAC: Invalid TNS region length  */
     74     OMX_StsACAAC_TnsOrderErr         = -155,  /* AAC: Invalid order of TNS filter  */
     75     OMX_StsACAAC_TnsCoefResErr       = -154,  /* AAC: Invalid bit-resolution for TNS filter coefficients  */
     76     OMX_StsACAAC_TnsCoefErr          = -153,  /* AAC: Invalid TNS filter coefficients  */
     77     OMX_StsACAAC_TnsDirectErr        = -152,  /* AAC: Invalid TNS filter direction  */
     78 
     79     OMX_StsICJP_JPEGMarkerErr        = -183,  /* JPEG marker encountered within an entropy-coded block; */
     80                                               /* Huffman decoding operation terminated early.           */
     81     OMX_StsICJP_JPEGMarker           = -181,  /* JPEG marker encountered; Huffman decoding */
     82                                               /* operation terminated early.                         */
     83     OMX_StsIPPP_ContextMatchErr      = -17,   /* Context parameter doesn't match to the operation */
     84 
     85     OMX_StsSP_EvenMedianMaskSizeErr  = -180,  /* Even size of the Median Filter mask was replaced by the odd one */
     86 
     87     OMX_Sts_MaximumEnumeration       = INT_MAX  /*Placeholder, forces enum of size OMX_INT*/
     88 
     89  } OMXResult;          /** Return value or error value returned from a function. Identical to OMX_INT */
     90 
     91 
     92 /* OMX_U8 */
     93 #if UCHAR_MAX == 0xff
     94 typedef unsigned char OMX_U8;
     95 #elif USHRT_MAX == 0xff
     96 typedef unsigned short int OMX_U8;
     97 #else
     98 #error OMX_U8 undefined
     99 #endif
    100 
    101 
    102 /* OMX_S8 */
    103 #if SCHAR_MAX == 0x7f
    104 typedef signed char OMX_S8;
    105 #elif SHRT_MAX == 0x7f
    106 typedef signed short int OMX_S8;
    107 #else
    108 #error OMX_S8 undefined
    109 #endif
    110 
    111 
    112 /* OMX_U16 */
    113 #if USHRT_MAX == 0xffff
    114 typedef unsigned short int OMX_U16;
    115 #elif UINT_MAX == 0xffff
    116 typedef unsigned int OMX_U16;
    117 #else
    118 #error OMX_U16 undefined
    119 #endif
    120 
    121 
    122 /* OMX_S16 */
    123 #if SHRT_MAX == 0x7fff
    124 typedef signed short int OMX_S16;
    125 #elif INT_MAX == 0x7fff
    126 typedef signed int OMX_S16;
    127 #else
    128 #error OMX_S16 undefined
    129 #endif
    130 
    131 
    132 /* OMX_U32 */
    133 #if UINT_MAX == 0xffffffff
    134 typedef unsigned int OMX_U32;
    135 #elif LONG_MAX == 0xffffffff
    136 typedef unsigned long int OMX_U32;
    137 #else
    138 #error OMX_U32 undefined
    139 #endif
    140 
    141 
    142 /* OMX_S32 */
    143 #if INT_MAX == 0x7fffffff
    144 typedef signed int OMX_S32;
    145 #elif LONG_MAX == 0x7fffffff
    146 typedef long signed int OMX_S32;
    147 #else
    148 #error OMX_S32 undefined
    149 #endif
    150 
    151 
    152 /* OMX_U64 & OMX_S64 */
    153 #if defined( _WIN32 ) || defined ( _WIN64 )
    154     typedef __int64 OMX_S64; /** Signed 64-bit integer */
    155     typedef unsigned __int64 OMX_U64; /** Unsigned 64-bit integer */
    156     #define OMX_MIN_S64			(0x8000000000000000i64)
    157     #define OMX_MIN_U64			(0x0000000000000000i64)
    158     #define OMX_MAX_S64			(0x7FFFFFFFFFFFFFFFi64)
    159     #define OMX_MAX_U64			(0xFFFFFFFFFFFFFFFFi64)
    160 #else
    161     typedef long long OMX_S64; /** Signed 64-bit integer */
    162     typedef unsigned long long OMX_U64; /** Unsigned 64-bit integer */
    163     #define OMX_MIN_S64			(0x8000000000000000LL)
    164     #define OMX_MIN_U64			(0x0000000000000000LL)
    165     #define OMX_MAX_S64			(0x7FFFFFFFFFFFFFFFLL)
    166     #define OMX_MAX_U64			(0xFFFFFFFFFFFFFFFFLL)
    167 #endif
    168 
    169 
    170 /* OMX_SC8 */
    171 typedef struct
    172 {
    173   OMX_S8 Re; /** Real part */
    174   OMX_S8 Im; /** Imaginary part */
    175 
    176 } OMX_SC8; /** Signed 8-bit complex number */
    177 
    178 
    179 /* OMX_SC16 */
    180 typedef struct
    181 {
    182   OMX_S16 Re; /** Real part */
    183   OMX_S16 Im; /** Imaginary part */
    184 
    185 } OMX_SC16; /** Signed 16-bit complex number */
    186 
    187 
    188 /* OMX_SC32 */
    189 typedef struct
    190 {
    191   OMX_S32 Re; /** Real part */
    192   OMX_S32 Im; /** Imaginary part */
    193 
    194 } OMX_SC32; /** Signed 32-bit complex number */
    195 
    196 
    197 /* OMX_SC64 */
    198 typedef struct
    199 {
    200   OMX_S64 Re; /** Real part */
    201   OMX_S64 Im; /** Imaginary part */
    202 
    203 } OMX_SC64; /** Signed 64-bit complex number */
    204 
    205 
    206 /* OMX_F32 */
    207 typedef float OMX_F32; /** Single precision floating point,IEEE 754 */
    208 
    209 /* OMX_F64 */
    210 typedef double OMX_F64; /** Double precision floating point,IEEE 754 */
    211 
    212 /* OMX_FC32 */
    213 typedef struct
    214 {
    215   OMX_F32 Re; /** Real part */
    216   OMX_F32 Im; /** Imaginary part */
    217 
    218 } OMX_FC32; /** single precision floating point complex number */
    219 
    220 /* OMX_FC64 */
    221 typedef struct
    222 {
    223   OMX_F64 Re; /** Real part */
    224   OMX_F64 Im; /** Imaginary part */
    225 
    226 } OMX_FC64; /** double precision floating point complex number */
    227 
    228 /* OMX_INT */
    229 typedef int OMX_INT; /** signed integer corresponding to machine word length, has maximum signed value INT_MAX*/
    230 
    231 
    232 #define OMX_MIN_S8  	   	(-128)
    233 #define OMX_MIN_U8  		0
    234 #define OMX_MIN_S16		 	(-32768)
    235 #define OMX_MIN_U16			0
    236 #define OMX_MIN_S32			(-2147483647-1)
    237 #define OMX_MIN_U32			0
    238 
    239 #define OMX_MAX_S8			(127)
    240 #define OMX_MAX_U8			(255)
    241 #define OMX_MAX_S16			(32767)
    242 #define OMX_MAX_U16			(0xFFFF)
    243 #define OMX_MAX_S32			(2147483647)
    244 #define OMX_MAX_U32			(0xFFFFFFFF)
    245 
    246 typedef void OMXVoid;
    247 
    248 #ifndef NULL
    249 #define NULL ((void*)0)
    250 #endif
    251 
    252 /** Defines the geometric position and size of a rectangle,
    253   * where x,y defines the coordinates of the top left corner
    254   * of the rectangle, with dimensions width in the x-direction
    255   * and height in the y-direction */
    256 typedef struct {
    257 	OMX_INT x;      /** x-coordinate of top left corner of rectangle */
    258 	OMX_INT y;      /** y-coordinate of top left corner of rectangle */
    259 	OMX_INT width;  /** Width in the x-direction. */
    260 	OMX_INT height; /** Height in the y-direction. */
    261 }OMXRect;
    262 
    263 
    264 /** Defines the geometric position of a point, */
    265 typedef struct
    266 {
    267  OMX_INT x; /** x-coordinate */
    268  OMX_INT y;	/** y-coordinate */
    269 
    270 } OMXPoint;
    271 
    272 
    273 /** Defines the dimensions of a rectangle, or region of interest in an image */
    274 typedef struct
    275 {
    276  OMX_INT width;  /** Width of the rectangle, in the x-direction */
    277  OMX_INT height; /** Height of the rectangle, in the y-direction */
    278 
    279 } OMXSize;
    280 
    281 #ifdef __cplusplus
    282 }
    283 #endif
    284 #endif /* _OMXTYPES_H_ */
    285