From 8853519d896f11b678873f0afacac16b3cdebc27 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Wed, 1 Apr 2020 23:17:46 -0700 Subject: 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. --- common/bsinc_tables.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 common/bsinc_tables.h (limited to 'common/bsinc_tables.h') diff --git a/common/bsinc_tables.h b/common/bsinc_tables.h new file mode 100644 index 00000000..2e2443e5 --- /dev/null +++ b/common/bsinc_tables.h @@ -0,0 +1,17 @@ +#ifndef BSINC_TABLES_H +#define BSINC_TABLES_H + +#include "bsinc_defs.h" + + +struct BSincTable { + float scaleBase, scaleRange; + unsigned int m[BSINC_SCALE_COUNT]; + unsigned int filterOffset[BSINC_SCALE_COUNT]; + const float *Tab; +}; + +extern const BSincTable bsinc12; +extern const BSincTable bsinc24; + +#endif /* BSINC_TABLES_H */ -- cgit v1.2.3