1885f2ff5a7a7d6a73432d26a6c0ae9147e6b452sergeyu@chromium.org/* (C) COPYRIGHT 1994-2002 Xiph.Org Foundation */
2885f2ff5a7a7d6a73432d26a6c0ae9147e6b452sergeyu@chromium.org/* Modified by Jean-Marc Valin */
3885f2ff5a7a7d6a73432d26a6c0ae9147e6b452sergeyu@chromium.org/*
4885f2ff5a7a7d6a73432d26a6c0ae9147e6b452sergeyu@chromium.org   Redistribution and use in source and binary forms, with or without
5885f2ff5a7a7d6a73432d26a6c0ae9147e6b452sergeyu@chromium.org   modification, are permitted provided that the following conditions
6885f2ff5a7a7d6a73432d26a6c0ae9147e6b452sergeyu@chromium.org   are met:
7885f2ff5a7a7d6a73432d26a6c0ae9147e6b452sergeyu@chromium.org
8885f2ff5a7a7d6a73432d26a6c0ae9147e6b452sergeyu@chromium.org   - Redistributions of source code must retain the above copyright
9885f2ff5a7a7d6a73432d26a6c0ae9147e6b452sergeyu@chromium.org   notice, this list of conditions and the following disclaimer.
10885f2ff5a7a7d6a73432d26a6c0ae9147e6b452sergeyu@chromium.org
11885f2ff5a7a7d6a73432d26a6c0ae9147e6b452sergeyu@chromium.org   - Redistributions in binary form must reproduce the above copyright
12885f2ff5a7a7d6a73432d26a6c0ae9147e6b452sergeyu@chromium.org   notice, this list of conditions and the following disclaimer in the
13885f2ff5a7a7d6a73432d26a6c0ae9147e6b452sergeyu@chromium.org   documentation and/or other materials provided with the distribution.
14885f2ff5a7a7d6a73432d26a6c0ae9147e6b452sergeyu@chromium.org
15885f2ff5a7a7d6a73432d26a6c0ae9147e6b452sergeyu@chromium.org   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
16885f2ff5a7a7d6a73432d26a6c0ae9147e6b452sergeyu@chromium.org   ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
17885f2ff5a7a7d6a73432d26a6c0ae9147e6b452sergeyu@chromium.org   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
18885f2ff5a7a7d6a73432d26a6c0ae9147e6b452sergeyu@chromium.org   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
19885f2ff5a7a7d6a73432d26a6c0ae9147e6b452sergeyu@chromium.org   OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
20885f2ff5a7a7d6a73432d26a6c0ae9147e6b452sergeyu@chromium.org   EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
21885f2ff5a7a7d6a73432d26a6c0ae9147e6b452sergeyu@chromium.org   PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
22885f2ff5a7a7d6a73432d26a6c0ae9147e6b452sergeyu@chromium.org   PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
23885f2ff5a7a7d6a73432d26a6c0ae9147e6b452sergeyu@chromium.org   LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
24885f2ff5a7a7d6a73432d26a6c0ae9147e6b452sergeyu@chromium.org   NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25885f2ff5a7a7d6a73432d26a6c0ae9147e6b452sergeyu@chromium.org   SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26885f2ff5a7a7d6a73432d26a6c0ae9147e6b452sergeyu@chromium.org*/
27885f2ff5a7a7d6a73432d26a6c0ae9147e6b452sergeyu@chromium.org/* opus_types.h based on ogg_types.h from libogg */
28885f2ff5a7a7d6a73432d26a6c0ae9147e6b452sergeyu@chromium.org
29885f2ff5a7a7d6a73432d26a6c0ae9147e6b452sergeyu@chromium.org/**
30885f2ff5a7a7d6a73432d26a6c0ae9147e6b452sergeyu@chromium.org   @file opus_types.h
31885f2ff5a7a7d6a73432d26a6c0ae9147e6b452sergeyu@chromium.org   @brief Opus reference implementation types
32885f2ff5a7a7d6a73432d26a6c0ae9147e6b452sergeyu@chromium.org*/
33885f2ff5a7a7d6a73432d26a6c0ae9147e6b452sergeyu@chromium.org#ifndef OPUS_TYPES_H
34885f2ff5a7a7d6a73432d26a6c0ae9147e6b452sergeyu@chromium.org#define OPUS_TYPES_H
35885f2ff5a7a7d6a73432d26a6c0ae9147e6b452sergeyu@chromium.org
36885f2ff5a7a7d6a73432d26a6c0ae9147e6b452sergeyu@chromium.org/* Use the real stdint.h if it's there (taken from Paul Hsieh's pstdint.h) */
37885f2ff5a7a7d6a73432d26a6c0ae9147e6b452sergeyu@chromium.org#if (defined(__STDC__) && __STDC__ && __STDC_VERSION__ >= 199901L) || (defined(__GNUC__) && (defined(_STDINT_H) || defined(_STDINT_H_)) || defined (HAVE_STDINT_H))
38885f2ff5a7a7d6a73432d26a6c0ae9147e6b452sergeyu@chromium.org#include <stdint.h>
39885f2ff5a7a7d6a73432d26a6c0ae9147e6b452sergeyu@chromium.org
40885f2ff5a7a7d6a73432d26a6c0ae9147e6b452sergeyu@chromium.org   typedef int16_t opus_int16;
41885f2ff5a7a7d6a73432d26a6c0ae9147e6b452sergeyu@chromium.org   typedef uint16_t opus_uint16;
42885f2ff5a7a7d6a73432d26a6c0ae9147e6b452sergeyu@chromium.org   typedef int32_t opus_int32;
43885f2ff5a7a7d6a73432d26a6c0ae9147e6b452sergeyu@chromium.org   typedef uint32_t opus_uint32;
44885f2ff5a7a7d6a73432d26a6c0ae9147e6b452sergeyu@chromium.org#elif defined(_WIN32)
45885f2ff5a7a7d6a73432d26a6c0ae9147e6b452sergeyu@chromium.org
46885f2ff5a7a7d6a73432d26a6c0ae9147e6b452sergeyu@chromium.org#  if defined(__CYGWIN__)
47885f2ff5a7a7d6a73432d26a6c0ae9147e6b452sergeyu@chromium.org#    include <_G_config.h>
48885f2ff5a7a7d6a73432d26a6c0ae9147e6b452sergeyu@chromium.org     typedef _G_int32_t opus_int32;
49885f2ff5a7a7d6a73432d26a6c0ae9147e6b452sergeyu@chromium.org     typedef _G_uint32_t opus_uint32;
50885f2ff5a7a7d6a73432d26a6c0ae9147e6b452sergeyu@chromium.org     typedef _G_int16 opus_int16;
51885f2ff5a7a7d6a73432d26a6c0ae9147e6b452sergeyu@chromium.org     typedef _G_uint16 opus_uint16;
52885f2ff5a7a7d6a73432d26a6c0ae9147e6b452sergeyu@chromium.org#  elif defined(__MINGW32__)
53885f2ff5a7a7d6a73432d26a6c0ae9147e6b452sergeyu@chromium.org     typedef short opus_int16;
54885f2ff5a7a7d6a73432d26a6c0ae9147e6b452sergeyu@chromium.org     typedef unsigned short opus_uint16;
55885f2ff5a7a7d6a73432d26a6c0ae9147e6b452sergeyu@chromium.org     typedef int opus_int32;
56885f2ff5a7a7d6a73432d26a6c0ae9147e6b452sergeyu@chromium.org     typedef unsigned int opus_uint32;
57885f2ff5a7a7d6a73432d26a6c0ae9147e6b452sergeyu@chromium.org#  elif defined(__MWERKS__)
58885f2ff5a7a7d6a73432d26a6c0ae9147e6b452sergeyu@chromium.org     typedef int opus_int32;
59885f2ff5a7a7d6a73432d26a6c0ae9147e6b452sergeyu@chromium.org     typedef unsigned int opus_uint32;
60885f2ff5a7a7d6a73432d26a6c0ae9147e6b452sergeyu@chromium.org     typedef short opus_int16;
61885f2ff5a7a7d6a73432d26a6c0ae9147e6b452sergeyu@chromium.org     typedef unsigned short opus_uint16;
62885f2ff5a7a7d6a73432d26a6c0ae9147e6b452sergeyu@chromium.org#  else
63885f2ff5a7a7d6a73432d26a6c0ae9147e6b452sergeyu@chromium.org     /* MSVC/Borland */
64885f2ff5a7a7d6a73432d26a6c0ae9147e6b452sergeyu@chromium.org     typedef __int32 opus_int32;
65885f2ff5a7a7d6a73432d26a6c0ae9147e6b452sergeyu@chromium.org     typedef unsigned __int32 opus_uint32;
66885f2ff5a7a7d6a73432d26a6c0ae9147e6b452sergeyu@chromium.org     typedef __int16 opus_int16;
67885f2ff5a7a7d6a73432d26a6c0ae9147e6b452sergeyu@chromium.org     typedef unsigned __int16 opus_uint16;
68885f2ff5a7a7d6a73432d26a6c0ae9147e6b452sergeyu@chromium.org#  endif
69885f2ff5a7a7d6a73432d26a6c0ae9147e6b452sergeyu@chromium.org
70885f2ff5a7a7d6a73432d26a6c0ae9147e6b452sergeyu@chromium.org#elif defined(__MACOS__)
71885f2ff5a7a7d6a73432d26a6c0ae9147e6b452sergeyu@chromium.org
72885f2ff5a7a7d6a73432d26a6c0ae9147e6b452sergeyu@chromium.org#  include <sys/types.h>
73885f2ff5a7a7d6a73432d26a6c0ae9147e6b452sergeyu@chromium.org   typedef SInt16 opus_int16;
74885f2ff5a7a7d6a73432d26a6c0ae9147e6b452sergeyu@chromium.org   typedef UInt16 opus_uint16;
75885f2ff5a7a7d6a73432d26a6c0ae9147e6b452sergeyu@chromium.org   typedef SInt32 opus_int32;
76885f2ff5a7a7d6a73432d26a6c0ae9147e6b452sergeyu@chromium.org   typedef UInt32 opus_uint32;
77885f2ff5a7a7d6a73432d26a6c0ae9147e6b452sergeyu@chromium.org
78885f2ff5a7a7d6a73432d26a6c0ae9147e6b452sergeyu@chromium.org#elif (defined(__APPLE__) && defined(__MACH__)) /* MacOS X Framework build */
79885f2ff5a7a7d6a73432d26a6c0ae9147e6b452sergeyu@chromium.org
80885f2ff5a7a7d6a73432d26a6c0ae9147e6b452sergeyu@chromium.org#  include <sys/types.h>
81885f2ff5a7a7d6a73432d26a6c0ae9147e6b452sergeyu@chromium.org   typedef int16_t opus_int16;
82885f2ff5a7a7d6a73432d26a6c0ae9147e6b452sergeyu@chromium.org   typedef u_int16_t opus_uint16;
83885f2ff5a7a7d6a73432d26a6c0ae9147e6b452sergeyu@chromium.org   typedef int32_t opus_int32;
84885f2ff5a7a7d6a73432d26a6c0ae9147e6b452sergeyu@chromium.org   typedef u_int32_t opus_uint32;
85885f2ff5a7a7d6a73432d26a6c0ae9147e6b452sergeyu@chromium.org
86885f2ff5a7a7d6a73432d26a6c0ae9147e6b452sergeyu@chromium.org#elif defined(__BEOS__)
87885f2ff5a7a7d6a73432d26a6c0ae9147e6b452sergeyu@chromium.org
88885f2ff5a7a7d6a73432d26a6c0ae9147e6b452sergeyu@chromium.org   /* Be */
89885f2ff5a7a7d6a73432d26a6c0ae9147e6b452sergeyu@chromium.org#  include <inttypes.h>
90885f2ff5a7a7d6a73432d26a6c0ae9147e6b452sergeyu@chromium.org   typedef int16 opus_int16;
91885f2ff5a7a7d6a73432d26a6c0ae9147e6b452sergeyu@chromium.org   typedef u_int16 opus_uint16;
92885f2ff5a7a7d6a73432d26a6c0ae9147e6b452sergeyu@chromium.org   typedef int32_t opus_int32;
93885f2ff5a7a7d6a73432d26a6c0ae9147e6b452sergeyu@chromium.org   typedef u_int32_t opus_uint32;
94885f2ff5a7a7d6a73432d26a6c0ae9147e6b452sergeyu@chromium.org
95885f2ff5a7a7d6a73432d26a6c0ae9147e6b452sergeyu@chromium.org#elif defined (__EMX__)
96885f2ff5a7a7d6a73432d26a6c0ae9147e6b452sergeyu@chromium.org
97885f2ff5a7a7d6a73432d26a6c0ae9147e6b452sergeyu@chromium.org   /* OS/2 GCC */
98885f2ff5a7a7d6a73432d26a6c0ae9147e6b452sergeyu@chromium.org   typedef short opus_int16;
99885f2ff5a7a7d6a73432d26a6c0ae9147e6b452sergeyu@chromium.org   typedef unsigned short opus_uint16;
100885f2ff5a7a7d6a73432d26a6c0ae9147e6b452sergeyu@chromium.org   typedef int opus_int32;
101885f2ff5a7a7d6a73432d26a6c0ae9147e6b452sergeyu@chromium.org   typedef unsigned int opus_uint32;
102885f2ff5a7a7d6a73432d26a6c0ae9147e6b452sergeyu@chromium.org
103885f2ff5a7a7d6a73432d26a6c0ae9147e6b452sergeyu@chromium.org#elif defined (DJGPP)
104885f2ff5a7a7d6a73432d26a6c0ae9147e6b452sergeyu@chromium.org
105885f2ff5a7a7d6a73432d26a6c0ae9147e6b452sergeyu@chromium.org   /* DJGPP */
106885f2ff5a7a7d6a73432d26a6c0ae9147e6b452sergeyu@chromium.org   typedef short opus_int16;
107885f2ff5a7a7d6a73432d26a6c0ae9147e6b452sergeyu@chromium.org   typedef unsigned short opus_uint16;
108885f2ff5a7a7d6a73432d26a6c0ae9147e6b452sergeyu@chromium.org   typedef int opus_int32;
109885f2ff5a7a7d6a73432d26a6c0ae9147e6b452sergeyu@chromium.org   typedef unsigned int opus_uint32;
110885f2ff5a7a7d6a73432d26a6c0ae9147e6b452sergeyu@chromium.org
111885f2ff5a7a7d6a73432d26a6c0ae9147e6b452sergeyu@chromium.org#elif defined(R5900)
112885f2ff5a7a7d6a73432d26a6c0ae9147e6b452sergeyu@chromium.org
113885f2ff5a7a7d6a73432d26a6c0ae9147e6b452sergeyu@chromium.org   /* PS2 EE */
114885f2ff5a7a7d6a73432d26a6c0ae9147e6b452sergeyu@chromium.org   typedef int opus_int32;
115885f2ff5a7a7d6a73432d26a6c0ae9147e6b452sergeyu@chromium.org   typedef unsigned opus_uint32;
116885f2ff5a7a7d6a73432d26a6c0ae9147e6b452sergeyu@chromium.org   typedef short opus_int16;
117885f2ff5a7a7d6a73432d26a6c0ae9147e6b452sergeyu@chromium.org   typedef unsigned short opus_uint16;
118885f2ff5a7a7d6a73432d26a6c0ae9147e6b452sergeyu@chromium.org
119885f2ff5a7a7d6a73432d26a6c0ae9147e6b452sergeyu@chromium.org#elif defined(__SYMBIAN32__)
120885f2ff5a7a7d6a73432d26a6c0ae9147e6b452sergeyu@chromium.org
121885f2ff5a7a7d6a73432d26a6c0ae9147e6b452sergeyu@chromium.org   /* Symbian GCC */
122885f2ff5a7a7d6a73432d26a6c0ae9147e6b452sergeyu@chromium.org   typedef signed short opus_int16;
123885f2ff5a7a7d6a73432d26a6c0ae9147e6b452sergeyu@chromium.org   typedef unsigned short opus_uint16;
124885f2ff5a7a7d6a73432d26a6c0ae9147e6b452sergeyu@chromium.org   typedef signed int opus_int32;
125885f2ff5a7a7d6a73432d26a6c0ae9147e6b452sergeyu@chromium.org   typedef unsigned int opus_uint32;
126885f2ff5a7a7d6a73432d26a6c0ae9147e6b452sergeyu@chromium.org
127885f2ff5a7a7d6a73432d26a6c0ae9147e6b452sergeyu@chromium.org#elif defined(CONFIG_TI_C54X) || defined (CONFIG_TI_C55X)
128885f2ff5a7a7d6a73432d26a6c0ae9147e6b452sergeyu@chromium.org
129885f2ff5a7a7d6a73432d26a6c0ae9147e6b452sergeyu@chromium.org   typedef short opus_int16;
130885f2ff5a7a7d6a73432d26a6c0ae9147e6b452sergeyu@chromium.org   typedef unsigned short opus_uint16;
131885f2ff5a7a7d6a73432d26a6c0ae9147e6b452sergeyu@chromium.org   typedef long opus_int32;
132885f2ff5a7a7d6a73432d26a6c0ae9147e6b452sergeyu@chromium.org   typedef unsigned long opus_uint32;
133885f2ff5a7a7d6a73432d26a6c0ae9147e6b452sergeyu@chromium.org
134885f2ff5a7a7d6a73432d26a6c0ae9147e6b452sergeyu@chromium.org#elif defined(CONFIG_TI_C6X)
135885f2ff5a7a7d6a73432d26a6c0ae9147e6b452sergeyu@chromium.org
136885f2ff5a7a7d6a73432d26a6c0ae9147e6b452sergeyu@chromium.org   typedef short opus_int16;
137885f2ff5a7a7d6a73432d26a6c0ae9147e6b452sergeyu@chromium.org   typedef unsigned short opus_uint16;
138885f2ff5a7a7d6a73432d26a6c0ae9147e6b452sergeyu@chromium.org   typedef int opus_int32;
139885f2ff5a7a7d6a73432d26a6c0ae9147e6b452sergeyu@chromium.org   typedef unsigned int opus_uint32;
140885f2ff5a7a7d6a73432d26a6c0ae9147e6b452sergeyu@chromium.org
141885f2ff5a7a7d6a73432d26a6c0ae9147e6b452sergeyu@chromium.org#else
142885f2ff5a7a7d6a73432d26a6c0ae9147e6b452sergeyu@chromium.org
143885f2ff5a7a7d6a73432d26a6c0ae9147e6b452sergeyu@chromium.org   /* Give up, take a reasonable guess */
144885f2ff5a7a7d6a73432d26a6c0ae9147e6b452sergeyu@chromium.org   typedef short opus_int16;
145885f2ff5a7a7d6a73432d26a6c0ae9147e6b452sergeyu@chromium.org   typedef unsigned short opus_uint16;
146885f2ff5a7a7d6a73432d26a6c0ae9147e6b452sergeyu@chromium.org   typedef int opus_int32;
147885f2ff5a7a7d6a73432d26a6c0ae9147e6b452sergeyu@chromium.org   typedef unsigned int opus_uint32;
148885f2ff5a7a7d6a73432d26a6c0ae9147e6b452sergeyu@chromium.org
149885f2ff5a7a7d6a73432d26a6c0ae9147e6b452sergeyu@chromium.org#endif
150885f2ff5a7a7d6a73432d26a6c0ae9147e6b452sergeyu@chromium.org
151885f2ff5a7a7d6a73432d26a6c0ae9147e6b452sergeyu@chromium.org#define opus_int         int                     /* used for counters etc; at least 16 bits */
152885f2ff5a7a7d6a73432d26a6c0ae9147e6b452sergeyu@chromium.org#define opus_int64       long long
153885f2ff5a7a7d6a73432d26a6c0ae9147e6b452sergeyu@chromium.org#define opus_int8        signed char
154885f2ff5a7a7d6a73432d26a6c0ae9147e6b452sergeyu@chromium.org
155885f2ff5a7a7d6a73432d26a6c0ae9147e6b452sergeyu@chromium.org#define opus_uint        unsigned int            /* used for counters etc; at least 16 bits */
156885f2ff5a7a7d6a73432d26a6c0ae9147e6b452sergeyu@chromium.org#define opus_uint64      unsigned long long
157885f2ff5a7a7d6a73432d26a6c0ae9147e6b452sergeyu@chromium.org#define opus_uint8       unsigned char
158885f2ff5a7a7d6a73432d26a6c0ae9147e6b452sergeyu@chromium.org
159885f2ff5a7a7d6a73432d26a6c0ae9147e6b452sergeyu@chromium.org#endif  /* OPUS_TYPES_H */
160