Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package ft2-clone for openSUSE:Factory checked in at 2025-12-16 15:54:02 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/ft2-clone (Old) and /work/SRC/openSUSE:Factory/.ft2-clone.new.1939 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ft2-clone" Tue Dec 16 15:54:02 2025 rev:30 rq:1322923 version:2.03 Changes: -------- --- /work/SRC/openSUSE:Factory/ft2-clone/ft2-clone.changes 2025-12-09 12:57:23.909723226 +0100 +++ /work/SRC/openSUSE:Factory/.ft2-clone.new.1939/ft2-clone.changes 2025-12-16 16:00:14.816929095 +0100 @@ -1,0 +2,7 @@ +Sun Dec 14 19:58:23 UTC 2025 - Martin Hauke <[email protected]> + +- Update to version 2.03 + * Further tweak of sinc interpolation to prevent ringing (in + extreme cases). + +------------------------------------------------------------------- Old: ---- ft2-clone-2.02.tar.gz New: ---- ft2-clone-2.03.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ ft2-clone.spec ++++++ --- /var/tmp/diff_new_pack.npHlLq/_old 2025-12-16 16:00:16.096982816 +0100 +++ /var/tmp/diff_new_pack.npHlLq/_new 2025-12-16 16:00:16.096982816 +0100 @@ -17,7 +17,7 @@ Name: ft2-clone -Version: 2.02 +Version: 2.03 Release: 0 Summary: Fasttracker II clone License: BSD-3-Clause AND CC-BY-NC-SA-4.0 ++++++ ft2-clone-2.02.tar.gz -> ft2-clone-2.03.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ft2-clone-2.02/src/ft2_header.h new/ft2-clone-2.03/src/ft2_header.h --- old/ft2-clone-2.02/src/ft2_header.h 2025-12-06 21:35:14.000000000 +0100 +++ new/ft2-clone-2.03/src/ft2_header.h 2025-12-14 17:18:40.000000000 +0100 @@ -12,7 +12,7 @@ #endif #include "ft2_replayer.h" -#define PROG_VER_STR "2.02" +#define PROG_VER_STR "2.03" // do NOT change these! It will only mess things up... diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ft2-clone-2.02/src/mixer/ft2_windowed_sinc.c new/ft2-clone-2.03/src/mixer/ft2_windowed_sinc.c --- old/ft2-clone-2.02/src/mixer/ft2_windowed_sinc.c 2025-12-06 21:35:14.000000000 +0100 +++ new/ft2-clone-2.03/src/mixer/ft2_windowed_sinc.c 2025-12-14 17:18:40.000000000 +0100 @@ -1,138 +1,127 @@ -// 8-point/16-point windowed-sinc interpolation LUT generator - -#include <stdint.h> -#include <stdbool.h> -#include <stdlib.h> -#include <math.h> -#include "ft2_windowed_sinc.h" -#include "../ft2_header.h" // PI -#include "../ft2_video.h" // showErrorMsgBox() - -typedef struct -{ - double kaiserBeta, sincCutoff; -} sincKernel_t; - -// globalized -float *fSinc[SINC_KERNELS], *fSinc8[SINC_KERNELS], *fSinc16[SINC_KERNELS]; -uint64_t sincRatio1, sincRatio2; - -static sincKernel_t sincKernelConfig[2][SINC_KERNELS] = -{ - /* Some notes on the Kaiser-Bessel beta parameter: - ** Lower beta = less treble cut off, more aliasing (narrower mainlobe, stronger sidelobe) - ** Higher beta = more treble cut off, less aliasing (wider mainlobe, weaker sidelobe) - */ - { // -- settings for 8-point sinc -- - // beta, cutoff - { 9.20, 1.000 }, // kernel #1 (beta < ~9.2 leads to audible aliasing here) - { 8.50, 0.750 }, // kernel #2 - { 7.30, 0.425 } // kernel #3 - }, - - { // -- settings for 16-point sinc -- - // beta, cutoff - { 8.61, 1.000 }, // kernel #1 (beta 8.61 = Blackman-window approximation) - { 8.50, 0.750 }, // kernel #2 - { 7.30, 0.425 } // kernel #3 - } -}; - -// zeroth-order modified Bessel function of the first kind (series approximation) -static inline double besselI0(double z) -{ - double s = 1.0, ds = 1.0, d = 2.0; - const double zz = z * z; - - do - { - ds *= zz / (d * d); - s += ds; - d += 2.0; - } - while (ds > s*(1E-12)); - - return s; -} - -static inline double sinc(double x, double cutoff) -{ - if (x == 0.0) - { - return cutoff; - } - else - { - x *= PI; - return sin(cutoff * x) / x; - } -} - -// note: numPoints/numPhases must be 2^n! -static void makeSincKernel(float *out, int32_t numPoints, int32_t numPhases, double beta, double cutoff) -{ - const int32_t kernelLen = numPhases * numPoints; - const int32_t pointBits = (int32_t)log2(numPoints); - const int32_t pointMask = numPoints - 1; - const int32_t centerPoint = (numPoints / 2) - 1; - const double besselI0Beta = 1.0 / besselI0(beta); - const double phaseMul = 1.0 / numPhases; - const double xMul = 1.0 / (numPoints / 2); - - for (int32_t i = 0; i < kernelLen; i++) - { - const double x = ((i & pointMask) - centerPoint) - ((i >> pointBits) * phaseMul); - - // Kaiser-Bessel window - const double n = x * xMul; - const double window = besselI0(beta * sqrt(1.0 - n * n)) * besselI0Beta; - - out[i] = (float)(sinc(x, cutoff) * window); - } -} - -bool setupWindowedSincTables(void) -{ - sincKernel_t *k; - for (int32_t i = 0; i < SINC_KERNELS; i++, k++) - { - fSinc8[i] = (float *)malloc( 8 * SINC_PHASES * sizeof (float)); - fSinc16[i] = (float *)malloc(16 * SINC_PHASES * sizeof (float)); - - if (fSinc8[i] == NULL || fSinc16[i] == NULL) - { - showErrorMsgBox("Not enough memory!"); - return false; - } - - k = &sincKernelConfig[0][i]; - makeSincKernel(fSinc8[i], 8, SINC_PHASES, k->kaiserBeta, k->sincCutoff); - - k = &sincKernelConfig[1][i]; - makeSincKernel(fSinc16[i], 16, SINC_PHASES, k->kaiserBeta, k->sincCutoff); - } - - // resampling ratios for sinc kernel selection - sincRatio1 = (uint64_t)(1.1875 * MIXER_FRAC_SCALE); // fSinc[0] if <= - sincRatio2 = (uint64_t)(1.5000 * MIXER_FRAC_SCALE); // fSinc[1] if <=, else fSinc[2] if > - - return true; -} - -void freeWindowedSincTables(void) -{ - for (int32_t i = 0; i < SINC_KERNELS; i++) - { - if (fSinc8[i] != NULL) - { - free(fSinc8[i]); - fSinc8[i] = NULL; - } - - if (fSinc16[i] != NULL) - { - free(fSinc16[i]); - fSinc16[i] = NULL; - } - } -} +// 8-point/16-point windowed-sinc interpolation LUT generator + +#include <stdint.h> +#include <stdbool.h> +#include <stdlib.h> +#include <math.h> +#include "ft2_windowed_sinc.h" +#include "../ft2_header.h" // PI +#include "../ft2_video.h" // showErrorMsgBox() + +typedef struct +{ + double kaiserBeta, sincCutoff; +} sincKernel_t; + +// globalized +float *fSinc[SINC_KERNELS], *fSinc8[SINC_KERNELS], *fSinc16[SINC_KERNELS]; +uint64_t sincRatio1, sincRatio2; + +static sincKernel_t sincKernelConfig[SINC_KERNELS] = +{ + /* Some notes on the Kaiser-Bessel beta parameter: + ** Lower beta = less treble cut off, more aliasing (narrower mainlobe, stronger sidelobe) + ** Higher beta = more treble cut off, less aliasing (wider mainlobe, weaker sidelobe) + */ + + // beta, cutoff + { 9.6377, 1.000 }, // kernel #1 (lower beta results in audible ringing in some cases) + { 8.5000, 0.750 }, // kernel #2 + { 7.3000, 0.425 } // kernel #3 +}; + +// zeroth-order modified Bessel function of the first kind (series approximation) +static inline double besselI0(double z) +{ + double s = 1.0, ds = 1.0, d = 2.0; + const double zz = z * z; + + do + { + ds *= zz / (d * d); + s += ds; + d += 2.0; + } + while (ds > s*(1E-12)); + + return s; +} + +static inline double sinc(double x, double cutoff) +{ + if (x == 0.0) + { + return cutoff; + } + else + { + x *= PI; + return sin(cutoff * x) / x; + } +} + +// note: numPoints/numPhases must be 2^n! +static void makeSincKernel(float *fOut, int32_t numPoints, int32_t numPhases, double beta, double cutoff) +{ + const int32_t kernelLen = numPhases * numPoints; + const int32_t pointBits = (int32_t)log2(numPoints); + const int32_t pointMask = numPoints - 1; + const int32_t centerPoint = (numPoints / 2) - 1; + const double besselI0Beta = 1.0 / besselI0(beta); + const double phaseMul = 1.0 / numPhases; + const double xMul = 1.0 / (numPoints / 2); + + for (int32_t i = 0; i < kernelLen; i++) + { + const double x = ((i & pointMask) - centerPoint) - ((i >> pointBits) * phaseMul); + + // Kaiser-Bessel window + const double n = x * xMul; + const double window = besselI0(beta * sqrt(1.0 - n * n)) * besselI0Beta; + + fOut[i] = (float)(sinc(x, cutoff) * window); + } +} + +bool setupWindowedSincTables(void) +{ + sincKernel_t *k = sincKernelConfig; + for (int32_t i = 0; i < SINC_KERNELS; i++, k++) + { + fSinc8[i] = (float *)malloc( 8 * SINC_PHASES * sizeof (float)); + fSinc16[i] = (float *)malloc(16 * SINC_PHASES * sizeof (float)); + + if (fSinc8[i] == NULL || fSinc16[i] == NULL) + { + showErrorMsgBox("Not enough memory!"); + return false; + } + + makeSincKernel( fSinc8[i], 8, SINC_PHASES, k->kaiserBeta, k->sincCutoff); + makeSincKernel(fSinc16[i], 16, SINC_PHASES, k->kaiserBeta, k->sincCutoff); + } + + // resampling ratios for sinc kernel selection + sincRatio1 = (uint64_t)(1.1875 * MIXER_FRAC_SCALE); // fSinc[0] if <= + sincRatio2 = (uint64_t)(1.5000 * MIXER_FRAC_SCALE); // fSinc[1] if <=, else fSinc[2] if > + + return true; +} + +void freeWindowedSincTables(void) +{ + for (int32_t i = 0; i < SINC_KERNELS; i++) + { + if (fSinc8[i] != NULL) + { + free(fSinc8[i]); + fSinc8[i] = NULL; + } + + if (fSinc16[i] != NULL) + { + free(fSinc16[i]); + fSinc16[i] = NULL; + } + } +}
