Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #11706 from Minty-Meeo/update-soundtouch
Update SoundTouch to 2.3.2 commit 1eda9c0b01039f29d230a46cda9f2290bbd1f62b
  • Loading branch information
AdmiralCurtiss committed Apr 2, 2023
2 parents aaeaa9c + 0e7e8d2 commit 0cd70c2
Show file tree
Hide file tree
Showing 30 changed files with 1,914 additions and 1,692 deletions.
18 changes: 2 additions & 16 deletions Externals/soundtouch/AAFilter.cpp
Expand Up @@ -12,13 +12,6 @@
///
////////////////////////////////////////////////////////////////////////////////
//
// 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 $
//
////////////////////////////////////////////////////////////////////////////////
//
// License :
//
// SoundTouch audio processing library
Expand Down Expand Up @@ -49,7 +42,7 @@

using namespace soundtouch;

#define PI 3.141592655357989
#define PI 3.14159265358979323846
#define TWOPI (2 * PI)

// define this to save AA filter coefficients to a file
Expand All @@ -61,7 +54,7 @@ using namespace soundtouch;
static void _DEBUG_SAVE_AAFIR_COEFFS(SAMPLETYPE *coeffs, int len)
{
FILE *fptr = fopen("aa_filter_coeffs.txt", "wt");
if (fptr == NULL) return;
if (fptr == nullptr) return;

for (int i = 0; i < len; i ++)
{
Expand All @@ -75,7 +68,6 @@ using namespace soundtouch;
#define _DEBUG_SAVE_AAFIR_COEFFS(x, y)
#endif


/*****************************************************************************
*
* Implementation of the class 'AAFilter'
Expand All @@ -90,14 +82,12 @@ AAFilter::AAFilter(uint len)
}



AAFilter::~AAFilter()
{
delete pFIR;
}



// Sets new anti-alias filter cut-off edge frequency, scaled to
// sampling frequency (nyquist frequency = 0.5).
// The filter will cut frequencies higher than the given frequency.
Expand All @@ -108,7 +98,6 @@ void AAFilter::setCutoffFreq(double newCutoffFreq)
}



// Sets number of FIR filter taps
void AAFilter::setLength(uint newLength)
{
Expand All @@ -117,7 +106,6 @@ void AAFilter::setLength(uint newLength)
}



// Calculates coefficients for a low-pass FIR filter using Hamming window
void AAFilter::calculateCoeffs()
{
Expand Down Expand Up @@ -177,12 +165,10 @@ void AAFilter::calculateCoeffs()
for (i = 0; i < length; i ++)
{
temp = work[i] * scaleCoeff;
//#if SOUNDTOUCH_INTEGER_SAMPLES
// scale & round to nearest integer
temp += (temp >= 0) ? 0.5 : -0.5;
// ensure no overfloods
assert(temp >= -32768 && temp <= 32767);
//#endif
coeffs[i] = (SAMPLETYPE)temp;
}

Expand Down
7 changes: 0 additions & 7 deletions Externals/soundtouch/AAFilter.h
Expand Up @@ -13,13 +13,6 @@
///
////////////////////////////////////////////////////////////////////////////////
//
// 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 $
//
////////////////////////////////////////////////////////////////////////////////
//
// License :
//
// SoundTouch audio processing library
Expand Down

0 comments on commit 0cd70c2

Please sign in to comment.