Opus
Opus audio codec (RFC 6716): API and operations manual
1.3
opus_types.h
Go to the documentation of this file.
00001 /* (C) COPYRIGHT 1994-2002 Xiph.Org Foundation */
00002 /* Modified by Jean-Marc Valin */
00003 /*
00004    Redistribution and use in source and binary forms, with or without
00005    modification, are permitted provided that the following conditions
00006    are met:
00007 
00008    - Redistributions of source code must retain the above copyright
00009    notice, this list of conditions and the following disclaimer.
00010 
00011    - Redistributions in binary form must reproduce the above copyright
00012    notice, this list of conditions and the following disclaimer in the
00013    documentation and/or other materials provided with the distribution.
00014 
00015    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
00016    ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
00017    LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
00018    A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
00019    OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
00020    EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
00021    PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
00022    PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
00023    LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
00024    NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
00025    SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00026 */
00027 /* opus_types.h based on ogg_types.h from libogg */
00028 
00033 #ifndef OPUS_TYPES_H
00034 #define OPUS_TYPES_H
00035 
00036 #define opus_int         int                     /* used for counters etc; at least 16 bits */
00037 #define opus_int64       long long
00038 #define opus_int8        signed char
00039 
00040 #define opus_uint        unsigned int            /* used for counters etc; at least 16 bits */
00041 #define opus_uint64      unsigned long long
00042 #define opus_uint8       unsigned char
00043 
00044 /* Use the real stdint.h if it's there (taken from Paul Hsieh's pstdint.h) */
00045 #if (defined(__STDC__) && __STDC__ && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || (defined(__GNUC__) && (defined(_STDINT_H) || defined(_STDINT_H_)) || defined (HAVE_STDINT_H))
00046 #include <stdint.h>
00047 #  undef opus_int64
00048 #  undef opus_int8
00049 #  undef opus_uint64
00050 #  undef opus_uint8
00051    typedef int8_t opus_int8;
00052    typedef uint8_t opus_uint8;
00053    typedef int16_t opus_int16;
00054    typedef uint16_t opus_uint16;
00055    typedef int32_t opus_int32;
00056    typedef uint32_t opus_uint32;
00057    typedef int64_t opus_int64;
00058    typedef uint64_t opus_uint64;
00059 #elif defined(_WIN32)
00060 
00061 #  if defined(__CYGWIN__)
00062 #    include <_G_config.h>
00063      typedef _G_int32_t opus_int32;
00064      typedef _G_uint32_t opus_uint32;
00065      typedef _G_int16 opus_int16;
00066      typedef _G_uint16 opus_uint16;
00067 #  elif defined(__MINGW32__)
00068      typedef short opus_int16;
00069      typedef unsigned short opus_uint16;
00070      typedef int opus_int32;
00071      typedef unsigned int opus_uint32;
00072 #  elif defined(__MWERKS__)
00073      typedef int opus_int32;
00074      typedef unsigned int opus_uint32;
00075      typedef short opus_int16;
00076      typedef unsigned short opus_uint16;
00077 #  else
00078      /* MSVC/Borland */
00079      typedef __int32 opus_int32;
00080      typedef unsigned __int32 opus_uint32;
00081      typedef __int16 opus_int16;
00082      typedef unsigned __int16 opus_uint16;
00083 #  endif
00084 
00085 #elif defined(__MACOS__)
00086 
00087 #  include <sys/types.h>
00088    typedef SInt16 opus_int16;
00089    typedef UInt16 opus_uint16;
00090    typedef SInt32 opus_int32;
00091    typedef UInt32 opus_uint32;
00092 
00093 #elif (defined(__APPLE__) && defined(__MACH__)) /* MacOS X Framework build */
00094 
00095 #  include <sys/types.h>
00096    typedef int16_t opus_int16;
00097    typedef u_int16_t opus_uint16;
00098    typedef int32_t opus_int32;
00099    typedef u_int32_t opus_uint32;
00100 
00101 #elif defined(__BEOS__)
00102 
00103    /* Be */
00104 #  include <inttypes.h>
00105    typedef int16 opus_int16;
00106    typedef u_int16 opus_uint16;
00107    typedef int32_t opus_int32;
00108    typedef u_int32_t opus_uint32;
00109 
00110 #elif defined (__EMX__)
00111 
00112    /* OS/2 GCC */
00113    typedef short opus_int16;
00114    typedef unsigned short opus_uint16;
00115    typedef int opus_int32;
00116    typedef unsigned int opus_uint32;
00117 
00118 #elif defined (DJGPP)
00119 
00120    /* DJGPP */
00121    typedef short opus_int16;
00122    typedef unsigned short opus_uint16;
00123    typedef int opus_int32;
00124    typedef unsigned int opus_uint32;
00125 
00126 #elif defined(R5900)
00127 
00128    /* PS2 EE */
00129    typedef int opus_int32;
00130    typedef unsigned opus_uint32;
00131    typedef short opus_int16;
00132    typedef unsigned short opus_uint16;
00133 
00134 #elif defined(__SYMBIAN32__)
00135 
00136    /* Symbian GCC */
00137    typedef signed short opus_int16;
00138    typedef unsigned short opus_uint16;
00139    typedef signed int opus_int32;
00140    typedef unsigned int opus_uint32;
00141 
00142 #elif defined(CONFIG_TI_C54X) || defined (CONFIG_TI_C55X)
00143 
00144    typedef short opus_int16;
00145    typedef unsigned short opus_uint16;
00146    typedef long opus_int32;
00147    typedef unsigned long opus_uint32;
00148 
00149 #elif defined(CONFIG_TI_C6X)
00150 
00151    typedef short opus_int16;
00152    typedef unsigned short opus_uint16;
00153    typedef int opus_int32;
00154    typedef unsigned int opus_uint32;
00155 
00156 #else
00157 
00158    /* Give up, take a reasonable guess */
00159    typedef short opus_int16;
00160    typedef unsigned short opus_uint16;
00161    typedef int opus_int32;
00162    typedef unsigned int opus_uint32;
00163 
00164 #endif
00165 
00166 #endif  /* OPUS_TYPES_H */
 All Files Functions Typedefs Defines
For more information visit the Opus Website.