diff options
author | Chris Robinson <[email protected]> | 2020-04-01 23:17:46 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2020-04-02 00:49:19 -0700 |
commit | 8853519d896f11b678873f0afacac16b3cdebc27 (patch) | |
tree | 319fd5c5a5978e7790bbd22844c9e218b2bbe10e /alc | |
parent | 6fb59f1182965a0e1e45d60e81e3ff02db45944c (diff) |
Generate the bsinc tables using constexpr methods
All the methods used should be compliant with C++14 constexpr rules. However,
the number of scales and phases cause GenerateBSincCoeffs to reach the allowed
step limit, preventing full compile-time generation. It's not a terribly big
deal, it'll generate them very quickly when loading, but it does prevent using
shared read-only memory pages.
Diffstat (limited to 'alc')
-rw-r--r-- | alc/alu.cpp | 4 | ||||
-rw-r--r-- | alc/mixer/mixer_c.cpp | 2 | ||||
-rw-r--r-- | alc/mixer/mixer_neon.cpp | 1 | ||||
-rw-r--r-- | alc/mixer/mixer_sse.cpp | 1 | ||||
-rw-r--r-- | alc/voice.h | 11 |
5 files changed, 7 insertions, 12 deletions
diff --git a/alc/alu.cpp b/alc/alu.cpp index df9af3fe..18973942 100644 --- a/alc/alu.cpp +++ b/alc/alu.cpp @@ -80,10 +80,10 @@ #include "vecmat.h" #include "voice.h" -#include "bsinc_inc.h" +#include "bsinc_tables.h" -static_assert(!(MAX_RESAMPLER_PADDING&1) && MAX_RESAMPLER_PADDING >= bsinc24.m[0], +static_assert(!(MAX_RESAMPLER_PADDING&1) && MAX_RESAMPLER_PADDING >= BSINC_POINTS_MAX, "MAX_RESAMPLER_PADDING is not a multiple of two, or is too small"); diff --git a/alc/mixer/mixer_c.cpp b/alc/mixer/mixer_c.cpp index c086dd8d..6b68d821 100644 --- a/alc/mixer/mixer_c.cpp +++ b/alc/mixer/mixer_c.cpp @@ -6,7 +6,7 @@ #include "alcmain.h" #include "alu.h" - +#include "bsinc_defs.h" #include "defs.h" #include "hrtfbase.h" diff --git a/alc/mixer/mixer_neon.cpp b/alc/mixer/mixer_neon.cpp index afc9768a..2cdf21c3 100644 --- a/alc/mixer/mixer_neon.cpp +++ b/alc/mixer/mixer_neon.cpp @@ -10,6 +10,7 @@ #include "alu.h" #include "hrtf.h" #include "defs.h" +#include "bsinc_defs.h" #include "hrtfbase.h" diff --git a/alc/mixer/mixer_sse.cpp b/alc/mixer/mixer_sse.cpp index 3bc7b30f..32345522 100644 --- a/alc/mixer/mixer_sse.cpp +++ b/alc/mixer/mixer_sse.cpp @@ -9,6 +9,7 @@ #include "alcmain.h" #include "alu.h" +#include "bsinc_defs.h" #include "defs.h" #include "hrtfbase.h" diff --git a/alc/voice.h b/alc/voice.h index 7adffe7f..f4d09ad3 100644 --- a/alc/voice.h +++ b/alc/voice.h @@ -44,16 +44,9 @@ enum class Resampler { }; extern Resampler ResamplerDefault; -/* The number of distinct scale and phase intervals within the bsinc filter - * table. - */ -#define BSINC_SCALE_BITS 4 -#define BSINC_SCALE_COUNT (1<<BSINC_SCALE_BITS) -#define BSINC_PHASE_BITS 5 -#define BSINC_PHASE_COUNT (1<<BSINC_PHASE_BITS) -/* Interpolator state. Kind of a misnomer since the interpolator itself is - * stateless. This just keeps it from having to recompute scale-related +/* Interpolator state. Kind of a misnomer since the interpolator itself is + * stateless. This just keeps it from having to recompute scale-related * mappings for every sample. */ struct BsincState { |