From aca9f4e09586f4b1859bb28c5712f39c1b95570e Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Tue, 17 Sep 2019 18:38:46 -0700 Subject: Make the bsinc l and m coefficients unsigned --- native-tools/bsincgen.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) (limited to 'native-tools') 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. */ -- cgit v1.2.3