Reorganise into faster (R2) and finer (R3)

This commit is contained in:
Chris Cannam
2022-05-19 13:34:51 +01:00
parent e9264ae909
commit e9ad04e2b4
66 changed files with 89 additions and 127 deletions

View File

@@ -40,7 +40,7 @@
#include <lv2.h> #include <lv2.h>
#endif #endif
#include "base/RingBuffer.h" #include "common/RingBuffer.h"
namespace RubberBand { namespace RubberBand {
class RubberBandStretcher; class RubberBandStretcher;

View File

@@ -33,18 +33,17 @@
#include <fstream> #include <fstream>
#include "../src/system/sysutils.h" #include "../src/common/sysutils.h"
#include "../src/common/Profiler.h"
#ifdef _MSC_VER #ifdef _MSC_VER
#include "../src/getopt/getopt.h" #include "../src/ext/getopt/getopt.h"
#else #else
#include <getopt.h> #include <getopt.h>
#include <unistd.h> #include <unistd.h>
#include <sys/time.h> #include <sys/time.h>
#endif #endif
#include "../src/base/Profiler.h"
#ifdef _WIN32 #ifdef _WIN32
using RubberBand::gettimeofday; using RubberBand::gettimeofday;
#endif #endif

View File

@@ -33,21 +33,21 @@ public_headers = [
library_sources = [ library_sources = [
'src/rubberband-c.cpp', 'src/rubberband-c.cpp',
'src/RubberBandStretcher.cpp', 'src/RubberBandStretcher.cpp',
'src/StretcherProcess.cpp', 'src/faster/AudioCurveCalculator.cpp',
'src/StretchCalculator.cpp', 'src/faster/CompoundAudioCurve.cpp',
'src/base/Profiler.cpp', 'src/faster/HighFrequencyAudioCurve.cpp',
'src/dsp/AudioCurveCalculator.cpp', 'src/faster/SilentAudioCurve.cpp',
'src/audiocurves/CompoundAudioCurve.cpp', 'src/faster/PercussiveAudioCurve.cpp',
'src/audiocurves/HighFrequencyAudioCurve.cpp', 'src/faster/StretchCalculator.cpp',
'src/audiocurves/SilentAudioCurve.cpp', 'src/faster/StretcherChannelData.cpp',
'src/audiocurves/PercussiveAudioCurve.cpp', 'src/faster/StretcherImpl.cpp',
'src/dsp/Resampler.cpp', 'src/faster/StretcherProcess.cpp',
'src/dsp/FFT.cpp', 'src/common/Profiler.cpp',
'src/system/Allocators.cpp', 'src/common/Resampler.cpp',
'src/system/sysutils.cpp', 'src/common/FFT.cpp',
'src/system/Thread.cpp', 'src/common/Allocators.cpp',
'src/StretcherChannelData.cpp', 'src/common/sysutils.cpp',
'src/StretcherImpl.cpp', 'src/common/Thread.cpp',
'src/temporary.cpp', 'src/temporary.cpp',
] ]
@@ -203,7 +203,7 @@ if resampler == 'builtin'
if samplerate_dep.found() if samplerate_dep.found()
message('(to use libsamplerate instead, reconfigure with -Dresampler=libsamplerate)') message('(to use libsamplerate instead, reconfigure with -Dresampler=libsamplerate)')
endif endif
library_sources += 'src/dsp/BQResampler.cpp' library_sources += 'src/common/BQResampler.cpp'
feature_defines += ['-DUSE_BQRESAMPLER'] feature_defines += ['-DUSE_BQRESAMPLER']
elif resampler == 'libsamplerate' elif resampler == 'libsamplerate'

View File

@@ -21,7 +21,7 @@
you must obtain a valid commercial licence before doing so. you must obtain a valid commercial licence before doing so.
*/ */
#include "StretcherImpl.h" #include "faster/StretcherImpl.h"
namespace RubberBand { namespace RubberBand {

View File

@@ -28,8 +28,8 @@
#include <iostream> #include <iostream>
#include <algorithm> #include <algorithm>
#include "../system/Allocators.h" #include "Allocators.h"
#include "../system/VectorOps.h" #include "VectorOps.h"
#define BQ_R__ R__ #define BQ_R__ R__

View File

@@ -26,8 +26,8 @@
#include <vector> #include <vector>
#include "../system/Allocators.h" #include "Allocators.h"
#include "../system/VectorOps.h" #include "VectorOps.h"
namespace RubberBand { namespace RubberBand {

View File

@@ -22,11 +22,11 @@
*/ */
#include "FFT.h" #include "FFT.h"
#include "../system/Thread.h" #include "Thread.h"
#include "../base/Profiler.h" #include "Profiler.h"
#include "../system/Allocators.h" #include "Allocators.h"
#include "../system/VectorOps.h" #include "VectorOps.h"
#include "../system/VectorOpsComplex.h" #include "VectorOpsComplex.h"
// Define USE_FFTW_WISDOM if you are defining HAVE_FFTW3 and you want // Define USE_FFTW_WISDOM if you are defining HAVE_FFTW3 and you want
// to use FFTW_MEASURE mode with persistent wisdom files. This will // to use FFTW_MEASURE mode with persistent wisdom files. This will

View File

@@ -24,7 +24,7 @@
#ifndef RUBBERBAND_FFT_H #ifndef RUBBERBAND_FFT_H
#define RUBBERBAND_FFT_H #define RUBBERBAND_FFT_H
#include "../system/sysutils.h" #include "sysutils.h"
#include <string> #include <string>
#include <set> #include <set>

View File

@@ -25,11 +25,9 @@
#define RUBBERBAND_MOVING_MEDIAN_H #define RUBBERBAND_MOVING_MEDIAN_H
#include "SampleFilter.h" #include "SampleFilter.h"
#include "Allocators.h"
#include "../system/Allocators.h"
#include <algorithm> #include <algorithm>
#include <iostream> #include <iostream>
namespace RubberBand namespace RubberBand

View File

@@ -23,7 +23,7 @@
#include "Profiler.h" #include "Profiler.h"
#include "../system/Thread.h" #include "Thread.h"
#include <algorithm> #include <algorithm>
#include <set> #include <set>

View File

@@ -42,7 +42,7 @@
#ifdef PROFILE_CLOCKS #ifdef PROFILE_CLOCKS
#include <time.h> #include <time.h>
#else #else
#include "../system/sysutils.h" #include "sysutils.h"
#ifndef _WIN32 #ifndef _WIN32
#include <sys/time.h> #include <sys/time.h>
#endif #endif

View File

@@ -23,8 +23,8 @@
#include "Resampler.h" #include "Resampler.h"
#include "../system/Allocators.h" #include "Allocators.h"
#include "../system/VectorOps.h" #include "VectorOps.h"
#include <cstdlib> #include <cstdlib>
#include <cmath> #include <cmath>

View File

@@ -24,7 +24,7 @@
#ifndef RUBBERBAND_RESAMPLER_H #ifndef RUBBERBAND_RESAMPLER_H
#define RUBBERBAND_RESAMPLER_H #define RUBBERBAND_RESAMPLER_H
#include "../system/sysutils.h" #include "sysutils.h"
namespace RubberBand { namespace RubberBand {

View File

@@ -28,8 +28,8 @@
//#define DEBUG_RINGBUFFER 1 //#define DEBUG_RINGBUFFER 1
#include "../system/sysutils.h" #include "sysutils.h"
#include "../system/Allocators.h" #include "Allocators.h"
#include <iostream> #include <iostream>

View File

@@ -33,9 +33,9 @@
#include <sys/time.h> #include <sys/time.h>
#endif #endif
#include "../system/Thread.h" #include "Thread.h"
#include "../system/sysutils.h" #include "sysutils.h"
#include "../system/Allocators.h" #include "Allocators.h"
//#define DEBUG_SCAVENGER 1 //#define DEBUG_SCAVENGER 1

View File

@@ -33,8 +33,6 @@ namespace RubberBand {
template<typename T> template<typename T>
inline void c_phasor(T *real, T *imag, T phase) inline void c_phasor(T *real, T *imag, T phase)
{ {
//!!! IPP contains ippsSinCos_xxx in ippvm.h -- these are
//!!! fixed-accuracy, test and compare
#if defined HAVE_VDSP #if defined HAVE_VDSP
int one = 1; int one = 1;
if (sizeof(T) == sizeof(float)) { if (sizeof(T) == sizeof(float)) {

View File

@@ -28,9 +28,9 @@
#include <cstdlib> #include <cstdlib>
#include <map> #include <map>
#include "../system/sysutils.h" #include "sysutils.h"
#include "../system/VectorOps.h" #include "VectorOps.h"
#include "../system/Allocators.h" #include "Allocators.h"
namespace RubberBand { namespace RubberBand {

View File

@@ -28,7 +28,6 @@
#include <fcntl.h> #include <fcntl.h>
#include <io.h> #include <io.h>
#else /* !_WIN32 */ #else /* !_WIN32 */
#include <signal.h>
#include <unistd.h> #include <unistd.h>
#ifdef __APPLE__ #ifdef __APPLE__
#include <sys/sysctl.h> #include <sys/sysctl.h>
@@ -209,31 +208,6 @@ void system_specific_application_initialise()
{ {
} }
ProcessStatus
system_get_process_status(int pid)
{
#ifdef _WIN32
HANDLE handle = OpenProcess(PROCESS_QUERY_INFORMATION, FALSE, pid);
if (!handle) {
return ProcessNotRunning;
} else {
CloseHandle(handle);
return ProcessRunning;
}
#else
if (kill(getpid(), 0) == 0) {
if (kill(pid, 0) == 0) {
return ProcessRunning;
} else {
return ProcessNotRunning;
}
} else {
return UnknownProcessStatus;
}
#endif
}
#ifdef _WIN32 #ifdef _WIN32
void system_memorybarrier() void system_memorybarrier()
{ {

View File

@@ -87,9 +87,6 @@ extern bool system_is_multiprocessor();
extern void system_specific_initialise(); extern void system_specific_initialise();
extern void system_specific_application_initialise(); extern void system_specific_application_initialise();
enum ProcessStatus { ProcessRunning, ProcessNotRunning, UnknownProcessStatus };
extern ProcessStatus system_get_process_status(int pid);
#ifdef _WIN32 #ifdef _WIN32
struct timeval { long tv_sec; long tv_usec; }; struct timeval { long tv_sec; long tv_usec; };
void gettimeofday(struct timeval *p, void *tz); void gettimeofday(struct timeval *p, void *tz);

View File

@@ -26,7 +26,7 @@
#include <sys/types.h> #include <sys/types.h>
#include "../system/sysutils.h" #include "../common/sysutils.h"
namespace RubberBand namespace RubberBand
{ {

View File

@@ -23,7 +23,7 @@
#include "CompoundAudioCurve.h" #include "CompoundAudioCurve.h"
#include "../dsp/MovingMedian.h" #include "../common/MovingMedian.h"
#include <iostream> #include <iostream>

View File

@@ -26,7 +26,7 @@
#include "PercussiveAudioCurve.h" #include "PercussiveAudioCurve.h"
#include "HighFrequencyAudioCurve.h" #include "HighFrequencyAudioCurve.h"
#include "../dsp/SampleFilter.h" #include "../common/SampleFilter.h"
namespace RubberBand namespace RubberBand
{ {

View File

@@ -24,7 +24,7 @@
#ifndef RUBBERBAND_HIGHFREQUENCY_AUDIO_CURVE_H #ifndef RUBBERBAND_HIGHFREQUENCY_AUDIO_CURVE_H
#define RUBBERBAND_HIGHFREQUENCY_AUDIO_CURVE_H #define RUBBERBAND_HIGHFREQUENCY_AUDIO_CURVE_H
#include "../dsp/AudioCurveCalculator.h" #include "AudioCurveCalculator.h"
namespace RubberBand namespace RubberBand
{ {

View File

@@ -23,8 +23,8 @@
#include "PercussiveAudioCurve.h" #include "PercussiveAudioCurve.h"
#include "../system/Allocators.h" #include "../common/Allocators.h"
#include "../system/VectorOps.h" #include "../common/VectorOps.h"
#include <cmath> #include <cmath>
#include <iostream> #include <iostream>

View File

@@ -24,7 +24,7 @@
#ifndef RUBBERBAND_PERCUSSIVE_AUDIO_CURVE_H #ifndef RUBBERBAND_PERCUSSIVE_AUDIO_CURVE_H
#define RUBBERBAND_PERCUSSIVE_AUDIO_CURVE_H #define RUBBERBAND_PERCUSSIVE_AUDIO_CURVE_H
#include "../dsp/AudioCurveCalculator.h" #include "AudioCurveCalculator.h"
namespace RubberBand namespace RubberBand
{ {

View File

@@ -24,7 +24,7 @@
#ifndef RUBBERBAND_SILENT_AUDIO_CURVE_H #ifndef RUBBERBAND_SILENT_AUDIO_CURVE_H
#define RUBBERBAND_SILENT_AUDIO_CURVE_H #define RUBBERBAND_SILENT_AUDIO_CURVE_H
#include "../dsp/AudioCurveCalculator.h" #include "AudioCurveCalculator.h"
namespace RubberBand namespace RubberBand
{ {

View File

@@ -29,9 +29,9 @@
#include <cstdlib> #include <cstdlib>
#include <map> #include <map>
#include "../system/sysutils.h" #include "../common/sysutils.h"
#include "../system/VectorOps.h" #include "../common/VectorOps.h"
#include "../system/Allocators.h" #include "../common/Allocators.h"
namespace RubberBand { namespace RubberBand {

View File

@@ -30,7 +30,7 @@
#include <cassert> #include <cassert>
#include <algorithm> #include <algorithm>
#include "system/sysutils.h" #include "../common/sysutils.h"
namespace RubberBand namespace RubberBand
{ {

View File

@@ -23,9 +23,8 @@
#include "StretcherChannelData.h" #include "StretcherChannelData.h"
#include "dsp/Resampler.h" #include "../common/Resampler.h"
#include "../common/Allocators.h"
#include "system/Allocators.h"
#include <algorithm> #include <algorithm>

View File

@@ -23,19 +23,16 @@
#include "StretcherImpl.h" #include "StretcherImpl.h"
#include "audiocurves/PercussiveAudioCurve.h" #include "PercussiveAudioCurve.h"
#include "audiocurves/HighFrequencyAudioCurve.h" #include "HighFrequencyAudioCurve.h"
#include "audiocurves/SilentAudioCurve.h" #include "SilentAudioCurve.h"
#include "audiocurves/CompoundAudioCurve.h" #include "CompoundAudioCurve.h"
#include "dsp/Resampler.h"
#include "StretchCalculator.h" #include "StretchCalculator.h"
#include "StretcherChannelData.h" #include "StretcherChannelData.h"
#include "base/Profiler.h" #include "../common/Resampler.h"
#include "../common/Profiler.h"
#include "system/sysutils.h" #include "../common/sysutils.h"
#include <cassert> #include <cassert>
#include <cmath> #include <cmath>

View File

@@ -26,16 +26,15 @@
#include "../rubberband/RubberBandStretcher.h" #include "../rubberband/RubberBandStretcher.h"
#include "dsp/Window.h" #include "../common/Window.h"
#include "dsp/SincWindow.h" #include "../common/FFT.h"
#include "dsp/FFT.h" #include "../common/RingBuffer.h"
#include "../common/Scavenger.h"
#include "../common/Thread.h"
#include "../common/sysutils.h"
#include "audiocurves/CompoundAudioCurve.h" #include "SincWindow.h"
#include "CompoundAudioCurve.h"
#include "base/RingBuffer.h"
#include "base/Scavenger.h"
#include "system/Thread.h"
#include "system/sysutils.h"
#include <set> #include <set>
#include <algorithm> #include <algorithm>

View File

@@ -25,10 +25,10 @@
#include "StretchCalculator.h" #include "StretchCalculator.h"
#include "StretcherChannelData.h" #include "StretcherChannelData.h"
#include "dsp/Resampler.h" #include "../common/Resampler.h"
#include "base/Profiler.h" #include "../common/Profiler.h"
#include "system/VectorOps.h" #include "../common/VectorOps.h"
#include "system/sysutils.h" #include "../common/sysutils.h"
#include <cassert> #include <cassert>
#include <cmath> #include <cmath>

View File

@@ -24,9 +24,9 @@
#ifndef RUBBERBAND_BIN_CLASSIFIER_H #ifndef RUBBERBAND_BIN_CLASSIFIER_H
#define RUBBERBAND_BIN_CLASSIFIER_H #define RUBBERBAND_BIN_CLASSIFIER_H
#include "../system/Allocators.h" #include "../common/Allocators.h"
#include "../dsp/MovingMedian.h" #include "../common/MovingMedian.h"
#include "../base/RingBuffer.h" #include "../common/RingBuffer.h"
#include <vector> #include <vector>
#include <memory> #include <memory>

View File

@@ -25,6 +25,7 @@
#define RUBBERBAND_BIN_SEGMENTER_H #define RUBBERBAND_BIN_SEGMENTER_H
#include "BinClassifier.h" #include "BinClassifier.h"
#include <vector> #include <vector>
namespace RubberBand { namespace RubberBand {

View File

@@ -27,11 +27,11 @@
#include <map> #include <map>
#include <memory> #include <memory>
#include "dsp/BinSegmenter.h" #include "BinSegmenter.h"
#include "dsp/FFT.h" #include "Peak.h"
#include "system/Allocators.h"
#include "dsp/Peak.h" #include "../common/FFT.h"
#include "../common/Allocators.h"
namespace RubberBand namespace RubberBand
{ {

View File

@@ -1 +1 @@
#include "R3StretcherImpl.h" #include "finer/R3StretcherImpl.h"

View File

@@ -23,8 +23,8 @@
#include "RubberBandVampPlugin.h" #include "RubberBandVampPlugin.h"
#include "StretchCalculator.h" #include "faster/StretchCalculator.h"
#include "system/sysutils.h" #include "common/sysutils.h"
#include <cmath> #include <cmath>
#include <cstdio> #include <cstdio>