]> git.sesse.net Git - c64tapwav/blobdiff - decode.cpp
Make the syncer slightly less memory-hungry.
[c64tapwav] / decode.cpp
index fdc1347e0e124a7297ab4c6ef4a71e644c58f0fd..0e88f9d85d73d55d5e5a55262c5f68f1b99acfcf 100644 (file)
@@ -1,7 +1,6 @@
 #include <stdio.h>
 #include <string.h>
 #include <math.h>
-#include <unistd.h>
 #include <assert.h>
 #include <limits.h>
 #include <vector>
@@ -42,7 +41,7 @@ double find_zerocrossing(const std::vector<short> &pcm, int x)
 
        double upper = x;
        double lower = x + 1;
-       while (upper - lower > 1e-6) {
+       while (lower - upper > 1e-3) {
                double mid = 0.5f * (upper + lower);
                if (lanczos_interpolate(pcm, mid) > 0) {
                        upper = mid;
@@ -61,6 +60,7 @@ struct pulse {
        
 int main(int argc, char **argv)
 {
+       make_lanczos_weight_table();
        std::vector<short> pcm;
 
        while (!feof(stdin)) {