avcodec/h264: fix stride calculation in slice_table for multi-slice field video deblocking

fix for https://trac.ffmpeg.org/ticket/11360
A new fate test case is added to validate the fix, the smaple file is located at https://trac.ffmpeg.org/attachment/ticket/11360/slice2_field_aurora4.264.

Signed-off-by: Lingyi Kong <konglingyi@visionular.com>
This commit is contained in:
Lingyi Kong 2024-12-24 18:35:50 +08:00 committed by Kieran Kunhya
parent bb033e6910
commit 504df09c34
3 changed files with 58 additions and 1 deletions

View file

@ -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);

View file

@ -184,6 +184,7 @@ FATE_H264 = aud_mw_e \
sva_fm1_e \
sva_nl1_b \
sva_nl2_e \
slice2_field_aurora4 \
$(if $(CONFIG_SCALE_FILTER),$(FATE_H264_HIGH_BIT_DEPTH))
FATE_H264_REINIT_TESTS := large_420_8-to-small_420_8 \
@ -432,6 +433,7 @@ fate-h264-conformance-sva_cl1_e: CMD = framecrc -i $(TARGET_SAM
fate-h264-conformance-sva_fm1_e: CMD = framecrc -i $(TARGET_SAMPLES)/h264-conformance/SVA_FM1_E.264
fate-h264-conformance-sva_nl1_b: CMD = framecrc -i $(TARGET_SAMPLES)/h264-conformance/SVA_NL1_B.264
fate-h264-conformance-sva_nl2_e: CMD = framecrc -i $(TARGET_SAMPLES)/h264-conformance/SVA_NL2_E.264
fate-h264-conformance-slice2_field_aurora4: CMD = framecrc -i $(TARGET_SAMPLES)/h264-conformance/slice2_field_aurora4.264
fate-h264-bsf-mp4toannexb: CMD = md5 -i $(TARGET_SAMPLES)/h264/interlaced_crop.mp4 -c:v copy -f h264
# First IDR is prefixed by SPS/PPS

View file

@ -0,0 +1,55 @@
#tb 0: 1001/15000
#media_type 0: video
#codec_id 0: rawvideo
#dimensions 0: 352x288
#sar 0: 128/117
0, 0, 0, 1, 152064, 0xc7f514e8
0, 1, 1, 1, 152064, 0xa07f55fe
0, 2, 2, 1, 152064, 0xa72df0ab
0, 3, 3, 1, 152064, 0xd7aa10d4
0, 4, 4, 1, 152064, 0xd7b2421b
0, 5, 5, 1, 152064, 0x16b8ca60
0, 6, 6, 1, 152064, 0x747fed7e
0, 7, 7, 1, 152064, 0xa9a7396e
0, 8, 8, 1, 152064, 0x452623f8
0, 9, 9, 1, 152064, 0xe35bdb3b
0, 10, 10, 1, 152064, 0x8a18d050
0, 11, 11, 1, 152064, 0x966836b4
0, 12, 12, 1, 152064, 0x4cff9812
0, 13, 13, 1, 152064, 0x7e4dab3f
0, 14, 14, 1, 152064, 0x99276308
0, 15, 15, 1, 152064, 0x4dc8a241
0, 16, 16, 1, 152064, 0xe923b293
0, 17, 17, 1, 152064, 0xb3d719f5
0, 18, 18, 1, 152064, 0xec05258f
0, 19, 19, 1, 152064, 0x0a49c42f
0, 20, 20, 1, 152064, 0x4dfaee5d
0, 21, 21, 1, 152064, 0x8ce0ad44
0, 22, 22, 1, 152064, 0x91a2e261
0, 23, 23, 1, 152064, 0xb3a245db
0, 24, 24, 1, 152064, 0x135905fd
0, 25, 25, 1, 152064, 0x7e1a7dab
0, 26, 26, 1, 152064, 0xb97a6948
0, 27, 27, 1, 152064, 0x0fd18d91
0, 28, 28, 1, 152064, 0x650f4983
0, 29, 29, 1, 152064, 0x6e84cd98
0, 30, 30, 1, 152064, 0x405a8273
0, 31, 31, 1, 152064, 0x7aeea990
0, 32, 32, 1, 152064, 0x5b49684e
0, 33, 33, 1, 152064, 0x09d2b406
0, 34, 34, 1, 152064, 0xdc6fa34d
0, 35, 35, 1, 152064, 0x22f1a88f
0, 36, 36, 1, 152064, 0xeaa20ff5
0, 37, 37, 1, 152064, 0xe7c633e6
0, 38, 38, 1, 152064, 0x5e03a598
0, 39, 39, 1, 152064, 0x8a379e6f
0, 40, 40, 1, 152064, 0x915fb502
0, 41, 41, 1, 152064, 0x580d43ae
0, 42, 42, 1, 152064, 0x254f3f8c
0, 43, 43, 1, 152064, 0xe2ae9b29
0, 44, 44, 1, 152064, 0x69aa8934
0, 45, 45, 1, 152064, 0xa819d959
0, 46, 46, 1, 152064, 0xe1b3a9c0
0, 47, 47, 1, 152064, 0x3c1824d4
0, 48, 48, 1, 152064, 0x7ad0e291
0, 49, 49, 1, 152064, 0x2a4671f0