From 38793bba10b72c71b15b8e950a6dda8217b94306 Mon Sep 17 00:00:00 2001 From: Chris Cannam Date: Thu, 10 Sep 2020 14:30:36 +0100 Subject: [PATCH 01/17] Added tag v1.9 for changeset 37b18c17c042 --- .hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/.hgtags b/.hgtags index c72ad9e..70cb1f3 100644 --- a/.hgtags +++ b/.hgtags @@ -10,3 +10,4 @@ efbc861f9b9460068c48a250232d343ffa7d5726 v1.7 77466ee7ffb5b07efda9b1dbed858379c987a9da v1.8.1 d4911a276d96f6232a68c6b8448056d3946043b9 v1.8.1 fa6a54be7e6bf0c5adffd19ccec622481a8140a5 v1.8.2 +37b18c17c042eafc39483ffb58837de844ba3289 v1.9 From d7608fb05ff1a6f5d07df7fef9b08325d9e8ccd5 Mon Sep 17 00:00:00 2001 From: Chris Cannam Date: Fri, 11 Sep 2020 17:11:21 +0100 Subject: [PATCH 02/17] Add tracker & git links --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index b476350..ae612f0 100644 --- a/README.md +++ b/README.md @@ -12,6 +12,8 @@ tempo and pitch of an audio recording independently of one another. * About Rubber Band: https://breakfastquay.com/rubberband/ * Code repository: https://hg.sr.ht/~breakfastquay/rubberband +* Issue tracker: https://todo.sr.ht/~breakfastquay/rubberband +* Github mirror: https://github.com/breakfastquay/rubberband ## Licence From 8acf2e539ea95fbc8cb9ff19d39bd55d4d09ea22 Mon Sep 17 00:00:00 2001 From: Chris Cannam Date: Mon, 14 Sep 2020 10:35:16 +0100 Subject: [PATCH 03/17] Define Vamp and LADSPA LDFLAGS --- Makefile.osx | 2 ++ ladspa/ladspa-plugin.list | 1 + vamp/vamp-plugin.list | 1 + 3 files changed, 4 insertions(+) create mode 100644 ladspa/ladspa-plugin.list create mode 100644 vamp/vamp-plugin.list diff --git a/Makefile.osx b/Makefile.osx index 642533f..650c2f0 100644 --- a/Makefile.osx +++ b/Makefile.osx @@ -32,6 +32,8 @@ DYNAMIC_EXTENSION := .dylib DYNAMIC_FULL_VERSION := 2.1.2 DYNAMIC_ABI_VERSION := 2 DYNAMIC_LDFLAGS := -dynamiclib -install_name $(INSTALL_LIBDIR)/$(LIBNAME).$(DYNAMIC_ABI_VERSION)$(DYNAMIC_EXTENSION) -current_version $(DYNAMIC_FULL_VERSION) -compatibility_version $(DYNAMIC_ABI_VERSION) +VAMP_LDFLAGS := -dynamiclib -install_name vamp-rubberband.dylib -exported_symbols_list vamp/vamp-plugin.list +LADSPA_LDFLAGS := -dynamiclib -install_name ladspa-rubberband.dylib -exported_symbols_list ladspa/ladspa-plugin.list PROGRAM_TARGET := bin/rubberband STATIC_TARGET := lib/$(LIBNAME).a diff --git a/ladspa/ladspa-plugin.list b/ladspa/ladspa-plugin.list new file mode 100644 index 0000000..853ffc6 --- /dev/null +++ b/ladspa/ladspa-plugin.list @@ -0,0 +1 @@ +_ladspa_descriptor diff --git a/vamp/vamp-plugin.list b/vamp/vamp-plugin.list new file mode 100644 index 0000000..47a3e77 --- /dev/null +++ b/vamp/vamp-plugin.list @@ -0,0 +1 @@ +_vampGetPluginDescriptor From 051309666175d802de2fc3fc62cc251a08963223 Mon Sep 17 00:00:00 2001 From: Chris Cannam Date: Mon, 14 Sep 2020 12:04:08 +0100 Subject: [PATCH 04/17] Fix build failure for macOS 10.6 --- src/system/VectorOps.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/system/VectorOps.h b/src/system/VectorOps.h index 405b176..e9b7c53 100644 --- a/src/system/VectorOps.h +++ b/src/system/VectorOps.h @@ -677,7 +677,7 @@ inline void v_abs(float *const R__ dst, const int count) { float tmp[count]; -#if (defined(MACOSX_DEPLOYMENT_TARGET) && MACOSX_DEPLOYMENT_TARGET <= 1070 && MAC_OS_X_VERSION_MIN_REQUIRED <= 1070) +#if (defined(MAC_OS_X_VERSION_MIN_REQUIRED) && MAC_OS_X_VERSION_MIN_REQUIRED < 1070) vvfabf(tmp, dst, &count); #else vvfabsf(tmp, dst, &count); From a992376541d083a1a9471b55ae675f2935cb903e Mon Sep 17 00:00:00 2001 From: Chris Cannam Date: Tue, 15 Sep 2020 08:20:07 +0100 Subject: [PATCH 05/17] Fix iOS build broken by earlier commit --- src/system/VectorOps.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/system/VectorOps.h b/src/system/VectorOps.h index e9b7c53..fc1d0f6 100644 --- a/src/system/VectorOps.h +++ b/src/system/VectorOps.h @@ -677,7 +677,9 @@ inline void v_abs(float *const R__ dst, const int count) { float tmp[count]; -#if (defined(MAC_OS_X_VERSION_MIN_REQUIRED) && MAC_OS_X_VERSION_MIN_REQUIRED < 1070) +#if TARGET_OS_IPHONE + vvfabsf(tmp, dst, &count); +#elif (defined(MAC_OS_X_VERSION_MIN_REQUIRED) && MAC_OS_X_VERSION_MIN_REQUIRED < 1070) vvfabf(tmp, dst, &count); #else vvfabsf(tmp, dst, &count); From 61c1cbe91c233afb122eaeb9e815257c6a6f4825 Mon Sep 17 00:00:00 2001 From: Chris Cannam Date: Tue, 15 Sep 2020 08:32:07 +0100 Subject: [PATCH 06/17] Add CI build badges --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index ae612f0..9a56e40 100644 --- a/README.md +++ b/README.md @@ -15,6 +15,8 @@ tempo and pitch of an audio recording independently of one another. * Issue tracker: https://todo.sr.ht/~breakfastquay/rubberband * Github mirror: https://github.com/breakfastquay/rubberband +CI builds: Linux, macOS, iOS [![Build Status](https://travis-ci.org/breakfastquay/rubberband.svg?branch=master)](https://travis-ci.org/breakfastquay/rubberband); Windows [![Build Status](https://ci.appveyor.com/api/projects/status/hhhhpf718jwhpyf6?svg=true)](https://ci.appveyor.com/project/breakfastquay/rubberband) + ## Licence From 6de1ab5b68e51656cba3037f9afbe238aa115ed1 Mon Sep 17 00:00:00 2001 From: Chris Cannam Date: Tue, 15 Sep 2020 08:37:53 +0100 Subject: [PATCH 07/17] Experiment with cacheing homebrew stuff in Travis --- .travis.yml | 11 ++++++++++- README.md | 5 ++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 1ddce82..eb3bafc 100644 --- a/.travis.yml +++ b/.travis.yml @@ -19,7 +19,16 @@ addons: - libfftw3-dev - vamp-plugin-sdk - ladspa-sdk - + +cache: + directories: + - $HOME/Library/Caches/Homebrew + - /usr/local/Homebrew + +before_cache: + - if [ "${TRAVIS_OS_NAME}" = "osx" ]; then brew cleanup; fi + - if [ "${TRAVIS_OS_NAME}" = "osx" ]; then find /usr/local/Homebrew \! -regex ".+\.git.+" -delete; fi + before_install: - if [[ "$TRAVIS_OS_NAME" = "osx" ]] ; then brew update ; brew install libsndfile ; fi diff --git a/README.md b/README.md index 9a56e40..9494b4d 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,10 @@ tempo and pitch of an audio recording independently of one another. * Issue tracker: https://todo.sr.ht/~breakfastquay/rubberband * Github mirror: https://github.com/breakfastquay/rubberband -CI builds: Linux, macOS, iOS [![Build Status](https://travis-ci.org/breakfastquay/rubberband.svg?branch=master)](https://travis-ci.org/breakfastquay/rubberband); Windows [![Build Status](https://ci.appveyor.com/api/projects/status/hhhhpf718jwhpyf6?svg=true)](https://ci.appveyor.com/project/breakfastquay/rubberband) +CI builds: + +* [![Build Status](https://travis-ci.org/breakfastquay/rubberband.svg?branch=master)](https://travis-ci.org/breakfastquay/rubberband) (Linux, macOS, iOS) +* [![Build Status](https://ci.appveyor.com/api/projects/status/hhhhpf718jwhpyf6?svg=true)](https://ci.appveyor.com/project/breakfastquay/rubberband) (Windows) ## Licence From be843f3da71f2319660b2a093cce6e74d937aca1 Mon Sep 17 00:00:00 2001 From: Chris Cannam Date: Tue, 15 Sep 2020 15:23:33 +0100 Subject: [PATCH 08/17] Avoid an input increment of zero (= sigfpe) when given a very long stretch factor --- src/StretcherImpl.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/StretcherImpl.cpp b/src/StretcherImpl.cpp index b9e3443..cbf8b7b 100644 --- a/src/StretcherImpl.cpp +++ b/src/StretcherImpl.cpp @@ -466,6 +466,10 @@ RubberBandStretcher::Impl::calculateSizes() outputIncrement /= 2; inputIncrement = int(outputIncrement / r); } + while (inputIncrement < 1) { + outputIncrement *= 2; + inputIncrement = int(outputIncrement / r); + } size_t minwin = roundUp(lrint(outputIncrement * windowIncrRatio)); if (windowSize < minwin) windowSize = minwin; @@ -501,6 +505,10 @@ RubberBandStretcher::Impl::calculateSizes() outputIncrement /= 2; inputIncrement = int(outputIncrement / r); } + while (inputIncrement < 1) { + outputIncrement *= 2; + inputIncrement = int(outputIncrement / r); + } windowSize = std::max(windowSize, roundUp(outputIncrement * 6)); if (r > 5) while (windowSize < 8192) windowSize *= 2; } From 438893fb6f0e147c633132dcc67de594ce6458be Mon Sep 17 00:00:00 2001 From: Chris Cannam Date: Wed, 16 Sep 2020 17:47:30 +0100 Subject: [PATCH 09/17] Avoid some compiler warnings --- src/audiocurves/HighFrequencyAudioCurve.cpp | 4 ++-- src/audiocurves/PercussiveAudioCurve.cpp | 4 ++-- src/audiocurves/SpectralDifferenceAudioCurve.cpp | 4 ++-- src/system/Allocators.h | 16 ++++++++++++---- src/system/Thread.cpp | 12 ++++++++++-- 5 files changed, 28 insertions(+), 12 deletions(-) diff --git a/src/audiocurves/HighFrequencyAudioCurve.cpp b/src/audiocurves/HighFrequencyAudioCurve.cpp index bae61f5..dbe3c24 100644 --- a/src/audiocurves/HighFrequencyAudioCurve.cpp +++ b/src/audiocurves/HighFrequencyAudioCurve.cpp @@ -42,7 +42,7 @@ HighFrequencyAudioCurve::reset() } float -HighFrequencyAudioCurve::processFloat(const float *R__ mag, int increment) +HighFrequencyAudioCurve::processFloat(const float *R__ mag, int) { float result = 0.0; @@ -56,7 +56,7 @@ HighFrequencyAudioCurve::processFloat(const float *R__ mag, int increment) } double -HighFrequencyAudioCurve::processDouble(const double *R__ mag, int increment) +HighFrequencyAudioCurve::processDouble(const double *R__ mag, int) { float result = 0.0; diff --git a/src/audiocurves/PercussiveAudioCurve.cpp b/src/audiocurves/PercussiveAudioCurve.cpp index c1190fb..5d3efcb 100644 --- a/src/audiocurves/PercussiveAudioCurve.cpp +++ b/src/audiocurves/PercussiveAudioCurve.cpp @@ -58,7 +58,7 @@ PercussiveAudioCurve::setFftSize(int newSize) } float -PercussiveAudioCurve::processFloat(const float *R__ mag, int increment) +PercussiveAudioCurve::processFloat(const float *R__ mag, int) { static float threshold = powf(10.f, 0.15f); // 3dB rise in square of magnitude static float zeroThresh = powf(10.f, -8); @@ -84,7 +84,7 @@ PercussiveAudioCurve::processFloat(const float *R__ mag, int increment) } double -PercussiveAudioCurve::processDouble(const double *R__ mag, int increment) +PercussiveAudioCurve::processDouble(const double *R__ mag, int) { static double threshold = pow(10., 0.15); // 3dB rise in square of magnitude static double zeroThresh = pow(10., -8); diff --git a/src/audiocurves/SpectralDifferenceAudioCurve.cpp b/src/audiocurves/SpectralDifferenceAudioCurve.cpp index cb10ee6..91fc81f 100644 --- a/src/audiocurves/SpectralDifferenceAudioCurve.cpp +++ b/src/audiocurves/SpectralDifferenceAudioCurve.cpp @@ -62,7 +62,7 @@ SpectralDifferenceAudioCurve::setFftSize(int newSize) } float -SpectralDifferenceAudioCurve::processFloat(const float *R__ mag, int increment) +SpectralDifferenceAudioCurve::processFloat(const float *R__ mag, int) { double result = 0.0; @@ -83,7 +83,7 @@ SpectralDifferenceAudioCurve::processFloat(const float *R__ mag, int increment) } double -SpectralDifferenceAudioCurve::processDouble(const double *R__ mag, int increment) +SpectralDifferenceAudioCurve::processDouble(const double *R__ mag, int) { double result = 0.0; diff --git a/src/system/Allocators.h b/src/system/Allocators.h index c431f78..2f1fbbf 100644 --- a/src/system/Allocators.h +++ b/src/system/Allocators.h @@ -271,9 +271,13 @@ T **reallocate_channels(T **ptr, { T **newptr = allocate_channels(channels, count); if (oldcount && ptr) { - v_copy_channels(newptr, ptr, channels, oldcount < count ? oldcount : count); + for (size_t c = 0; c < oldchannels && c < channels; ++c) { + for (size_t i = 0; i < oldcount && i < count; ++i) { + newptr[c][i] = ptr[c][i]; + } + } } - if (ptr) deallocate_channels(ptr, channels); + if (ptr) deallocate_channels(ptr, oldchannels); return newptr; } @@ -284,9 +288,13 @@ T **reallocate_and_zero_extend_channels(T **ptr, { T **newptr = allocate_and_zero_channels(channels, count); if (oldcount && ptr) { - v_copy_channels(newptr, ptr, channels, oldcount < count ? oldcount : count); + for (size_t c = 0; c < oldchannels && c < channels; ++c) { + for (size_t i = 0; i < oldcount && i < count; ++i) { + newptr[c][i] = ptr[c][i]; + } + } } - if (ptr) deallocate_channels(ptr, channels); + if (ptr) deallocate_channels(ptr, oldchannels); return newptr; } diff --git a/src/system/Thread.cpp b/src/system/Thread.cpp index 8d35647..eb65731 100644 --- a/src/system/Thread.cpp +++ b/src/system/Thread.cpp @@ -200,7 +200,11 @@ Mutex::trylock() } } -Condition::Condition(string name) : +Condition::Condition(string +#ifdef DEBUG_CONDITION + name +#endif + ) : m_locked(false) #ifdef DEBUG_CONDITION , m_name(name) @@ -456,7 +460,11 @@ Mutex::trylock() } } -Condition::Condition(string name) : +Condition::Condition(string +#ifdef DEBUG_CONDITION + name +#endif + ) : m_locked(false) #ifdef DEBUG_CONDITION , m_name(name) From 76175b9e802cd87e399ca049b34d69014ab361e2 Mon Sep 17 00:00:00 2001 From: Chris Cannam Date: Wed, 16 Sep 2020 17:52:33 +0100 Subject: [PATCH 10/17] It appears this may be all we need - apparently the occasional odd extra sample (due to incremental rounding) added up and eventually overran the filter. I believe +1 is perfectly good here, but we can afford to be more accommodating just in case --- src/dsp/Resampler.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dsp/Resampler.cpp b/src/dsp/Resampler.cpp index d2db61f..248ede5 100644 --- a/src/dsp/Resampler.cpp +++ b/src/dsp/Resampler.cpp @@ -609,7 +609,7 @@ D_SRC::resample(const float *const R__ *const R__ in, { SRC_DATA data; - int outcount = lrintf(ceilf(incount * ratio)); + int outcount = lrintf(ceilf(incount * ratio) + 10); if (m_channels == 1) { data.data_in = const_cast(*in); //!!!??? From 4728c79862becca6480b0b489af958849a84982d Mon Sep 17 00:00:00 2001 From: Chris Cannam Date: Mon, 21 Sep 2020 13:48:45 +0100 Subject: [PATCH 11/17] Fix potential discontinuity when window size is reduced due to change in ratio --- src/StretcherProcess.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/StretcherProcess.cpp b/src/StretcherProcess.cpp index 7fc118e..39da682 100644 --- a/src/StretcherProcess.cpp +++ b/src/StretcherProcess.cpp @@ -1018,7 +1018,7 @@ RubberBandStretcher::Impl::synthesiseChunk(size_t channel, m_swindow->cut(fltbuf); v_add(accumulator, fltbuf, wsz); - cd.accumulatorFill = wsz; + cd.accumulatorFill = std::max(cd.accumulatorFill, size_t(wsz)); if (wsz > fsz) { // reuse fltbuf to calculate interpolating window shape for @@ -1041,7 +1041,7 @@ RubberBandStretcher::Impl::writeChunk(size_t channel, size_t shiftIncrement, boo float *const R__ accumulator = cd.accumulator; float *const R__ windowAccumulator = cd.windowAccumulator; - const int sz = m_sWindowSize; + const int sz = cd.accumulatorFill; const int si = shiftIncrement; if (m_debugLevel > 2) { From f42a369b8e86f9d5b5783f276f83bbbae1bf12aa Mon Sep 17 00:00:00 2001 From: Chris Cannam Date: Mon, 21 Sep 2020 16:44:53 +0100 Subject: [PATCH 12/17] Same fix in resampleInterleaved as earlier committed in resample --- src/dsp/Resampler.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dsp/Resampler.cpp b/src/dsp/Resampler.cpp index 248ede5..90ccdba 100644 --- a/src/dsp/Resampler.cpp +++ b/src/dsp/Resampler.cpp @@ -661,7 +661,7 @@ D_SRC::resampleInterleaved(const float *const R__ in, { SRC_DATA data; - int outcount = lrintf(ceilf(incount * ratio)); + int outcount = lrintf(ceilf(incount * ratio) + 10); data.data_in = const_cast(in); data.data_out = out; From 8df9558868754c06d42f219ed4137d9fb076458f Mon Sep 17 00:00:00 2001 From: Chris Cannam Date: Tue, 22 Sep 2020 10:35:50 +0100 Subject: [PATCH 13/17] In this emergency, increase the buffer size by a factor rather than only by a constant amount - because if this arises because of an overlong increment being broken down into littler bits, we would end up doing it again and again, which is much more expensive. This makes a huge performance difference in cases where a time map ends up mapping very little input into a great expanse of output --- src/StretcherProcess.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/StretcherProcess.cpp b/src/StretcherProcess.cpp index 39da682..d8c912e 100644 --- a/src/StretcherProcess.cpp +++ b/src/StretcherProcess.cpp @@ -521,7 +521,14 @@ RubberBandStretcher::Impl::processChunkForChannel(size_t c, // This is an unhappy situation. RingBuffer *oldbuf = cd.outbuf; - cd.outbuf = oldbuf->resized(oldbuf->getSize() + (required - ws)); + cd.outbuf = oldbuf->resized(oldbuf->getSize() * 2); + + if (m_debugLevel > 1) { + cerr << "(Write space was " << ws << ", needed " << required + << ": resized output buffer from " << oldbuf->getSize() + << " to " << cd.outbuf->getSize() << ")" << endl; + } + m_emergencyScavenger.claim(oldbuf); } From 4c00915ab42e560530842312262fc9f99bd06abd Mon Sep 17 00:00:00 2001 From: Chris Cannam Date: Tue, 22 Sep 2020 14:10:29 +0100 Subject: [PATCH 14/17] Note about preference for libsamplerate --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 9494b4d..bfcc98f 100644 --- a/README.md +++ b/README.md @@ -200,6 +200,8 @@ Name Flags required Notes ---- -------------- ----- libsamplerate -DHAVE_LIBSAMPLERATE GPL until v0.1.8, BSD for v0.1.9 and later. + This is the preferred choice in almost + all cases. libresample -DHAVE_LIBRESAMPLE LGPL. From 390a273044584c2dd2127f520f46ddc39b123ace Mon Sep 17 00:00:00 2001 From: Chris Cannam Date: Thu, 24 Sep 2020 17:40:01 +0100 Subject: [PATCH 15/17] Add -fembed-bitcode --- Makefile.ios | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile.ios b/Makefile.ios index 04741a6..a8d8087 100644 --- a/Makefile.ios +++ b/Makefile.ios @@ -4,10 +4,10 @@ CC := clang OPTFLAGS := -ffast-math -freciprocal-math -O3 -ftree-vectorize # For the device -ARCHFLAGS_DEV := -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk -miphoneos-version-min=6 -stdlib=libc++ -arch armv7 -arch arm64 +ARCHFLAGS_DEV := -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk -miphoneos-version-min=6 -stdlib=libc++ -arch armv7 -arch arm64 -fembed-bitcode # Or for the simulator -ARCHFLAGS_SIM := -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk -miphoneos-version-min=6 -stdlib=libc++ -arch i386 -arch x86_64 +ARCHFLAGS_SIM := -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk -miphoneos-version-min=6 -stdlib=libc++ -arch i386 -arch x86_64 -fembed-bitcode CXXFLAGS_ANY := $(OPTFLAGS) -I. -Isrc -Irubberband -DMALLOC_IS_ALIGNED -DHAVE_VDSP -DUSE_SPEEX -DUSE_POMMIER_MATHFUN -DNO_THREADING -DNO_THREAD_CHECKS -DNO_TIMING -DNO_TIMING_COMPLETE_NOOP -DNDEBUG From 42ff18a22948cfd28a6c36bb2822608e616e2d3e Mon Sep 17 00:00:00 2001 From: Chris Cannam Date: Tue, 29 Sep 2020 11:04:18 +0100 Subject: [PATCH 16/17] Prefer libsamplerate at any performance setting, now we know it is better-behaved when changing rates --- src/dsp/Resampler.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/dsp/Resampler.cpp b/src/dsp/Resampler.cpp index 90ccdba..24429ae 100644 --- a/src/dsp/Resampler.cpp +++ b/src/dsp/Resampler.cpp @@ -1147,11 +1147,11 @@ Resampler::Resampler(Resampler::Quality quality, int channels, #ifdef HAVE_LIBRESAMPLE m_method = 3; #endif -#ifdef HAVE_LIBSAMPLERATE - m_method = 1; -#endif #ifdef USE_SPEEX m_method = 2; +#endif +#ifdef HAVE_LIBSAMPLERATE + m_method = 1; #endif break; From d05806450a1598a1574f9e53b2db353c1ab2da3b Mon Sep 17 00:00:00 2001 From: Chris Cannam Date: Thu, 8 Oct 2020 11:20:52 +0100 Subject: [PATCH 17/17] Avoid compiler complaints about dynamic array syntax. This is no better code, bu t it's less sensitive to compile options. --- src/system/VectorOps.h | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/system/VectorOps.h b/src/system/VectorOps.h index fc1d0f6..92694e1 100644 --- a/src/system/VectorOps.h +++ b/src/system/VectorOps.h @@ -38,6 +38,7 @@ #ifdef HAVE_VDSP #include +#include #endif #include @@ -521,7 +522,7 @@ template<> inline void v_log(float *const R__ dst, const int count) { - float tmp[count]; + float *tmp = (float *)alloca(count * sizeof(float)); vvlogf(tmp, dst, &count); v_copy(dst, tmp, count); } @@ -529,7 +530,7 @@ template<> inline void v_log(double *const R__ dst, const int count) { - double tmp[count]; + double *tmp = (double *)alloca(count * sizeof(double)); vvlog(tmp, dst, &count); v_copy(dst, tmp, count); } @@ -566,7 +567,7 @@ template<> inline void v_exp(float *const R__ dst, const int count) { - float tmp[count]; + float *tmp = (float *)alloca(count * sizeof(float)); vvexpf(tmp, dst, &count); v_copy(dst, tmp, count); } @@ -574,7 +575,7 @@ template<> inline void v_exp(double *const R__ dst, const int count) { - double tmp[count]; + double *tmp = (double *)alloca(count * sizeof(double)); vvexp(tmp, dst, &count); v_copy(dst, tmp, count); } @@ -611,7 +612,7 @@ template<> inline void v_sqrt(float *const R__ dst, const int count) { - float tmp[count]; + float *tmp = (float *)alloca(count * sizeof(float)); vvsqrtf(tmp, dst, &count); v_copy(dst, tmp, count); } @@ -619,7 +620,7 @@ template<> inline void v_sqrt(double *const R__ dst, const int count) { - double tmp[count]; + double *tmp = (double *)alloca(count * sizeof(double)); vvsqrt(tmp, dst, &count); v_copy(dst, tmp, count); } @@ -676,7 +677,7 @@ template<> inline void v_abs(float *const R__ dst, const int count) { - float tmp[count]; + float *tmp = (float *)alloca(count * sizeof(float)); #if TARGET_OS_IPHONE vvfabsf(tmp, dst, &count); #elif (defined(MAC_OS_X_VERSION_MIN_REQUIRED) && MAC_OS_X_VERSION_MIN_REQUIRED < 1070)