[FFmpeg-cvslog] avfilter/vf_gblur: properly round output

Paul B Mahol git at videolan.org
Thu Jun 23 19:49:16 EEST 2022


ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Thu Jun 23 14:47:29 2022 +0200| [5a4ffb4f5ef6ab68132f74d845a911ac65c1019f] | committer: Paul B Mahol

avfilter/vf_gblur: properly round output

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=5a4ffb4f5ef6ab68132f74d845a911ac65c1019f
---

 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;
             }



More information about the ffmpeg-cvslog mailing list