- Library code update
- project update (added Eigen) git-svn-id: http://moon:8086/svn/software/trunk/projects/mpsk_rx_gui@94 b431acfa-c32f-4a4a-93f1-934dc6c82436
This commit is contained in:
@@ -25,7 +25,7 @@
|
||||
void AudioDataConverters::convertFloatToInt16LE (const float* source, void* dest, int numSamples, const int destBytesPerSample)
|
||||
{
|
||||
const double maxVal = (double) 0x7fff;
|
||||
char* intData = static_cast <char*> (dest);
|
||||
char* intData = static_cast<char*> (dest);
|
||||
|
||||
if (dest != (void*) source || destBytesPerSample <= 4)
|
||||
{
|
||||
@@ -50,7 +50,7 @@ void AudioDataConverters::convertFloatToInt16LE (const float* source, void* dest
|
||||
void AudioDataConverters::convertFloatToInt16BE (const float* source, void* dest, int numSamples, const int destBytesPerSample)
|
||||
{
|
||||
const double maxVal = (double) 0x7fff;
|
||||
char* intData = static_cast <char*> (dest);
|
||||
char* intData = static_cast<char*> (dest);
|
||||
|
||||
if (dest != (void*) source || destBytesPerSample <= 4)
|
||||
{
|
||||
@@ -75,7 +75,7 @@ void AudioDataConverters::convertFloatToInt16BE (const float* source, void* dest
|
||||
void AudioDataConverters::convertFloatToInt24LE (const float* source, void* dest, int numSamples, const int destBytesPerSample)
|
||||
{
|
||||
const double maxVal = (double) 0x7fffff;
|
||||
char* intData = static_cast <char*> (dest);
|
||||
char* intData = static_cast<char*> (dest);
|
||||
|
||||
if (dest != (void*) source || destBytesPerSample <= 4)
|
||||
{
|
||||
@@ -100,7 +100,7 @@ void AudioDataConverters::convertFloatToInt24LE (const float* source, void* dest
|
||||
void AudioDataConverters::convertFloatToInt24BE (const float* source, void* dest, int numSamples, const int destBytesPerSample)
|
||||
{
|
||||
const double maxVal = (double) 0x7fffff;
|
||||
char* intData = static_cast <char*> (dest);
|
||||
char* intData = static_cast<char*> (dest);
|
||||
|
||||
if (dest != (void*) source || destBytesPerSample <= 4)
|
||||
{
|
||||
@@ -125,7 +125,7 @@ void AudioDataConverters::convertFloatToInt24BE (const float* source, void* dest
|
||||
void AudioDataConverters::convertFloatToInt32LE (const float* source, void* dest, int numSamples, const int destBytesPerSample)
|
||||
{
|
||||
const double maxVal = (double) 0x7fffffff;
|
||||
char* intData = static_cast <char*> (dest);
|
||||
char* intData = static_cast<char*> (dest);
|
||||
|
||||
if (dest != (void*) source || destBytesPerSample <= 4)
|
||||
{
|
||||
@@ -150,7 +150,7 @@ void AudioDataConverters::convertFloatToInt32LE (const float* source, void* dest
|
||||
void AudioDataConverters::convertFloatToInt32BE (const float* source, void* dest, int numSamples, const int destBytesPerSample)
|
||||
{
|
||||
const double maxVal = (double) 0x7fffffff;
|
||||
char* intData = static_cast <char*> (dest);
|
||||
char* intData = static_cast<char*> (dest);
|
||||
|
||||
if (dest != (void*) source || destBytesPerSample <= 4)
|
||||
{
|
||||
@@ -176,7 +176,7 @@ void AudioDataConverters::convertFloatToFloat32LE (const float* source, void* de
|
||||
{
|
||||
jassert (dest != (void*) source || destBytesPerSample <= 4); // This op can't be performed on in-place data!
|
||||
|
||||
char* d = static_cast <char*> (dest);
|
||||
char* d = static_cast<char*> (dest);
|
||||
|
||||
for (int i = 0; i < numSamples; ++i)
|
||||
{
|
||||
@@ -194,7 +194,7 @@ void AudioDataConverters::convertFloatToFloat32BE (const float* source, void* de
|
||||
{
|
||||
jassert (dest != (void*) source || destBytesPerSample <= 4); // This op can't be performed on in-place data!
|
||||
|
||||
char* d = static_cast <char*> (dest);
|
||||
char* d = static_cast<char*> (dest);
|
||||
|
||||
for (int i = 0; i < numSamples; ++i)
|
||||
{
|
||||
@@ -212,7 +212,7 @@ void AudioDataConverters::convertFloatToFloat32BE (const float* source, void* de
|
||||
void AudioDataConverters::convertInt16LEToFloat (const void* const source, float* const dest, int numSamples, const int srcBytesPerSample)
|
||||
{
|
||||
const float scale = 1.0f / 0x7fff;
|
||||
const char* intData = static_cast <const char*> (source);
|
||||
const char* intData = static_cast<const char*> (source);
|
||||
|
||||
if (source != (void*) dest || srcBytesPerSample >= 4)
|
||||
{
|
||||
@@ -237,7 +237,7 @@ void AudioDataConverters::convertInt16LEToFloat (const void* const source, float
|
||||
void AudioDataConverters::convertInt16BEToFloat (const void* const source, float* const dest, int numSamples, const int srcBytesPerSample)
|
||||
{
|
||||
const float scale = 1.0f / 0x7fff;
|
||||
const char* intData = static_cast <const char*> (source);
|
||||
const char* intData = static_cast<const char*> (source);
|
||||
|
||||
if (source != (void*) dest || srcBytesPerSample >= 4)
|
||||
{
|
||||
@@ -262,7 +262,7 @@ void AudioDataConverters::convertInt16BEToFloat (const void* const source, float
|
||||
void AudioDataConverters::convertInt24LEToFloat (const void* const source, float* const dest, int numSamples, const int srcBytesPerSample)
|
||||
{
|
||||
const float scale = 1.0f / 0x7fffff;
|
||||
const char* intData = static_cast <const char*> (source);
|
||||
const char* intData = static_cast<const char*> (source);
|
||||
|
||||
if (source != (void*) dest || srcBytesPerSample >= 4)
|
||||
{
|
||||
@@ -287,7 +287,7 @@ void AudioDataConverters::convertInt24LEToFloat (const void* const source, float
|
||||
void AudioDataConverters::convertInt24BEToFloat (const void* const source, float* const dest, int numSamples, const int srcBytesPerSample)
|
||||
{
|
||||
const float scale = 1.0f / 0x7fffff;
|
||||
const char* intData = static_cast <const char*> (source);
|
||||
const char* intData = static_cast<const char*> (source);
|
||||
|
||||
if (source != (void*) dest || srcBytesPerSample >= 4)
|
||||
{
|
||||
@@ -312,7 +312,7 @@ void AudioDataConverters::convertInt24BEToFloat (const void* const source, float
|
||||
void AudioDataConverters::convertInt32LEToFloat (const void* const source, float* const dest, int numSamples, const int srcBytesPerSample)
|
||||
{
|
||||
const float scale = 1.0f / 0x7fffffff;
|
||||
const char* intData = static_cast <const char*> (source);
|
||||
const char* intData = static_cast<const char*> (source);
|
||||
|
||||
if (source != (void*) dest || srcBytesPerSample >= 4)
|
||||
{
|
||||
@@ -337,7 +337,7 @@ void AudioDataConverters::convertInt32LEToFloat (const void* const source, float
|
||||
void AudioDataConverters::convertInt32BEToFloat (const void* const source, float* const dest, int numSamples, const int srcBytesPerSample)
|
||||
{
|
||||
const float scale = 1.0f / 0x7fffffff;
|
||||
const char* intData = static_cast <const char*> (source);
|
||||
const char* intData = static_cast<const char*> (source);
|
||||
|
||||
if (source != (void*) dest || srcBytesPerSample >= 4)
|
||||
{
|
||||
@@ -361,7 +361,7 @@ void AudioDataConverters::convertInt32BEToFloat (const void* const source, float
|
||||
|
||||
void AudioDataConverters::convertFloat32LEToFloat (const void* const source, float* const dest, int numSamples, const int srcBytesPerSample)
|
||||
{
|
||||
const char* s = static_cast <const char*> (source);
|
||||
const char* s = static_cast<const char*> (source);
|
||||
|
||||
for (int i = 0; i < numSamples; ++i)
|
||||
{
|
||||
@@ -378,7 +378,7 @@ void AudioDataConverters::convertFloat32LEToFloat (const void* const source, flo
|
||||
|
||||
void AudioDataConverters::convertFloat32BEToFloat (const void* const source, float* const dest, int numSamples, const int srcBytesPerSample)
|
||||
{
|
||||
const char* s = static_cast <const char*> (source);
|
||||
const char* s = static_cast<const char*> (source);
|
||||
|
||||
for (int i = 0; i < numSamples; ++i)
|
||||
{
|
||||
|
||||
@@ -91,7 +91,7 @@ AudioSampleBuffer::AudioSampleBuffer (float* const* dataToReferTo,
|
||||
allocatedBytes (0)
|
||||
{
|
||||
jassert (dataToReferTo != nullptr);
|
||||
jassert (numChans >= 0);
|
||||
jassert (numChans >= 0 && numSamples >= 0);
|
||||
allocateChannels (dataToReferTo, 0);
|
||||
}
|
||||
|
||||
@@ -105,7 +105,7 @@ AudioSampleBuffer::AudioSampleBuffer (float* const* dataToReferTo,
|
||||
isClear (false)
|
||||
{
|
||||
jassert (dataToReferTo != nullptr);
|
||||
jassert (numChans >= 0);
|
||||
jassert (numChans >= 0 && startSample >= 0 && numSamples >= 0);
|
||||
allocateChannels (dataToReferTo, startSample);
|
||||
}
|
||||
|
||||
@@ -114,7 +114,7 @@ void AudioSampleBuffer::setDataToReferTo (float** dataToReferTo,
|
||||
const int newNumSamples) noexcept
|
||||
{
|
||||
jassert (dataToReferTo != nullptr);
|
||||
jassert (newNumChannels >= 0);
|
||||
jassert (newNumChannels >= 0 && newNumSamples >= 0);
|
||||
|
||||
allocatedBytes = 0;
|
||||
allocatedData.free();
|
||||
@@ -128,6 +128,8 @@ void AudioSampleBuffer::setDataToReferTo (float** dataToReferTo,
|
||||
|
||||
void AudioSampleBuffer::allocateChannels (float* const* const dataToReferTo, int offset)
|
||||
{
|
||||
jassert (offset >= 0);
|
||||
|
||||
// (try to avoid doing a malloc here, as that'll blow up things like Pro-Tools)
|
||||
if (numChannels < (int) numElementsInArray (preallocatedChannelSpace))
|
||||
{
|
||||
@@ -163,6 +165,8 @@ AudioSampleBuffer& AudioSampleBuffer::operator= (const AudioSampleBuffer& other)
|
||||
}
|
||||
else
|
||||
{
|
||||
isClear = false;
|
||||
|
||||
for (int i = 0; i < numChannels; ++i)
|
||||
FloatVectorOperations::copy (channels[i], other.channels[i], size);
|
||||
}
|
||||
|
||||
@@ -24,8 +24,9 @@
|
||||
|
||||
namespace FloatVectorHelpers
|
||||
{
|
||||
#define JUCE_INCREMENT_SRC_DEST dest += (16 / sizeof (*dest)); src += (16 / sizeof (*dest));
|
||||
#define JUCE_INCREMENT_DEST dest += (16 / sizeof (*dest));
|
||||
#define JUCE_INCREMENT_SRC_DEST dest += (16 / sizeof (*dest)); src += (16 / sizeof (*dest));
|
||||
#define JUCE_INCREMENT_SRC1_SRC2_DEST dest += (16 / sizeof (*dest)); src1 += (16 / sizeof (*dest)); src2 += (16 / sizeof (*dest));
|
||||
#define JUCE_INCREMENT_DEST dest += (16 / sizeof (*dest));
|
||||
|
||||
#if JUCE_USE_SSE_INTRINSICS
|
||||
static bool sse2Present = false;
|
||||
@@ -122,6 +123,17 @@ namespace FloatVectorHelpers
|
||||
} \
|
||||
JUCE_FINISH_VEC_OP (normalOp)
|
||||
|
||||
#define JUCE_PERFORM_VEC_OP_SRC1_SRC2_DEST(normalOp, vecOp, locals, increment, setupOp) \
|
||||
JUCE_BEGIN_VEC_OP \
|
||||
setupOp \
|
||||
{ \
|
||||
Mode::ParallelType (&loadSrc1) (const Mode::Type* v) = FloatVectorHelpers::isAligned (src1) ? Mode::loadA : Mode::loadU; \
|
||||
Mode::ParallelType (&loadSrc2) (const Mode::Type* v) = FloatVectorHelpers::isAligned (src2) ? Mode::loadA : Mode::loadU; \
|
||||
void (&storeDst) (Mode::Type* dest, Mode::ParallelType a) = FloatVectorHelpers::isAligned (dest) ? Mode::storeA : Mode::storeU; \
|
||||
JUCE_VEC_LOOP_TWO_SOURCES (vecOp, loadSrc1, loadSrc2, storeDst, locals, increment); \
|
||||
} \
|
||||
JUCE_FINISH_VEC_OP (normalOp)
|
||||
|
||||
//==============================================================================
|
||||
#elif JUCE_USE_ARM_NEON
|
||||
|
||||
@@ -193,6 +205,12 @@ namespace FloatVectorHelpers
|
||||
JUCE_VEC_LOOP (vecOp, Mode::loadU, Mode::loadU, Mode::storeU, locals, increment) \
|
||||
JUCE_FINISH_VEC_OP (normalOp)
|
||||
|
||||
#define JUCE_PERFORM_VEC_OP_SRC1_SRC2_DEST(normalOp, vecOp, locals, increment, setupOp) \
|
||||
JUCE_BEGIN_VEC_OP \
|
||||
setupOp \
|
||||
JUCE_VEC_LOOP_TWO_SOURCES (vecOp, Mode::loadU, Mode::loadU, Mode::storeU, locals, increment) \
|
||||
JUCE_FINISH_VEC_OP (normalOp)
|
||||
|
||||
//==============================================================================
|
||||
#else
|
||||
#define JUCE_PERFORM_VEC_OP_DEST(normalOp, vecOp, locals, setupOp) \
|
||||
@@ -201,6 +219,8 @@ namespace FloatVectorHelpers
|
||||
#define JUCE_PERFORM_VEC_OP_SRC_DEST(normalOp, vecOp, locals, increment, setupOp) \
|
||||
for (int i = 0; i < num; ++i) normalOp;
|
||||
|
||||
#define JUCE_PERFORM_VEC_OP_SRC1_SRC2_DEST(normalOp, vecOp, locals, increment, setupOp) \
|
||||
for (int i = 0; i < num; ++i) normalOp;
|
||||
#endif
|
||||
|
||||
//==============================================================================
|
||||
@@ -212,10 +232,19 @@ namespace FloatVectorHelpers
|
||||
increment; \
|
||||
}
|
||||
|
||||
#define JUCE_VEC_LOOP_TWO_SOURCES(vecOp, src1Load, src2Load, dstStore, locals, increment) \
|
||||
for (int i = 0; i < numLongOps; ++i) \
|
||||
{ \
|
||||
locals (src1Load, src2Load); \
|
||||
dstStore (dest, vecOp); \
|
||||
increment; \
|
||||
}
|
||||
|
||||
#define JUCE_LOAD_NONE(srcLoad, dstLoad)
|
||||
#define JUCE_LOAD_DEST(srcLoad, dstLoad) const Mode::ParallelType d = dstLoad (dest);
|
||||
#define JUCE_LOAD_SRC(srcLoad, dstLoad) const Mode::ParallelType s = srcLoad (src);
|
||||
#define JUCE_LOAD_SRC_DEST(srcLoad, dstLoad) const Mode::ParallelType d = dstLoad (dest), s = srcLoad (src);
|
||||
#define JUCE_LOAD_DEST(srcLoad, dstLoad) const Mode::ParallelType d = dstLoad (dest);
|
||||
#define JUCE_LOAD_SRC(srcLoad, dstLoad) const Mode::ParallelType s = srcLoad (src);
|
||||
#define JUCE_LOAD_SRC1_SRC2(src1Load, src2Load) const Mode::ParallelType s1 = src1Load (src1), s2 = src2Load (src2);
|
||||
#define JUCE_LOAD_SRC_DEST(srcLoad, dstLoad) const Mode::ParallelType d = dstLoad (dest), s = srcLoad (src);
|
||||
|
||||
#if JUCE_USE_SSE_INTRINSICS || JUCE_USE_ARM_NEON
|
||||
template<int typeSize> struct ModeType { typedef BasicOps32 Mode; };
|
||||
@@ -229,7 +258,7 @@ namespace FloatVectorHelpers
|
||||
|
||||
static Type findMinOrMax (const Type* src, int num, const bool isMinimum) noexcept
|
||||
{
|
||||
const int numLongOps = num / Mode::numParallel;
|
||||
int numLongOps = num / Mode::numParallel;
|
||||
|
||||
#if JUCE_USE_SSE_INTRINSICS
|
||||
if (numLongOps > 1 && isSSE2Available())
|
||||
@@ -246,7 +275,7 @@ namespace FloatVectorHelpers
|
||||
|
||||
if (isMinimum)
|
||||
{
|
||||
for (int i = 1; i < numLongOps; ++i)
|
||||
while (--numLongOps > 0)
|
||||
{
|
||||
src += Mode::numParallel;
|
||||
val = Mode::min (val, Mode::loadA (src));
|
||||
@@ -254,7 +283,7 @@ namespace FloatVectorHelpers
|
||||
}
|
||||
else
|
||||
{
|
||||
for (int i = 1; i < numLongOps; ++i)
|
||||
while (--numLongOps > 0)
|
||||
{
|
||||
src += Mode::numParallel;
|
||||
val = Mode::max (val, Mode::loadA (src));
|
||||
@@ -268,7 +297,7 @@ namespace FloatVectorHelpers
|
||||
|
||||
if (isMinimum)
|
||||
{
|
||||
for (int i = 1; i < numLongOps; ++i)
|
||||
while (--numLongOps > 0)
|
||||
{
|
||||
src += Mode::numParallel;
|
||||
val = Mode::min (val, Mode::loadU (src));
|
||||
@@ -276,7 +305,7 @@ namespace FloatVectorHelpers
|
||||
}
|
||||
else
|
||||
{
|
||||
for (int i = 1; i < numLongOps; ++i)
|
||||
while (--numLongOps > 0)
|
||||
{
|
||||
src += Mode::numParallel;
|
||||
val = Mode::max (val, Mode::loadU (src));
|
||||
@@ -288,6 +317,7 @@ namespace FloatVectorHelpers
|
||||
: Mode::max (val);
|
||||
|
||||
num &= (Mode::numParallel - 1);
|
||||
src += Mode::numParallel;
|
||||
|
||||
for (int i = 0; i < num; ++i)
|
||||
result = isMinimum ? jmin (result, src[i])
|
||||
@@ -302,7 +332,7 @@ namespace FloatVectorHelpers
|
||||
|
||||
static Range<Type> findMinAndMax (const Type* src, int num) noexcept
|
||||
{
|
||||
const int numLongOps = num / Mode::numParallel;
|
||||
int numLongOps = num / Mode::numParallel;
|
||||
|
||||
#if JUCE_USE_SSE_INTRINSICS
|
||||
if (numLongOps > 1 && isSSE2Available())
|
||||
@@ -318,7 +348,7 @@ namespace FloatVectorHelpers
|
||||
mn = Mode::loadA (src);
|
||||
mx = mn;
|
||||
|
||||
for (int i = 1; i < numLongOps; ++i)
|
||||
while (--numLongOps > 0)
|
||||
{
|
||||
src += Mode::numParallel;
|
||||
const ParallelType v = Mode::loadA (src);
|
||||
@@ -332,7 +362,7 @@ namespace FloatVectorHelpers
|
||||
mn = Mode::loadU (src);
|
||||
mx = mn;
|
||||
|
||||
for (int i = 1; i < numLongOps; ++i)
|
||||
while (--numLongOps > 0)
|
||||
{
|
||||
src += Mode::numParallel;
|
||||
const ParallelType v = Mode::loadU (src);
|
||||
@@ -344,7 +374,9 @@ namespace FloatVectorHelpers
|
||||
Range<Type> result (Mode::min (mn),
|
||||
Mode::max (mx));
|
||||
|
||||
num &= 3;
|
||||
num &= (Mode::numParallel - 1);
|
||||
src += Mode::numParallel;
|
||||
|
||||
for (int i = 0; i < num; ++i)
|
||||
result = result.getUnionWith (src[i]);
|
||||
|
||||
@@ -409,7 +441,7 @@ void JUCE_CALLTYPE FloatVectorOperations::copy (double* dest, const double* src,
|
||||
void JUCE_CALLTYPE FloatVectorOperations::copyWithMultiply (float* dest, const float* src, float multiplier, int num) noexcept
|
||||
{
|
||||
#if JUCE_USE_VDSP_FRAMEWORK
|
||||
vDSP_vsmul (src, 1, &multiplier, dest, 1, num);
|
||||
vDSP_vsmul (src, 1, &multiplier, dest, 1, (vDSP_Length) num);
|
||||
#else
|
||||
JUCE_PERFORM_VEC_OP_SRC_DEST (dest[i] = src[i] * multiplier, Mode::mul (mult, s),
|
||||
JUCE_LOAD_SRC, JUCE_INCREMENT_SRC_DEST,
|
||||
@@ -420,7 +452,7 @@ void JUCE_CALLTYPE FloatVectorOperations::copyWithMultiply (float* dest, const f
|
||||
void JUCE_CALLTYPE FloatVectorOperations::copyWithMultiply (double* dest, const double* src, double multiplier, int num) noexcept
|
||||
{
|
||||
#if JUCE_USE_VDSP_FRAMEWORK
|
||||
vDSP_vsmulD (src, 1, &multiplier, dest, 1, num);
|
||||
vDSP_vsmulD (src, 1, &multiplier, dest, 1, (vDSP_Length) num);
|
||||
#else
|
||||
JUCE_PERFORM_VEC_OP_SRC_DEST (dest[i] = src[i] * multiplier, Mode::mul (mult, s),
|
||||
JUCE_LOAD_SRC, JUCE_INCREMENT_SRC_DEST,
|
||||
@@ -440,10 +472,32 @@ void JUCE_CALLTYPE FloatVectorOperations::add (double* dest, double amount, int
|
||||
const Mode::ParallelType amountToAdd = Mode::load1 (amount);)
|
||||
}
|
||||
|
||||
void JUCE_CALLTYPE FloatVectorOperations::add (float* dest, float* src, float amount, int num) noexcept
|
||||
{
|
||||
#if JUCE_USE_VDSP_FRAMEWORK
|
||||
vDSP_vsadd (src, 1, &amount, dest, 1, (vDSP_Length) num);
|
||||
#else
|
||||
JUCE_PERFORM_VEC_OP_SRC_DEST (dest[i] = src[i] + amount, Mode::add (am, s),
|
||||
JUCE_LOAD_SRC, JUCE_INCREMENT_SRC_DEST,
|
||||
const Mode::ParallelType am = Mode::load1 (amount);)
|
||||
#endif
|
||||
}
|
||||
|
||||
void JUCE_CALLTYPE FloatVectorOperations::add (double* dest, double* src, double amount, int num) noexcept
|
||||
{
|
||||
#if JUCE_USE_VDSP_FRAMEWORK
|
||||
vDSP_vsaddD (src, 1, &amount, dest, 1, (vDSP_Length) num);
|
||||
#else
|
||||
JUCE_PERFORM_VEC_OP_SRC_DEST (dest[i] = src[i] + amount, Mode::add (am, s),
|
||||
JUCE_LOAD_SRC, JUCE_INCREMENT_SRC_DEST,
|
||||
const Mode::ParallelType am = Mode::load1 (amount);)
|
||||
#endif
|
||||
}
|
||||
|
||||
void JUCE_CALLTYPE FloatVectorOperations::add (float* dest, const float* src, int num) noexcept
|
||||
{
|
||||
#if JUCE_USE_VDSP_FRAMEWORK
|
||||
vDSP_vadd (src, 1, dest, 1, dest, 1, num);
|
||||
vDSP_vadd (src, 1, dest, 1, dest, 1, (vDSP_Length) num);
|
||||
#else
|
||||
JUCE_PERFORM_VEC_OP_SRC_DEST (dest[i] += src[i], Mode::add (d, s), JUCE_LOAD_SRC_DEST, JUCE_INCREMENT_SRC_DEST, )
|
||||
#endif
|
||||
@@ -452,16 +506,34 @@ void JUCE_CALLTYPE FloatVectorOperations::add (float* dest, const float* src, in
|
||||
void JUCE_CALLTYPE FloatVectorOperations::add (double* dest, const double* src, int num) noexcept
|
||||
{
|
||||
#if JUCE_USE_VDSP_FRAMEWORK
|
||||
vDSP_vaddD (src, 1, dest, 1, dest, 1, num);
|
||||
vDSP_vaddD (src, 1, dest, 1, dest, 1, (vDSP_Length) num);
|
||||
#else
|
||||
JUCE_PERFORM_VEC_OP_SRC_DEST (dest[i] += src[i], Mode::add (d, s), JUCE_LOAD_SRC_DEST, JUCE_INCREMENT_SRC_DEST, )
|
||||
#endif
|
||||
}
|
||||
|
||||
void JUCE_CALLTYPE FloatVectorOperations::add (float* dest, const float* src1, const float* src2, int num) noexcept
|
||||
{
|
||||
#if JUCE_USE_VDSP_FRAMEWORK
|
||||
vDSP_vadd (src1, 1, src2, 1, dest, 1, (vDSP_Length) num);
|
||||
#else
|
||||
JUCE_PERFORM_VEC_OP_SRC1_SRC2_DEST (dest[i] = src1[i] + src2[i], Mode::add (s1, s2), JUCE_LOAD_SRC1_SRC2, JUCE_INCREMENT_SRC1_SRC2_DEST, )
|
||||
#endif
|
||||
}
|
||||
|
||||
void JUCE_CALLTYPE FloatVectorOperations::add (double* dest, const double* src1, const double* src2, int num) noexcept
|
||||
{
|
||||
#if JUCE_USE_VDSP_FRAMEWORK
|
||||
vDSP_vaddD (src1, 1, src2, 1, dest, 1, (vDSP_Length) num);
|
||||
#else
|
||||
JUCE_PERFORM_VEC_OP_SRC1_SRC2_DEST (dest[i] = src1[i] + src2[i], Mode::add (s1, s2), JUCE_LOAD_SRC1_SRC2, JUCE_INCREMENT_SRC1_SRC2_DEST, )
|
||||
#endif
|
||||
}
|
||||
|
||||
void JUCE_CALLTYPE FloatVectorOperations::subtract (float* dest, const float* src, int num) noexcept
|
||||
{
|
||||
#if JUCE_USE_VDSP_FRAMEWORK
|
||||
vDSP_vsub (src, 1, dest, 1, dest, 1, num);
|
||||
vDSP_vsub (src, 1, dest, 1, dest, 1, (vDSP_Length) num);
|
||||
#else
|
||||
JUCE_PERFORM_VEC_OP_SRC_DEST (dest[i] -= src[i], Mode::sub (d, s), JUCE_LOAD_SRC_DEST, JUCE_INCREMENT_SRC_DEST, )
|
||||
#endif
|
||||
@@ -470,12 +542,30 @@ void JUCE_CALLTYPE FloatVectorOperations::subtract (float* dest, const float* sr
|
||||
void JUCE_CALLTYPE FloatVectorOperations::subtract (double* dest, const double* src, int num) noexcept
|
||||
{
|
||||
#if JUCE_USE_VDSP_FRAMEWORK
|
||||
vDSP_vsubD (src, 1, dest, 1, dest, 1, num);
|
||||
vDSP_vsubD (src, 1, dest, 1, dest, 1, (vDSP_Length) num);
|
||||
#else
|
||||
JUCE_PERFORM_VEC_OP_SRC_DEST (dest[i] -= src[i], Mode::sub (d, s), JUCE_LOAD_SRC_DEST, JUCE_INCREMENT_SRC_DEST, )
|
||||
#endif
|
||||
}
|
||||
|
||||
void JUCE_CALLTYPE FloatVectorOperations::subtract (float* dest, const float* src1, const float* src2, int num) noexcept
|
||||
{
|
||||
#if JUCE_USE_VDSP_FRAMEWORK
|
||||
vDSP_vsub (src2, 1, src1, 1, dest, 1, (vDSP_Length) num);
|
||||
#else
|
||||
JUCE_PERFORM_VEC_OP_SRC1_SRC2_DEST (dest[i] = src1[i] - src2[i], Mode::sub (s1, s2), JUCE_LOAD_SRC1_SRC2, JUCE_INCREMENT_SRC1_SRC2_DEST, )
|
||||
#endif
|
||||
}
|
||||
|
||||
void JUCE_CALLTYPE FloatVectorOperations::subtract (double* dest, const double* src1, const double* src2, int num) noexcept
|
||||
{
|
||||
#if JUCE_USE_VDSP_FRAMEWORK
|
||||
vDSP_vsubD (src2, 1, src1, 1, dest, 1, (vDSP_Length) num);
|
||||
#else
|
||||
JUCE_PERFORM_VEC_OP_SRC1_SRC2_DEST (dest[i] = src1[i] - src2[i], Mode::sub (s1, s2), JUCE_LOAD_SRC1_SRC2, JUCE_INCREMENT_SRC1_SRC2_DEST, )
|
||||
#endif
|
||||
}
|
||||
|
||||
void JUCE_CALLTYPE FloatVectorOperations::addWithMultiply (float* dest, const float* src, float multiplier, int num) noexcept
|
||||
{
|
||||
JUCE_PERFORM_VEC_OP_SRC_DEST (dest[i] += src[i] * multiplier, Mode::add (d, Mode::mul (mult, s)),
|
||||
@@ -493,7 +583,7 @@ void JUCE_CALLTYPE FloatVectorOperations::addWithMultiply (double* dest, const d
|
||||
void JUCE_CALLTYPE FloatVectorOperations::multiply (float* dest, const float* src, int num) noexcept
|
||||
{
|
||||
#if JUCE_USE_VDSP_FRAMEWORK
|
||||
vDSP_vmul (src, 1, dest, 1, dest, 1, num);
|
||||
vDSP_vmul (src, 1, dest, 1, dest, 1, (vDSP_Length) num);
|
||||
#else
|
||||
JUCE_PERFORM_VEC_OP_SRC_DEST (dest[i] *= src[i], Mode::mul (d, s), JUCE_LOAD_SRC_DEST, JUCE_INCREMENT_SRC_DEST, )
|
||||
#endif
|
||||
@@ -502,16 +592,34 @@ void JUCE_CALLTYPE FloatVectorOperations::multiply (float* dest, const float* sr
|
||||
void JUCE_CALLTYPE FloatVectorOperations::multiply (double* dest, const double* src, int num) noexcept
|
||||
{
|
||||
#if JUCE_USE_VDSP_FRAMEWORK
|
||||
vDSP_vmulD (src, 1, dest, 1, dest, 1, num);
|
||||
vDSP_vmulD (src, 1, dest, 1, dest, 1, (vDSP_Length) num);
|
||||
#else
|
||||
JUCE_PERFORM_VEC_OP_SRC_DEST (dest[i] *= src[i], Mode::mul (d, s), JUCE_LOAD_SRC_DEST, JUCE_INCREMENT_SRC_DEST, )
|
||||
#endif
|
||||
}
|
||||
|
||||
void JUCE_CALLTYPE FloatVectorOperations::multiply (float* dest, const float* src1, const float* src2, int num) noexcept
|
||||
{
|
||||
#if JUCE_USE_VDSP_FRAMEWORK
|
||||
vDSP_vmul (src1, 1, src2, 1, dest, 1, (vDSP_Length) num);
|
||||
#else
|
||||
JUCE_PERFORM_VEC_OP_SRC1_SRC2_DEST (dest[i] = src1[i] * src2[i], Mode::mul (s1, s2), JUCE_LOAD_SRC1_SRC2, JUCE_INCREMENT_SRC1_SRC2_DEST, )
|
||||
#endif
|
||||
}
|
||||
|
||||
void JUCE_CALLTYPE FloatVectorOperations::multiply (double* dest, const double* src1, const double* src2, int num) noexcept
|
||||
{
|
||||
#if JUCE_USE_VDSP_FRAMEWORK
|
||||
vDSP_vmulD (src1, 1, src2, 1, dest, 1, (vDSP_Length) num);
|
||||
#else
|
||||
JUCE_PERFORM_VEC_OP_SRC1_SRC2_DEST (dest[i] = src1[i] * src2[i], Mode::mul (s1, s2), JUCE_LOAD_SRC1_SRC2, JUCE_INCREMENT_SRC1_SRC2_DEST, )
|
||||
#endif
|
||||
}
|
||||
|
||||
void JUCE_CALLTYPE FloatVectorOperations::multiply (float* dest, float multiplier, int num) noexcept
|
||||
{
|
||||
#if JUCE_USE_VDSP_FRAMEWORK
|
||||
vDSP_vsmul (dest, 1, &multiplier, dest, 1, num);
|
||||
vDSP_vsmul (dest, 1, &multiplier, dest, 1, (vDSP_Length) num);
|
||||
#else
|
||||
JUCE_PERFORM_VEC_OP_DEST (dest[i] *= multiplier, Mode::mul (d, mult), JUCE_LOAD_DEST,
|
||||
const Mode::ParallelType mult = Mode::load1 (multiplier);)
|
||||
@@ -521,13 +629,27 @@ void JUCE_CALLTYPE FloatVectorOperations::multiply (float* dest, float multiplie
|
||||
void JUCE_CALLTYPE FloatVectorOperations::multiply (double* dest, double multiplier, int num) noexcept
|
||||
{
|
||||
#if JUCE_USE_VDSP_FRAMEWORK
|
||||
vDSP_vsmulD (dest, 1, &multiplier, dest, 1, num);
|
||||
vDSP_vsmulD (dest, 1, &multiplier, dest, 1, (vDSP_Length) num);
|
||||
#else
|
||||
JUCE_PERFORM_VEC_OP_DEST (dest[i] *= multiplier, Mode::mul (d, mult), JUCE_LOAD_DEST,
|
||||
const Mode::ParallelType mult = Mode::load1 (multiplier);)
|
||||
#endif
|
||||
}
|
||||
|
||||
void JUCE_CALLTYPE FloatVectorOperations::multiply (float* dest, const float* src, float multiplier, int num) noexcept
|
||||
{
|
||||
JUCE_PERFORM_VEC_OP_SRC_DEST (dest[i] = src[i] * multiplier, Mode::mul (mult, s),
|
||||
JUCE_LOAD_SRC, JUCE_INCREMENT_SRC_DEST,
|
||||
const Mode::ParallelType mult = Mode::load1 (multiplier);)
|
||||
}
|
||||
|
||||
void JUCE_CALLTYPE FloatVectorOperations::multiply (double* dest, const double* src, double multiplier, int num) noexcept
|
||||
{
|
||||
JUCE_PERFORM_VEC_OP_SRC_DEST (dest[i] = src[i] * multiplier, Mode::mul (mult, s),
|
||||
JUCE_LOAD_SRC, JUCE_INCREMENT_SRC_DEST,
|
||||
const Mode::ParallelType mult = Mode::load1 (multiplier);)
|
||||
}
|
||||
|
||||
void FloatVectorOperations::negate (float* dest, const float* src, int num) noexcept
|
||||
{
|
||||
#if JUCE_USE_VDSP_FRAMEWORK
|
||||
@@ -640,8 +762,8 @@ public:
|
||||
const int range = random.nextBool() ? 500 : 10;
|
||||
const int num = random.nextInt (range) + 1;
|
||||
|
||||
HeapBlock<ValueType> buffer1 (num + 16), buffer2 (num + 16);
|
||||
HeapBlock<int> buffer3 (num + 16);
|
||||
HeapBlock<ValueType> buffer1 ((size_t) num + 16), buffer2 ((size_t) num + 16);
|
||||
HeapBlock<int> buffer3 ((size_t) num + 16);
|
||||
|
||||
#if JUCE_ARM
|
||||
ValueType* const data1 = buffer1;
|
||||
|
||||
@@ -65,18 +65,36 @@ public:
|
||||
/** Adds a fixed value to the destination values. */
|
||||
static void JUCE_CALLTYPE add (double* dest, double amountToAdd, int numValues) noexcept;
|
||||
|
||||
/** Adds a fixed value to each source value and stores it in the destination array. */
|
||||
static void JUCE_CALLTYPE add (float* dest, float* src, float amount, int numValues) noexcept;
|
||||
|
||||
/** Adds a fixed value to each source value and stores it in the destination array. */
|
||||
static void JUCE_CALLTYPE add (double* dest, double* src, double amount, int numValues) noexcept;
|
||||
|
||||
/** Adds the source values to the destination values. */
|
||||
static void JUCE_CALLTYPE add (float* dest, const float* src, int numValues) noexcept;
|
||||
|
||||
/** Adds the source values to the destination values. */
|
||||
static void JUCE_CALLTYPE add (double* dest, const double* src, int numValues) noexcept;
|
||||
|
||||
/** Adds each source1 value to the corresponding source2 value and stores the result in the destination array. */
|
||||
static void JUCE_CALLTYPE add (float* dest, const float* src1, const float* src2, int num) noexcept;
|
||||
|
||||
/** Adds each source1 value to the corresponding source2 value and stores the result in the destination array. */
|
||||
static void JUCE_CALLTYPE add (double* dest, const double* src1, const double* src2, int num) noexcept;
|
||||
|
||||
/** Subtracts the source values from the destination values. */
|
||||
static void JUCE_CALLTYPE subtract (float* dest, const float* src, int numValues) noexcept;
|
||||
|
||||
/** Subtracts the source values from the destination values. */
|
||||
static void JUCE_CALLTYPE subtract (double* dest, const double* src, int numValues) noexcept;
|
||||
|
||||
/** Subtracts each source2 value from the corresponding source1 value and stores the result in the destination array. */
|
||||
static void JUCE_CALLTYPE subtract (float* dest, const float* src1, const float* src2, int num) noexcept;
|
||||
|
||||
/** Subtracts each source2 value from the corresponding source1 value and stores the result in the destination array. */
|
||||
static void JUCE_CALLTYPE subtract (double* dest, const double* src1, const double* src2, int num) noexcept;
|
||||
|
||||
/** Multiplies each source value by the given multiplier, then adds it to the destination value. */
|
||||
static void JUCE_CALLTYPE addWithMultiply (float* dest, const float* src, float multiplier, int numValues) noexcept;
|
||||
|
||||
@@ -89,12 +107,24 @@ public:
|
||||
/** Multiplies the destination values by the source values. */
|
||||
static void JUCE_CALLTYPE multiply (double* dest, const double* src, int numValues) noexcept;
|
||||
|
||||
/** Multiplies each source1 value by the correspinding source2 value, then stores it in the destination array. */
|
||||
static void JUCE_CALLTYPE multiply (float* dest, const float* src1, const float* src2, int numValues) noexcept;
|
||||
|
||||
/** Multiplies each source1 value by the correspinding source2 value, then stores it in the destination array. */
|
||||
static void JUCE_CALLTYPE multiply (double* dest, const double* src1, const double* src2, int numValues) noexcept;
|
||||
|
||||
/** Multiplies each of the destination values by a fixed multiplier. */
|
||||
static void JUCE_CALLTYPE multiply (float* dest, float multiplier, int numValues) noexcept;
|
||||
|
||||
/** Multiplies each of the destination values by a fixed multiplier. */
|
||||
static void JUCE_CALLTYPE multiply (double* dest, double multiplier, int numValues) noexcept;
|
||||
|
||||
/** Multiplies each of the source values by a fixed multiplier and stores the result in the destination array. */
|
||||
static void JUCE_CALLTYPE multiply (float* dest, const float* src, float multiplier, int num) noexcept;
|
||||
|
||||
/** Multiplies each of the source values by a fixed multiplier and stores the result in the destination array. */
|
||||
static void JUCE_CALLTYPE multiply (double* dest, const double* src, double multiplier, int num) noexcept;
|
||||
|
||||
/** Copies a source vector to a destination, negating each value. */
|
||||
static void JUCE_CALLTYPE negate (float* dest, const float* src, int numValues) noexcept;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user