diff --git a/src/gallium/drivers/d3d12/d3d12_video_dec.cpp b/src/gallium/drivers/d3d12/d3d12_video_dec.cpp index f3a970e4e2b..ea4470339ca 100644 --- a/src/gallium/drivers/d3d12/d3d12_video_dec.cpp +++ b/src/gallium/drivers/d3d12/d3d12_video_dec.cpp @@ -345,7 +345,7 @@ d3d12_video_decoder_decode_bitstream(struct pipe_video_codec *codec, if (pD3D12Dec->m_d3d12DecProfileType == d3d12_video_decode_profile_type_h264) { struct pipe_h264_picture_desc *h264 = (pipe_h264_picture_desc*) picture; - target->interlaced = !h264->pps->sps->frame_mbs_only_flag && (h264->field_pic_flag || /* PAFF */ h264->pps->sps->mb_adaptive_frame_field_flag); /* MBAFF */ + target->interlaced = !h264->pps->sps->frame_mbs_only_flag; } } @@ -1128,15 +1128,13 @@ d3d12_video_decoder_reconfigure_dpb(struct d3d12_video_decoder *pD3D12Dec, uint32_t width; uint32_t height; uint16_t maxDPB; - bool isInterlaced; - d3d12_video_decoder_get_frame_info(pD3D12Dec, &width, &height, &maxDPB, isInterlaced); + d3d12_video_decoder_get_frame_info(pD3D12Dec, &width, &height, &maxDPB); ID3D12Resource *pPipeD3D12DstResource = d3d12_resource_resource(pD3D12VideoBuffer->texture); D3D12_RESOURCE_DESC outputResourceDesc = GetDesc(pPipeD3D12DstResource); - assert(pD3D12VideoBuffer->base.interlaced == isInterlaced); D3D12_VIDEO_FRAME_CODED_INTERLACE_TYPE interlaceTypeRequested = - isInterlaced ? D3D12_VIDEO_FRAME_CODED_INTERLACE_TYPE_FIELD_BASED : D3D12_VIDEO_FRAME_CODED_INTERLACE_TYPE_NONE; + pD3D12VideoBuffer->base.interlaced ? D3D12_VIDEO_FRAME_CODED_INTERLACE_TYPE_FIELD_BASED : D3D12_VIDEO_FRAME_CODED_INTERLACE_TYPE_NONE; if ((pD3D12Dec->m_decodeFormat != outputResourceDesc.Format) || (pD3D12Dec->m_decoderDesc.Configuration.InterlaceType != interlaceTypeRequested)) { // Copy current pD3D12Dec->m_decoderDesc, modify decodeprofile and re-create decoder. @@ -1254,37 +1252,36 @@ d3d12_video_decoder_refresh_dpb_active_references(struct d3d12_video_decoder *pD void d3d12_video_decoder_get_frame_info( - struct d3d12_video_decoder *pD3D12Dec, uint32_t *pWidth, uint32_t *pHeight, uint16_t *pMaxDPB, bool &isInterlaced) + struct d3d12_video_decoder *pD3D12Dec, uint32_t *pWidth, uint32_t *pHeight, uint16_t *pMaxDPB) { *pWidth = 0; *pHeight = 0; *pMaxDPB = 0; - isInterlaced = false; #if D3D12_VIDEO_ANY_DECODER_ENABLED switch (pD3D12Dec->m_d3d12DecProfileType) { #if VIDEO_CODEC_H264DEC case d3d12_video_decode_profile_type_h264: { - d3d12_video_decoder_get_frame_info_h264(pD3D12Dec, pWidth, pHeight, pMaxDPB, isInterlaced); + d3d12_video_decoder_get_frame_info_h264(pD3D12Dec, pWidth, pHeight, pMaxDPB); } break; #endif #if VIDEO_CODEC_H265DEC case d3d12_video_decode_profile_type_hevc: { - d3d12_video_decoder_get_frame_info_hevc(pD3D12Dec, pWidth, pHeight, pMaxDPB, isInterlaced); + d3d12_video_decoder_get_frame_info_hevc(pD3D12Dec, pWidth, pHeight, pMaxDPB); } break; #endif #if VIDEO_CODEC_AV1DEC case d3d12_video_decode_profile_type_av1: { - d3d12_video_decoder_get_frame_info_av1(pD3D12Dec, pWidth, pHeight, pMaxDPB, isInterlaced); + d3d12_video_decoder_get_frame_info_av1(pD3D12Dec, pWidth, pHeight, pMaxDPB); } break; #endif #if VIDEO_CODEC_VP9DEC case d3d12_video_decode_profile_type_vp9: { - d3d12_video_decoder_get_frame_info_vp9(pD3D12Dec, pWidth, pHeight, pMaxDPB, &isInterlaced); + d3d12_video_decoder_get_frame_info_vp9(pD3D12Dec, pWidth, pHeight, pMaxDPB); } break; #endif default: diff --git a/src/gallium/drivers/d3d12/d3d12_video_dec.h b/src/gallium/drivers/d3d12/d3d12_video_dec.h index b79aac8189f..cf8bab50f36 100644 --- a/src/gallium/drivers/d3d12/d3d12_video_dec.h +++ b/src/gallium/drivers/d3d12/d3d12_video_dec.h @@ -240,7 +240,7 @@ d3d12_video_decoder_reconfigure_dpb(struct d3d12_video_decoder * const d3d12_video_decode_output_conversion_arguments &conversionArguments); void d3d12_video_decoder_get_frame_info( - struct d3d12_video_decoder *pD3D12Dec, uint32_t *pWidth, uint32_t *pHeight, uint16_t *pMaxDPB, bool &isInterlaced); + struct d3d12_video_decoder *pD3D12Dec, uint32_t *pWidth, uint32_t *pHeight, uint16_t *pMaxDPB); void d3d12_video_decoder_store_converted_dxva_picparams_from_pipe_input(struct d3d12_video_decoder *codec, struct pipe_picture_desc * picture, diff --git a/src/gallium/drivers/d3d12/d3d12_video_dec_av1.cpp b/src/gallium/drivers/d3d12/d3d12_video_dec_av1.cpp index 1fdbe1f979d..ef6a4e2dd34 100644 --- a/src/gallium/drivers/d3d12/d3d12_video_dec_av1.cpp +++ b/src/gallium/drivers/d3d12/d3d12_video_dec_av1.cpp @@ -57,7 +57,7 @@ d3d12_video_decoder_refresh_dpb_active_references_av1(struct d3d12_video_decoder void d3d12_video_decoder_get_frame_info_av1( - struct d3d12_video_decoder *pD3D12Dec, uint32_t *pWidth, uint32_t *pHeight, uint16_t *pMaxDPB, bool &isInterlaced) + struct d3d12_video_decoder *pD3D12Dec, uint32_t *pWidth, uint32_t *pHeight, uint16_t *pMaxDPB) { auto pPicParams = d3d12_video_decoder_get_current_dxva_picparams(pD3D12Dec); /* width, height @@ -75,7 +75,6 @@ d3d12_video_decoder_get_frame_info_av1( Each frame may pick up to 7 reference frames (frame_refs[]) from the pool to use for inter prediction of the current frame. */ *pMaxDPB = 8 + 1 /*current picture*/; - isInterlaced = false; } void diff --git a/src/gallium/drivers/d3d12/d3d12_video_dec_av1.h b/src/gallium/drivers/d3d12/d3d12_video_dec_av1.h index 24501c0647d..2027a18f713 100644 --- a/src/gallium/drivers/d3d12/d3d12_video_dec_av1.h +++ b/src/gallium/drivers/d3d12/d3d12_video_dec_av1.h @@ -334,7 +334,7 @@ d3d12_video_decoder_refresh_dpb_active_references_av1(struct d3d12_video_decoder void d3d12_video_decoder_get_frame_info_av1( - struct d3d12_video_decoder *pD3D12Dec, uint32_t *pWidth, uint32_t *pHeight, uint16_t *pMaxDPB, bool &isInterlaced); + struct d3d12_video_decoder *pD3D12Dec, uint32_t *pWidth, uint32_t *pHeight, uint16_t *pMaxDPB); DXVA_PicParams_AV1 d3d12_video_decoder_dxva_picparams_from_pipe_picparams_av1( diff --git a/src/gallium/drivers/d3d12/d3d12_video_dec_h264.cpp b/src/gallium/drivers/d3d12/d3d12_video_dec_h264.cpp index b2ba785b114..b05f436ab90 100644 --- a/src/gallium/drivers/d3d12/d3d12_video_dec_h264.cpp +++ b/src/gallium/drivers/d3d12/d3d12_video_dec_h264.cpp @@ -72,7 +72,7 @@ d3d12_video_decoder_refresh_dpb_active_references_h264(struct d3d12_video_decode void d3d12_video_decoder_get_frame_info_h264( - struct d3d12_video_decoder *pD3D12Dec, uint32_t *pWidth, uint32_t *pHeight, uint16_t *pMaxDPB, bool &isInterlaced) + struct d3d12_video_decoder *pD3D12Dec, uint32_t *pWidth, uint32_t *pHeight, uint16_t *pMaxDPB) { auto pPicParams = d3d12_video_decoder_get_current_dxva_picparams(pD3D12Dec); // wFrameWidthInMbsMinus1 Width of the frame containing this picture, in units of macroblocks, minus 1. (The width in @@ -85,7 +85,6 @@ d3d12_video_decoder_get_frame_info_h264( *pHeight = (2 - pPicParams->frame_mbs_only_flag) * *pHeight; *pHeight = *pHeight * 16; *pMaxDPB = pPicParams->num_ref_frames + 1; - isInterlaced = !pPicParams->frame_mbs_only_flag; } /// diff --git a/src/gallium/drivers/d3d12/d3d12_video_dec_h264.h b/src/gallium/drivers/d3d12/d3d12_video_dec_h264.h index 3b39b996aa0..a3c816e11eb 100644 --- a/src/gallium/drivers/d3d12/d3d12_video_dec_h264.h +++ b/src/gallium/drivers/d3d12/d3d12_video_dec_h264.h @@ -203,7 +203,7 @@ d3d12_video_decoder_dxva_picparams_from_pipe_picparams_h264(uint32_t pipe_h264_picture_desc *pipeDesc); void d3d12_video_decoder_get_frame_info_h264( - struct d3d12_video_decoder *pD3D12Dec, uint32_t *pWidth, uint32_t *pHeight, uint16_t *pMaxDPB, bool &isInterlaced); + struct d3d12_video_decoder *pD3D12Dec, uint32_t *pWidth, uint32_t *pHeight, uint16_t *pMaxDPB); void d3d12_video_decoder_prepare_current_frame_references_h264(struct d3d12_video_decoder *pD3D12Dec, ID3D12Resource * pTexture2D, diff --git a/src/gallium/drivers/d3d12/d3d12_video_dec_hevc.cpp b/src/gallium/drivers/d3d12/d3d12_video_dec_hevc.cpp index a501d885fa7..3511e3acbe5 100644 --- a/src/gallium/drivers/d3d12/d3d12_video_dec_hevc.cpp +++ b/src/gallium/drivers/d3d12/d3d12_video_dec_hevc.cpp @@ -75,14 +75,13 @@ LengthFromMinCb(int length, int cbsize) void d3d12_video_decoder_get_frame_info_hevc( - struct d3d12_video_decoder *pD3D12Dec, uint32_t *pWidth, uint32_t *pHeight, uint16_t *pMaxDPB, bool &isInterlaced) + struct d3d12_video_decoder *pD3D12Dec, uint32_t *pWidth, uint32_t *pHeight, uint16_t *pMaxDPB) { auto pPicParams = d3d12_video_decoder_get_current_dxva_picparams(pD3D12Dec); UINT log2_min_luma_coding_block_size = pPicParams->log2_min_luma_coding_block_size_minus3 + 3; *pWidth = LengthFromMinCb(pPicParams->PicWidthInMinCbsY, log2_min_luma_coding_block_size); *pHeight = LengthFromMinCb(pPicParams->PicHeightInMinCbsY, log2_min_luma_coding_block_size); *pMaxDPB = pPicParams->sps_max_dec_pic_buffering_minus1 + 1; - isInterlaced = false; } /// diff --git a/src/gallium/drivers/d3d12/d3d12_video_dec_hevc.h b/src/gallium/drivers/d3d12/d3d12_video_dec_hevc.h index fad499e9bcf..0804330b631 100644 --- a/src/gallium/drivers/d3d12/d3d12_video_dec_hevc.h +++ b/src/gallium/drivers/d3d12/d3d12_video_dec_hevc.h @@ -216,7 +216,7 @@ d3d12_video_decoder_dxva_picparams_from_pipe_picparams_hevc(struct d3d12_video_d pipe_h265_picture_desc * pipeDesc); void d3d12_video_decoder_get_frame_info_hevc( - struct d3d12_video_decoder *pD3D12Dec, uint32_t *pWidth, uint32_t *pHeight, uint16_t *pMaxDPB, bool &isInterlaced); + struct d3d12_video_decoder *pD3D12Dec, uint32_t *pWidth, uint32_t *pHeight, uint16_t *pMaxDPB); void d3d12_video_decoder_prepare_current_frame_references_hevc(struct d3d12_video_decoder *pD3D12Dec, ID3D12Resource * pTexture2D, diff --git a/src/gallium/drivers/d3d12/d3d12_video_dec_vp9.cpp b/src/gallium/drivers/d3d12/d3d12_video_dec_vp9.cpp index 0e7c5b45c35..bfc389914a6 100644 --- a/src/gallium/drivers/d3d12/d3d12_video_dec_vp9.cpp +++ b/src/gallium/drivers/d3d12/d3d12_video_dec_vp9.cpp @@ -62,7 +62,7 @@ d3d12_video_decoder_refresh_dpb_active_references_vp9(struct d3d12_video_decoder void d3d12_video_decoder_get_frame_info_vp9( - struct d3d12_video_decoder *pD3D12Dec, uint32_t *pWidth, uint32_t *pHeight, uint16_t *pMaxDPB, bool *pIsInterlaced) + struct d3d12_video_decoder *pD3D12Dec, uint32_t *pWidth, uint32_t *pHeight, uint16_t *pMaxDPB) { auto pPicParams = d3d12_video_decoder_get_current_dxva_picparams(pD3D12Dec); *pWidth = pPicParams->width; @@ -74,7 +74,6 @@ d3d12_video_decoder_get_frame_info_vp9( Golden, and AltRef) of the current frame. */ *pMaxDPB = 8 + 1 /*current picture*/; - *pIsInterlaced = false; } void diff --git a/src/gallium/drivers/d3d12/d3d12_video_dec_vp9.h b/src/gallium/drivers/d3d12/d3d12_video_dec_vp9.h index 24aa032ef0b..b51344e2fa1 100644 --- a/src/gallium/drivers/d3d12/d3d12_video_dec_vp9.h +++ b/src/gallium/drivers/d3d12/d3d12_video_dec_vp9.h @@ -140,7 +140,7 @@ d3d12_video_decoder_refresh_dpb_active_references_vp9(struct d3d12_video_decoder void d3d12_video_decoder_get_frame_info_vp9( - struct d3d12_video_decoder *pD3D12Dec, uint32_t *pWidth, uint32_t *pHeight, uint16_t *pMaxDPB, bool *pIsInterlaced); + struct d3d12_video_decoder *pD3D12Dec, uint32_t *pWidth, uint32_t *pHeight, uint16_t *pMaxDPB); DXVA_PicParams_VP9 d3d12_video_decoder_dxva_picparams_from_pipe_picparams_vp9(