Bug 810262 - Updated libsoundtouch to r160 r=padenot

This commit is contained in:
Jacek Caban 2012-11-13 11:25:14 +01:00
parent 42483631ba
commit c31804e035
20 changed files with 65 additions and 58 deletions

View File

@ -1,5 +1,5 @@
These files are from the SoundTouch library (http://www.surina.net/soundtouch/),
and are extracted from the revision r143 of the svn repository at
and are extracted from the revision r160 of the svn repository at
https://soundtouch.svn.sourceforge.net/svnroot/soundtouch/trunk.
The whole library is not used, only the relevant files are imported in the tree,

View File

@ -461,10 +461,9 @@ unchanged:
/// 'sequenceMS' = one processing sequence length in milliseconds
/// 'seekwindowMS' = seeking window length for scanning the best overlapping
/// position
only in patch2:
--- /src/cpu_detect_x86.cpp 2012-04-12 19:52:12.743376976 -0700
+++ /src/cpu_detect_x86.cpp 2012-08-02 09:54:24.561712171 -0700
@@ -38,30 +38,35 @@
--- /src/cpu_detect_x86.cpp
+++ /src/cpu_detect_x86.cpp
@@ -38,28 +38,33 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
////////////////////////////////////////////////////////////////////////////////
@ -479,14 +478,12 @@ only in patch2:
+ #if defined(__GNUC__)
+ // gcc and clang
#include "cpuid.h"
#endif
#if defined(_M_IX86)
// windows
#elif defined(_M_IX86)
// windows non-gcc
#include <intrin.h>
- #define bit_MMX (1 << 23)
- #define bit_SSE (1 << 25)
- #define bit_SSE2 (1 << 26)
- #define bit_MMX (1 << 23)
- #define bit_SSE (1 << 25)
- #define bit_SSE2 (1 << 26)
#endif
-
+ // If we still don't have the macros, define them (Windows, MacOS)

View File

@ -12,10 +12,10 @@
///
////////////////////////////////////////////////////////////////////////////////
//
// Last changed : $Date: 2009-01-11 03:34:24 -0800 (Sun, 11 Jan 2009) $
// Last changed : $Date$
// File revision : $Revision: 4 $
//
// $Id: AAFilter.cpp 45 2009-01-11 11:34:24Z oparviai $
// $Id$
//
////////////////////////////////////////////////////////////////////////////////
//

View File

@ -13,10 +13,10 @@
///
////////////////////////////////////////////////////////////////////////////////
//
// Last changed : $Date: 2008-02-10 08:26:55 -0800 (Sun, 10 Feb 2008) $
// Last changed : $Date$
// File revision : $Revision: 4 $
//
// $Id: AAFilter.h 11 2008-02-10 16:26:55Z oparviai $
// $Id$
//
////////////////////////////////////////////////////////////////////////////////
//

View File

@ -15,10 +15,10 @@
///
////////////////////////////////////////////////////////////////////////////////
//
// Last changed : $Date: 2012-06-13 12:29:53 -0700 (Wed, 13 Jun 2012) $
// Last changed : $Date$
// File revision : $Revision: 4 $
//
// $Id: FIFOSampleBuffer.cpp 143 2012-06-13 19:29:53Z oparviai $
// $Id$
//
////////////////////////////////////////////////////////////////////////////////
//
@ -177,7 +177,7 @@ void FIFOSampleBuffer::ensureCapacity(uint capacityRequirement)
ST_THROW_RT_ERROR("Couldn't allocate memory!\n");
}
// Align the buffer to begin at 16byte cache line boundary for optimal performance
temp = (SAMPLETYPE *)(((ulong)tempUnaligned + 15) & (ulong)-16);
temp = (SAMPLETYPE *)SOUNDTOUCH_ALIGN_POINTER_16(tempUnaligned);
if (samplesInBuffer)
{
memcpy(temp, ptrBegin(), samplesInBuffer * channels * sizeof(SAMPLETYPE));

View File

@ -15,10 +15,10 @@
///
////////////////////////////////////////////////////////////////////////////////
//
// Last changed : $Date: 2012-06-13 12:29:53 -0700 (Wed, 13 Jun 2012) $
// Last changed : $Date$
// File revision : $Revision: 4 $
//
// $Id: FIFOSampleBuffer.h 143 2012-06-13 19:29:53Z oparviai $
// $Id$
//
////////////////////////////////////////////////////////////////////////////////
//

View File

@ -17,10 +17,10 @@
///
////////////////////////////////////////////////////////////////////////////////
//
// Last changed : $Date: 2012-06-13 12:29:53 -0700 (Wed, 13 Jun 2012) $
// Last changed : $Date$
// File revision : $Revision: 4 $
//
// $Id: FIFOSamplePipe.h 143 2012-06-13 19:29:53Z oparviai $
// $Id$
//
////////////////////////////////////////////////////////////////////////////////
//

View File

@ -11,10 +11,10 @@
///
////////////////////////////////////////////////////////////////////////////////
//
// Last changed : $Date: 2011-09-02 11:56:11 -0700 (Fri, 02 Sep 2011) $
// Last changed : $Date$
// File revision : $Revision: 4 $
//
// $Id: FIRFilter.cpp 131 2011-09-02 18:56:11Z oparviai $
// $Id$
//
////////////////////////////////////////////////////////////////////////////////
//

View File

@ -11,10 +11,10 @@
///
////////////////////////////////////////////////////////////////////////////////
//
// Last changed : $Date: 2011-02-13 11:13:57 -0800 (Sun, 13 Feb 2011) $
// Last changed : $Date$
// File revision : $Revision: 4 $
//
// $Id: FIRFilter.h 104 2011-02-13 19:13:57Z oparviai $
// $Id$
//
////////////////////////////////////////////////////////////////////////////////
//

View File

@ -10,10 +10,10 @@
///
////////////////////////////////////////////////////////////////////////////////
//
// Last changed : $Date: 2011-09-02 11:56:11 -0700 (Fri, 02 Sep 2011) $
// Last changed : $Date$
// File revision : $Revision: 4 $
//
// $Id: RateTransposer.cpp 131 2011-09-02 18:56:11Z oparviai $
// $Id$
//
////////////////////////////////////////////////////////////////////////////////
//

View File

@ -14,10 +14,10 @@
///
////////////////////////////////////////////////////////////////////////////////
//
// Last changed : $Date: 2009-02-21 08:00:14 -0800 (Sat, 21 Feb 2009) $
// Last changed : $Date$
// File revision : $Revision: 4 $
//
// $Id: RateTransposer.h 63 2009-02-21 16:00:14Z oparviai $
// $Id$
//
////////////////////////////////////////////////////////////////////////////////
//

View File

@ -8,10 +8,10 @@
///
////////////////////////////////////////////////////////////////////////////////
//
// Last changed : $Date: 2012-04-01 10:01:42 -0700 (Sun, 01 Apr 2012) $
// Last changed : $Date$
// File revision : $Revision: 3 $
//
// $Id: STTypes.h 136 2012-04-01 17:01:42Z oparviai $
// $Id$
//
////////////////////////////////////////////////////////////////////////////////
//
@ -42,6 +42,18 @@
typedef unsigned int uint;
typedef unsigned long ulong;
// Patch for MinGW: on Win64 long is 32-bit
#ifdef _WIN64
typedef unsigned long long ulongptr;
#else
typedef ulong ulongptr;
#endif
// Helper macro for aligning pointer up to next 16-byte boundary
#define SOUNDTOUCH_ALIGN_POINTER_16(x) ( ( (ulongptr)(x) + 15 ) & ~(ulongptr)15 )
#include "soundtouch_config.h"
#ifdef WIN32

View File

@ -41,10 +41,10 @@
///
////////////////////////////////////////////////////////////////////////////////
//
// Last changed : $Date: 2012-06-13 12:29:53 -0700 (Wed, 13 Jun 2012) $
// Last changed : $Date$
// File revision : $Revision: 4 $
//
// $Id: SoundTouch.cpp 143 2012-06-13 19:29:53Z oparviai $
// $Id$
//
////////////////////////////////////////////////////////////////////////////////
//

View File

@ -41,10 +41,10 @@
///
////////////////////////////////////////////////////////////////////////////////
//
// Last changed : $Date: 2012-04-04 12:47:28 -0700 (Wed, 04 Apr 2012) $
// Last changed : $Date$
// File revision : $Revision: 4 $
//
// $Id: SoundTouch.h 141 2012-04-04 19:47:28Z oparviai $
// $Id$
//
////////////////////////////////////////////////////////////////////////////////
//

View File

@ -13,10 +13,10 @@
///
////////////////////////////////////////////////////////////////////////////////
//
// Last changed : $Date: 2012-04-01 12:49:30 -0700 (Sun, 01 Apr 2012) $
// Last changed : $Date$
// File revision : $Revision: 1.12 $
//
// $Id: TDStretch.cpp 137 2012-04-01 19:49:30Z oparviai $
// $Id$
//
////////////////////////////////////////////////////////////////////////////////
//
@ -590,7 +590,7 @@ void TDStretch::acceptNewOverlapLength(int newOverlapLength)
pMidBufferUnaligned = new SAMPLETYPE[overlapLength * 2 + 16 / sizeof(SAMPLETYPE)];
// ensure that 'pMidBuffer' is aligned to 16 byte boundary for efficiency
pMidBuffer = (SAMPLETYPE *)((((ulong)pMidBufferUnaligned) + 15) & (ulong)-16);
pMidBuffer = (SAMPLETYPE *)SOUNDTOUCH_ALIGN_POINTER_16(pMidBufferUnaligned);
clearMidBuffer();
}

