mirror of
https://github.com/mpv-player/mpv
synced 2025-03-19 09:57:34 +00: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:
parent
51e01e9772
commit
190b15c827
@ -51,11 +51,6 @@ static float **realloc_2d(float **p, int x, int y)
|
|||||||
return array;
|
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)
|
static void zero_2d_partial(float **a, int x, int y)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < x; ++i) {
|
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->output_time = 0.0;
|
||||||
p->search_block_index = 0;
|
p->search_block_index = 0;
|
||||||
p->target_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->num_complete_frames = 0;
|
||||||
p->wsola_output_started = false;
|
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_size = p->ola_window_size + p->ola_hop_size;
|
||||||
p->wsola_output = realloc_2d(p->wsola_output, p->channels, p->wsola_output_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.
|
// Auxiliary containers.
|
||||||
p->optimal_block = realloc_2d(p->optimal_block, p->channels, p->ola_window_size);
|
p->optimal_block = realloc_2d(p->optimal_block, p->channels, p->ola_window_size);
|
||||||
|
Loading…
Reference in New Issue
Block a user