PageRenderTime 424ms CodeModel.GetById 201ms app.highlight 4ms RepoModel.GetById 218ms app.codeStats 0ms

/external/pysoundtouch14/libsoundtouch/STTypes.h

http://echo-nest-remix.googlecode.com/
C++ Header | 110 lines | 36 code | 19 blank | 55 comment | 1 complexity | 4bd6d60f9bcefa299c555b11e4dde2b6 MD5 | raw file
  1////////////////////////////////////////////////////////////////////////////////
  2///
  3/// Common type definitions for SoundTouch audio processing library.
  4///
  5/// Author        : Copyright (c) Olli Parviainen
  6/// Author e-mail : oparviai @ iki.fi
  7/// SoundTouch WWW: http://www.iki.fi/oparviai/soundtouch
  8///
  9////////////////////////////////////////////////////////////////////////////////
 10//
 11// Last changed  : $Date: 2004/10/30 16:10:15 $
 12// File revision : $Revision: 1.13 $
 13//
 14// $Id: STTypes.h,v 1.13 2004/10/30 16:10:15 Olli Exp $
 15//
 16////////////////////////////////////////////////////////////////////////////////
 17//
 18// License :
 19//
 20//  SoundTouch audio processing library
 21//  Copyright (c) Olli Parviainen
 22//
 23//  This library is free software; you can redistribute it and/or
 24//  modify it under the terms of the GNU Lesser General Public
 25//  License as published by the Free Software Foundation; either
 26//  version 2.1 of the License, or (at your option) any later version.
 27//
 28//  This library is distributed in the hope that it will be useful,
 29//  but WITHOUT ANY WARRANTY; without even the implied warranty of
 30//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 31//  Lesser General Public License for more details.
 32//
 33//  You should have received a copy of the GNU Lesser General Public
 34//  License along with this library; if not, write to the Free Software
 35//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 36//
 37////////////////////////////////////////////////////////////////////////////////
 38
 39#ifndef STTypes_H

 40#define STTypes_H

 41
 42typedef unsigned int    uint;
 43typedef unsigned long   ulong;
 44
 45#ifndef _WINDEF_

 46    // if these aren't defined already by Windows headers, define now
 47
 48    typedef unsigned int    BOOL;
 49
 50    #define FALSE   0
 51    #define TRUE    1
 52
 53#endif  // _WINDEF_
 54
 55
 56namespace soundtouch
 57{
 58    /// Enable one of the following defines to choose either 16bit integer or
 59    /// 32bit float sample type. If you don't have opinion, using integer samples
 60    /// is generally faster.
 61    //#define INTEGER_SAMPLES       //< 16bit integer samples
 62    #define FLOAT_SAMPLES       //< 32bit float samples
 63
 64
 65    /// Define this to allow CPU-specific assembler optimizations. Notice that 
 66    /// having this enabled on non-x86 platforms doesn't matter; the compiler can 
 67    /// drop unsupported extensions on different platforms automatically. 
 68    /// However, if you're having difficulties getting the optimized routines 
 69    /// compiled with your compler (e.g. some gcc compiler versions may be picky), 
 70    /// you may wish to disable the optimizations to make the library compile.
 71    #define ALLOW_OPTIMIZATIONS     1

 72
 73
 74    #ifdef INTEGER_SAMPLES

 75        // 16bit integer sample type
 76        typedef short SAMPLETYPE;
 77        // data type for sample accumulation: Use 32bit integer to prevent overflows
 78        typedef long  LONG_SAMPLETYPE;
 79
 80        #ifdef FLOAT_SAMPLES
 81            // check that only one sample type is defined
 82            #error "conflicting sample types defined"

 83        #endif // FLOAT_SAMPLES
 84
 85        #ifdef ALLOW_OPTIMIZATIONS

 86            #if WIN32 || __i386__

 87                // Allow MMX optimizations
 88                #define ALLOW_MMX   1

 89            #endif

 90        #endif

 91
 92    #else

 93
 94        // floating point samples
 95        typedef float  SAMPLETYPE;
 96        // data type for sample accumulation: Use double to utilize full precision.
 97        typedef double LONG_SAMPLETYPE;
 98
 99        #ifdef ALLOW_OPTIMIZATIONS
100            #ifdef WIN32
101                // Allow 3DNow! and SSE optimizations
102                #define ALLOW_3DNOW     1

103                #define ALLOW_SSE       1

104            #endif // WIN32
105        #endif

106
107    #endif  // INTEGER_SAMPLES
108};
109
110#endif