View File

@ -13,10 +13,10 @@
///
////////////////////////////////////////////////////////////////////////////////
//
// Last changed : $Date: 2012-04-01 12:49:30 -0700 (Sun, 01 Apr 2012) $
// Last changed : $Date$
// File revision : $Revision: 4 $
//
// $Id: TDStretch.h 137 2012-04-01 19:49:30Z oparviai $
// $Id$
//
////////////////////////////////////////////////////////////////////////////////
//

View File

@ -12,10 +12,10 @@
///
////////////////////////////////////////////////////////////////////////////////
//
// Last changed : $Date: 2008-02-10 08:26:55 -0800 (Sun, 10 Feb 2008) $
// Last changed : $Date$
// File revision : $Revision: 4 $
//
// $Id: cpu_detect.h 11 2008-02-10 16:26:55Z oparviai $
// $Id$
//
////////////////////////////////////////////////////////////////////////////////
//

View File

@ -11,10 +11,10 @@
///
////////////////////////////////////////////////////////////////////////////////
//
// Last changed : $Date: 2012-04-01 13:00:09 -0700 (Sun, 01 Apr 2012) $
// Last changed : $Date$
// File revision : $Revision: 4 $
//
// $Id: cpu_detect_x86.cpp 138 2012-04-01 20:00:09Z oparviai $
// $Id$
//
////////////////////////////////////////////////////////////////////////////////
//
@ -46,10 +46,8 @@
#if defined(__GNUC__)
// gcc and clang
#include "cpuid.h"
#endif
#if defined(_M_IX86)
// windows
#elif defined(_M_IX86)
// windows non-gcc
#include <intrin.h>
#endif
// If we still don't have the macros, define them (Windows, MacOS)

