From 20d28e80a5c861a9d5f449ea911ab75b4f37ad0d Mon Sep 17 00:00:00 2001 From: Jef Date: Tue, 24 Sep 2024 14:54:57 +0200 Subject: Initial community commit --- .../openmpt-trunk/soundlib/Resampler.h | 143 +++++++++++++++++++++ 1 file changed, 143 insertions(+) create mode 100644 Src/external_dependencies/openmpt-trunk/soundlib/Resampler.h (limited to 'Src/external_dependencies/openmpt-trunk/soundlib/Resampler.h') diff --git a/Src/external_dependencies/openmpt-trunk/soundlib/Resampler.h b/Src/external_dependencies/openmpt-trunk/soundlib/Resampler.h new file mode 100644 index 00000000..1f617c77 --- /dev/null +++ b/Src/external_dependencies/openmpt-trunk/soundlib/Resampler.h @@ -0,0 +1,143 @@ +/* + * Resampler.h + * ----------- + * Purpose: Holds the tables for all available resamplers. + * Notes : (currently none) + * Authors: OpenMPT Devs + * The OpenMPT source code is released under the BSD license. Read LICENSE for more details. + */ + +#pragma once + +#include "openmpt/all/BuildSettings.hpp" + + +#include "WindowedFIR.h" +#include "Mixer.h" +#include "MixerSettings.h" +#include "Paula.h" + + +OPENMPT_NAMESPACE_BEGIN + + +#ifdef LIBOPENMPT_BUILD +// All these optimizations are not applicable to the tracker +// because cutoff and firtype are configurable there. + +// Cache resampler tables across resampler object creation. +// A C++11-style function-static singleton is holding the cached values. +#define MPT_RESAMPLER_TABLES_CACHED + +// Prime the tables cache when the library is loaded. +// Caching gets triggered via a global object that primes the cache during +// construction. +// This is only really useful with MPT_RESAMPLER_TABLES_CACHED. +//#define MPT_RESAMPLER_TABLES_CACHED_ONSTARTUP + +#endif // LIBOPENMPT_BUILD + + +#define SINC_WIDTH 8 + +#define SINC_PHASES_BITS 12 +#define SINC_PHASES (1<