aboutsummaryrefslogtreecommitdiffstats
path: root/native-tools/bsincgen.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2019-09-17 18:38:46 -0700
committerChris Robinson <[email protected]>2019-09-17 18:38:46 -0700
commitaca9f4e09586f4b1859bb28c5712f39c1b95570e (patch)
tree214ef2e4e5bdcb9330272e501cccc7560dee8ffa /native-tools/bsincgen.c
parent1da75126283cbd0f7ed3835a34c6e34e8dcfc32a (diff)
Make the bsinc l and m coefficients unsigned
Diffstat (limited to 'native-tools/bsincgen.c')
-rw-r--r--native-tools/bsincgen.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/native-tools/bsincgen.c b/native-tools/bsincgen.c
index 89f9f378..802403fd 100644
--- a/native-tools/bsincgen.c
+++ b/native-tools/bsincgen.c
@@ -278,13 +278,13 @@ static void BsiGenerateTables(FILE *output, const char *tabname, const double re
fprintf(output, "\n ");
for(i = 0; i < m; i++)
fprintf(output, " %+14.9ef,", filter[si][pi][o + i]);
- fprintf(output, "\n ");
+ fprintf(output, "\n ");
for(i = 0; i < m; i++)
fprintf(output, " %+14.9ef,", scDeltas[si][pi][o + i]);
- fprintf(output, "\n ");
+ fprintf(output, "\n ");
for(i = 0; i < m; i++)
fprintf(output, " %+14.9ef,", phDeltas[si][pi][o + i]);
- fprintf(output, "\n ");
+ fprintf(output, "\n ");
for(i = 0; i < m; i++)
fprintf(output, " %+14.9ef,", spDeltas[si][pi][o + i]);
fprintf(output, "\n");
@@ -300,17 +300,17 @@ static void BsiGenerateTables(FILE *output, const char *tabname, const double re
fprintf(output, " /* scaleBase */ %.9ef, /* scaleRange */ %.9ef,\n", scaleBase, 1.0 / scaleRange);
fprintf(output, " /* m */ {");
- fprintf(output, " %d", mt[0]);
+ fprintf(output, " %du", mt[0]);
for(si = 1; si < BSINC_SCALE_COUNT; si++)
- fprintf(output, ", %d", mt[si]);
+ fprintf(output, ", %du", mt[si]);
fprintf(output, " },\n");
fprintf(output, " /* filterOffset */ {");
- fprintf(output, " %d", 0);
+ fprintf(output, " %du", 0);
i = mt[0]*4*BSINC_PHASE_COUNT;
for(si = 1; si < BSINC_SCALE_COUNT; si++)
{
- fprintf(output, ", %d", i);
+ fprintf(output, ", %du", i);
i += mt[si]*4*BSINC_PHASE_COUNT;
}
@@ -344,14 +344,15 @@ int main(int argc, char *argv[])
else
output = stdout;
- fprintf(output, "/* Generated by bsincgen, do not edit! */\n\n"
+ 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"
"struct BSincTable {\n"
" const float scaleBase, scaleRange;\n"
-" const int m[BSINC_SCALE_COUNT];\n"
-" const int filterOffset[BSINC_SCALE_COUNT];\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);
/* A 23rd order filter with a -60dB drop at nyquist. */