SDL: Rewrote audio resampler using cubic filter interpolation

From 8f6f9cadc4379ae15ef92a3d56768d1478cc8c58 Mon Sep 17 00:00:00 2001
From: Brick <[EMAIL REDACTED]>
Date: Thu, 4 Apr 2024 19:25:25 +0100
Subject: [PATCH] Rewrote audio resampler using cubic filter interpolation

This allows using a much smaller (1.5 KB) lookup table, in exchange for a small amount of extra work per frame.

The extra work (a few extra loads/mul/adds) is negligible, and can execute in parallel.
The reduction in cache misses almost certainly outweighs any added cost.

The table is generated at runtime, and takes less than 0.02ms on my computer.
---
 Xcode/SDL/SDL.xcodeproj/project.pbxproj    |   4 -
 build-scripts/gen_audio_resampler_filter.c | 149 -----
 src/audio/SDL_audio_resampler_filter.h     | 544 -------------------
 src/audio/SDL_audioresample.c              | 597 +++++++++++++++++----
 test/testautomation_audio.c                |   4 +-
 5 files changed, 481 insertions(+), 817 deletions(-)
 delete mode 100644 build-scripts/gen_audio_resampler_filter.c
 delete mode 100644 src/audio/SDL_audio_resampler_filter.h

diff --git a/Xcode/SDL/SDL.xcodeproj/project.pbxproj b/Xcode/SDL/SDL.xcodeproj/project.pbxproj
index 3325864953db4..d56de311b09da 100644
--- a/Xcode/SDL/SDL.xcodeproj/project.pbxproj
+++ b/Xcode/SDL/SDL.xcodeproj/project.pbxproj
@@ -391,7 +391,6 @@
 		F32DDACF2AB795A30041EAA5 /* SDL_audio_channel_converters.h in Headers */ = {isa = PBXBuildFile; fileRef = F32DDAC92AB795A30041EAA5 /* SDL_audio_channel_converters.h */; };
 		F32DDAD02AB795A30041EAA5 /* SDL_audioresample.h in Headers */ = {isa = PBXBuildFile; fileRef = F32DDACA2AB795A30041EAA5 /* SDL_audioresample.h */; };
 		F32DDAD12AB795A30041EAA5 /* SDL_audioqueue.c in Sources */ = {isa = PBXBuildFile; fileRef = F32DDACB2AB795A30041EAA5 /* SDL_audioqueue.c */; };
-		F32DDAD22AB795A30041EAA5 /* SDL_audio_resampler_filter.h in Headers */ = {isa = PBXBuildFile; fileRef = F32DDACC2AB795A30041EAA5 /* SDL_audio_resampler_filter.h */; };
 		F32DDAD32AB795A30041EAA5 /* SDL_audioqueue.h in Headers */ = {isa = PBXBuildFile; fileRef = F32DDACD2AB795A30041EAA5 /* SDL_audioqueue.h */; };
 		F32DDAD42AB795A30041EAA5 /* SDL_audioresample.c in Sources */ = {isa = PBXBuildFile; fileRef = F32DDACE2AB795A30041EAA5 /* SDL_audioresample.c */; };
 		F34B9895291DEFF500AAC96E /* SDL_hidapi_steam.c in Sources */ = {isa = PBXBuildFile; fileRef = A75FDAAC23E2795C00529352 /* SDL_hidapi_steam.c */; };
@@ -916,7 +915,6 @@
 		F32DDAC92AB795A30041EAA5 /* SDL_audio_channel_converters.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_audio_channel_converters.h; sourceTree = "<group>"; };
 		F32DDACA2AB795A30041EAA5 /* SDL_audioresample.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_audioresample.h; sourceTree = "<group>"; };
 		F32DDACB2AB795A30041EAA5 /* SDL_audioqueue.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_audioqueue.c; sourceTree = "<group>"; };
-		F32DDACC2AB795A30041EAA5 /* SDL_audio_resampler_filter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_audio_resampler_filter.h; sourceTree = "<group>"; };
 		F32DDACD2AB795A30041EAA5 /* SDL_audioqueue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_audioqueue.h; sourceTree = "<group>"; };
 		F32DDACE2AB795A30041EAA5 /* SDL_audioresample.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_audioresample.c; sourceTree = "<group>"; };
 		F362B9152B3349E200D30B94 /* controller_list.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = controller_list.h; sourceTree = "<group>"; };
@@ -1982,7 +1980,6 @@
 				A7D8A87023E2513F00DCD162 /* dummy */,
 				A7D8A87323E2513F00DCD162 /* SDL_audio_c.h */,
 				F32DDAC92AB795A30041EAA5 /* SDL_audio_channel_converters.h */,
-				F32DDACC2AB795A30041EAA5 /* SDL_audio_resampler_filter.h */,
 				A7D8A8B823E2513F00DCD162 /* SDL_audio.c */,
 				A7D8A8A123E2513F00DCD162 /* SDL_audiocvt.c */,
 				A7D8A87723E2513F00DCD162 /* SDL_audiodev_c.h */,
