OSDN Git Service

original
[gb-231r1-is01/Gingerbread_2.3.3_r1_IS01.git] / frameworks / base / media / libstagefright / codecs / amrwbenc / inc / typedefs.h
1 /*\r
2  ** Copyright 2003-2010, VisualOn, Inc.\r
3  **\r
4  ** Licensed under the Apache License, Version 2.0 (the "License");\r
5  ** you may not use this file except in compliance with the License.\r
6  ** You may obtain a copy of the License at\r
7  **\r
8  **     http://www.apache.org/licenses/LICENSE-2.0\r
9  **\r
10  ** Unless required by applicable law or agreed to in writing, software\r
11  ** distributed under the License is distributed on an "AS IS" BASIS,\r
12  ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
13  ** See the License for the specific language governing permissions and\r
14  ** limitations under the License.\r
15  */\r
16 \r
17 /*\r
18 *\r
19 *      File             : typedefs.h\r
20 *      Description      : Definition of platform independent data\r
21 *                         types and constants\r
22 *\r
23 *\r
24 *      The following platform independent data types and corresponding\r
25 *      preprocessor (#define) constants are defined:\r
26 *\r
27 *        defined type  meaning           corresponding constants\r
28 *        ----------------------------------------------------------\r
29 *        Char          character         (none)\r
30 *        Bool          boolean           true, false\r
31 *        Word8         8-bit signed      minWord8,   maxWord8\r
32 *        UWord8        8-bit unsigned    minUWord8,  maxUWord8\r
33 *        Word16        16-bit signed     minWord16,  maxWord16\r
34 *        UWord16       16-bit unsigned   minUWord16, maxUWord16\r
35 *        Word32        32-bit signed     minWord32,  maxWord32\r
36 *        UWord32       32-bit unsigned   minUWord32, maxUWord32\r
37 *        Float         floating point    minFloat,   maxFloat\r
38 *\r
39 *\r
40 *      The following compile switches are #defined:\r
41 *\r
42 *        PLATFORM      string indicating platform progam is compiled on\r
43 *                      possible values: "OSF", "PC", "SUN"\r
44 *\r
45 *        OSF           only defined if the current platform is an Alpha\r
46 *        PC            only defined if the current platform is a PC\r
47 *        SUN           only defined if the current platform is a Sun\r
48 *        \r
49 *        LSBFIRST      is defined if the byte order on this platform is\r
50 *                      "least significant byte first" -> defined on DEC Alpha\r
51 *                      and PC, undefined on Sun\r
52 *\r
53 ********************************************************************************\r
54 */\r
55 \r
56 #ifndef __TYPEDEFS_H__\r
57 #define __TYPEDEFS_H__\r
58 \r
59 /*\r
60 ********************************************************************************\r
61 *                         INCLUDE FILES\r
62 ********************************************************************************\r
63 */\r
64 #include <float.h>\r
65 #include <limits.h>\r
66 \r
67 \r
68 \r
69 /*\r
70 ********************************************************************************\r
71 *                         DEFINITION OF CONSTANTS \r
72 ********************************************************************************\r
73 */\r
74 /*\r
75  ********* define char type\r
76  */\r
77 typedef char Char;\r
78 \r
79 /*\r
80  ********* define 8 bit signed/unsigned types & constants\r
81  */\r
82 #if SCHAR_MAX == 127\r
83 typedef signed char Word8;\r
84 #define minWord8  SCHAR_MIN\r
85 #define maxWord8  SCHAR_MAX\r
86 \r
87 typedef unsigned char UWord8;\r
88 #define minUWord8 0\r
89 #define maxUWord8 UCHAR_MAX\r
90 #else\r
91 #error cannot find 8-bit type\r
92 #endif\r
93 \r
94 \r
95 /*\r
96  ********* define 16 bit signed/unsigned types & constants\r
97  */\r
98 #if INT_MAX == 32767\r
99 typedef int Word16;\r
100 #define minWord16     INT_MIN\r
101 #define maxWord16     INT_MAX\r
102 typedef unsigned int UWord16;\r
103 #define minUWord16    0\r
104 #define maxUWord16    UINT_MAX\r
105 #elif SHRT_MAX == 32767\r
106 typedef short Word16;\r
107 #define minWord16     SHRT_MIN\r
108 #define maxWord16     SHRT_MAX\r
109 typedef unsigned short UWord16;\r
110 #define minUWord16    0\r
111 #define maxUWord16    USHRT_MAX\r
112 #else\r
113 #error cannot find 16-bit type\r
114 #endif\r
115 \r
116 \r
117 /*\r
118  ********* define 32 bit signed/unsigned types & constants\r
119  */\r
120 #if INT_MAX == 2147483647\r
121 typedef int Word32;\r
122 #define minWord32     INT_MIN\r
123 #define maxWord32     INT_MAX\r
124 typedef unsigned int UWord32;\r
125 #define minUWord32    0\r
126 #define maxUWord32    UINT_MAX\r
127 #elif LONG_MAX == 2147483647\r
128 typedef long Word32;\r
129 #define minWord32     LONG_MIN\r
130 #define maxWord32     LONG_MAX\r
131 typedef unsigned long UWord32;\r
132 #define minUWord32    0\r
133 #define maxUWord32    ULONG_MAX\r
134 #else\r
135 #error cannot find 32-bit type\r
136 #endif\r
137 \r
138 /*\r
139  ********* define floating point type & constants\r
140  */\r
141 /* use "#if 0" below if Float should be double;\r
142    use "#if 1" below if Float should be float\r
143  */\r
144 #if 0\r
145 typedef float Float;\r
146 #define maxFloat      FLT_MAX\r
147 #define minFloat      FLT_MIN\r
148 #else\r
149 typedef double Float;\r
150 #define maxFloat      DBL_MAX\r
151 #define minFloat      DBL_MIN\r
152 #endif\r
153 \r
154 /*\r
155  ********* define complex type\r
156  */\r
157 typedef struct {\r
158   Float r;  /* real      part */\r
159   Float i;  /* imaginary part */\r
160 } CPX;\r
161 \r
162 /*\r
163  ********* define boolean type\r
164  */\r
165 typedef int Bool;\r
166 #define false 0\r
167 #define true 1\r
168 \r
169 /* ******Avoid function multiple definition****** */\r
170 #define     Autocorr         voAWB_Autocorr\r
171 #define     Convolve         voAWB_Convolve\r
172 #define     cor_h_x          voAWB_cor_h_x\r
173 #define     dtx_enc_init     voAWB_dtx_enc_init\r
174 #define     dtx_enc_reset    voAWB_dtx_enc_reset\r
175 #define     dtx_enc_exit     voAWB_dtx_enc_exit\r
176 #define     dtx_enc          voAWB_dtx_enc\r
177 #define     dtx_buffer       voAWB_dtx_buffer\r
178 #define     tx_dtx_handler   voAWB_tx_dtx_handler\r
179 #define     G_pitch          voAWB_G_pitch\r
180 #define     Isp_Az           voAWB_Isp_Az\r
181 #define     Lag_window       voAWB_Lag_window\r
182 #define     Log2_norm        voAWB_Log2_norm\r
183 #define     Log2             voAWB_Log2\r
184 #define     Pow2             voAWB_Pow2\r
185 #define     L_Comp           voAWB_L_Comp\r
186 #define     Mpy_32           voAWB_Mpy_32\r
187 #define     Mpy_32_16        voAWB_Mpy_32_16\r
188 #define     Div_32           voAWB_Div_32\r
189 #define     Pit_shrp         voAWB_Pit_shrp\r
190 #define     Qisf_ns          voAWB_Qisf_ns\r
191 #define     Disf_ns          voAWB_Disf_ns\r
192 #define     Residu           voAWB_Residu\r
193 #define     Syn_filt         voAWB_Syn_filt\r
194 #define     Set_zero         voAWB_Set_zero\r
195 #define     Copy             voAWB_Copy\r
196 #define     voice_factor     voAWB_voice_factor\r
197 #define     Syn_filt_32      voAWB_Syn_filt_32\r
198 #define     Isf_isp          voAWB_Isf_isp\r
199 #define     Levinson         voAWB_Levinson\r
200 #define     median5          voAWB_median5           \r
201 #define     Pred_lt4         voAWB_Pred_lt4\r
202 #define     Reorder_isf      voAWB_Reorder_isf\r
203 #define     Dpisf_2s_36b     voAWB_Dpisf_2s_36b\r
204 #define     Dpisf_2s_46b     voAWB_Dpisf_2s_46b\r
205 #define     Dot_product12    voAWB_Dot_product12\r
206 #define     mem_malloc       voAWB_mem_malloc\r
207 #define     mem_free         voAWB_mem_free\r
208 /******************************************************/\r
209 \r
210 #endif  //#define __TYPEDEFS_H__\r
211 \r