summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2024-04-04 04:00:20 +0200
committerNuo Mi <nuomi2021@gmail.com>2024-04-04 11:36:41 +0800
commit9309b5bc64a9c18eb5973953532ef6029be384de (patch)
tree71fe80acaa8fd08d27708852b083554cecd75125
parent3fe28831edfe9cd58492abdca9564e444514678b (diff)
avcodec/vvc/vvc_inter_template: Fix left shift of negative number
Affected the vvc-conformance-WP_A_3 FATE test. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
-rw-r--r--libavcodec/vvc/vvc_inter_template.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/vvc/vvc_inter_template.c b/libavcodec/vvc/vvc_inter_template.c
index e5cff079fb..e2fbfd4fc0 100644
--- a/libavcodec/vvc/vvc_inter_template.c
+++ b/libavcodec/vvc/vvc_inter_template.c
@@ -46,7 +46,7 @@ static void FUNC(w_avg)(uint8_t *_dst, const ptrdiff_t _dst_stride,
pixel *dst = (pixel*)_dst;
const ptrdiff_t dst_stride = _dst_stride / sizeof(pixel);
const int shift = denom + FFMAX(3, 15 - BIT_DEPTH);
- const int offset = (((o0 + o1) << (BIT_DEPTH - 8)) + 1) << (shift - 1);
+ const int offset = ((o0 + o1) * (1 << (BIT_DEPTH - 8)) + 1) * (1 << (shift - 1));
for (int y = 0; y < height; y++) {
for (int x = 0; x < width; x++)