From 4fca9d96991bd70f75be9cfa2b3b4ccf1208bf5e Mon Sep 17 00:00:00 2001 From: David Rosca Date: Tue, 6 May 2025 16:40:26 +0200 Subject: [PATCH] pipe/video: Remove st_rps_bits and UseStRpsBits Reviewed-By: Sil Vilerino Reviewed-by: Ruijing Dong Part-of: --- src/gallium/drivers/d3d12/d3d12_video_dec_hevc.cpp | 2 +- src/gallium/drivers/radeonsi/radeon_vcn_dec.c | 4 ++-- src/gallium/drivers/virgl/virgl_video.c | 2 -- src/gallium/frontends/va/picture_hevc.c | 4 +--- src/gallium/frontends/vdpau/decode.c | 1 - src/gallium/include/pipe/p_video_state.h | 2 -- 6 files changed, 4 insertions(+), 11 deletions(-) diff --git a/src/gallium/drivers/d3d12/d3d12_video_dec_hevc.cpp b/src/gallium/drivers/d3d12/d3d12_video_dec_hevc.cpp index 9425636e346..763bedb7dba 100644 --- a/src/gallium/drivers/d3d12/d3d12_video_dec_hevc.cpp +++ b/src/gallium/drivers/d3d12/d3d12_video_dec_hevc.cpp @@ -416,7 +416,7 @@ d3d12_video_decoder_dxva_picparams_from_pipe_picparams_hevc( // NumDeltaPocsOfRefRpsIdx is not passed from VA to pipe, and VA doesn't have it defined in their va_dec_hevc header. // DXVA drivers should use wNumBitsForShortTermRPSInSlice (st_rps_bits in VA) to derive the slice header info instead dxvaStructure.ucNumDeltaPocsOfRefRpsIdx = static_cast(pPipeDesc->NumDeltaPocsOfRefRpsIdx); - dxvaStructure.wNumBitsForShortTermRPSInSlice = pps->st_rps_bits; + dxvaStructure.wNumBitsForShortTermRPSInSlice = static_cast(pPipeDesc->NumShortTermPictureSliceHeaderBits); dxvaStructure.scaling_list_enabled_flag = sps->scaling_list_enabled_flag; dxvaStructure.amp_enabled_flag = sps->amp_enabled_flag; diff --git a/src/gallium/drivers/radeonsi/radeon_vcn_dec.c b/src/gallium/drivers/radeonsi/radeon_vcn_dec.c index 74b5ccbdbfd..942038dddb2 100644 --- a/src/gallium/drivers/radeonsi/radeon_vcn_dec.c +++ b/src/gallium/drivers/radeonsi/radeon_vcn_dec.c @@ -261,9 +261,9 @@ static rvcn_dec_message_hevc_t get_h265_msg(struct radeon_decoder *dec, result.sps_info_flags |= pic->pps->sps->separate_colour_plane_flag << 8; if (((struct si_screen *)dec->screen)->info.family == CHIP_CARRIZO) result.sps_info_flags |= 1 << 9; - if (pic->UseStRpsBits == true && pic->pps->st_rps_bits != 0) { + if (pic->NumShortTermPictureSliceHeaderBits != 0) { result.sps_info_flags |= 1 << 11; - result.st_rps_bits = pic->pps->st_rps_bits; + result.st_rps_bits = pic->NumShortTermPictureSliceHeaderBits; } result.chroma_format = pic->pps->sps->chroma_format_idc; diff --git a/src/gallium/drivers/virgl/virgl_video.c b/src/gallium/drivers/virgl/virgl_video.c index 6f56467075e..1e09ac04848 100644 --- a/src/gallium/drivers/virgl/virgl_video.c +++ b/src/gallium/drivers/virgl/virgl_video.c @@ -377,7 +377,6 @@ static int fill_h265_picture_desc(const struct pipe_picture_desc *desc, ITEM_SET(&vh265->pps, h265->pps, lists_modification_present_flag); ITEM_SET(&vh265->pps, h265->pps, log2_parallel_merge_level_minus2); ITEM_SET(&vh265->pps, h265->pps, slice_segment_header_extension_present_flag); - ITEM_SET(&vh265->pps, h265->pps, st_rps_bits); ITEM_SET(vh265, h265, IDRPicFlag); ITEM_SET(vh265, h265, RAPPicFlag); @@ -401,7 +400,6 @@ static int fill_h265_picture_desc(const struct pipe_picture_desc *desc, ITEM_CPY(vh265, h265, RefPicSetStCurrAfter); ITEM_CPY(vh265, h265, RefPicSetLtCurr); ITEM_CPY(vh265, h265, RefPicList); - ITEM_SET(vh265, h265, UseStRpsBits); return 0; } diff --git a/src/gallium/frontends/va/picture_hevc.c b/src/gallium/frontends/va/picture_hevc.c index 741fafc038b..96242db3ac5 100644 --- a/src/gallium/frontends/va/picture_hevc.c +++ b/src/gallium/frontends/va/picture_hevc.c @@ -213,9 +213,7 @@ void vlVaHandlePictureParameterBufferHEVC(vlVaDriver *drv, vlVaContext *context, vlVaSortRefPicSet(context, context->desc.h265.RefPicSetStCurrAfter, context->desc.h265.NumPocStCurrAfter, true); context->desc.h265.LtCurrDone = context->desc.h265.NumPocLtCurr < 2; - context->desc.h265.pps->st_rps_bits = hevc->st_rps_bits; context->desc.h265.NumShortTermPictureSliceHeaderBits = hevc->st_rps_bits; - context->desc.h265.UseStRpsBits = true; context->desc.h265.slice_parameter.slice_count = 0; context->desc.h265.slice_parameter.slice_info_present = false; @@ -374,7 +372,7 @@ void vlVaDecoderHEVCBitstreamHeader(vlVaContext *context, vlVaBuffer *buf) if (nal_unit_type != PIPE_H265_NAL_IDR_W_RADL && nal_unit_type != PIPE_H265_NAL_IDR_N_LP) { vl_rbsp_u(&rbsp, sps->log2_max_pic_order_cnt_lsb_minus4 + 4); /* slice_pic_order_cnt_lsb */ if (!vl_rbsp_u(&rbsp, 1)) { /* short_term_ref_pic_set_sps_flag */ - for (uint8_t i = 0; i < pps->st_rps_bits; i++) + for (unsigned i = 0; i < pic->NumShortTermPictureSliceHeaderBits; i++) vl_rbsp_u(&rbsp, 1); } else if (sps->num_short_term_ref_pic_sets > 1) { vl_rbsp_u(&rbsp, util_logbase2_ceil(sps->num_short_term_ref_pic_sets)); /* short_term_ref_pic_set_idx */ diff --git a/src/gallium/frontends/vdpau/decode.c b/src/gallium/frontends/vdpau/decode.c index f20991c1808..8c975b2789b 100644 --- a/src/gallium/frontends/vdpau/decode.c +++ b/src/gallium/frontends/vdpau/decode.c @@ -527,7 +527,6 @@ vlVdpDecoderRenderH265(struct pipe_h265_picture_desc *picture, memcpy(picture->RefPicSetStCurrBefore, picture_info->RefPicSetStCurrBefore, 8); memcpy(picture->RefPicSetStCurrAfter, picture_info->RefPicSetStCurrAfter, 8); memcpy(picture->RefPicSetLtCurr, picture_info->RefPicSetLtCurr, 8); - picture->UseStRpsBits = false; return VDP_STATUS_OK; } diff --git a/src/gallium/include/pipe/p_video_state.h b/src/gallium/include/pipe/p_video_state.h index c83b0506ff3..ce1d716c1ec 100644 --- a/src/gallium/include/pipe/p_video_state.h +++ b/src/gallium/include/pipe/p_video_state.h @@ -1669,7 +1669,6 @@ struct pipe_h265_pps uint8_t lists_modification_present_flag; uint8_t log2_parallel_merge_level_minus2; uint8_t slice_segment_header_extension_present_flag; - uint16_t st_rps_bits; }; struct pipe_h265_picture_desc @@ -1707,7 +1706,6 @@ struct pipe_h265_picture_desc uint8_t RefPicSetStCurrAfter[8]; uint8_t RefPicSetLtCurr[8]; uint8_t RefPicList[2][15]; - bool UseStRpsBits; bool LtCurrDone; struct