@@ -2295,7 +2292,6 @@
 				F3F7D8ED2933074E00816151 /* SDL_audio.h in Headers */,
 				A7D8B7A023E2514400DCD162 /* SDL_audio_c.h in Headers */,
 				F32DDACF2AB795A30041EAA5 /* SDL_audio_channel_converters.h in Headers */,
-				F32DDAD22AB795A30041EAA5 /* SDL_audio_resampler_filter.h in Headers */,
 				A7D8B7B223E2514400DCD162 /* SDL_audiodev_c.h in Headers */,
 				F32DDAD32AB795A30041EAA5 /* SDL_audioqueue.h in Headers */,
 				F32DDAD02AB795A30041EAA5 /* SDL_audioresample.h in Headers */,
diff --git a/build-scripts/gen_audio_resampler_filter.c b/build-scripts/gen_audio_resampler_filter.c
deleted file mode 100644
index c115484a9cdb3..0000000000000
--- a/build-scripts/gen_audio_resampler_filter.c
+++ /dev/null
@@ -1,149 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2024 Sam Lantinga <slouken@libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-
-/*
-
-Built with:
-
-gcc -o genfilter build-scripts/gen_audio_resampler_filter.c -lm && ./genfilter > src/audio/SDL_audio_resampler_filter.h
-
-*/
-
-/*
-   SDL's resampler uses a "bandlimited interpolation" algorithm:
-     https://ccrma.stanford.edu/~jos/resample/
-
-   This code pre-generates the kaiser tables so we don't have to do this at
-   run time, at a cost of about 20 kilobytes of static data in SDL. This code
-   used to be part of SDL itself and generated the tables on the first use,
-   but that was expensive to produce on platforms without floating point
-   hardware.
-*/
-
-#include <stdio.h>
-#include <math.h>
-
-#ifndef M_PI
-    #define M_PI 3.14159265358979323846
-#endif
-
-#define RESAMPLER_ZERO_CROSSINGS 5
-#define RESAMPLER_BITS_PER_SAMPLE 16
-#define RESAMPLER_BITS_PER_ZERO_CROSSING  ((RESAMPLER_BITS_PER_SAMPLE / 2) + 1)
-#define RESAMPLER_SAMPLES_PER_ZERO_CROSSING  (1 << RESAMPLER_BITS_PER_ZERO_CROSSING)
-#define RESAMPLER_FILTER_SIZE (RESAMPLER_SAMPLES_PER_ZERO_CROSSING * RESAMPLER_ZERO_CROSSINGS)
-
-/* This is a "modified" bessel function, so you can't use POSIX j0() */
-static double
-bessel(const double x)
-{
-    const double xdiv2 = x / 2.0;
-    double i0 = 1.0;
-    double f = 1.0;
-    int i = 1;
-
-    while (1) {
-        const double diff = pow(xdiv2, i * 2) / pow(f, 2);
-        if (diff < 1.0e-21) {
-            break;
-        }
-        i0 += diff;
-        i++;
-        f *= (double) i;
-    }
-
-    return i0;
-}
-
-/* build kaiser table with cardinal sine applied to it, and array of differences between elements. */
-static void
-kaiser_and_sinc(double *table, const int tablelen, const double beta)
-{
-    const double bessel_beta = bessel(beta);
-    int i;
-
-    table[0] = 1.0;
-
-    for (i = 1; i < tablelen; i++) {
-        const double kaiser = bessel(beta * sqrt(1.0 - pow((double)i / (double)(tablelen), 2.0))) / bessel_beta;
-        const double x = (((double) i) / ((double) RESAMPLER_SAMPLES_PER_ZERO_CROSSING)) * M_PI;
-        table[i] = kaiser * (sin(x) / x);
-    }
-}
-
-static double ResamplerFilter[RESAMPLER_FILTER_SIZE];
-
-static void
-PrepareResampleFilter(void)
-{
-    /* if dB > 50, beta=(0.1102 * (dB - 8.7)), according to Matlab. */
-    const double dB = 80.0;
-    const double beta = 0.1102 * (dB - 8.7);
-    kaiser_and_sinc(ResamplerFilter, RESAMPLER_FILTER_SIZE, beta);
-}
-
-int main(void)
-{
-    int i, j;
-
-    PrepareResampleFilter();
-
-    printf(
-        "/*\n"
-        "  Simple DirectMedia Layer\n"
-        "  Copyright (C) 1997-2024 Sam Lantinga <slouken@libsdl.org>\n"
-        "\n"
-        "  This software is provided 'as-is', without any express or implied\n"
-        "  warranty.  In no event will the authors be held liable for any damages\n"
-        "  arising from the use of this software.\n"
-        "\n"
-        "  Permission is granted to anyone to use this software for any purpose,\n"
-        "  including commercial applications, and to alter it and redistribute it\n"
-        "  freely, subject to the following restrictions:\n"
-        "\n"
-        "  1. The origin of this software must not be misrepresented; you must not\n"
-        "     claim that you wrote the original software. If you use this software\n"
-        "     in a product, an acknowledgment in the product documentation would be\n"
-        "     appreciated but is not required.\n"
-        "  2. Altered source versions must be plainly marked as such, and must not be\n"
-        "     misrepresented as being the original software.\n"
-        "  3. This notice may not be removed or altered from any source distribution.\n"
-        "*/\n"
-        "\n"
-        "// DO NOT EDIT, THIS FILE WAS GENERATED BY build-scripts/gen_audio_resampler_filter.c\n"
-        "\n"
-        "#define RESAMPLER_ZERO_CROSSINGS %d\n"
-        "#define RESAMPLER_BITS_PER_SAMPLE %d\n"
-        "#define RESAMPLER_BITS_PER_ZERO_CROSSING ((RESAMPLER_BITS_PER_SAMPLE / 2) + 1)\n"
-        "#define RESAMPLER_SAMPLES_PER_ZERO_CROSSING (1 << RESAMPLER_BITS_PER_ZERO_CROSSING)\n"
-        "#define RESAMPLER_FILTER_SIZE (RESAMPLER_SAMPLES_PER_ZERO_CROSSING * RESAMPLER_ZERO_CROSSINGS)\n"
-        "\n", RESAMPLER_ZERO_CROSSINGS, RESAMPLER_BITS_PER_SAMPLE
-    );
-
-    printf("static const float ResamplerFilter[RESAMPLER_FILTER_SIZE] = {");
-    for (i = 0; i < RESAMPLER_FILTER_SIZE; i++) {
-        j = (i % RESAMPLER_ZERO_CROSSINGS) * RESAMPLER_SAMPLES_PER_ZERO_CROSSING + (i / RESAMPLER_ZERO_CROSSINGS);
-        printf("%s%12.9ff,", (i % RESAMPLER_ZERO_CROSSINGS) ? "" : "\n    ", ResamplerFilter[j]);
-    }
-    printf("\n};\n\n");
-
-    return 0;
-}
diff --git a/src/audio/SDL_audio_resampler_filter.h b/src/audio/SDL_audio_resampler_filter.h
deleted file mode 100644
index ae12a97aca411..0000000000000
--- a/src/audio/SDL_audio_resampler_filter.h
+++ /dev/null
@@ -1,544 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2024 Sam Lantinga <slouken@libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-
-// DO NOT EDIT, THIS FILE WAS GENERATED BY build-scripts/gen_audio_resampler_filter.c
-
-#define RESAMPLER_ZERO_CROSSINGS 5
-#define RESAMPLER_BITS_PER_SAMPLE 16
-#define RESAMPLER_BITS_PER_ZERO_CROSSING ((RESAMPLER_BITS_PER_SAMPLE / 2) + 1)
-#define RESAMPLER_SAMPLES_PER_ZERO_CROSSING (1 << RESAMPLER_BITS_PER_ZERO_CROSSING)
-#define RESAMPLER_FILTER_SIZE (RESAMPLER_SAMPLES_PER_ZERO_CROSSING * RESAMPLER_ZERO_CROSSINGS)
-
-static const float ResamplerFilter[RESAMPLER_FILTER_SIZE] = {
-     1.000000000f, 0.000000000f,-0.000000000f, 0.000000000f,-0.000000000f,
-     0.999993165f,-0.001679888f, 0.000529080f,-0.000151513f, 0.000027455f,
-     0.999972661f,-0.003351212f, 0.001055794f,-0.000302183f, 0.000054683f,
-     0.999938488f,-0.005013955f, 0.001580128f,-0.000452009f, 0.000081685f,
-     0.999890647f,-0.006668099f, 0.002102071f,-0.000600987f, 0.000108459f,
-     0.999829139f,-0.008313629f, 0.002621611f,-0.000749115f, 0.000135007f,
-     0.999753966f,-0.009950528f, 0.003138734f,-0.000896389f, 0.000161328f,
-     0.999665131f,-0.011578779f, 0.003653429f,-0.001042807f, 0.000187423f,
-     0.999562634f,-0.013198368f, 0.004165684f,-0.001188367f, 0.000213291f,
-     0.999446480f,-0.014809279f, 0.004675488f,-0.001333066f, 0.000238933f,
-     0.999316672f,-0.016411497f, 0.005182828f,-0.001476901f, 0.000264348f,
-     0.999173212f,-0.018005007f, 0.005687694f,-0.001619871f, 0.000289537f,
-     0.999016105f,-0.019589795f, 0.006190074f,-0.001761971f, 0.000314501f,
-     0.998845356f,-0.021165846f, 0.006689957f,-0.001903201f, 0.000339239f,
-     0.998660968f,-0.022733147f, 0.007187332f,-0.002043558f, 0.000363751f,
-     0.998462946f,-0.024291684f, 0.007682189f,-0.002183039f, 0.000388037f,
-     0.998251297f,-0.025841443f, 0.008174516f,-0.002321643f, 0.000412099f,
-     0.998026026f,-0.027382413f, 0.008664303f,-0.002459367f, 0.000435935f,
-     0.997787138f,-0.028914579f, 0.009151540f,-0.002596209f, 0.000459547f,
-     0.997534641f,-0.030437930f, 0.009636217f,-0.002732167f, 0.000482934f,
-     0.997268542f,-0.031952453f, 0.010118324f,-0.002867240f, 0.000506097f,
-     0.996988847f,-0.033458137f, 0.010597850f,-0.003001425f, 0.000529036f,
-     0.996695563f,-0.034954970f, 0.011074786f,-0.003134721f, 0.000551752f,
-     0.996388700f,-0.036442941f, 0.011549123f,-0.003267125f, 0.000574244f,
-     0.996068266f,-0.037922039f, 0.012020851f,-0.003398637f, 0.000596512f,
-     0.995734268f,-0.039392253f, 0.012489961f,-0.003529253f, 0.000618558f,
-     0.995386717f,-0.040853574f, 0.012956443f,-0.003658973f, 0.000640382f,
-     0.995025621f,-0.042305990f, 0.013420290f,-0.003787796f, 0.000661984f,
-     0.994650990f,-0.043749493f, 0.013881491f,-0.003915718f, 0.000683363f,
-     0.994262835f,-0.045184072f, 0.014340039f,-0.004042740f, 0.000704522f,
-     0.993861166f,-0.046609719f, 0.014795924f,-0.004168860f, 0.000725459f,
-     0.993445994f,-0.048026424f, 0.015249139f,-0.004294075f, 0.000746176f,
-     0.993017331f,-0.049434180f, 0.015699676f,-0.004418386f, 0.000766672f,
-     0.992575187f,-0.050832978f, 0.016147525f,-0.004541790f, 0.000786949f,
-     0.992119574f,-0.052222809f, 0.016592680f,-0.004664287f, 0.000807006f,
-     0.991650506f,-0.053603666f, 0.017035133f,-0.004785875f, 0.000826844f,
-     0.991167995f,-0.054975543f, 0.017474875f,-0.004906553f, 0.000846464f,
-     0.990672054f,-0.056338431f, 0.017911900f,-0.005026320f, 0.000865865f,
-     0.990162696f,-0.057692323f, 0.018346201f,-0.005145175f, 0.000885049f,
-     0.989639935f,-0.059037214f, 0.018777770f,-0.005263117f, 0.000904016f,
-     0.989103786f,-0.060373097f, 0.019206599f,-0.005380146f, 0.000922766f,
-     0.988554262f,-0.061699966f, 0.019632684f,-0.005496260f, 0.000941300f,
-     0.987991380f,-0.063017815f, 0.020056015f,-0.005611458f, 0.000959619f,
-     0.987415153f,-0.064326639f, 0.020476588f,-0.005725741f, 0.000977722f,
-     0.986825598f,-0.065626433f, 0.020894396f,-0.005839106f, 0.000995611f,
-     0.986222730f,-0.066917192f, 0.021309432f,-0.005951554f, 0.001013285f,
-     0.985606567f,-0.068198912f, 0.021721690f,-0.006063084f, 0.001030746f,
-     0.984977124f,-0.069471588f, 0.022131165f,-0.006173695f, 0.001047994f,
-     0.984334418f,-0.070735217f, 0.022537850f,-0.006283387f, 0.001065030f,
-     0.983678468f,-0.071989794f, 0.022941741f,-0.006392159f, 0.001081853f,
-     0.983009290f,-0.073235317f, 0.023342830f,-0.006500011f, 0.001098466f,
-     0.982326903f,-0.074471782f, 0.023741114f,-0.006606943f, 0.001114868f,
-     0.981631326f,-0.075699186f, 0.024136587f,-0.006712954f, 0.001131059f,
-     0.980922577f,-0.076917527f, 0.024529243f,-0.006818044f, 0.001147042f,
-     0.980200675f,-0.078126804f, 0.024919078f,-0.006922213f, 0.001162815f,
-     0.979465640f,-0.079327013f, 0.025306087f,-0.007025460f, 0.001178380f,
-     0.978717491f,-0.080518153f, 0.025690266f,-0.007127786f, 0.001193738f,
-     0.977956250f,-0.081700223f, 0.026071609f,-0.007229191f, 0.001208889f,
-     0.977181936f,-0.082873221f, 0.026450113f,-0.007329674f, 0.001223833f,
-     0.976394570f,-0.084037148f, 0.026825773f,-0.007429235f, 0.001238572f,
-     0.975594175f,-0.085192002f, 0.027198586f,-0.007527875f, 0.001253106f,
-     0.974780770f,-0.086337783f, 0.027568547f,-0.007625593f, 0.001267436f,
-     0.973954379f,-0.087474491f, 0.027935652f,-0.007722391f, 0.001281562f,
-     0.973115024f,-0.088602126f, 0.028299898f,-0.007818267f, 0.001295485f,
-     0.972262727f,-0.089720690f, 0.028661282f,-0.007913223f, 0.001309207f,
-     0.971397512f,-0.090830182f, 0.029019799f,-0.008007258f, 0.001322726f,
-     0.970519401f,-0.091930604f, 0.029375448f,-0.008100373f, 0.001336045f,
-     0.969628418f,-0.093021958f, 0.029728224f,-0.008192568f, 0.001349164f,
-     0.968724588f,-0.094104245f, 0.030078125f,-0.008283845f, 0.001362084f,
-     0.967807935f,-0.095177467f, 0.030425148f,-0.008374202f, 0.001374806f,
-     0.966878483f,-0.096241627f, 0.030769290f,-0.008463642f, 0.001387329f,
-     0.965936258f,-0.097296726f, 0.031110550f,-0.008552163f, 0.001399656f,
-     0.964981285f,-0.098342768f, 0.031448923f,-0.008639768f, 0.001411786f,
-     0.964013590f,-0.099379756f, 0.031784409f,-0.008726456f, 0.001423721f,
-     0.963033199f,-0.100407693f, 0.032117005f,-0.008812229f, 0.001435461f,
-     0.962040138f,-0.101426582f, 0.032446709f,-0.008897086f, 0.001447008f,
-     0.961034434f,-0.102436428f, 0.032773519f,-0.008981030f, 0.001458361f,
-     0.960016114f,-0.103437235f, 0.033097434f,-0.009064060f, 0.001469522f,
-     0.958985206f,-0.104429007f, 0.033418451f,-0.009146178f, 0.001480492f,
-     0.957941737f,-0.105411749f, 0.033736571f,-0.009227385f, 0.001491271f,
-     0.956885736f,-0.106385466f, 0.034051790f,-0.009307680f, 0.001501860f,
-     0.955817231f,-0.107350163f, 0.034364109f,-0.009387067f, 0.001512261f,
-     0.954736250f,-0.108305845f, 0.034673526f,-0.009465545f, 0.001522473f,
-     0.953642823f,-0.109252518f, 0.034980040f,-0.009543115f, 0.001532497f,
-     0.952536979f,-0.110190189f, 0.035283651f,-0.009619779f, 0.001542336f,
-     0.951418748f,-0.111118864f, 0.035584357f,-0.009695538f, 0.001551988f,
-     0.950288160f,-0.112038548f, 0.035882158f,-0.009770393f, 0.001561456f,
-     0.949145245f,-0.112949250f, 0.036177055f,-0.009844346f, 0.001570741f,
-     0.947990034f,-0.113850976f, 0.036469046f,-0.009917397f, 0.001579842f,
-     0.946822559f,-0.114743733f, 0.036758132f,-0.009989548f, 0.001588761f,
-     0.945642850f,-0.115627529f, 0.037044312f,-0.010060800f, 0.001597498f,
-     0.944450939f,-0.116502372f, 0.037327588f,-0.010131156f, 0.001606056f,
-     0.943246858f,-0.117368270f, 0.037607958f,-0.010200615f, 0.001614434f,
-     0.942030639f,-0.118225231f, 0.037885424f,-0.010269180f, 0.001622633f,
-     0.940802316f,-0.119073264f, 0.038159985f,-0.010336852f, 0.001630655f,
-     0.939561921f,-0.119912378f, 0.038431644f,-0.010403633f, 0.001638500f,
-     0.938309487f,-0.120742582f, 0.038700400f,-0.010469524f, 0.001646169f,
-     0.937045048f,-0.121563886f, 0.038966254f,-0.010534527f, 0.001653663f,
-     0.935768638f,-0.122376299f, 0.039229208f,-0.010598644f, 0.001660984f,
-     0.934480291f,-0.123179830f, 0.039489262f,-0.010661876f, 0.001668131f,
-     0.933180042f,-0.123974491f, 0.039746418f,-0.010724225f, 0.001675106f,
-     0.931867925f,-0.124760291f, 0.040000678f,-0.010785693f, 0.001681910f,
-     0.930543975f,-0.125537242f, 0.040252042f,-0.010846282f, 0.001688544f,
-     0.929208228f,-0.126305353f, 0.040500513f,-0.010905994f, 0.001695008f,
-     0.927860720f,-0.127064637f, 0.040746092f,-0.010964829f, 0.001701305f,
-     0.926501487f,-0.127815104f, 0.040988782f,-0.011022792f, 0.001707433f,
-     0.925130565f,-0.128556767f, 0.041228583f,-0.011079882f, 0.001713396f,
-     0.923747991f,-0.129289637f, 0.041465499f,-0.011136103f, 0.001719193f,
-     0.922353802f,-0.130013726f, 0.041699532f,-0.011191456f, 0.001724825f,
-     0.920948034f,-0.130729047f, 0.041930683f,-0.011245944f, 0.001730294f,
-     0.919530726f,-0.131435613f, 0.042158956f,-0.011299568f, 0.001735601f,
-     0.918101916f,-0.132133435f, 0.042384354f,-0.011352330f, 0.001740746f,
-     0.916661641f,-0.132822528f, 0.042606878f,-0.011404234f, 0.001745730f,
-     0.915209940f,-0.133502905f, 0.042826532f,-0.011455280f, 0.001750555f,
-     0.913746852f,-0.134174578f, 0.043043318f,-0.011505472f, 0.001755221f,
-     0.912272416f,-0.134837563f, 0.043257241f,-0.011554812f, 0.001759730f,
-     0.910786671f,-0.135491873f, 0.043468303f,-0.011603301f, 0.001764082f,
-     0.909289657f,-0.136137522f, 0.043676506f,-0.011650942f, 0.001768278f,
-     0.907781413f,-0.136774525f, 0.043881856f,-0.011697738f, 0.001772320f,
-     0.906261980f,-0.137402897f, 0.044084355f,-0.011743690f, 0.001776208f,
-     0.904731398f,-0.138022653f, 0.044284007f,-0.011788802f, 0.001779944f,
-     0.903189708f,-0.138633807f, 0.044480816f,-0.011833076f, 0.001783528f,
-     0.901636952f,-0.139236376f, 0.044674785f,-0.011876514f, 0.001786962f,
-     0.900073170f,-0.139830375f, 0.044865920f,-0.011919118f, 0.001790246f,
-     0.898498403f,-0.140415819f, 0.045054222f,-0.011960892f, 0.001793381f,
-     0.896912695f,-0.140992726f, 0.045239698f,-0.012001838f, 0.001796369f,
-     0.895316086f,-0.141561111f, 0.045422352f,-0.012041958f, 0.001799211f,
-     0.893708620f,-0.142120991f, 0.045602186f,-0.012081256f, 0.001801907f,
-     0.892090339f,-0.142672383f, 0.045779208f,-0.012119733f, 0.001804459f,
-     0.890461286f,-0.143215304f, 0.045953420f,-0.012157393f, 0.001806868f,
-     0.888821505f,-0.143749771f, 0.046124828f,-0.012194238f, 0.001809134f,
-     0.887171038f,-0.144275802f, 0.046293436f,-0.012230270f, 0.001811259f,
-     0.885509930f,-0.144793414f, 0.046459250f,-0.012265494f, 0.001813243f,
-     0.883838224f,-0.145302625f, 0.046622274f,-0.012299911f, 0.001815089f,
-     0.882155965f,-0.145803453f, 0.046782515f,-0.012333524f, 0.001816796f,
-     0.880463198f,-0.146295917f, 0.046939976f,-0.012366337f, 0.001818366f,
-     0.878759967f,-0.146780035f, 0.047094664f,-0.012398351f, 0.001819800f,
-     0.877046317f,-0.147255826f, 0.047246583f,-0.012429571f, 0.001821099f,
-     0.875322295f,-0.147723309f, 0.047395741f,-0.012459998f, 0.001822264f,
-     0.873587944f,-0.148182503f, 0.047542141f,-0.012489637f, 0.001823295f,
-     0.871843312f,-0.148633428f, 0.047685790f,-0.012518489f, 0.001824196f,
-     0.870088444f,-0.149076103f, 0.047826695f,-0.012546558f, 0.001824965f,
-     0.868323386f,-0.149510548f, 0.047964860f,-0.012573847f, 0.001825604f,
-     0.866548186f,-0.149936783f, 0.048100292f,-0.012600359f, 0.001826115f,
-     0.864762890f,-0.150354828f, 0.048232997f,-0.012626097f, 0.001826498f,
-     0.862967545f,-0.150764704f, 0.048362981f,-0.012651064f, 0.001826754f,
-     0.861162199f,-0.151166432f, 0.048490252f,-0.012675264f, 0.001826885f,
-     0.859346899f,-0.151560031f, 0.048614814f,-0.012698699f, 0.001826891f,
-     0.857521693f,-0.151945524f, 0.048736676f,-0.012721373f, 0.001826774f,
-     0.855686629f,-0.152322931f, 0.048855842f,-0.012743288f, 0.001826534f,
-     0.853841755f,-0.152692274f, 0.048972321f,-0.012764449f, 0.001826173f,
-     0.851987121f,-0.153053574f, 0.049086119f,-0.012784858f, 0.001825691f,
-     0.850122774f,-0.153406854f, 0.049197244f,-0.012804518f, 0.001825091f,
-     0.848248764f,-0.153752135f, 0.049305701f,-0.012823434f, 0.001824372f,
-     0.846365140f,-0.154089440f, 0.049411498f,-0.012841607f, 0.001823536f,
-     0.844471951f,-0.154418791f, 0.049514643f,-0.012859042f, 0.001822584f,
-     0.842569248f,-0.154740210f, 0.049615142f,-0.012875742f, 0.001821517f,
-     0.840657079f,-0.155053721f, 0.049713003f,-0.012891710f, 0.001820336f,
-     0.838735496f,-0.155359346f, 0.049808234f,-0.012906950f, 0.001819042f,
-     0.836804549f,-0.155657108f, 0.049900842f,-0.012921465f, 0.001817636f,
-     0.834864288f,-0.155947032f, 0.049990834f,-0.012935259f, 0.001816120f,
-     0.832914765f,-0.156229140f, 0.050078219f,-0.012948334f, 0.001814493f,
-     0.830956029f,-0.156503456f, 0.050163005f,-0.012960695f, 0.001812758f,
-     0.828988133f,-0.156770004f, 0.050245198f,-0.012972345f, 0.001810916f,
-     0.827011128f,-0.157028808f, 0.050324808f,-0.012983287f, 0.001808967f,
-     0.825025066f,-0.157279893f, 0.050401842f,-0.012993525f, 0.001806912f,
-     0.823029998f,-0.157523282f, 0.050476308f,-0.013003063f, 0.001804753f,
-     0.821025977f,-0.157759001f, 0.050548215f,-0.013011904f, 0.001802491f,
-     0.819013055f,-0.157987074f, 0.050617571f,-0.013020051f, 0.001800126f,
-     0.816991284f,-0.158207526f, 0.050684384f,-0.013027509f, 0.001797660f,
-     0.814960718f,-0.158420382f, 0.050748664f,-0.013034280f, 0.001795094f,
-     0.812921409f,-0.158625668f, 0.050810417f,-0.013040370f, 0.001792428f,
-     0.810873410f,-0.158823410f, 0.050869654f,-0.013045780f, 0.001789664f,
-     0.808816775f,-0.159013631f, 0.050926382f,-0.013050515f, 0.001786804f,
-     0.806751557f,-0.159196360f, 0.050980610f,-0.013054579f, 0.001783847f,
-     0.804677811f,-0.159371620f, 0.051032348f,-0.013057974f, 0.001780795f,
-     0.802595589f,-0.159539440f, 0.051081605f,-0.013060706f, 0.001777649f,
-     0.800504946f,-0.159699844f, 0.051128389f,-0.013062778f, 0.001774411f,
-     0.798405936f,-0.159852860f, 0.051172709f,-0.013064192f, 0.001771080f,
-     0.796298614f,-0.159998514f, 0.051214574f,-0.013064954f, 0.001767659f,
-     0.794183034f,-0.160136832f, 0.051253995f,-0.013065067f, 0.001764147f,
-     0.792059252f,-0.160267843f, 0.051290979f,-0.013064535f, 0.001760547f,
-     0.789927322f,-0.160391572f, 0.051325537f,-0.013063361f, 0.001756860f,
-     0.787787300f,-0.160508047f, 0.051357678f,-0.013061549f, 0.001753085f,
-     0.785639241f,-0.160617296f, 0.051387412f,-0.013059104f, 0.001749225f,
-     0.783483200f,-0.160719346f, 0.051414747f,-0.013056029f, 0.001745280f,
-     0.781319234f,-0.160814225f, 0.051439694f,-0.013052327f, 0.001741252f,
-     0.779147398f,-0.160901960f, 0.051462263f,-0.013048003f, 0.001737141f,
-     0.776967749f,-0.160982580f, 0.051482462f,-0.013043061f, 0.001732948f,
-     0.774780342f,-0.161056113f, 0.051500303f,-0.013037504f, 0.001728675f,
-     0.772585234f,-0.161122587f, 0.051515795f,-0.013031336f, 0.001724323f,
-     0.770382481f,-0.161182031f, 0.051528947f,-0.013024562f, 0.001719892f,
-     0.768172142f,-0.161234473f, 0.051539771f,-0.013017185f, 0.001715383f,
-     0.765954271f,-0.161279942f, 0.051548275f,-0.013009209f, 0.001710798f,
-     0.763728927f,-0.161318466f, 0.051554471f,-0.013000638f, 0.001706137f,
-     0.761496167f,-0.161350075f, 0.051558368f,-0.012991476f, 0.001701402f,
-     0.759256048f,-0.161374798f, 0.051559977f,-0.012981727f, 0.001696593f,
-     0.757008627f,-0.161392665f, 0.051559309f,-0.012971395f, 0.001691712f,
-     0.754753963f,-0.161403704f, 0.051556372f,-0.012960484f, 0.001686760f,
-     0.752492113f,-0.161407945f, 0.051551179f,-0.012948997f, 0.001681737f,
-     0.750223135f,-0.161405418f, 0.051543739f,-0.012936940f, 0.001676644f,
-     0.747947088f,-0.161396153f, 0.051534064f,-0.012924315f, 0.001671483f,
-     0.745664029f,-0.161380179f, 0.051522163f,-0.012911128f, 0.001666254f,
-     0.743374018f,-0.161357527f, 0.051508048f,-0.012897381f, 0.001660959f,
-     0.741077112f,-0.161328227f, 0.051491729f,-0.012883079f, 0.001655598f,
-     0.738773370f,-0.161292309f, 0.051473217f,-0.012868227f, 0.001650173f,
-     0.736462852f,-0.161249804f, 0.051452522f,-0.012852827f, 0.001644684f,
-     0.734145616f,-0.161200742f, 0.051429657f,-0.012836884f, 0.001639133f,
-     0.731821721f,-0.161145154f, 0.051404631f,-0.012820403f, 0.001633520f,
-     0.729491227f,-0.161083070f, 0.051377457f,-0.012803386f, 0.001627846f,
-     0.727154193f,-0.161014523f, 0.051348144f,-0.012785839f, 0.001622112f,
-     0.724810678f,-0.160939542f, 0.051316704f,-0.012767765f, 0.001616320f,
-     0.722460743f,-0.160858158f, 0.051283148f,-0.012749169f, 0.001610470f,
-     0.720104446f,-0.160770404f, 0.051247488f,-0.012730054f, 0.001604563f,
-     0.717741848f,-0.160676310f, 0.051209734f,-0.012710425f, 0.001598600f,
-     0.715373009f,-0.160575909f, 0.051169898f,-0.012690285f, 0.001592582f,
-     0.712997988f,-0.160469230f, 0.051127991f,-0.012669640f, 0.001586510f,
-     0.710616847f,-0.160356307f, 0.051084025f,-0.012648492f, 0.001580385f,
-     0.708229645f,-0.160237171f, 0.051038012f,-0.012626846f, 0.001574207f,
-     0.705836443f,-0.160111854f, 0.050989962f,-0.012604706f, 0.001567979f,
-     0.703437301f,-0.159980389f, 0.050939887f,-0.012582077f, 0.001561700f,
-     0.701032280f,-0.159842806f, 0.050887799f,-0.012558961f, 0.001555372f,
-     0.698621441f,-0.159699138f, 0.050833709f,-0.012535365f, 0.001548995f,
-     0.696204845f,-0.159549419f, 0.050777630f,-0.012511290f, 0.001542571f,
-     0.693782552f,-0.159393679f, 0.050719572f,-0.012486743f, 0.001536101f,
-     0.691354624f,-0.159231952f, 0.050659547f,-0.012461726f, 0.001529584f,
-     0.688921121f,-0.159064270f, 0.050597568f,-0.012436245f, 0.001523023f,
-     0.686482106f,-0.158890666f, 0.050533646f,-0.012410302f, 0.001516417f,
-     0.684037639f,-0.158711173f, 0.050467793f,-0.012383903f, 0.001509769f,
-     0.681587783f,-0.158525823f, 0.050400021f,-0.012357051f, 0.001503079f,
-     0.679132597f,-0.158334650f, 0.050330342f,-0.012329751f, 0.001496347f,
-     0.676672145f,-0.158137687f, 0.050258767f,-0.012302006f, 0.001489575f,
-     0.674206487f,-0.157934966f, 0.050185310f,-0.012273821f, 0.001482764f,
-     0.671735685f,-0.157726522f, 0.050109981f,-0.012245200f, 0.001475914f,
-     0.669259802f,-0.157512387f, 0.050032793f,-0.012216147f, 0.001469026f,
-     0.666778900f,-0.157292594f, 0.049953758f,-0.012186667f, 0.001462101f,
-     0.664293039f,-0.157067178f, 0.049872888f,-0.012156762f, 0.001455141f,
-     0.661802283f,-0.156836172f, 0.049790195f,-0.012126439f, 0.001448145f,
-     0.659306693f,-0.156599609f, 0.049705692f,-0.012095699f, 0.001441115f,
-     0.656806333f,-0.156357523f, 0.049619391f,-0.012064549f, 0.001434051f,
-     0.654301263f,-0.156109948f, 0.049531303f,-0.012032992f, 0.001426955f,
-     0.651791546f,-0.155856918f, 0.049441442f,-0.012001031f, 0.001419827f,
-     0.649277246f,-0.155598467f, 0.049349819f,-0.011968672f, 0.001412668f,
-     0.646758423f,-0.155334628f, 0.049256448f,-0.011935918f, 0.001405479f,
-     0.644235142f,-0.155065436f, 0.049161340f,-0.011902774f, 0.001398261f,
-     0.641707464f,-0.154790925f, 0.049064507f,-0.011869243f, 0.001391015f,
-     0.639175452f,-0.154511129f, 0.048965963f,-0.011835330f, 0.001383741f,
-     0.636639169f,-0.154226083f, 0.048865719f,-0.011801038f, 0.001376440f,
-     0.634098677f,-0.153935820f, 0.048763788f,-0.011766373f, 0.001369113f,
-     0.631554040f,-0.153640376f, 0.048660183f,-0.011731337f, 0.001361761f,
-     0.629005320f,-0.153339784f, 0.048554915f,-0.011695936f, 0.001354384f,
-     0.626452580f,-0.153034079f, 0.048447999f,-0.011660173f, 0.001346984f,
-     0.623895883f,-0.152723296f, 0.048339445f,-0.011624053f, 0.001339561f,
-     0.621335293f,-0.152407470f, 0.048229267f,-0.011587579f, 0.001332116f,
-     0.618770871f,-0.152086634f, 0.048117478f,-0.011550756f, 0.001324650f,
-     0.616202682f,-0.151760824f, 0.048004090f,-0.011513587f, 0.001317164f,
-     0.613630788f,-0.151430075f, 0.047889115f,-

(Patch may be truncated, please check the link at the top of this post.)