aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2018-01-07 05:58:52 -0800
committerChris Robinson <[email protected]>2018-01-07 05:58:52 -0800
commitc423b6c8b77354bee82f14c3b22c5d453d257c19 (patch)
tree84dbcc117b91e9a8d9c9091b2595f9342a248bbd
parent4cc1c646466737ba411aa23ce4a6116936ada8c2 (diff)
Remove the sinc4 table
-rw-r--r--Alc/ALu.c5
-rw-r--r--OpenAL32/Include/alu.h5
-rw-r--r--native-tools/bsincgen.c47
3 files changed, 4 insertions, 53 deletions
diff --git a/Alc/ALu.c b/Alc/ALu.c
index 1964e6c7..97066737 100644
--- a/Alc/ALu.c
+++ b/Alc/ALu.c
@@ -1046,9 +1046,6 @@ static void CalcNonAttnSourceParams(ALvoice *voice, const struct ALvoiceProps *p
BsincPrepare(voice->Step, &voice->ResampleState.bsinc, &bsinc24);
else if(props->Resampler == BSinc12Resampler)
BsincPrepare(voice->Step, &voice->ResampleState.bsinc, &bsinc12);
- else
-
- voice->ResampleState.sinc4.filter = sinc4Tab;
voice->Resampler = SelectResampler(props->Resampler);
/* Calculate gains */
@@ -1396,8 +1393,6 @@ static void CalcAttnSourceParams(ALvoice *voice, const struct ALvoiceProps *prop
BsincPrepare(voice->Step, &voice->ResampleState.bsinc, &bsinc24);
else if(props->Resampler == BSinc12Resampler)
BsincPrepare(voice->Step, &voice->ResampleState.bsinc, &bsinc12);
- else
- voice->ResampleState.sinc4.filter = sinc4Tab;
voice->Resampler = SelectResampler(props->Resampler);
if(Distance > FLT_EPSILON)
diff --git a/OpenAL32/Include/alu.h b/OpenAL32/Include/alu.h
index c427df0c..2c326327 100644
--- a/OpenAL32/Include/alu.h
+++ b/OpenAL32/Include/alu.h
@@ -84,13 +84,8 @@ typedef struct BsincState {
const ALfloat *filter;
} BsincState;
-typedef struct Sinc4State {
- const ALfloat (*filter)[4];
-} Sinc4State;
-
typedef union InterpState {
BsincState bsinc;
- Sinc4State sinc4;
} InterpState;
typedef const ALfloat* (*ResamplerFunc)(const InterpState *state,
diff --git a/native-tools/bsincgen.c b/native-tools/bsincgen.c
index 2a7e4326..49102279 100644
--- a/native-tools/bsincgen.c
+++ b/native-tools/bsincgen.c
@@ -50,6 +50,10 @@
#define log2(x) (log(x) / log(2.0))
#endif
+/* Same as in alu.h! */
+#define FRACTIONBITS (12)
+#define FRACTIONONE (1<<FRACTIONBITS)
+
// The number of distinct scale and phase intervals within the filter table.
// Must be the same as in alu.h!
#define BSINC_SCALE_COUNT (16)
@@ -316,48 +320,6 @@ static void BsiGenerateTables(FILE *output, const char *tabname, const double re
}
-/* These methods generate a much simplified 4-point sinc interpolator using a
- * Kaiser window. This is much simpler to process at run-time, but has notably
- * more aliasing noise.
- */
-
-/* Same as in alu.h! */
-#define FRACTIONBITS (12)
-#define FRACTIONONE (1<<FRACTIONBITS)
-
-static void Sinc4GenerateTables(FILE *output, const double rejection)
-{
- static double filter[FRACTIONONE][4];
-
- const double width = CalcKaiserWidth(rejection, 3);
- const double beta = CalcKaiserBeta(rejection);
- const double scaleBase = width / 2.0;
- const double scaleRange = 1.0 - scaleBase;
- const double scale = scaleBase + scaleRange;
- const double a = MinDouble(4.0, floor(4.0 / (2.0*scale)));
- const int m = 2 * (int)a;
- const int l = (m/2) - 1;
- int pi;
- for(pi = 0;pi < FRACTIONONE;pi++)
- {
- const double phase = l + ((double)pi / FRACTIONONE);
- int i;
-
- for(i = 0;i < m;i++)
- {
- double x = i - phase;
- filter[pi][i] = Kaiser(beta, x / a) * Sinc(x);
- }
- }
-
- fprintf(output, "alignas(16) static const float sinc4Tab[FRACTIONONE][4] = {\n");
- for(pi = 0;pi < FRACTIONONE;pi++)
- fprintf(output, " { %+14.9ef, %+14.9ef, %+14.9ef, %+14.9ef },\n",
- filter[pi][0], filter[pi][1], filter[pi][2], filter[pi][3]);
- fprintf(output, "};\n\n");
-}
-
-
int main(int argc, char *argv[])
{
FILE *output;
@@ -396,7 +358,6 @@ int main(int argc, char *argv[])
BsiGenerateTables(output, "bsinc24", 60.0, 23);
/* An 11th order filter with a -60dB drop at nyquist. */
BsiGenerateTables(output, "bsinc12", 60.0, 11);
- Sinc4GenerateTables(output, 60.0);
if(output != stdout)
fclose(output);