1 /* (C) COPYRIGHT 1994-2002 Xiph.Org Foundation */
2 /* Modified by Jean-Marc Valin */
4 Redistribution and use in source and binary forms, with or without
5 modification, are permitted provided that the following conditions
8 - Redistributions of source code must retain the above copyright
9 notice, this list of conditions and the following disclaimer.
11 - Redistributions in binary form must reproduce the above copyright
12 notice, this list of conditions and the following disclaimer in the
13 documentation and/or other materials provided with the distribution.
15 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
16 ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
17 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
18 A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
19 OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
20 EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
21 PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
22 PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
23 LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
24 NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 /* opus_types.h based on ogg_types.h from libogg */
31 @brief Opus reference implementation types
36 /* Use the real stdint.h if it's there (taken from Paul Hsieh's pstdint.h) */
37 #if (defined(__STDC__) && __STDC__ && __STDC_VERSION__ >= 199901L) || (defined(__GNUC__) && (defined(_STDINT_H) || defined(_STDINT_H_)) || defined (HAVE_STDINT_H))
40 typedef int16_t opus_int16;
41 typedef uint16_t opus_uint16;
42 typedef int32_t opus_int32;
43 typedef uint32_t opus_uint32;
46 # if defined(__CYGWIN__)
47 # include <_G_config.h>
48 typedef _G_int32_t opus_int32;
49 typedef _G_uint32_t opus_uint32;
50 typedef _G_int16 opus_int16;
51 typedef _G_uint16 opus_uint16;
52 # elif defined(__MINGW32__)
53 typedef short opus_int16;
54 typedef unsigned short opus_uint16;
55 typedef int opus_int32;
56 typedef unsigned int opus_uint32;
57 # elif defined(__MWERKS__)
58 typedef int opus_int32;
59 typedef unsigned int opus_uint32;
60 typedef short opus_int16;
61 typedef unsigned short opus_uint16;
64 typedef __int32 opus_int32;
65 typedef unsigned __int32 opus_uint32;
66 typedef __int16 opus_int16;
67 typedef unsigned __int16 opus_uint16;
70 #elif defined(__MACOS__)
72 # include <sys/types.h>
73 typedef SInt16 opus_int16;
74 typedef UInt16 opus_uint16;
75 typedef SInt32 opus_int32;
76 typedef UInt32 opus_uint32;
78 #elif (defined(__APPLE__) && defined(__MACH__)) /* MacOS X Framework build */
80 # include <sys/types.h>
81 typedef int16_t opus_int16;
82 typedef u_int16_t opus_uint16;
83 typedef int32_t opus_int32;
84 typedef u_int32_t opus_uint32;
86 #elif defined(__BEOS__)
89 # include <inttypes.h>
90 typedef int16 opus_int16;
91 typedef u_int16 opus_uint16;
92 typedef int32_t opus_int32;
93 typedef u_int32_t opus_uint32;
95 #elif defined (__EMX__)
98 typedef short opus_int16;
99 typedef unsigned short opus_uint16;
100 typedef int opus_int32;
101 typedef unsigned int opus_uint32;
103 #elif defined (DJGPP)
106 typedef short opus_int16;
107 typedef unsigned short opus_uint16;
108 typedef int opus_int32;
109 typedef unsigned int opus_uint32;
114 typedef int opus_int32;
115 typedef unsigned opus_uint32;
116 typedef short opus_int16;
117 typedef unsigned short opus_uint16;
119 #elif defined(__SYMBIAN32__)
122 typedef signed short opus_int16;
123 typedef unsigned short opus_uint16;
124 typedef signed int opus_int32;
125 typedef unsigned int opus_uint32;
127 #elif defined(CONFIG_TI_C54X) || defined (CONFIG_TI_C55X)
129 typedef short opus_int16;
130 typedef unsigned short opus_uint16;
131 typedef long opus_int32;
132 typedef unsigned long opus_uint32;
134 #elif defined(CONFIG_TI_C6X)
136 typedef short opus_int16;
137 typedef unsigned short opus_uint16;
138 typedef int opus_int32;
139 typedef unsigned int opus_uint32;
143 /* Give up, take a reasonable guess */
144 typedef short opus_int16;
145 typedef unsigned short opus_uint16;
146 typedef int opus_int32;
147 typedef unsigned int opus_uint32;
151 #define opus_int int /* used for counters etc; at least 16 bits */
152 #define opus_int64 long long
153 #define opus_int8 signed char
155 #define opus_uint unsigned int /* used for counters etc; at least 16 bits */
156 #define opus_uint64 unsigned long long
157 #define opus_uint8 unsigned char
159 #endif /* OPUS_TYPES_H */