View File

@ -20,10 +20,10 @@
///
////////////////////////////////////////////////////////////////////////////////
//
// Last changed : $Date: 2012-04-01 12:49:30 -0700 (Sun, 01 Apr 2012) $
// Last changed : $Date$
// File revision : $Revision: 4 $
//
// $Id: mmx_optimized.cpp 137 2012-04-01 19:49:30Z oparviai $
// $Id$
//
////////////////////////////////////////////////////////////////////////////////
//
@ -239,7 +239,7 @@ void FIRFilterMMX::setCoefficients(const short *coeffs, uint newLength, uint uRe
// Ensure that filter coeffs array is aligned to 16-byte boundary
delete[] filterCoeffsUnalign;
filterCoeffsUnalign = new short[2 * newLength + 8];
filterCoeffsAlign = (short *)(((ulong)filterCoeffsUnalign + 15) & -16);
filterCoeffsAlign = (short *)SOUNDTOUCH_ALIGN_POINTER_16(filterCoeffsUnalign);
// rearrange the filter coefficients for mmx routines
for (i = 0;i < length; i += 4)

View File

@ -23,10 +23,10 @@
///
////////////////////////////////////////////////////////////////////////////////
//
// Last changed : $Date: 2012-04-01 12:49:30 -0700 (Sun, 01 Apr 2012) $
// Last changed : $Date$
// File revision : $Revision: 4 $
//
// $Id: sse_optimized.cpp 137 2012-04-01 19:49:30Z oparviai $
// $Id$
//
////////////////////////////////////////////////////////////////////////////////
//
@ -93,7 +93,7 @@ double TDStretchSSE::calcCrossCorr(const float *pV1, const float *pV2) const
#define _MM_LOAD _mm_load_ps
if (((ulong)pV1) & 15) return -1e50; // skip unaligned locations
if (((ulongptr)pV1) & 15) return -1e50; // skip unaligned locations
#else
// No cheating allowed, use unaligned load & take the resulting
@ -218,7 +218,7 @@ void FIRFilterSSE::setCoefficients(const float *coeffs, uint newLength, uint uRe
// Ensure that filter coeffs array is aligned to 16-byte boundary
delete[] filterCoeffsUnalign;
filterCoeffsUnalign = new float[2 * newLength + 4];
filterCoeffsAlign = (float *)(((unsigned long)filterCoeffsUnalign + 15) & (ulong)-16);
filterCoeffsAlign = (float *)SOUNDTOUCH_ALIGN_POINTER_16(filterCoeffsUnalign);
fDivider = (float)resultDivider;
@ -246,7 +246,7 @@ uint FIRFilterSSE::evaluateFilterStereo(float *dest, const float *source, uint n
assert(dest != NULL);
assert((length % 8) == 0);
assert(filterCoeffsAlign != NULL);
assert(((ulong)filterCoeffsAlign) % 16 == 0);
assert(((ulongptr)filterCoeffsAlign) % 16 == 0);
// filter is evaluated for two stereo samples with each iteration, thus use of 'j += 2'
for (j = 0; j < count; j += 2)