avfilter/vf_monochrome: use lrintf for rounding

This commit is contained in:
Paul B Mahol 2022-02-20 23:10:02 +01:00
parent b15d3db8b6
commit 954279564a
1 changed files with 2 additions and 2 deletions

View File

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