summaryrefslogtreecommitdiff
path: root/libavfilter/vf_chromanr.c
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2020-07-10 23:04:49 +0200
committerPaul B Mahol <onemda@gmail.com>2020-07-10 23:09:19 +0200
commit6f84e92172a12f14d24c4467b2e58611afd726bd (patch)
treee3606fc1ec8e18179f3faaf6750574c01b149faf /libavfilter/vf_chromanr.c
parent5d91b7718efc581da8882a4e9bf2f5953e41adbf (diff)
avfilter/vf_chromanr: move thres calculation to filter_frame()
Diffstat (limited to 'libavfilter/vf_chromanr.c')
-rw-r--r--libavfilter/vf_chromanr.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libavfilter/vf_chromanr.c b/libavfilter/vf_chromanr.c
index 7cda8a8a5f..78dbe37e68 100644
--- a/libavfilter/vf_chromanr.c
+++ b/libavfilter/vf_chromanr.c
@@ -171,6 +171,8 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
ChromaNRContext *s = ctx->priv;
AVFrame *out;
+ s->thres = s->threshold * (1 << (s->depth - 8));
+
out = ff_get_video_buffer(outlink, outlink->w, outlink->h);
if (!out) {
av_frame_free(&in);
@@ -197,7 +199,6 @@ static int config_input(AVFilterLink *inlink)
s->nb_planes = desc->nb_components;
s->depth = desc->comp[0].depth;
- s->thres = s->threshold * (1 << (s->depth - 8));
s->filter_slice = s->depth <= 8 ? filter_slice8 : filter_slice16;
s->chroma_w = 1 << desc->log2_chroma_w;
s->chroma_h = 1 << desc->log2_chroma_h;