diff options
Diffstat (limited to 'common/bsinc_tables.cpp')
-rw-r--r-- | common/bsinc_tables.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/common/bsinc_tables.cpp b/common/bsinc_tables.cpp index 437f582d..853fe605 100644 --- a/common/bsinc_tables.cpp +++ b/common/bsinc_tables.cpp @@ -5,6 +5,7 @@ #include <cassert> #include <cmath> #include <limits> +#include <memory> #include <stdexcept> #include "math_defs.h" @@ -210,10 +211,14 @@ struct Array { T data[N]; }; +/* FIXME: This should be constexpr, but the temporary filter table is apparently too big + * (~200K) for some systems. This requires using heap space, which is not + * allowed in a constexpr function. + */ template<size_t total_size> -constexpr auto GenerateBSincCoeffs(const BSincHeader &hdr) +auto GenerateBSincCoeffs(const BSincHeader &hdr) { - double filter[BSincScaleCount][BSincPhaseCount+1][BSincPointsMax]{}; + auto filter = std::make_unique<double[][BSincPhaseCount+1][BSincPointsMax]>(BSincScaleCount); /* Calculate the Kaiser-windowed Sinc filter coefficients for each scale * and phase index. |