Commit 077c9901ef for ffmpeg
commit 077c9901ef4e9a72ad5caac21e92e748a8d7fc72
Author: Wu Jianhua <toqsxw@outlook.com>
Date: Tue Apr 15 04:48:09 2025 +0800
avcodec/vvc/filter_template: fix alf_filter_luma function for high bitdepth
This commit fixed Coding tree block filtering process for luma samples
Signed-off-by: Wu Jianhua <toqsxw@outlook.com>
diff --git a/libavcodec/vvc/filter_template.c b/libavcodec/vvc/filter_template.c
index a72d4a2f47..708232e083 100644
--- a/libavcodec/vvc/filter_template.c
+++ b/libavcodec/vvc/filter_template.c
@@ -35,15 +35,16 @@ static void FUNC(lmcs_filter_luma)(uint8_t *_dst, ptrdiff_t dst_stride, const in
}
}
-static av_always_inline int16_t FUNC(alf_clip)(pixel curr, pixel v0, pixel v1, int16_t clip)
+static av_always_inline tpixel FUNC(alf_clip)(pixel curr, pixel v0, pixel v1, tpixel clip)
{
return av_clip(v0 - curr, -clip, clip) + av_clip(v1 - curr, -clip, clip);
}
static void FUNC(alf_filter_luma)(uint8_t *_dst, ptrdiff_t dst_stride, const uint8_t *_src, ptrdiff_t src_stride,
- const int width, const int height, const int16_t *filter, const int16_t *clip, const int vb_pos)
+ const int width, const int height, const int16_t *filter, const int16_t *_clip, const int vb_pos)
{
const pixel *src = (pixel *)_src;
+ const tpixel *clip = (const tpixel *)_clip;
const int shift = 7;
const int offset = 1 << ( shift - 1 );
const int vb_above = vb_pos - 4;