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#include <stdint.h>
36
37#define OMX_IN
38#define OMX_OUT
39#define OMX_INOUT
40
41
42typedef enum {
43
44    /* Mandatory return codes - use cases are explicitly described for each function */
45    OMX_Sts_NoErr                    =  0,    /* No error, the function completed successfully */
46    OMX_Sts_Err                      = -2,    /* Unknown/unspecified error */
47    OMX_Sts_InvalidBitstreamValErr   = -182,  /* Invalid value detected during bitstream processing */
48    OMX_Sts_MemAllocErr              = -9,    /* Not enough memory allocated for the operation */
49    OMX_StsACAAC_GainCtrErr    	     = -159,  /* AAC: Unsupported gain control data detected */
50    OMX_StsACAAC_PrgNumErr           = -167,  /* AAC: Invalid number of elements for one program   */
51    OMX_StsACAAC_CoefValErr          = -163,  /* AAC: Invalid quantized coefficient value          */
52    OMX_StsACAAC_MaxSfbErr           = -162,  /* AAC: Invalid maxSfb value in relation to numSwb */
53	OMX_StsACAAC_PlsDataErr		     = -160,  /* AAC: pulse escape sequence data error */
54
55    /* Optional return codes - use cases are explicitly described for each function*/
56    OMX_Sts_BadArgErr                = -5,    /* Bad Arguments */
57
58    OMX_StsACAAC_TnsNumFiltErr       = -157,  /* AAC: Invalid number of TNS filters  */
59    OMX_StsACAAC_TnsLenErr           = -156,  /* AAC: Invalid TNS region length  */
60    OMX_StsACAAC_TnsOrderErr         = -155,  /* AAC: Invalid order of TNS filter  */
61    OMX_StsACAAC_TnsCoefResErr       = -154,  /* AAC: Invalid bit-resolution for TNS filter coefficients  */
62    OMX_StsACAAC_TnsCoefErr          = -153,  /* AAC: Invalid TNS filter coefficients  */
63    OMX_StsACAAC_TnsDirectErr        = -152,  /* AAC: Invalid TNS filter direction  */
64
65    OMX_StsICJP_JPEGMarkerErr        = -183,  /* JPEG marker encountered within an entropy-coded block; */
66                                              /* Huffman decoding operation terminated early.           */
67    OMX_StsICJP_JPEGMarker           = -181,  /* JPEG marker encountered; Huffman decoding */
68                                              /* operation terminated early.                         */
69    OMX_StsIPPP_ContextMatchErr      = -17,   /* Context parameter doesn't match to the operation */
70
71    OMX_StsSP_EvenMedianMaskSizeErr  = -180,  /* Even size of the Median Filter mask was replaced by the odd one */
72
73    OMX_Sts_MaximumEnumeration       = INT_MAX  /*Placeholder, forces enum of size OMX_INT*/
74
75 } OMXResult;          /** Return value or error value returned from a function. Identical to OMX_INT */
76
77
78/* OMX_U8 */
79typedef uint8_t OMX_U8;
80
81/* OMX_S8 */
82typedef int8_t OMX_S8;
83
84/* OMX_U16 */
85typedef uint16_t OMX_U16;
86
87/* OMX_S16 */
88typedef int16_t OMX_S16;
89
90/* OMX_U32 */
91typedef uint32_t OMX_U32;
92
93/* OMX_S32 */
94typedef int32_t OMX_S32;
95
96/* OMX_U64 & OMX_S64 */
97#if defined( _WIN32 ) || defined ( _WIN64 )
98    typedef __int64 OMX_S64; /** Signed 64-bit integer */
99    typedef unsigned __int64 OMX_U64; /** Unsigned 64-bit integer */
100    #define OMX_MIN_S64			(0x8000000000000000i64)
101    #define OMX_MIN_U64			(0x0000000000000000i64)
102    #define OMX_MAX_S64			(0x7FFFFFFFFFFFFFFFi64)
103    #define OMX_MAX_U64			(0xFFFFFFFFFFFFFFFFi64)
104#else
105    typedef int64_t OMX_S64; /** Signed 64-bit integer */
106    typedef uint64_t OMX_U64; /** Unsigned 64-bit integer */
107    #define OMX_MIN_S64			(0x8000000000000000LL)
108    #define OMX_MIN_U64			(0x0000000000000000LL)
109    #define OMX_MAX_S64			(0x7FFFFFFFFFFFFFFFLL)
110    #define OMX_MAX_U64			(0xFFFFFFFFFFFFFFFFLL)
111#endif
112
113/* OMX_SC8 */
114typedef struct
115{
116  OMX_S8 Re; /** Real part */
117  OMX_S8 Im; /** Imaginary part */
118
119} OMX_SC8; /** Signed 8-bit complex number */
120
121
122/* OMX_SC16 */
123typedef struct
124{
125  OMX_S16 Re; /** Real part */
126  OMX_S16 Im; /** Imaginary part */
127
128} OMX_SC16; /** Signed 16-bit complex number */
129
130
131/* OMX_SC32 */
132typedef struct
133{
134  OMX_S32 Re; /** Real part */
135  OMX_S32 Im; /** Imaginary part */
136
137} OMX_SC32; /** Signed 32-bit complex number */
138
139
140/* OMX_SC64 */
141typedef struct
142{
143  OMX_S64 Re; /** Real part */
144  OMX_S64 Im; /** Imaginary part */
145
146} OMX_SC64; /** Signed 64-bit complex number */
147
148
149/* OMX_F32 */
150typedef float OMX_F32; /** Single precision floating point,IEEE 754 */
151
152
153/* OMX_F64 */
154typedef double OMX_F64; /** Double precision floating point,IEEE 754 */
155
156
157/* OMX_INT */
158typedef int OMX_INT; /** signed integer corresponding to machine word length, has maximum signed value INT_MAX*/
159
160
161#define OMX_MIN_S8  	   	(-128)
162#define OMX_MIN_U8  		0
163#define OMX_MIN_S16		 	(-32768)
164#define OMX_MIN_U16			0
165#define OMX_MIN_S32			(-2147483647-1)
166#define OMX_MIN_U32			0
167
168#define OMX_MAX_S8			(127)
169#define OMX_MAX_U8			(255)
170#define OMX_MAX_S16			(32767)
171#define OMX_MAX_U16			(0xFFFF)
172#define OMX_MAX_S32			(2147483647)
173#define OMX_MAX_U32			(0xFFFFFFFF)
174
175typedef void OMXVoid;
176
177#ifndef NULL
178#define NULL ((void*)0)
179#endif
180
181/** Defines the geometric position and size of a rectangle,
182  * where x,y defines the coordinates of the top left corner
183  * of the rectangle, with dimensions width in the x-direction
184  * and height in the y-direction */
185typedef struct {
186	OMX_INT x;      /** x-coordinate of top left corner of rectangle */
187	OMX_INT y;      /** y-coordinate of top left corner of rectangle */
188	OMX_INT width;  /** Width in the x-direction. */
189	OMX_INT height; /** Height in the y-direction. */
190}OMXRect;
191
192
193/** Defines the geometric position of a point, */
194typedef struct
195{
196 OMX_INT x; /** x-coordinate */
197 OMX_INT y;	/** y-coordinate */
198
199} OMXPoint;
200
201
202/** Defines the dimensions of a rectangle, or region of interest in an image */
203typedef struct
204{
205 OMX_INT width;  /** Width of the rectangle, in the x-direction */
206 OMX_INT height; /** Height of the rectangle, in the y-direction */
207
208} OMXSize;
209
210#endif /* _OMXTYPES_H_ */
211