0
0
mirror of https://github.com/mpv-player/mpv.git synced 2024-09-19 19:42:24 +02:00

af_scaletempo2: remove redundant buffer zeroing

First iteration does not overlap with initial buffer contents any more,
so this zeroing was redundant.
This commit is contained in:
ferreum 2024-04-24 19:53:06 +02:00 committed by Kacper Michajłow
parent 51e01e9772
commit 190b15c827

View File

@ -51,11 +51,6 @@ static float **realloc_2d(float **p, int x, int y)
return array;
}
static void zero_2d(float **a, int x, int y)
{
memset(a + x, 0, sizeof(float) * x * y);
}
static void zero_2d_partial(float **a, int x, int y)
{
for (int i = 0; i < x; ++i) {
@ -791,8 +786,6 @@ void mp_scaletempo2_reset(struct mp_scaletempo2 *p)
p->output_time = 0.0;
p->search_block_index = 0;
p->target_block_index = 0;
// Clear the queue of decoded packets.
zero_2d(p->wsola_output, p->channels, p->wsola_output_size);
p->num_complete_frames = 0;
p->wsola_output_started = false;
}
@ -855,8 +848,6 @@ void mp_scaletempo2_init(struct mp_scaletempo2 *p, int channels, int rate)
p->wsola_output_size = p->ola_window_size + p->ola_hop_size;
p->wsola_output = realloc_2d(p->wsola_output, p->channels, p->wsola_output_size);
// Initialize for overlap-and-add of the first block.
zero_2d(p->wsola_output, p->channels, p->wsola_output_size);
// Auxiliary containers.
p->optimal_block = realloc_2d(p->optimal_block, p->channels, p->ola_window_size);