ffmpeg | branch: master | Paul B Mahol <one...@gmail.com> | Sun Feb 20 23:10:02 
2022 +0100| [954279564a0ae38e72ce828a90c7d57f9b90a29e] | committer: Paul B Mahol

avfilter/vf_monochrome: use lrintf for rounding

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

 libavfilter/vf_monochrome.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavfilter/vf_monochrome.c b/libavfilter/vf_monochrome.c
index 1afc21560d..c77c3b8f19 100644
--- a/libavfilter/vf_monochrome.c
+++ b/libavfilter/vf_monochrome.c
@@ -107,7 +107,7 @@ static int monochrome_slice8(AVFilterContext *ctx, void 
*arg, int jobnr, int nb_
         for (int x = 0; x < width; x++) {
             PROCESS()
 
-            yptr[x] = av_clip_uint8(ny * max);
+            yptr[x] = av_clip_uint8(lrintf(ny * max));
         }
 
         yptr += ylinesize;
@@ -146,7 +146,7 @@ static int monochrome_slice16(AVFilterContext *ctx, void 
*arg, int jobnr, int nb
         for (int x = 0; x < width; x++) {
             PROCESS()
 
-            yptr[x] = av_clip_uintp2_c(ny * max, depth);
+            yptr[x] = av_clip_uintp2_c(lrintf(ny * max), depth);
         }
 
         yptr += ylinesize;

_______________________________________________
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

To unsubscribe, visit link above, or email
ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".

Reply via email to