Don't rebalance bits for itheta=0 or 16384
[opus.git] / libcelt / celt_types.h
1 /* celt_types.h taken from libogg */
2 /********************************************************************
3  *                                                                  *
4  * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE.   *
5  * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS     *
6  * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
7  * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING.       *
8  *                                                                  *
9  * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2002             *
10  * by the Xiph.Org Foundation http://www.xiph.org/                  *
11  *                                                                  *
12  ********************************************************************
13
14  function: #ifdef jail to whip a few platforms into the UNIX ideal.
15  last mod: $Id: os_types.h 7524 2004-08-11 04:20:36Z conrad $
16
17  ********************************************************************/
18 /**
19    @file celt_types.h
20    @brief CELT types
21 */
22 #ifndef _CELT_TYPES_H
23 #define _CELT_TYPES_H
24
25 /* Use the real stdint.h if it's there (taken from Paul Hsieh's pstdint.h) */
26 #if (defined(__STDC__) && __STDC__ && __STDC_VERSION__ >= 199901L) || (defined(__GNUC__) && (defined(_STDINT_H) || defined(_STDINT_H_)) || defined (HAVE_STDINT_H))
27 #include <stdint.h>
28
29    typedef int16_t celt_int16;
30    typedef uint16_t celt_uint16;
31    typedef int32_t celt_int32;
32    typedef uint32_t celt_uint32;
33 #elif defined(_WIN32) 
34
35 #  if defined(__CYGWIN__)
36 #    include <_G_config.h>
37      typedef _G_int32_t celt_int32;
38      typedef _G_uint32_t celt_uint32;
39      typedef _G_int16 celt_int16;
40      typedef _G_uint16 celt_uint16;
41 #  elif defined(__MINGW32__)
42      typedef short celt_int16;
43      typedef unsigned short celt_uint16;
44      typedef int celt_int32;
45      typedef unsigned int celt_uint32;
46 #  elif defined(__MWERKS__)
47      typedef int celt_int32;
48      typedef unsigned int celt_uint32;
49      typedef short celt_int16;
50      typedef unsigned short celt_uint16;
51 #  else
52      /* MSVC/Borland */
53      typedef __int32 celt_int32;
54      typedef unsigned __int32 celt_uint32;
55      typedef __int16 celt_int16;
56      typedef unsigned __int16 celt_uint16;
57 #  endif
58
59 #elif defined(__MACOS__)
60
61 #  include <sys/types.h>
62    typedef SInt16 celt_int16;
63    typedef UInt16 celt_uint16;
64    typedef SInt32 celt_int32;
65    typedef UInt32 celt_uint32;
66
67 #elif (defined(__APPLE__) && defined(__MACH__)) /* MacOS X Framework build */
68
69 #  include <sys/types.h>
70    typedef int16_t celt_int16;
71    typedef u_int16_t celt_uint16;
72    typedef int32_t celt_int32;
73    typedef u_int32_t celt_uint32;
74
75 #elif defined(__BEOS__)
76
77    /* Be */
78 #  include <inttypes.h>
79    typedef int16 celt_int16;
80    typedef u_int16 celt_uint16;
81    typedef int32_t celt_int32;
82    typedef u_int32_t celt_uint32;
83
84 #elif defined (__EMX__)
85
86    /* OS/2 GCC */
87    typedef short celt_int16;
88    typedef unsigned short celt_uint16;
89    typedef int celt_int32;
90    typedef unsigned int celt_uint32;
91
92 #elif defined (DJGPP)
93
94    /* DJGPP */
95    typedef short celt_int16;
96    typedef unsigned short celt_uint16;
97    typedef int celt_int32;
98    typedef unsigned int celt_uint32;
99
100 #elif defined(R5900)
101
102    /* PS2 EE */
103    typedef int celt_int32;
104    typedef unsigned celt_uint32;
105    typedef short celt_int16;
106    typedef unsigned short celt_uint16;
107
108 #elif defined(__SYMBIAN32__)
109
110    /* Symbian GCC */
111    typedef signed short celt_int16;
112    typedef unsigned short celt_uint16;
113    typedef signed int celt_int32;
114    typedef unsigned int celt_uint32;
115
116 #elif defined(CONFIG_TI_C54X) || defined (CONFIG_TI_C55X)
117
118    typedef short celt_int16;
119    typedef unsigned short celt_uint16;
120    typedef long celt_int32;
121    typedef unsigned long celt_uint32;
122
123 #elif defined(CONFIG_TI_C6X)
124
125    typedef short celt_int16;
126    typedef unsigned short celt_uint16;
127    typedef int celt_int32;
128    typedef unsigned int celt_uint32;
129
130 #else
131
132    /* Give up, take a reasonable guess */
133    typedef short celt_int16;
134    typedef unsigned short celt_uint16;
135    typedef int celt_int32;
136    typedef unsigned int celt_uint32;
137
138 #endif
139
140 #endif  /* _CELT_TYPES_H */