summaryrefslogtreecommitdiff
path: root/media/libsoundtouch/src/InterpolateLinear.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'media/libsoundtouch/src/InterpolateLinear.cpp')
-rw-r--r--media/libsoundtouch/src/InterpolateLinear.cpp19
1 files changed, 8 insertions, 11 deletions
diff --git a/media/libsoundtouch/src/InterpolateLinear.cpp b/media/libsoundtouch/src/InterpolateLinear.cpp
index ae26e69a1e..9533e79b79 100644
--- a/media/libsoundtouch/src/InterpolateLinear.cpp
+++ b/media/libsoundtouch/src/InterpolateLinear.cpp
@@ -8,10 +8,6 @@
///
////////////////////////////////////////////////////////////////////////////////
//
-// $Id: InterpolateLinear.cpp 180 2014-01-06 19:16:02Z oparviai $
-//
-////////////////////////////////////////////////////////////////////////////////
-//
// License :
//
// SoundTouch audio processing library
@@ -146,7 +142,7 @@ int InterpolateLinearInteger::transposeMulti(SAMPLETYPE *dest, const SAMPLETYPE
LONG_SAMPLETYPE temp, vol1;
assert(iFract < SCALE);
- vol1 = (SCALE - iFract);
+ vol1 = (LONG_SAMPLETYPE)(SCALE - iFract);
for (int c = 0; c < numChannels; c ++)
{
temp = vol1 * src[c] + iFract * src[c + numChannels];
@@ -170,9 +166,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 +186,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 +271,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 ++;
}