From 0b150e4f614aa5eda415ade9b2c80a0707c647dc Mon Sep 17 00:00:00 2001 From: Paul B Mahol Date: Sun, 19 Sep 2021 13:47:59 +0200 Subject: [PATCH] avfilter/avf_avectorscope: fix zoom 0 mode with nonlinear scale --- libavfilter/avf_avectorscope.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/libavfilter/avf_avectorscope.c b/libavfilter/avf_avectorscope.c index e1d43b4766..e927b241ff 100644 --- a/libavfilter/avf_avectorscope.c +++ b/libavfilter/avf_avectorscope.c @@ -303,6 +303,18 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *insamples) av_assert2(0); } + switch (s->scale) { + case SQRT: + max = sqrtf(max); + break; + case CBRT: + max = cbrtf(max); + break; + case LOG: + max = logf(1 + max) / logf(2); + break; + } + zoom = 1. / max; }