mirror of
https://github.com/libretro/RetroArch
synced 2025-04-24 06:02:36 +00:00
Fix hermite cracking when ratio < 1.0.
This commit is contained in:
parent
b023687d04
commit
ccd1449aa8
@ -64,8 +64,22 @@ void resampler_process(rarch_resampler_t *re, struct resampler_data *data)
|
|||||||
const float *in_data = data->data_in;
|
const float *in_data = data->data_in;
|
||||||
float *out_data = data->data_out;
|
float *out_data = data->data_out;
|
||||||
|
|
||||||
for (size_t i = 0; i < in_frames; i++)
|
size_t i = 0;
|
||||||
|
while (i < in_frames)
|
||||||
{
|
{
|
||||||
|
while (re->r_frac >= 1.0 && i < in_frames)
|
||||||
|
{
|
||||||
|
re->r_frac -= 1.0;
|
||||||
|
for (unsigned i = 0; i < CHANNELS; i++)
|
||||||
|
{
|
||||||
|
re->chan_data[i][0] = re->chan_data[i][1];
|
||||||
|
re->chan_data[i][1] = re->chan_data[i][2];
|
||||||
|
re->chan_data[i][2] = re->chan_data[i][3];
|
||||||
|
re->chan_data[i][3] = *in_data++;
|
||||||
|
}
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
|
||||||
while (re->r_frac <= 1.0)
|
while (re->r_frac <= 1.0)
|
||||||
{
|
{
|
||||||
re->r_frac += r_step;
|
re->r_frac += r_step;
|
||||||
@ -77,18 +91,6 @@ void resampler_process(rarch_resampler_t *re, struct resampler_data *data)
|
|||||||
}
|
}
|
||||||
processed_out++;
|
processed_out++;
|
||||||
}
|
}
|
||||||
|
|
||||||
while (re->r_frac >= 1.0)
|
|
||||||
{
|
|
||||||
re->r_frac -= 1.0;
|
|
||||||
for (unsigned i = 0; i < CHANNELS; i++)
|
|
||||||
{
|
|
||||||
re->chan_data[i][0] = re->chan_data[i][1];
|
|
||||||
re->chan_data[i][1] = re->chan_data[i][2];
|
|
||||||
re->chan_data[i][2] = re->chan_data[i][3];
|
|
||||||
re->chan_data[i][3] = *in_data++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
data->output_frames = processed_out;
|
data->output_frames = processed_out;
|
||||||
|
@ -254,15 +254,14 @@ void resampler_process(rarch_resampler_t *re, struct resampler_data *data)
|
|||||||
frames--;
|
frames--;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (re->time >= PHASES)
|
while (re->time < PHASES)
|
||||||
break;
|
{
|
||||||
|
|
||||||
process_sinc(re, output);
|
process_sinc(re, output);
|
||||||
output += 2;
|
output += 2;
|
||||||
out_frames++;
|
out_frames++;
|
||||||
|
|
||||||
re->time += ratio;
|
re->time += ratio;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
data->output_frames = out_frames;
|
data->output_frames = out_frames;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user