summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorUwe Klotz <uwe_klotz@web.de>2016-03-05 13:55:26 +0100
committerUwe Klotz <uwe_klotz@web.de>2016-03-05 14:41:50 +0100
commit2f16493e75d2c7b5b76b714a475eb523d8cfc311 (patch)
tree7bed077686930b6c0db5add0687cd4c1faee0059 /lib
parentb44e0b4d0ed8d357cfc829d0548cd0f66c83ff74 (diff)
Upgrade Soundtouch: 1.8.0 -> 1.9.2
Diffstat (limited to 'lib')
-rw-r--r--lib/soundtouch-1.9.2/AAFilter.cpp (renamed from lib/soundtouch-1.8.0/AAFilter.cpp)2
-rw-r--r--lib/soundtouch-1.9.2/AAFilter.h (renamed from lib/soundtouch-1.8.0/AAFilter.h)2
-rw-r--r--lib/soundtouch-1.9.2/BPMDetect.cpp (renamed from lib/soundtouch-1.8.0/BPMDetect.cpp)5
-rw-r--r--lib/soundtouch-1.9.2/BPMDetect.h (renamed from lib/soundtouch-1.8.0/BPMDetect.h)2
-rw-r--r--lib/soundtouch-1.9.2/COPYING.TXT (renamed from lib/soundtouch-1.8.0/COPYING.TXT)0
-rw-r--r--lib/soundtouch-1.9.2/FIFOSampleBuffer.cpp (renamed from lib/soundtouch-1.8.0/FIFOSampleBuffer.cpp)2
-rw-r--r--lib/soundtouch-1.9.2/FIFOSampleBuffer.h (renamed from lib/soundtouch-1.8.0/FIFOSampleBuffer.h)2
-rw-r--r--lib/soundtouch-1.9.2/FIFOSamplePipe.h (renamed from lib/soundtouch-1.8.0/FIFOSamplePipe.h)2
-rw-r--r--lib/soundtouch-1.9.2/FIRFilter.cpp (renamed from lib/soundtouch-1.8.0/FIRFilter.cpp)65
-rw-r--r--lib/soundtouch-1.9.2/FIRFilter.h (renamed from lib/soundtouch-1.8.0/FIRFilter.h)8
-rw-r--r--lib/soundtouch-1.9.2/InterpolateCubic.cpp (renamed from lib/soundtouch-1.8.0/InterpolateCubic.cpp)0
-rw-r--r--lib/soundtouch-1.9.2/InterpolateCubic.h (renamed from lib/soundtouch-1.8.0/InterpolateCubic.h)4
-rw-r--r--lib/soundtouch-1.9.2/InterpolateLinear.cpp (renamed from lib/soundtouch-1.8.0/InterpolateLinear.cpp)15
-rw-r--r--lib/soundtouch-1.9.2/InterpolateLinear.h (renamed from lib/soundtouch-1.8.0/InterpolateLinear.h)6
-rw-r--r--lib/soundtouch-1.9.2/InterpolateShannon.cpp (renamed from lib/soundtouch-1.8.0/InterpolateShannon.cpp)0
-rw-r--r--lib/soundtouch-1.9.2/InterpolateShannon.h (renamed from lib/soundtouch-1.8.0/InterpolateShannon.h)4
-rw-r--r--lib/soundtouch-1.9.2/PeakFinder.cpp (renamed from lib/soundtouch-1.8.0/PeakFinder.cpp)20
-rw-r--r--lib/soundtouch-1.9.2/PeakFinder.h (renamed from lib/soundtouch-1.8.0/PeakFinder.h)2
-rw-r--r--lib/soundtouch-1.9.2/RateTransposer.cpp (renamed from lib/soundtouch-1.8.0/RateTransposer.cpp)16
-rw-r--r--lib/soundtouch-1.9.2/RateTransposer.h (renamed from lib/soundtouch-1.8.0/RateTransposer.h)10
-rw-r--r--lib/soundtouch-1.9.2/STTypes.h (renamed from lib/soundtouch-1.8.0/STTypes.h)7
-rw-r--r--lib/soundtouch-1.9.2/SoundTouch.cpp (renamed from lib/soundtouch-1.8.0/SoundTouch.cpp)120
-rw-r--r--lib/soundtouch-1.9.2/SoundTouch.h (renamed from lib/soundtouch-1.8.0/SoundTouch.h)56
-rw-r--r--lib/soundtouch-1.9.2/TDStretch.cpp (renamed from lib/soundtouch-1.8.0/TDStretch.cpp)281
-rw-r--r--lib/soundtouch-1.9.2/TDStretch.h (renamed from lib/soundtouch-1.8.0/TDStretch.h)49
-rw-r--r--lib/soundtouch-1.9.2/cpu_detect.h (renamed from lib/soundtouch-1.8.0/cpu_detect.h)2
-rw-r--r--lib/soundtouch-1.9.2/cpu_detect_x86.cpp (renamed from lib/soundtouch-1.8.0/cpu_detect_x86.cpp)2
-rw-r--r--lib/soundtouch-1.9.2/mmx_optimized.cpp (renamed from lib/soundtouch-1.8.0/mmx_optimized.cpp)29
-rw-r--r--lib/soundtouch-1.9.2/soundtouch_config.h (renamed from lib/soundtouch-1.8.0/soundtouch_config.h)0
-rw-r--r--lib/soundtouch-1.9.2/sse_optimized.cpp (renamed from lib/soundtouch-1.8.0/sse_optimized.cpp)20
30 files changed, 468 insertions, 265 deletions
diff --git a/lib/soundtouch-1.8.0/AAFilter.cpp b/lib/soundtouch-1.9.2/AAFilter.cpp
index a942859a37..c69f356f68 100644
--- a/lib/soundtouch-1.8.0/AAFilter.cpp
+++ b/lib/soundtouch-1.9.2/AAFilter.cpp
@@ -12,7 +12,7 @@
///
////////////////////////////////////////////////////////////////////////////////
//
-// Last changed : $Date: 2014-01-05 16:40:22 -0500 (Sun, 05 Jan 2014) $
+// Last changed : $Date: 2014-01-05 23:40:22 +0200 (Sun, 05 Jan 2014) $
// File revision : $Revision: 4 $
//
// $Id: AAFilter.cpp 177 2014-01-05 21:40:22Z oparviai $
diff --git a/lib/soundtouch-1.8.0/AAFilter.h b/lib/soundtouch-1.9.2/AAFilter.h
index 72f5b8a968..33e96948ec 100644
--- a/lib/soundtouch-1.8.0/AAFilter.h
+++ b/lib/soundtouch-1.9.2/AAFilter.h
@@ -13,7 +13,7 @@
///
////////////////////////////////////////////////////////////////////////////////
//
-// Last changed : $Date: 2014-01-07 14:41:23 -0500 (Tue, 07 Jan 2014) $
+// Last changed : $Date: 2014-01-07 21:41:23 +0200 (Tue, 07 Jan 2014) $
// File revision : $Revision: 4 $
//
// $Id: AAFilter.h 187 2014-01-07 19:41:23Z oparviai $
diff --git a/lib/soundtouch-1.8.0/BPMDetect.cpp b/lib/soundtouch-1.9.2/BPMDetect.cpp
index 0cee95716c..39dae83761 100644
--- a/lib/soundtouch-1.8.0/BPMDetect.cpp
+++ b/lib/soundtouch-1.9.2/BPMDetect.cpp
@@ -26,10 +26,10 @@
///
////////////////////////////////////////////////////////////////////////////////
//
-// Last changed : $Date: 2012-08-30 15:45:25 -0400 (Thu, 30 Aug 2012) $
+// Last changed : $Date: 2015-02-21 23:24:29 +0200 (Sat, 21 Feb 2015) $
// File revision : $Revision: 4 $
//
-// $Id: BPMDetect.cpp 149 2012-08-30 19:45:25Z oparviai $
+// $Id: BPMDetect.cpp 202 2015-02-21 21:24:29Z oparviai $
//
////////////////////////////////////////////////////////////////////////////////
//
@@ -226,6 +226,7 @@ void BPMDetect::updateXCorr(int process_samples)
assert(buffer->numSamples() >= (uint)(process_samples + windowLen));
pBuffer = buffer->ptrBegin();
+ #pragma omp parallel for
for (offs = windowStart; offs < windowLen; offs ++)
{
LONG_SAMPLETYPE sum;
diff --git a/lib/soundtouch-1.8.0/BPMDetect.h b/lib/soundtouch-1.9.2/BPMDetect.h
index f21890adf9..69d98143a7 100644
--- a/lib/soundtouch-1.8.0/BPMDetect.h
+++ b/lib/soundtouch-1.9.2/BPMDetect.h
@@ -26,7 +26,7 @@
///
////////////////////////////////////////////////////////////////////////////////
//
-// Last changed : $Date: 2012-08-30 15:53:44 -0400 (Thu, 30 Aug 2012) $
+// Last changed : $Date: 2012-08-30 22:53:44 +0300 (Thu, 30 Aug 2012) $
// File revision : $Revision: 4 $
//
// $Id: BPMDetect.h 150 2012-08-30 19:53:44Z oparviai $
diff --git a/lib/soundtouch-1.8.0/COPYING.TXT b/lib/soundtouch-1.9.2/COPYING.TXT
index 5b2161be20..5b2161be20 100644
--- a/lib/soundtouch-1.8.0/COPYING.TXT
+++ b/lib/soundtouch-1.9.2/COPYING.TXT
diff --git a/lib/soundtouch-1.8.0/FIFOSampleBuffer.cpp b/lib/soundtouch-1.9.2/FIFOSampleBuffer.cpp
index a8bf164d53..5f5ec4b7db 100644
--- a/lib/soundtouch-1.8.0/FIFOSampleBuffer.cpp
+++ b/lib/soundtouch-1.9.2/FIFOSampleBuffer.cpp
@@ -15,7 +15,7 @@
///
////////////////////////////////////////////////////////////////////////////////
//
-// Last changed : $Date: 2012-11-08 13:53:01 -0500 (Thu, 08 Nov 2012) $
+// Last changed : $Date: 2012-11-08 20:53:01 +0200 (Thu, 08 Nov 2012) $
// File revision : $Revision: 4 $
//
// $Id: FIFOSampleBuffer.cpp 160 2012-11-08 18:53:01Z oparviai $
diff --git a/lib/soundtouch-1.8.0/FIFOSampleBuffer.h b/lib/soundtouch-1.9.2/FIFOSampleBuffer.h
index ee4d66db39..6f33df3daa 100644
--- a/lib/soundtouch-1.8.0/FIFOSampleBuffer.h
+++ b/lib/soundtouch-1.9.2/FIFOSampleBuffer.h
@@ -15,7 +15,7 @@
///
////////////////////////////////////////////////////////////////////////////////
//
-// Last changed : $Date: 2014-01-05 16:40:22 -0500 (Sun, 05 Jan 2014) $
+// Last changed : $Date: 2014-01-05 23:40:22 +0200 (Sun, 05 Jan 2014) $
// File revision : $Revision: 4 $
//
// $Id: FIFOSampleBuffer.h 177 2014-01-05 21:40:22Z oparviai $
diff --git a/lib/soundtouch-1.8.0/FIFOSamplePipe.h b/lib/soundtouch-1.9.2/FIFOSamplePipe.h
index 22b3d7fe54..6e3105970b 100644
--- a/lib/soundtouch-1.8.0/FIFOSamplePipe.h
+++ b/lib/soundtouch-1.9.2/FIFOSamplePipe.h
@@ -17,7 +17,7 @@
///
////////////////////////////////////////////////////////////////////////////////
//
-// Last changed : $Date: 2012-06-13 15:29:53 -0400 (Wed, 13 Jun 2012) $
+// Last changed : $Date: 2012-06-13 22:29:53 +0300 (Wed, 13 Jun 2012) $
// File revision : $Revision: 4 $
//
// $Id: FIFOSamplePipe.h 143 2012-06-13 19:29:53Z oparviai $
diff --git a/lib/soundtouch-1.8.0/FIRFilter.cpp b/lib/soundtouch-1.9.2/FIRFilter.cpp
index 0a7e07a9e9..e56969b053 100644
--- a/lib/soundtouch-1.8.0/FIRFilter.cpp
+++ b/lib/soundtouch-1.9.2/FIRFilter.cpp
@@ -11,10 +11,10 @@
///
////////////////////////////////////////////////////////////////////////////////
//
-// Last changed : $Date: 2014-10-08 11:26:57 -0400 (Wed, 08 Oct 2014) $
+// Last changed : $Date: 2015-02-21 23:24:29 +0200 (Sat, 21 Feb 2015) $
// File revision : $Revision: 4 $
//
-// $Id: FIRFilter.cpp 201 2014-10-08 15:26:57Z oparviai $
+// $Id: FIRFilter.cpp 202 2015-02-21 21:24:29Z oparviai $
//
////////////////////////////////////////////////////////////////////////////////
//
@@ -61,22 +61,18 @@ FIRFilter::FIRFilter()
length = 0;
lengthDiv8 = 0;
filterCoeffs = NULL;
- sum = NULL;
- sumsize = 0;
}
FIRFilter::~FIRFilter()
{
delete[] filterCoeffs;
- delete[] sum;
}
// Usual C-version of the filter routine for stereo sound
uint FIRFilter::evaluateFilterStereo(SAMPLETYPE *dest, const SAMPLETYPE *src, uint numSamples) const
{
- uint i, j, end;
- LONG_SAMPLETYPE suml, sumr;
+ int j, end;
#ifdef SOUNDTOUCH_FLOAT_SAMPLES
// when using floating point samples, use a scaler instead of a divider
// because division is much slower operation than multiplying.
@@ -90,9 +86,12 @@ uint FIRFilter::evaluateFilterStereo(SAMPLETYPE *dest, const SAMPLETYPE *src, ui
end = 2 * (numSamples - length);
+ #pragma omp parallel for
for (j = 0; j < end; j += 2)
{
const SAMPLETYPE *ptr;
+ LONG_SAMPLETYPE suml, sumr;
+ uint i;
suml = sumr = 0;
ptr = src + j;
@@ -133,28 +132,31 @@ uint FIRFilter::evaluateFilterStereo(SAMPLETYPE *dest, const SAMPLETYPE *src, ui
// Usual C-version of the filter routine for mono sound
uint FIRFilter::evaluateFilterMono(SAMPLETYPE *dest, const SAMPLETYPE *src, uint numSamples) const
{
- uint i, j, end;
- LONG_SAMPLETYPE sum;
+ int j, end;
#ifdef SOUNDTOUCH_FLOAT_SAMPLES
// when using floating point samples, use a scaler instead of a divider
// because division is much slower operation than multiplying.
double dScaler = 1.0 / (double)resultDivider;
#endif
-
assert(length != 0);
end = numSamples - length;
+ #pragma omp parallel for
for (j = 0; j < end; j ++)
{
+ const SAMPLETYPE *pSrc = src + j;
+ LONG_SAMPLETYPE sum;
+ uint i;
+
sum = 0;
for (i = 0; i < length; i += 4)
{
// loop is unrolled by factor of 4 here for efficiency
- sum += src[i + 0] * filterCoeffs[i + 0] +
- src[i + 1] * filterCoeffs[i + 1] +
- src[i + 2] * filterCoeffs[i + 2] +
- src[i + 3] * filterCoeffs[i + 3];
+ sum += pSrc[i + 0] * filterCoeffs[i + 0] +
+ pSrc[i + 1] * filterCoeffs[i + 1] +
+ pSrc[i + 2] * filterCoeffs[i + 2] +
+ pSrc[i + 3] * filterCoeffs[i + 3];
}
#ifdef SOUNDTOUCH_INTEGER_SAMPLES
sum >>= resultDivFactor;
@@ -164,7 +166,6 @@ uint FIRFilter::evaluateFilterMono(SAMPLETYPE *dest, const SAMPLETYPE *src, uint
sum *= dScaler;
#endif // SOUNDTOUCH_INTEGER_SAMPLES
dest[j] = (SAMPLETYPE)sum;
- src ++;
}
return end;
}
@@ -172,15 +173,7 @@ uint FIRFilter::evaluateFilterMono(SAMPLETYPE *dest, const SAMPLETYPE *src, uint
uint FIRFilter::evaluateFilterMulti(SAMPLETYPE *dest, const SAMPLETYPE *src, uint numSamples, uint numChannels)
{
- uint i, j, end, c;
-
- if (sumsize < numChannels)
- {
- // allocate large enough array for keeping sums
- sumsize = numChannels;
- delete[] sum;
- sum = new LONG_SAMPLETYPE[numChannels];
- }
+ int j, end;
#ifdef SOUNDTOUCH_FLOAT_SAMPLES
// when using floating point samples, use a scaler instead of a divider
@@ -192,17 +185,21 @@ uint FIRFilter::evaluateFilterMulti(SAMPLETYPE *dest, const SAMPLETYPE *src, uin
assert(src != NULL);
assert(dest != NULL);
assert(filterCoeffs != NULL);
+ assert(numChannels < 16);
end = numChannels * (numSamples - length);
- for (c = 0; c < numChannels; c ++)
- {
- sum[c] = 0;
- }
-
+ #pragma omp parallel for
for (j = 0; j < end; j += numChannels)
{
const SAMPLETYPE *ptr;
+ LONG_SAMPLETYPE sums[16];
+ uint c, i;
+
+ for (c = 0; c < numChannels; c ++)
+ {
+ sums[c] = 0;
+ }
ptr = src + j;
@@ -211,7 +208,7 @@ uint FIRFilter::evaluateFilterMulti(SAMPLETYPE *dest, const SAMPLETYPE *src, uin
SAMPLETYPE coef=filterCoeffs[i];
for (c = 0; c < numChannels; c ++)
{
- sum[c] += ptr[0] * coef;
+ sums[c] += ptr[0] * coef;
ptr ++;
}
}
@@ -219,13 +216,11 @@ uint FIRFilter::evaluateFilterMulti(SAMPLETYPE *dest, const SAMPLETYPE *src, uin
for (c = 0; c < numChannels; c ++)
{
#ifdef SOUNDTOUCH_INTEGER_SAMPLES
- sum[c] >>= resultDivFactor;
+ sums[c] >>= resultDivFactor;
#else
- sum[c] *= dScaler;
+ sums[c] *= dScaler;
#endif // SOUNDTOUCH_INTEGER_SAMPLES
- *dest = (SAMPLETYPE)sum[c];
- dest++;
- sum[c] = 0;
+ dest[j+c] = (SAMPLETYPE)sums[c];
}
}
return numSamples - length;
diff --git a/lib/soundtouch-1.8.0/FIRFilter.h b/lib/soundtouch-1.9.2/FIRFilter.h
index 9bbfcd00b4..6b14238ce8 100644
--- a/lib/soundtouch-1.8.0/FIRFilter.h
+++ b/lib/soundtouch-1.9.2/FIRFilter.h
@@ -11,10 +11,10 @@
///
////////////////////////////////////////////////////////////////////////////////
//
-// Last changed : $Date: 2014-10-08 11:26:57 -0400 (Wed, 08 Oct 2014) $
+// Last changed : $Date: 2015-02-21 23:24:29 +0200 (Sat, 21 Feb 2015) $
// File revision : $Revision: 4 $
//
-// $Id: FIRFilter.h 201 2014-10-08 15:26:57Z oparviai $
+// $Id: FIRFilter.h 202 2015-02-21 21:24:29Z oparviai $
//
////////////////////////////////////////////////////////////////////////////////
//
@@ -65,10 +65,6 @@ protected:
// Memory for filter coefficients
SAMPLETYPE *filterCoeffs;
- // Memory for keeping temporary sums in multichannel processing
- LONG_SAMPLETYPE *sum;
- uint sumsize;
-
virtual uint evaluateFilterStereo(SAMPLETYPE *dest,
const SAMPLETYPE *src,
uint numSamples) const;
diff --git a/lib/soundtouch-1.8.0/InterpolateCubic.cpp b/lib/soundtouch-1.9.2/InterpolateCubic.cpp
index 06931173eb..06931173eb 100644
--- a/lib/soundtouch-1.8.0/InterpolateCubic.cpp
+++ b/lib/soundtouch-1.9.2/InterpolateCubic.cpp
diff --git a/lib/soundtouch-1.8.0/InterpolateCubic.h b/lib/soundtouch-1.9.2/InterpolateCubic.h
index 6c966669bc..2f6b061a21 100644
--- a/lib/soundtouch-1.8.0/InterpolateCubic.h
+++ b/lib/soundtouch-1.9.2/InterpolateCubic.h
@@ -8,7 +8,7 @@
///
////////////////////////////////////////////////////////////////////////////////
//
-// $Id: InterpolateCubic.h 179 2014-01-06 18:41:42Z oparviai $
+// $Id: InterpolateCubic.h 225 2015-07-26 14:45:48Z oparviai $
//
////////////////////////////////////////////////////////////////////////////////
//
@@ -56,7 +56,7 @@ protected:
const SAMPLETYPE *src,
int &srcSamples);
- float fract;
+ double fract;
public:
InterpolateCubic();
diff --git a/lib/soundtouch-1.8.0/InterpolateLinear.cpp b/lib/soundtouch-1.9.2/InterpolateLinear.cpp
index 792c22bf1f..0f9a03e1b9 100644
--- a/lib/soundtouch-1.8.0/InterpolateLinear.cpp
+++ b/lib/soundtouch-1.9.2/InterpolateLinear.cpp
@@ -8,7 +8,7 @@
///
////////////////////////////////////////////////////////////////////////////////
//
-// $Id: InterpolateLinear.cpp 180 2014-01-06 19:16:02Z oparviai $
+// $Id: InterpolateLinear.cpp 225 2015-07-26 14:45:48Z oparviai $
//
////////////////////////////////////////////////////////////////////////////////
//
@@ -170,9 +170,9 @@ int InterpolateLinearInteger::transposeMulti(SAMPLETYPE *dest, const SAMPLETYPE
// Sets new target iRate. Normal iRate = 1.0, smaller values represent slower
// iRate, larger faster iRates.
-void InterpolateLinearInteger::setRate(float newRate)
+void InterpolateLinearInteger::setRate(double newRate)
{
- iRate = (int)(newRate * SCALE + 0.5f);
+ iRate = (int)(newRate * SCALE + 0.5);
TransposerBase::setRate(newRate);
}
@@ -190,7 +190,7 @@ InterpolateLinearFloat::InterpolateLinearFloat() : TransposerBase()
// Notice: use local function calling syntax for sake of clarity,
// to indicate the fact that C++ constructor can't call virtual functions.
resetRegisters();
- setRate(1.0f);
+ setRate(1.0);
}
@@ -275,12 +275,13 @@ int InterpolateLinearFloat::transposeMulti(SAMPLETYPE *dest, const SAMPLETYPE *s
i = 0;
while (srcCount < srcSampleEnd)
{
- float temp, vol1;
+ float temp, vol1, fract_float;
- vol1 = (1.0f- fract);
+ vol1 = (float)(1.0 - fract);
+ fract_float = (float)fract;
for (int c = 0; c < numChannels; c ++)
{
- temp = vol1 * src[c] + fract * src[c + numChannels];
+ temp = vol1 * src[c] + fract_float * src[c + numChannels];
*dest = (SAMPLETYPE)temp;
dest ++;
}
diff --git a/lib/soundtouch-1.8.0/InterpolateLinear.h b/lib/soundtouch-1.9.2/InterpolateLinear.h
index b1ae0bb3ca..658330331c 100644
--- a/lib/soundtouch-1.8.0/InterpolateLinear.h
+++ b/lib/soundtouch-1.9.2/InterpolateLinear.h
@@ -8,7 +8,7 @@
///
////////////////////////////////////////////////////////////////////////////////
//
-// $Id: InterpolateLinear.h 179 2014-01-06 18:41:42Z oparviai $
+// $Id: InterpolateLinear.h 225 2015-07-26 14:45:48Z oparviai $
//
////////////////////////////////////////////////////////////////////////////////
//
@@ -63,7 +63,7 @@ public:
/// Sets new target rate. Normal rate = 1.0, smaller values represent slower
/// rate, larger faster rates.
- virtual void setRate(float newRate);
+ virtual void setRate(double newRate);
};
@@ -71,7 +71,7 @@ public:
class InterpolateLinearFloat : public TransposerBase
{
protected:
- float fract;
+ double fract;
virtual void resetRegisters();
diff --git a/lib/soundtouch-1.8.0/InterpolateShannon.cpp b/lib/soundtouch-1.9.2/InterpolateShannon.cpp
index c2b746f3c1..c2b746f3c1 100644
--- a/lib/soundtouch-1.8.0/InterpolateShannon.cpp
+++ b/lib/soundtouch-1.9.2/InterpolateShannon.cpp
diff --git a/lib/soundtouch-1.8.0/InterpolateShannon.h b/lib/soundtouch-1.9.2/InterpolateShannon.h
index cb2faac028..7f1e647130 100644
--- a/lib/soundtouch-1.8.0/InterpolateShannon.h
+++ b/lib/soundtouch-1.9.2/InterpolateShannon.h
@@ -13,7 +13,7 @@
///
////////////////////////////////////////////////////////////////////////////////
//
-// $Id: InterpolateShannon.h 179 2014-01-06 18:41:42Z oparviai $
+// $Id: InterpolateShannon.h 225 2015-07-26 14:45:48Z oparviai $
//
////////////////////////////////////////////////////////////////////////////////
//
@@ -61,7 +61,7 @@ protected:
const SAMPLETYPE *src,
int &srcSamples);
- float fract;
+ double fract;
public:
InterpolateShannon();
diff --git a/lib/soundtouch-1.8.0/PeakFinder.cpp b/lib/soundtouch-1.9.2/PeakFinder.cpp
index 6fb7518e0e..111cc88bbd 100644
--- a/lib/soundtouch-1.8.0/PeakFinder.cpp
+++ b/lib/soundtouch-1.9.2/PeakFinder.cpp
@@ -11,10 +11,10 @@
///
////////////////////////////////////////////////////////////////////////////////
//
-// Last changed : $Date: 2012-12-28 14:52:47 -0500 (Fri, 28 Dec 2012) $
+// Last changed : $Date: 2015-05-18 18:22:02 +0300 (Mon, 18 May 2015) $
// File revision : $Revision: 4 $
//
-// $Id: PeakFinder.cpp 164 2012-12-28 19:52:47Z oparviai $
+// $Id: PeakFinder.cpp 213 2015-05-18 15:22:02Z oparviai $
//
////////////////////////////////////////////////////////////////////////////////
//
@@ -192,11 +192,21 @@ double PeakFinder::getPeakCenter(const float *data, int peakpos) const
gp1 = findGround(data, peakpos, -1);
gp2 = findGround(data, peakpos, 1);
- groundLevel = 0.5f * (data[gp1] + data[gp2]);
peakLevel = data[peakpos];
- // calculate 70%-level of the peak
- cutLevel = 0.70f * peakLevel + 0.30f * groundLevel;
+ if (gp1 == gp2)
+ {
+ // avoid rounding errors when all are equal
+ assert(gp1 == peakpos);
+ cutLevel = groundLevel = peakLevel;
+ } else {
+ // get average of the ground levels
+ groundLevel = 0.5f * (data[gp1] + data[gp2]);
+
+ // calculate 70%-level of the peak
+ cutLevel = 0.70f * peakLevel + 0.30f * groundLevel;
+ }
+
// find mid-level crossings
crosspos1 = findCrossingLevel(data, cutLevel, peakpos, -1);
crosspos2 = findCrossingLevel(data, cutLevel, peakpos, 1);
diff --git a/lib/soundtouch-1.8.0/PeakFinder.h b/lib/soundtouch-1.9.2/PeakFinder.h
index 46cdf05c54..594f230882 100644
--- a/lib/soundtouch-1.8.0/PeakFinder.h
+++ b/lib/soundtouch-1.9.2/PeakFinder.h
@@ -9,7 +9,7 @@
///
////////////////////////////////////////////////////////////////////////////////
//
-// Last changed : $Date: 2011-12-30 15:33:46 -0500 (Fri, 30 Dec 2011) $
+// Last changed : $Date: 2011-12-30 22:33:46 +0200 (Fri, 30 Dec 2011) $
// File revision : $Revision: 4 $
//
// $Id: PeakFinder.h 132 2011-12-30 20:33:46Z oparviai $
diff --git a/lib/soundtouch-1.8.0/RateTransposer.cpp b/lib/soundtouch-1.9.2/RateTransposer.cpp
index 94e1fb2f81..95b9437a24 100644
--- a/lib/soundtouch-1.8.0/RateTransposer.cpp
+++ b/lib/soundtouch-1.9.2/RateTransposer.cpp
@@ -10,10 +10,10 @@
///
////////////////////////////////////////////////////////////////////////////////
//
-// Last changed : $Date: 2014-04-06 11:57:21 -0400 (Sun, 06 Apr 2014) $
+// Last changed : $Date: 2015-07-26 17:45:48 +0300 (Sun, 26 Jul 2015) $
// File revision : $Revision: 4 $
//
-// $Id: RateTransposer.cpp 195 2014-04-06 15:57:21Z oparviai $
+// $Id: RateTransposer.cpp 225 2015-07-26 14:45:48Z oparviai $
//
////////////////////////////////////////////////////////////////////////////////
//
@@ -97,20 +97,20 @@ AAFilter *RateTransposer::getAAFilter()
// Sets new target iRate. Normal iRate = 1.0, smaller values represent slower
// iRate, larger faster iRates.
-void RateTransposer::setRate(float newRate)
+void RateTransposer::setRate(double newRate)
{
double fCutoff;
pTransposer->setRate(newRate);
// design a new anti-alias filter
- if (newRate > 1.0f)
+ if (newRate > 1.0)
{
- fCutoff = 0.5f / newRate;
+ fCutoff = 0.5 / newRate;
}
else
{
- fCutoff = 0.5f * newRate;
+ fCutoff = 0.5 * newRate;
}
pAAFilter->setCutoffFreq(fCutoff);
}
@@ -225,7 +225,7 @@ void TransposerBase::setAlgorithm(TransposerBase::ALGORITHM a)
int TransposerBase::transpose(FIFOSampleBuffer &dest, FIFOSampleBuffer &src)
{
int numSrcSamples = src.numSamples();
- int sizeDemand = (int)((float)numSrcSamples / rate) + 8;
+ int sizeDemand = (int)((double)numSrcSamples / rate) + 8;
int numOutput;
SAMPLETYPE *psrc = src.ptrBegin();
SAMPLETYPE *pdest = dest.ptrEnd(sizeDemand);
@@ -270,7 +270,7 @@ void TransposerBase::setChannels(int channels)
}
-void TransposerBase::setRate(float newRate)
+void TransposerBase::setRate(double newRate)
{
rate = newRate;
}
diff --git a/lib/soundtouch-1.8.0/RateTransposer.h b/lib/soundtouch-1.9.2/RateTransposer.h
index 2fe2961cf5..e9cedfac9c 100644
--- a/lib/soundtouch-1.8.0/RateTransposer.h
+++ b/lib/soundtouch-1.9.2/RateTransposer.h
@@ -14,10 +14,10 @@
///
////////////////////////////////////////////////////////////////////////////////
//
-// Last changed : $Date: 2014-04-06 11:57:21 -0400 (Sun, 06 Apr 2014) $
+// Last changed : $Date: 2015-07-26 17:45:48 +0300 (Sun, 26 Jul 2015) $
// File revision : $Revision: 4 $
//
-// $Id: RateTransposer.h 195 2014-04-06 15:57:21Z oparviai $
+// $Id: RateTransposer.h 225 2015-07-26 14:45:48Z oparviai $
//
////////////////////////////////////////////////////////////////////////////////
//
@@ -81,14 +81,14 @@ protected:
static ALGORITHM algorithm;
public:
- float rate;
+ double rate;
int numChannels;
TransposerBase();
virtual ~TransposerBase();
virtual int transpose(FIFOSampleBuffer &dest, FIFOSampleBuffer &src);
- virtual void setRate(float newRate);
+ virtual void setRate(double newRate);
virtual void setChannels(int channels);
// static factory function
@@ -158,7 +158,7 @@ public:
/// Sets new target rate. Normal rate = 1.0, smaller values represent slower
/// rate, larger faster rates.
- virtual void setRate(float newRate);
+ virtual void setRate(double newRate);
/// Sets the number of channels, 1 = mono, 2 = stereo
void setChannels(int channels);
diff --git a/lib/soundtouch-1.8.0/STTypes.h b/lib/soundtouch-1.9.2/STTypes.h
index cac0b3114c..268d84eeed 100644
--- a/lib/soundtouch-1.8.0/STTypes.h
+++ b/lib/soundtouch-1.9.2/STTypes.h
@@ -8,10 +8,10 @@
///
////////////////////////////////////////////////////////////////////////////////
//
-// Last changed : $Date: 2014-04-06 11:57:21 -0400 (Sun, 06 Apr 2014) $
+// Last changed : $Date: 2015-05-18 18:25:07 +0300 (Mon, 18 May 2015) $
// File revision : $Revision: 3 $
//
-// $Id: STTypes.h 195 2014-04-06 15:57:21Z oparviai $
+// $Id: STTypes.h 215 2015-05-18 15:25:07Z oparviai $
//
////////////////////////////////////////////////////////////////////////////////
//
@@ -75,7 +75,7 @@ namespace soundtouch
/// runtime performance so recommendation is to keep this off.
// #define USE_MULTICH_ALWAYS
- #if (defined(__SOFTFP__))
+ #if (defined(__SOFTFP__) && defined(ANDROID))
// For Android compilation: Force use of Integer samples in case that
// compilation uses soft-floating point emulation - soft-fp is way too slow
#undef SOUNDTOUCH_FLOAT_SAMPLES
@@ -172,6 +172,7 @@ namespace soundtouch
#else
// use c++ standard exceptions
#include <stdexcept>
+ #include <string>
#define ST_THROW_RT_ERROR(x) {throw std::runtime_error(x);}
#endif
diff --git a/lib/soundtouch-1.8.0/SoundTouch.cpp b/lib/soundtouch-1.9.2/SoundTouch.cpp
index fcdacf425c..edccce238d 100644
--- a/lib/soundtouch-1.8.0/SoundTouch.cpp
+++ b/lib/soundtouch-1.9.2/SoundTouch.cpp
@@ -41,10 +41,10 @@
///
////////////////////////////////////////////////////////////////////////////////
//
-// Last changed : $Date: 2014-10-08 11:26:57 -0400 (Wed, 08 Oct 2014) $
+// Last changed : $Date: 2015-07-26 17:45:48 +0300 (Sun, 26 Jul 2015) $
// File revision : $Revision: 4 $
//
-// $Id: SoundTouch.cpp 201 2014-10-08 15:26:57Z oparviai $
+// $Id: SoundTouch.cpp 225 2015-07-26 14:45:48Z oparviai $
//
////////////////////////////////////////////////////////////////////////////////
//
@@ -110,6 +110,9 @@ SoundTouch::SoundTouch()
calcEffectiveRateAndTempo();
+ samplesExpectedOut = 0;
+ samplesOutput = 0;
+
channels = 0;
bSrateSet = false;
}
@@ -157,7 +160,7 @@ void SoundTouch::setChannels(uint numChannels)
// Sets new rate control value. Normal rate = 1.0, smaller values
// represent slower rate, larger faster rates.
-void SoundTouch::setRate(float newRate)
+void SoundTouch::setRate(double newRate)
{
virtualRate = newRate;
calcEffectiveRateAndTempo();
@@ -167,9 +170,9 @@ void SoundTouch::setRate(float newRate)
// Sets new rate control value as a difference in percents compared
// to the original rate (-50 .. +100 %)
-void SoundTouch::setRateChange(float newRate)
+void SoundTouch::setRateChange(double newRate)
{
- virtualRate = 1.0f + 0.01f * newRate;
+ virtualRate = 1.0 + 0.01 * newRate;
calcEffectiveRateAndTempo();
}
@@ -177,7 +180,7 @@ void SoundTouch::setRateChange(float newRate)
// Sets new tempo control value. Normal tempo = 1.0, smaller values
// represent slower tempo, larger faster tempo.
-void SoundTouch::setTempo(float newTempo)
+void SoundTouch::setTempo(double newTempo)
{
virtualTempo = newTempo;
calcEffectiveRateAndTempo();
@@ -187,9 +190,9 @@ void SoundTouch::setTempo(float newTempo)
// Sets new tempo control value as a difference in percents compared