[FFmpeg-cvslog] avfilter/af_afftfilt: remove invalid scaling
Paul B Mahol
git at videolan.org
Sat Jul 6 13:05:04 EEST 2019
ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Sat Jul 6 12:01:38 2019 +0200| [b9a6106842d0e6e65a040fd20d5e8a66350617c5] | committer: Paul B Mahol
avfilter/af_afftfilt: remove invalid scaling
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=b9a6106842d0e6e65a040fd20d5e8a66350617c5
---
libavfilter/af_afftfilt.c | 9 ++-------
1 file changed, 2 insertions(+), 7 deletions(-)
diff --git a/libavfilter/af_afftfilt.c b/libavfilter/af_afftfilt.c
index fcbebdde26..7992bc9352 100644
--- a/libavfilter/af_afftfilt.c
+++ b/libavfilter/af_afftfilt.c
@@ -49,7 +49,6 @@ typedef struct AFFTFiltContext {
AVFrame *buffer;
int eof;
int win_func;
- float win_scale;
float *window_func_lut;
} AFFTFiltContext;
@@ -138,7 +137,7 @@ static int config_input(AVFilterLink *inlink)
AVFilterContext *ctx = inlink->dst;
AFFTFiltContext *s = ctx->priv;
char *saveptr = NULL;
- int ret = 0, ch, i;
+ int ret = 0, ch;
float overlap;
char *args;
const char *last_expr = "1";
@@ -226,10 +225,6 @@ static int config_input(AVFilterLink *inlink)
if (s->overlap == 1)
s->overlap = overlap;
- for (s->win_scale = 0, i = 0; i < s->window_size; i++) {
- s->win_scale += s->window_func_lut[i] * s->window_func_lut[i];
- }
-
s->hop_size = s->window_size * (1 - s->overlap);
if (s->hop_size <= 0)
return AVERROR(EINVAL);
@@ -247,7 +242,7 @@ static int filter_frame(AVFilterLink *inlink)
AVFilterLink *outlink = ctx->outputs[0];
AFFTFiltContext *s = ctx->priv;
const int window_size = s->window_size;
- const float f = 1. / s->win_scale;
+ const float f = 1. / (s->window_size / 2);
double values[VAR_VARS_NB];
AVFrame *out, *in = NULL;
int ch, n, ret, i;
More information about the ffmpeg-cvslog
mailing list