~ubuntu-branches/ubuntu/gutsy/audacity/gutsy-backports

« back to all changes in this revision

Viewing changes to lib-src/soundtouch/soundtouch/STTypes.h

  • Committer: Bazaar Package Importer
  • Author(s): John Dong
  • Date: 2008-02-18 21:58:19 UTC
  • mfrom: (13.1.2 hardy)
  • Revision ID: james.westby@ubuntu.com-20080218215819-tmbcf1rx238r8gdv
Tags: 1.3.4-1.1ubuntu1~gutsy1
Automated backport upload; no source changes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
////////////////////////////////////////////////////////////////////////////////
2
 
///
3
 
/// Common type definitions for SoundTouch audio processing library.
4
 
///
5
 
/// Author        : Copyright (c) Olli Parviainen
6
 
/// Author e-mail : oparviai 'at' iki.fi
7
 
/// SoundTouch WWW: http://www.surina.net/soundtouch
8
 
///
9
 
////////////////////////////////////////////////////////////////////////////////
10
 
//
11
 
// Last changed  : $Date: 2006/09/18 07:39:15 $
12
 
// File revision : $Revision: 1.2 $
13
 
//
14
 
// $Id: STTypes.h,v 1.2 2006/09/18 07:39:15 richardash1981 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
 
 
42
 
typedef unsigned int    uint;
43
 
typedef unsigned long   ulong;
44
 
 
45
 
#ifdef __GNUC__
46
 
    // In GCC, include soundtouch_config.h made by config scritps
47
 
    #include "soundtouch_config.h"
48
 
#endif
49
 
 
50
 
#ifndef _WINDEF_
51
 
    // if these aren't defined already by Windows headers, define now
52
 
 
53
 
    typedef int BOOL;
54
 
 
55
 
    #define FALSE   0
56
 
    #define TRUE    1
57
 
 
58
 
#endif  // _WINDEF_
59
 
 
60
 
 
61
 
namespace soundtouch
62
 
{
63
 
/// Activate these undef's to overrule the possible sampletype 
64
 
/// setting inherited from some other header file:
65
 
//#undef INTEGER_SAMPLES
66
 
//#undef FLOAT_SAMPLES
67
 
 
68
 
#if !(INTEGER_SAMPLES || FLOAT_SAMPLES)
69
 
   
70
 
    /// Choose either 32bit floating point or 16bit integer sampletype
71
 
    /// by choosing one of the following defines, unless this selection 
72
 
    /// has already been done in some other file.
73
 
    ////
74
 
    /// Notes:
75
 
    /// - In Windows environment, choose the sample format with the
76
 
    ///   following defines.
77
 
    /// - In GNU environment, the floating point samples are used by 
78
 
    ///   default, but integer samples can be chosen by giving the 
79
 
    ///   following switch to the configure script:
80
 
    ///       ./configure --enable-integer-samples
81
 
    ///   However, if you still prefer to select the sample format here 
82
 
    ///   also in GNU environment, then please #undef the INTEGER_SAMPLE
83
 
    ///   and FLOAT_SAMPLE defines first as in comments above.
84
 
    //#define INTEGER_SAMPLES     1    //< 16bit integer samples
85
 
    #define FLOAT_SAMPLES       1    //< 32bit float samples
86
 
 
87
 
 #endif
88
 
 
89
 
    /// Define this to allow CPU-specific assembler optimizations. Notice that 
90
 
    /// having this enabled on non-x86 platforms doesn't matter; the compiler can 
91
 
    /// drop unsupported extensions on different platforms automatically. 
92
 
    /// However, if you're having difficulties getting the optimized routines 
93
 
    /// compiled with your compler (e.g. some gcc compiler versions may be picky), 
94
 
    /// you may wish to disable the optimizations to make the library compile.
95
 
    #define ALLOW_OPTIMIZATIONS     1
96
 
 
97
 
 
98
 
    // If defined, allows the SIMD-optimized routines to take minor shortcuts 
99
 
    // for improved performance. Undefine to require faithfully similar SIMD 
100
 
    // calculations as in normal C implementation.
101
 
    #define ALLOW_NONEXACT_SIMD_OPTIMIZATION    1
102
 
 
103
 
 
104
 
    #ifdef INTEGER_SAMPLES
105
 
        // 16bit integer sample type
106
 
        typedef short SAMPLETYPE;
107
 
        // data type for sample accumulation: Use 32bit integer to prevent overflows
108
 
        typedef long  LONG_SAMPLETYPE;
109
 
 
110
 
        #ifdef FLOAT_SAMPLES
111
 
            // check that only one sample type is defined
112
 
            #error "conflicting sample types defined"
113
 
        #endif // FLOAT_SAMPLES
114
 
 
115
 
        #ifdef ALLOW_OPTIMIZATIONS
116
 
            #if (WIN32 || __i386__ || __x86_64__)
117
 
                // Allow MMX optimizations
118
 
                #define ALLOW_MMX   1
119
 
            #endif
120
 
        #endif
121
 
 
122
 
    #else
123
 
 
124
 
        // floating point samples
125
 
        typedef float  SAMPLETYPE;
126
 
        // data type for sample accumulation: Use double to utilize full precision.
127
 
        typedef double LONG_SAMPLETYPE;
128
 
 
129
 
        #ifdef ALLOW_OPTIMIZATIONS
130
 
                // Allow 3DNow! and SSE optimizations
131
 
            #if WIN32
132
 
                #define ALLOW_3DNOW     1
133
 
            #endif
134
 
 
135
 
            #if (WIN32 || __i386__ || __x86_64__)
136
 
                #define ALLOW_SSE       1
137
 
            #endif
138
 
        #endif
139
 
 
140
 
    #endif  // INTEGER_SAMPLES
141
 
};
142
 
 
143
 
#endif