00001 00002 00003 00004 00005 00006 00007 00008 00009 00010 // 00011 // Last changed : $Date: 2006-05-24 10:56:37 -0400 (Wed, 24 May 2006) $ 00012 // File revision : $Revision: 10005 $ 00013 // 00014 // $Id: STTypes.h 10005 2006-05-24 14:56:37Z danielk $ 00015 // 00017 // 00018 // License : 00019 // 00020 // SoundTouch audio processing library 00021 // Copyright (c) Olli Parviainen 00022 // 00023 // This library is free software; you can redistribute it and/or 00024 // modify it under the terms of the GNU Lesser General Public 00025 // License as published by the Free Software Foundation; either 00026 // version 2.1 of the License, or (at your option) any later version. 00027 // 00028 // This library is distributed in the hope that it will be useful, 00029 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00030 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00031 // Lesser General Public License for more details. 00032 // 00033 // You should have received a copy of the GNU Lesser General Public 00034 // License along with this library; if not, write to the Free Software 00035 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00036 // 00038 00039 #ifndef STTypes_H 00040 #define STTypes_H 00041 00042 typedef unsigned int uint; 00043 typedef unsigned long ulong; 00044 00045 #ifndef _WINDEF_H 00046 // if these aren't defined already by Windows headers, define now 00047 00048 typedef int BOOL; 00049 00050 #define FALSE 0 00051 #define TRUE 1 00052 00053 #endif // _WINDEF_H 00054 00055 #define MULTICHANNEL 6 00056 00057 namespace soundtouch 00058 { 00061 //#undef INTEGER_SAMPLES 00062 //#undef FLOAT_SAMPLES 00063 00064 #if !(INTEGER_SAMPLES || FLOAT_SAMPLES) 00065 00080 #define INTEGER_SAMPLES 1 //< 16bit integer samples 00081 //#define FLOAT_SAMPLES 1 //< 32bit float samples 00082 00083 #endif 00084 00091 #define ALLOW_OPTIMIZATIONS 1 00092 00093 00094 // If defined, allows the SIMD-optimized routines to take minor shortcuts 00095 // for improved performance. Undefine to require faithfully similar SIMD 00096 // calculations as in normal C implementation. 00097 #define ALLOW_NONEXACT_SIMD_OPTIMIZATION 1 00098 00099 00100 #ifdef INTEGER_SAMPLES 00101 // 16bit integer sample type 00102 typedef short SAMPLETYPE; 00103 // data type for sample accumulation: Use 32bit integer to prevent overflows 00104 typedef long LONG_SAMPLETYPE; 00105 00106 #ifdef FLOAT_SAMPLES 00107 // check that only one sample type is defined 00108 #error "conflicting sample types defined" 00109 #endif // FLOAT_SAMPLES 00110 00111 #ifdef ALLOW_OPTIMIZATIONS 00112 #if _WIN32 || __MMX__ || MMX 00113 // Allow MMX optimizations 00114 #define ALLOW_MMX 1 00115 #endif 00116 #endif 00117 00118 #else 00119 00120 // floating point samples 00121 typedef float SAMPLETYPE; 00122 // data type for sample accumulation: Use double to utilize full precision. 00123 typedef double LONG_SAMPLETYPE; 00124 00125 #ifdef ALLOW_OPTIMIZATIONS 00126 // Allow 3DNow! and SSE optimizations 00127 #if WIN32 00128 #define ALLOW_3DNOW 1 00129 #endif 00130 00131 #if WIN32 || __MMX__ || MMX 00132 #define ALLOW_SSE 1 00133 #endif 00134 #endif 00135 00136 #endif // INTEGER_SAMPLES 00137 }; 00138 00139 #endif
1.5.5