aboutsummaryrefslogtreecommitdiffstats
path: root/libavfilter
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2022-03-01 09:22:15 +0100
committerPaul B Mahol <onemda@gmail.com>2022-03-01 09:47:41 +0100
commit5ffad29d626ec14d050d07009eed8ae3887287d2 (patch)
treef75c9613bec33bb8403839e3dd8db299c7663dbf /libavfilter
parent316e0ff752c782439843cc63d0eb8b9c998e47de (diff)
downloadffmpeg-5ffad29d626ec14d050d07009eed8ae3887287d2.tar.gz
avfilter/vf_chromanr: fix rounding of final output
Diffstat (limited to 'libavfilter')
-rw-r--r--libavfilter/vf_chromanr.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavfilter/vf_chromanr.c b/libavfilter/vf_chromanr.c
index 63ec8ff075..385a26c8a6 100644
--- a/libavfilter/vf_chromanr.c
+++ b/libavfilter/vf_chromanr.c
@@ -161,8 +161,8 @@ static int distance ## _slice##name(AVFilterContext *ctx, void *arg,
} \
} \
\
- out_uptr[x] = su / cn; \
- out_vptr[x] = sv / cn; \
+ out_uptr[x] = (su + (cn >> 1)) / cn; \
+ out_vptr[x] = (sv + (cn >> 1)) / cn; \
} \
\
out_uptr += out_ulinesize / sizeof(type); \