1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-28 20:53:54 +02:00

avfilter/af_dialoguenhance: do output scaling once

This commit is contained in:
Paul B Mahol 2023-11-27 11:52:37 +01:00
parent b1942734c7
commit f1f973313b

View File

@ -108,7 +108,7 @@ static int config_input(AVFilterLink *inlink)
generate_window_func(s->window, s->fft_size, WFUNC_SINE, &overlap);
iscale = 1.f / s->fft_size;
iscale = 1.f / (s->fft_size * 1.5f);
ret = av_tx_init(&s->tx_ctx[0], &s->tx_fn, AV_TX_FLOAT_RDFT, 0, s->fft_size, &scale, 0);
if (ret < 0)
@ -296,13 +296,10 @@ static int de_stereo(AVFilterContext *ctx, AVFrame *out)
memcpy(left_osamples, left_in, overlap * sizeof(float));
memcpy(right_osamples, right_in, overlap * sizeof(float));
// 4 times overlap with squared hanning window results in 1.5 time increase in amplitude
if (!ctx->is_disabled) {
for (int i = 0; i < overlap; i++)
center_osamples[i] = left_out[i] / 1.5f;
} else {
if (ctx->is_disabled)
memset(center_osamples, 0, overlap * sizeof(float));
}
else
memcpy(center_osamples, left_out, overlap * sizeof(float));
return 0;
}