Browse Source

Added a method FloatVectorOperations::negate().

tags/2021-05-28
jules 12 years ago
parent
commit
35286f06be
2 changed files with 12 additions and 0 deletions
  1. +9
    -0
      modules/juce_audio_basics/buffers/juce_FloatVectorOperations.cpp
  2. +3
    -0
      modules/juce_audio_basics/buffers/juce_FloatVectorOperations.h

+ 9
- 0
modules/juce_audio_basics/buffers/juce_FloatVectorOperations.cpp View File

@@ -251,6 +251,15 @@ void JUCE_CALLTYPE FloatVectorOperations::multiply (float* dest, float multiplie
#endif
}
void FloatVectorOperations::negate (float* dest, const float* src, int num) noexcept
{
#if JUCE_USE_VDSP_FRAMEWORK
vDSP_vneg (src, 1, dest, 1, num);
#else
copyWithMultiply (dest, src, -1.0f, num);
#endif
}
void JUCE_CALLTYPE FloatVectorOperations::convertFixedToFloat (float* dest, const int* src, float multiplier, int num) noexcept
{
#if JUCE_USE_SSE_INTRINSICS


+ 3
- 0
modules/juce_audio_basics/buffers/juce_FloatVectorOperations.h View File

@@ -62,6 +62,9 @@ public:
/** Multiplies each of the destination values by a fixed multiplier. */
static void JUCE_CALLTYPE multiply (float* dest, float multiplier, int numValues) noexcept;
/** Copies a source vector to a destination, negating each value. */
static void JUCE_CALLTYPE negate (float* dest, const float* src, int numValues) noexcept;
/** Converts a stream of integers to floats, multiplying each one by the given multiplier. */
static void JUCE_CALLTYPE convertFixedToFloat (float* dest, const int* src, float multiplier, int numValues) noexcept;


Loading…
Cancel
Save