From ef7ce8282857dbe0de3162ea86dda59200f2bc3d Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Mon, 21 Aug 2017 04:54:49 -0700 Subject: Properly postfix the filter order number --- utils/bsincgen.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'utils') diff --git a/utils/bsincgen.c b/utils/bsincgen.c index e4683ded..324e8b04 100644 --- a/utils/bsincgen.c +++ b/utils/bsincgen.c @@ -244,7 +244,7 @@ static void BsiGenerateTables() i += 4 * BSINC_PHASE_COUNT * mt[si]; fprintf(stdout, "/* Generated by bsincgen, do not edit! */\n\n" -"/* Table of windowed sinc coefficients and deltas. This %dth order filter\n" +"/* Table of windowed sinc coefficients and deltas. This %d%s order filter\n" " * has a rejection of -%gdB, yielding a transition width of ~%.3f\n" " * (normalized frequency). Order increases when downsampling to a limit of\n" " * one octave, after which the quality of the filter (transition width)\n" @@ -256,7 +256,11 @@ static void BsiGenerateTables() " const float scaleBase, scaleRange;\n" " const int m[BSINC_SCALE_COUNT];\n" " const int filterOffset[BSINC_SCALE_COUNT];\n" -"} bsinc = {\n", BSINC_ORDER, BSINC_REJECTION, width, log2(1.0/scaleBase), i); +"} bsinc = {\n", BSINC_ORDER, (((BSINC_ORDER%100)/10) == 1) ? "th" : + ((BSINC_ORDER%10) == 1) ? "st" : + ((BSINC_ORDER%10) == 2) ? "nd" : + ((BSINC_ORDER%10) == 3) ? "rd" : "th", + BSINC_REJECTION, width, log2(1.0/scaleBase), i); fprintf(stdout, " /* Tab */ {\n"); for(si = 0; si < BSINC_SCALE_COUNT; si++) -- cgit v1.2.3