From 5a4ffb4f5ef6ab68132f74d845a911ac65c1019f Mon Sep 17 00:00:00 2001 From: Paul B Mahol Date: Thu, 23 Jun 2022 14:47:29 +0200 Subject: [PATCH] avfilter/vf_gblur: properly round output --- libavfilter/vf_gblur.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/libavfilter/vf_gblur.c b/libavfilter/vf_gblur.c index b88a9a6d26..8bb851a774 100644 --- a/libavfilter/vf_gblur.c +++ b/libavfilter/vf_gblur.c @@ -280,17 +280,15 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in) width * sizeof(float), height); } else if (s->depth == 8) { for (y = 0; y < height; y++) { - for (x = 0; x < width; x++) { - dst[x] = bptr[x]; - } + for (x = 0; x < width; x++) + dst[x] = lrintf(bptr[x]); bptr += width; dst += out->linesize[plane]; } } else { for (y = 0; y < height; y++) { - for (x = 0; x < width; x++) { - dst16[x] = bptr[x]; - } + for (x = 0; x < width; x++) + dst16[x] = lrintf(bptr[x]); bptr += width; dst16 += out->linesize[plane] / 2; }