(sinc.c) Cleanup

This commit is contained in:
twinaphex 2015-06-26 17:33:15 +02:00
parent 9358114b9c
commit 7961d82e3c

View File

@ -132,7 +132,6 @@ static INLINE double besseli0(double x)
{
unsigned i;
double sum = 0.0;
double factorial = 1.0;
double factorial_mult = 0.0;
double x_pow = 1.0;
@ -174,10 +173,10 @@ static void init_sinc_table(rarch_sinc_resampler_t *resamp, double cutoff,
{
for (j = 0; j < taps; j++)
{
double window_phase, sinc_phase;
double sinc_phase;
float val;
int n = j * phases + i;
window_phase = (double)n / (phases * taps); /* [0, 1). */
double window_phase = (double)n / (phases * taps); /* [0, 1). */
window_phase = 2.0 * window_phase - 1.0; /* [-1, 1) */
sinc_phase = sidelobes * window_phase;
@ -190,6 +189,7 @@ static void init_sinc_table(rarch_sinc_resampler_t *resamp, double cutoff,
if (calculate_delta)
{
int phase;
for (p = 0; p < phases - 1; p++)
{
for (j = 0; j < taps; j++)
@ -204,9 +204,9 @@ static void init_sinc_table(rarch_sinc_resampler_t *resamp, double cutoff,
for (j = 0; j < taps; j++)
{
float val, delta;
double window_phase, sinc_phase;
double sinc_phase;
int n = j * phases + (phase + 1);
window_phase = (double)n / (phases * taps); /* (0, 1]. */
double window_phase = (double)n / (phases * taps); /* (0, 1]. */
window_phase = 2.0 * window_phase - 1.0; /* (-1, 1] */
sinc_phase = sidelobes * window_phase;
@ -431,7 +431,6 @@ static void resampler_sinc_process(void *re_, struct resampler_data *data)
rarch_sinc_resampler_t *re = (rarch_sinc_resampler_t*)re_;
uint32_t ratio = PHASES / data->ratio;
const float *input = data->data_in;
float *output = data->data_out;
size_t frames = data->input_frames;
@ -480,12 +479,11 @@ static void *resampler_sinc_new(const struct resampler_config *config,
double cutoff;
rarch_sinc_resampler_t *re = (rarch_sinc_resampler_t*)
calloc(1, sizeof(*re));
(void)config;
if (!re)
return NULL;
memset(re, 0, sizeof(*re));
(void)config;
re->taps = TAPS;
cutoff = CUTOFF;