summaryrefslogtreecommitdiff
path: root/libavfilter/vf_normalize.c
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2020-10-27 19:43:54 +0100
committerPaul B Mahol <onemda@gmail.com>2020-10-27 19:45:51 +0100
commitc7ece8e26f313bba7ab30f0ac7cfd282b6ff51e0 (patch)
tree2a03f500233ae6bb4f8062f44197eabc606ecb90 /libavfilter/vf_normalize.c
parent8b1bb4f38e0c0c083f1833ac9411fb1fa9d4764c (diff)
downloadffmpeg-c7ece8e26f313bba7ab30f0ac7cfd282b6ff51e0.tar.gz
avfilter/vf_normalize: fix regression with white/black point calculation
Diffstat (limited to 'libavfilter/vf_normalize.c')
-rw-r--r--libavfilter/vf_normalize.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavfilter/vf_normalize.c b/libavfilter/vf_normalize.c
index e2e00b1234..9675c8ac2c 100644
--- a/libavfilter/vf_normalize.c
+++ b/libavfilter/vf_normalize.c
@@ -448,8 +448,8 @@ static int config_input(AVFilterLink *inlink)
for (c = 0; c < 3; c++) {
s->min[c].history = s->history_mem + (c*2) * s->history_len;
s->max[c].history = s->history_mem + (c*2+1) * s->history_len;
- s->sblackpt[c] = scale * s->blackpt[c] + (s->blackpt[c] >> (s->depth - 8));
- s->swhitept[c] = scale * s->whitept[c] + (s->whitept[c] >> (s->depth - 8));
+ s->sblackpt[c] = scale * s->blackpt[c] + (s->blackpt[c] & (1 << (s->depth - 8)));
+ s->swhitept[c] = scale * s->whitept[c] + (s->whitept[c] & (1 << (s->depth - 8)));
}
planar = desc->flags & AV_PIX_FMT_FLAG_PLANAR;