From 190b15c82797024255c2f43a2faf1a170f2063bd Mon Sep 17 00:00:00 2001 From: ferreum Date: Wed, 24 Apr 2024 19:53:06 +0200 Subject: [PATCH] af_scaletempo2: remove redundant buffer zeroing First iteration does not overlap with initial buffer contents any more, so this zeroing was redundant. --- audio/filter/af_scaletempo2_internals.c | 9 --------- 1 file changed, 9 deletions(-) diff --git a/audio/filter/af_scaletempo2_internals.c b/audio/filter/af_scaletempo2_internals.c index 924c0914b3..94c6576893 100644 --- a/audio/filter/af_scaletempo2_internals.c +++ b/audio/filter/af_scaletempo2_internals.c @@ -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);