This is an automated email from the git hooks/post-receive script.

Git pushed a commit to branch master
in repository ffmpeg.

commit da2643e8a08e48027c7a01c34a474c095cb5faca
Author:     Wu Jianhua <[email protected]>
AuthorDate: Tue Apr 15 04:47:35 2025 +0800
Commit:     jianhuaw <[email protected]>
CommitDate: Sun Nov 29 10:42:10 2026 +0000

    avcodec/vvc/inter_template: fix apply_prof_uni function for high bitdepth
    
    This commit fixed the prediction refinement with optical flow process
    
    Signed-off-by: Wu Jianhua <[email protected]>
---
 libavcodec/vvc/inter_template.c | 16 ++++++----------
 1 file changed, 6 insertions(+), 10 deletions(-)

diff --git a/libavcodec/vvc/inter_template.c b/libavcodec/vvc/inter_template.c
index 3809cfae12..44656c7ed9 100644
--- a/libavcodec/vvc/inter_template.c
+++ b/libavcodec/vvc/inter_template.c
@@ -337,26 +337,23 @@ static void FUNC(apply_prof)(int16_t *_dst, const int16_t 
*_src, const int16_t *
             const int di = gradient_h[o] * diff_mv_x[o] + gradient_v[o] * 
diff_mv_y[o];
             const int val = src[x] + av_clip(di, -limit, limit - 1);
             dst[x] = val;
-
         }
         src += MAX_PB_SIZE;
         dst += MAX_PB_SIZE;
     }
 }
 
-static void FUNC(apply_prof_uni)(uint8_t *_dst, const ptrdiff_t _dst_stride, 
const int16_t *src, const int16_t *diff_mv_x, const int16_t *diff_mv_y)
+static void FUNC(apply_prof_uni)(uint8_t *_dst, const ptrdiff_t _dst_stride, 
const int16_t *_src, const int16_t *diff_mv_x, const int16_t *diff_mv_y)
 {
     const int limit             = (1 << FFMAX(13, BIT_DEPTH + 1));          
///< dILimit
+    const tpixel *src           = (const tpixel *)_src;
     pixel *dst                  = (pixel*)_dst;
     const ptrdiff_t dst_stride  = _dst_stride / sizeof(pixel);
-    const int shift             = 14 - BIT_DEPTH;
-#if BIT_DEPTH < 14
+    const int shift             = FFMAX(2, 14 - BIT_DEPTH);
     const int offset            = 1 << (shift - 1);
-#else
-    const int offset            = 0;
-#endif
-    int16_t gradient_h[AFFINE_MIN_BLOCK_SIZE * AFFINE_MIN_BLOCK_SIZE];
-    int16_t gradient_v[AFFINE_MIN_BLOCK_SIZE * AFFINE_MIN_BLOCK_SIZE];
+
+    tpixel gradient_h[AFFINE_MIN_BLOCK_SIZE * AFFINE_MIN_BLOCK_SIZE];
+    tpixel gradient_v[AFFINE_MIN_BLOCK_SIZE * AFFINE_MIN_BLOCK_SIZE];
 
     FUNC(prof_grad_filter)(gradient_h, gradient_v, AFFINE_MIN_BLOCK_SIZE, src, 
MAX_PB_SIZE, AFFINE_MIN_BLOCK_SIZE, AFFINE_MIN_BLOCK_SIZE);
 
@@ -366,7 +363,6 @@ static void FUNC(apply_prof_uni)(uint8_t *_dst, const 
ptrdiff_t _dst_stride, con
             const int di = gradient_h[o] * diff_mv_x[o] + gradient_v[o] * 
diff_mv_y[o];
             const int val = src[x] + av_clip(di, -limit, limit - 1);
             dst[x] = av_clip_pixel((val + offset) >> shift);
-
         }
         src += MAX_PB_SIZE;
         dst += dst_stride;

-- 
To stop receiving notification emails like this one, please contact
[email protected].
_______________________________________________
ffmpeg-cvslog mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to