aboutsummaryrefslogtreecommitdiffstats
path: root/common/bsinc_tables.h
diff options
context:
space:
mode:
authorChris Robinson <chris.kcat@gmail.com>2020-04-01 23:17:46 -0700
committerChris Robinson <chris.kcat@gmail.com>2020-04-02 00:49:19 -0700
commit8853519d896f11b678873f0afacac16b3cdebc27 (patch)
tree319fd5c5a5978e7790bbd22844c9e218b2bbe10e /common/bsinc_tables.h
parent6fb59f1182965a0e1e45d60e81e3ff02db45944c (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 'common/bsinc_tables.h')
-rw-r--r--common/bsinc_tables.h17
1 files changed, 17 insertions, 0 deletions
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 */