[FFmpeg-devel] [PATCH v2] avcodec/h264: fix stride calculation in slice_table for multi-slice field video deblocking

Lingyi Kong konglingyi at visionular.com
Fri Dec 20 07:19:55 EET 2024


fix for https://trac.ffmpeg.org/ticket/11360

Signed-off-by: Lingyi Kong <konglingyi at visionular.com>
---
 libavcodec/h264_mb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/h264_mb.c b/libavcodec/h264_mb.c
index 4e94136313..6083f7ad84 100644
--- a/libavcodec/h264_mb.c
+++ b/libavcodec/h264_mb.c
@@ -529,7 +529,7 @@ static av_always_inline void xchg_mb_border(const H264Context *h, H264SliceConte
     }
 
     if (sl->deblocking_filter == 2) {
-        deblock_topleft = h->slice_table[sl->mb_xy - 1 - h->mb_stride] == sl->slice_num;
+        deblock_topleft = h->slice_table[sl->mb_xy - 1 - (h->mb_stride << MB_FIELD(sl))] == sl->slice_num;
         deblock_top     = sl->top_type;
     } else {
         deblock_topleft = (sl->mb_x > 0);
-- 
2.43.0



More information about the ffmpeg-devel mailing list