Repaired "integer" build

This commit is contained in:
oparviai 2008-12-13 19:52:22 +00:00
parent 67e75873e3
commit 59d58734b4
3 changed files with 13 additions and 4 deletions

View File

@ -44,6 +44,7 @@
#include <string.h> #include <string.h>
#include <limits.h> #include <limits.h>
#include <assert.h> #include <assert.h>
#include <math.h>
#include <stdexcept> #include <stdexcept>
#include "STTypes.h" #include "STTypes.h"
@ -768,6 +769,12 @@ void TDStretch::overlapStereo(short *output, const short *input) const
} }
} }
// Calculates the x having the closest 2^x value for the given value
static int _getClosest2Power(double value)
{
return (int)(log(value) / log(2.0) + 0.5);
}
/// Calculates overlap period length in samples. /// Calculates overlap period length in samples.
/// Integer version rounds overlap length to closest power of 2 /// Integer version rounds overlap length to closest power of 2
@ -794,7 +801,7 @@ void TDStretch::calculateOverlapLength(int overlapMs)
long TDStretch::calcCrossCorrMono(const short *mixingPos, const short *compare) const long TDStretch::calcCrossCorrMono(const short *mixingPos, const short *compare) const
{ {
long corr; long corr;
uint i; int i;
corr = 0; corr = 0;
for (i = 1; i < overlapLength; i ++) for (i = 1; i < overlapLength; i ++)
@ -809,7 +816,7 @@ long TDStretch::calcCrossCorrMono(const short *mixingPos, const short *compare)
long TDStretch::calcCrossCorrStereo(const short *mixingPos, const short *compare) const long TDStretch::calcCrossCorrStereo(const short *mixingPos, const short *compare) const
{ {
long corr; long corr;
uint i; int i;
corr = 0; corr = 0;
for (i = 2; i < 2 * overlapLength; i += 2) for (i = 2; i < 2 * overlapLength; i += 2)

View File

@ -104,6 +104,8 @@ protected:
int seekLength; int seekLength;
int seekWindowLength; int seekWindowLength;
int maxOffset; int maxOffset;
int overlapDividerBits;
int slopingDivider;
float nominalSkip; float nominalSkip;
float skipFract; float skipFract;
FIFOSampleBuffer outputBuffer; FIFOSampleBuffer outputBuffer;

View File

@ -77,7 +77,7 @@ long TDStretchMMX::calcCrossCorrStereo(const short *pV1, const short *pV2) const
__m64 shifter; __m64 shifter;
__m64 accu; __m64 accu;
long corr; long corr;
uint i; int i;
pVec1 = (__m64*)pV1; pVec1 = (__m64*)pV1;
pVec2 = (__m64*)pV2; pVec2 = (__m64*)pV2;
@ -139,7 +139,7 @@ void TDStretchMMX::overlapStereo(short *output, const short *input) const
const __m64 *pVinput, *pVMidBuf; const __m64 *pVinput, *pVMidBuf;
__m64 *pVdest; __m64 *pVdest;
__m64 mix1, mix2, adder, shifter; __m64 mix1, mix2, adder, shifter;
uint i; int i;
pVinput = (const __m64*)input; pVinput = (const __m64*)input;
pVMidBuf = (const __m64*)pMidBuffer; pVMidBuf = (const __m64*)pMidBuffer;