PR #25609 opened by hyena
URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/25609
Patch URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/25609.patch
mc_uni_scaled() in libavcodec/vvc/inter.c passes the arguments as:
x, y, dx, dy, block_h, denom, wx, ox, hf, vf, block_w
This matches the DSP declaration in dsp.h, but both weighted RPR
callbacks in inter_template.c expect denom, wx, ox, height instead
of height, denom, wx, ox.
All four parameters are int, so the compiler accepts the mismatch.
With ox == 0, the callbacks read a zero height and leave the
prediction block untouched.
Reorder both callback signatures to match the interface and caller.
>From c894548d3faac32d23be1185e95ddaa0273da3bc Mon Sep 17 00:00:00 2001
From: hyena <[email protected]>
Date: Fri, 30 Oct 2026 04:59:26 -0700
Subject: [PATCH] avcodec/vvc: fix argument order in weighted RPR callbacks
The DSP interface and mc_uni_scaled() pass height before denom, wx and
ox, but both weighted RPR callbacks declare height after them. Since
these parameters are all int, the mismatch is not diagnosed by the
compiler. In particular, a zero offset is read as a zero block height,
leaving the prediction block untouched.
Match both callback signatures to the DSP interface.
Signed-off-by: hyena <[email protected]>
---
libavcodec/vvc/inter_template.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/libavcodec/vvc/inter_template.c b/libavcodec/vvc/inter_template.c
index efa432d1fde..e06eab5ffa8 100644
--- a/libavcodec/vvc/inter_template.c
+++ b/libavcodec/vvc/inter_template.c
@@ -166,16 +166,16 @@ static void av_always_inline
FUNC(put_uni_w_scaled)(uint8_t *_dst, const ptrdiff
static void FUNC(put_uni_luma_w_scaled)(uint8_t *_dst, const ptrdiff_t
_dst_stride,
const uint8_t *_src, ptrdiff_t _src_stride, const int src_height,
- const int x, const int y, const int dx, const int dy, const int denom,
const int wx, const int ox,
- const int height, const int8_t *hf, const int8_t *vf, const int width)
+ const int x, const int y, const int dx, const int dy, const int height,
+ const int denom, const int wx, const int ox, const int8_t *hf, const
int8_t *vf, const int width)
{
FUNC(put_uni_w_scaled)(_dst, _dst_stride, _src, _src_stride, src_height,
x, y, dx, dy, denom, wx, ox, height, hf, vf, width, 0);
}
static void FUNC(put_uni_chroma_w_scaled)(uint8_t *_dst, const ptrdiff_t
_dst_stride,
const uint8_t *_src, ptrdiff_t _src_stride, const int src_height,
- const int x, const int y, const int dx, const int dy, const int denom,
const int wx, const int ox,
- const int height, const int8_t *hf, const int8_t *vf, const int width)
+ const int x, const int y, const int dx, const int dy, const int height,
+ const int denom, const int wx, const int ox, const int8_t *hf, const
int8_t *vf, const int width)
{
FUNC(put_uni_w_scaled)(_dst, _dst_stride, _src, _src_stride, src_height,
x, y, dx, dy, denom, wx, ox, height, hf, vf, width, 1);
}
--
2.54.0
_______________________________________________
ffmpeg-devel mailing list -- [email protected]
To unsubscribe send an email to [email protected]