]> git.sesse.net Git - c64tapwav/blobdiff - interpolate.cpp
Add table-based lookups for the Lanczos interpolation, and use that in the syncer.
[c64tapwav] / interpolate.cpp
diff --git a/interpolate.cpp b/interpolate.cpp
new file mode 100644 (file)
index 0000000..cd250c1
--- /dev/null
@@ -0,0 +1,11 @@
+#include "interpolate.h"
+
+double lanczos_table[(LANCZOS_RADIUS * 2) * LANCZOS_RESOLUTION];
+
+void make_lanczos_weight_table()
+{
+       for (int i = 0; i < (LANCZOS_RADIUS * 2) * LANCZOS_RESOLUTION; ++i) {
+               float x = double(i) / LANCZOS_RESOLUTION - LANCZOS_RADIUS;
+               lanczos_table[i] = lanczos_weight(x);
+       }
+}