Commit 80348bae82 for ffmpeg
commit 80348bae8222f10b821a632403d34a3b9e23f43e
Author: Wu Jianhua <toqsxw@outlook.com>
Date: Tue Apr 15 04:47:19 2025 +0800
avcodec/vvc/inter_template: fix prof_grad_filter function for high bitdepth
This commit fixed the gradient filter for prediction refinement with optical flow process
Signed-off-by: Wu Jianhua <toqsxw@outlook.com>
diff --git a/libavcodec/vvc/inter_template.c b/libavcodec/vvc/inter_template.c
index db4f7ca826..961502f7ec 100644
--- a/libavcodec/vvc/inter_template.c
+++ b/libavcodec/vvc/inter_template.c
@@ -302,14 +302,13 @@ static void FUNC(fetch_samples)(int16_t *_dst, const uint8_t *_src, const ptrdif
FUNC(bdof_fetch_samples)(_dst, _src, _src_stride, x_frac, y_frac, AFFINE_MIN_BLOCK_SIZE, AFFINE_MIN_BLOCK_SIZE);
}
-static void FUNC(prof_grad_filter)(int16_t *gradient_h, int16_t *gradient_v, const ptrdiff_t gradient_stride,
- const int16_t *_src, const ptrdiff_t src_stride, const int width, const int height)
+static void FUNC(prof_grad_filter)(tpixel *gradient_h, tpixel *gradient_v, const ptrdiff_t gradient_stride,
+ const tpixel *src, const ptrdiff_t src_stride, const int width, const int height)
{
- const int shift = 6;
- const int16_t *src = _src;
+ const int shift = 6;
for (int y = 0; y < height; y++) {
- const int16_t *p = src;
+ const tpixel *p = src;
for (int x = 0; x < width; x++) {
gradient_h[x] = (p[1] >> shift) - (p[-1] >> shift);
gradient_v[x] = (p[src_stride] >> shift) - (p[-src_stride] >> shift);