aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--native-tools/bsincgen.c17
1 files changed, 6 insertions, 11 deletions
diff --git a/native-tools/bsincgen.c b/native-tools/bsincgen.c
index 802403fd..b99d482f 100644
--- a/native-tools/bsincgen.c
+++ b/native-tools/bsincgen.c
@@ -43,26 +43,22 @@
#ifndef M_PI
-#define M_PI (3.14159265358979323846)
+#define M_PI 3.14159265358979323846
#endif
#if !(defined(_ISOC99_SOURCE) || (defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE >= 200112L))
#define log2(x) (log(x) / log(2.0))
#endif
-/* Same as in alu.h! */
-#define FRACTIONBITS (12)
-#define FRACTIONONE (1<<FRACTIONBITS)
-
// The number of distinct scale and phase intervals within the filter table.
// Must be the same as in alu.h!
-#define BSINC_SCALE_COUNT (16)
-#define BSINC_PHASE_COUNT (16)
+#define BSINC_SCALE_COUNT 16
+#define BSINC_PHASE_COUNT 16
/* 48 points includes the doubling for downsampling, so the maximum number of
* base sample points is 24, which is 23rd order.
*/
-#define BSINC_POINTS_MAX (48)
+#define BSINC_POINTS_MAX 48
static double MinDouble(double a, double b)
{ return (a <= b) ? a : b; }
@@ -347,14 +343,13 @@ int main(int argc, char *argv[])
fprintf(output, "/* Generated by bsincgen, do not edit! */\n"
"#pragma once\n\n"
"static_assert(BSINC_SCALE_COUNT == %d, \"Unexpected BSINC_SCALE_COUNT value!\");\n"
-"static_assert(BSINC_PHASE_COUNT == %d, \"Unexpected BSINC_PHASE_COUNT value!\");\n"
-"static_assert(FRACTIONONE == %d, \"Unexpected FRACTIONONE value!\");\n\n"
+"static_assert(BSINC_PHASE_COUNT == %d, \"Unexpected BSINC_PHASE_COUNT value!\");\n\n"
"struct BSincTable {\n"
" const float scaleBase, scaleRange;\n"
" const unsigned int m[BSINC_SCALE_COUNT];\n"
" const unsigned int filterOffset[BSINC_SCALE_COUNT];\n"
" const float *Tab;\n"
-"};\n\n", BSINC_SCALE_COUNT, BSINC_PHASE_COUNT, FRACTIONONE);
+"};\n\n", BSINC_SCALE_COUNT, BSINC_PHASE_COUNT);
/* A 23rd order filter with a -60dB drop at nyquist. */
BsiGenerateTables(output, "bsinc24", 60.0, 23);
/* An 11th order filter with a -40dB drop at nyquist. */