shithub: ft²

ref: 92084cd0d35baae2154e9d8ea64dd50cf6152dd4
dir: /src/mixer/ft2_cubic_spline.h/

View raw version
#ifndef _ft2_cubic_spline_h_
#define _ft2_cubic_spline_h_

#include <stdint.h>
#include <stdbool.h>
#include "ft2_mix.h" // MIXER_FRAC_BITS

#define CUBIC_SPLINE_TAPS 4
#define CUBIC_WIDTH_BITS 2 // log2(CUBIC_SPLINE_TAPS)

// 8192 is a good compromise
#define CUBIC_SPLINE_PHASES 8192
#define CUBIC_SPLINE_PHASES_BITS 13 // log2(CUBIC_PHASES)

// do not change these!
#define CUBIC_SPLINE_FSHIFT (MIXER_FRAC_BITS-(CUBIC_SPLINE_PHASES_BITS+CUBIC_WIDTH_BITS))
#define CUBIC_SPLINE_FMASK ((CUBIC_SPLINE_TAPS*CUBIC_SPLINE_PHASES)-CUBIC_SPLINE_TAPS)

extern float *fCubicSplineLUT;

bool calcCubicSplineTable(void);
void freeCubicSplineTable(void);

#endif