mirror of
https://github.com/azahar-emu/soundtouch
synced 2025-11-07 07:30:02 +01:00
Fixed pointer aligning for mingw64 compilation
This commit is contained in:
parent
91305a5806
commit
c3f4ff9532
17
README.html
17
README.html
@ -716,11 +716,21 @@ submitted bugfixes since SoundTouch v1.3.1: </p>
|
||||
<li> Richard Ash</li>
|
||||
<li> Stanislav Brabec</li>
|
||||
<li> Christian Budde</li>
|
||||
<li> Jacek Caban</li>
|
||||
<li> Brian Cameron</li>
|
||||
<li> Jason Champion</li>
|
||||
<li> David Clark</li>
|
||||
<li> Patrick Colis</li>
|
||||
<li> Miquel Colon</li>
|
||||
<li> Justin Frankel</li>
|
||||
<li> Jason Garland</li>
|
||||
<li> Takashi Iwai</li>
|
||||
<li> Yuval Naveh</li>
|
||||
<li> Paulo Pizarro</li>
|
||||
<li> Blaise Potard</li>
|
||||
<li> RJ Ryan</li>
|
||||
<li> Patrick Colis </li>
|
||||
<li> Miquel Colon </li>
|
||||
<li> Sandro Cumerlato</li>
|
||||
<li> Justin Frankel </li>
|
||||
<li> Jason Garland </li>
|
||||
@ -732,6 +742,8 @@ submitted bugfixes since SoundTouch v1.3.1: </p>
|
||||
<li> RJ Ryan </li>
|
||||
<li> John Sheehy</li>
|
||||
<li> Tim Shuttleworth</li>
|
||||
<li> John Stumpo</li>
|
||||
<li> Tim Shuttleworth</li>
|
||||
<li> Katja Vetter</li>
|
||||
</ul>
|
||||
<p>Moral greetings to all other contributors and users also!</p>
|
||||
@ -750,9 +762,8 @@ General Public License for more details.</p>
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA</p>
|
||||
<hr><!--
|
||||
$Id$
|
||||
-->
|
||||
$Id$
-->
|
||||
<p>
|
||||
<i>README.html file updated on 29-Sep-2012</i></p>
|
||||
<i>README.html file updated on 8-Nov-2012</i></p>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@ -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 )
|
||||
|
||||
|
||||
#ifdef __GNUC__
|
||||
// In GCC, include soundtouch_config.h made by config scritps
|
||||
#include "soundtouch_config.h"
|
||||
|
||||
@ -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));
|
||||
|
||||
@ -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();
|
||||
}
|
||||
|
||||
@ -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)
|
||||
|
||||
@ -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)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user