From 0551d68bbb3266b1a6440429d92c5e22fd054e36 Mon Sep 17 00:00:00 2001 From: Seungha Yang Date: Sun, 8 Nov 2020 19:08:25 +0900 Subject: [PATCH] d3d11h264dec: Fix for MbaffFrameFlag and FrameNumList As per spec 7.4.3 Slice header semantics, the flag value is derived as MbaffFrameFlag = (mb_adaptive_frame_field_flag && !field_pic_flag) and DXVA uses the value. Regarding FrameNumList, in case of long-term ref, FrameNumList[i] value should be long_term_frame_idx not long_term_pic_num. Part-of: --- sys/d3d11/gstd3d11h264dec.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/d3d11/gstd3d11h264dec.c b/sys/d3d11/gstd3d11h264dec.c index 5946e93..4cd0a87 100644 --- a/sys/d3d11/gstd3d11h264dec.c +++ b/sys/d3d11/gstd3d11h264dec.c @@ -578,7 +578,7 @@ gst_d3d11_h264_dec_start_picture (GstH264Decoder * decoder, self->field_order_cnt_list[i][0] = other->top_field_order_cnt; self->field_order_cnt_list[i][1] = other->bottom_field_order_cnt; self->frame_num_list[i] = self->ref_frame_list[i].AssociatedFlag - ? other->long_term_pic_num : other->frame_num; + ? other->long_term_frame_idx : other->frame_num; self->used_for_reference_flags |= ref << (2 * i); self->non_existing_frame_flags |= (other->nonexisting) << i; } @@ -904,7 +904,7 @@ gst_d3d11_h264_dec_picture_params_from_sps (GstD3D11H264Dec * self, params->wFrameWidthInMbsMinus1 = sps->pic_width_in_mbs_minus1; params->wFrameHeightInMbsMinus1 = sps->pic_height_in_map_units_minus1; params->residual_colour_transform_flag = sps->separate_colour_plane_flag; - params->MbaffFrameFlag = sps->mb_adaptive_frame_field_flag && field_pic; + params->MbaffFrameFlag = (sps->mb_adaptive_frame_field_flag && !field_pic); params->field_pic_flag = field_pic; params->MinLumaBipredSize8x8Flag = sps->level_idc >= 31; -- 2.7.4