From: GuYanjie Date: Tue, 8 Mar 2022 06:54:34 +0000 (+0800) Subject: vaapih265dec: fixed st_rps_bits setting in h265 decoding. X-Git-Tag: 1.22.0~2209 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f39174fbc44333c75d1fb498280b5f19def5b83f;p=platform%2Fupstream%2Fgstreamer.git vaapih265dec: fixed st_rps_bits setting in h265 decoding. According to va_dec_hevc.h, pic_param->st_rps_bits should be set for accelorater to skip parsing the *short_term_ref_pic_set (num_short_term_ref_pic_sets) structure. Also modified fill_picture to get parser info as a parameter, in order to get slide_hdr->short_term_ref_pic_set_size. Part-of: --- diff --git a/subprojects/gstreamer-vaapi/gst-libs/gst/vaapi/gstvaapidecoder_h265.c b/subprojects/gstreamer-vaapi/gst-libs/gst/vaapi/gstvaapidecoder_h265.c index 218a25b..c8cad23 100644 --- a/subprojects/gstreamer-vaapi/gst-libs/gst/vaapi/gstvaapidecoder_h265.c +++ b/subprojects/gstreamer-vaapi/gst-libs/gst/vaapi/gstvaapidecoder_h265.c @@ -1889,10 +1889,12 @@ get_index_for_RefPicListX (VAPictureHEVC * ReferenceFrames, } static gboolean -fill_picture (GstVaapiDecoderH265 * decoder, GstVaapiPictureH265 * picture) +fill_picture (GstVaapiDecoderH265 * decoder, GstVaapiPictureH265 * picture, + GstVaapiParserInfoH265 * pi) { GstVaapiDecoderH265Private *const priv = &decoder->priv; GstVaapiPicture *const base_picture = &picture->base; + GstH265SliceHdr *const slice_hdr = &pi->data.slice_hdr; GstH265PPS *const pps = get_pps (decoder); GstH265SPS *const sps = get_sps (decoder); VAPictureParameterBufferHEVC *pic_param = base_picture->param; @@ -2034,8 +2036,10 @@ fill_picture (GstVaapiDecoderH265 * decoder, GstVaapiPictureH265 * picture) pic_param->pps_tc_offset_div2 = pps->tc_offset_div2; COPY_FIELD (pps, num_extra_slice_header_bits); - /* FIXME: Set correct value as mentioned in va_dec_hevc.h */ - pic_param->st_rps_bits = 0; + if (slice_hdr->short_term_ref_pic_set_sps_flag == 0) + pic_param->st_rps_bits = slice_hdr->short_term_ref_pic_set_size; + else + pic_param->st_rps_bits = 0; #if VA_CHECK_VERSION(1,2,0) if (pic_rext_param) { @@ -2497,7 +2501,7 @@ decode_picture (GstVaapiDecoderH265 * decoder, GstVaapiDecoderUnit * unit) if (!dpb_init (decoder, picture, pi)) return GST_VAAPI_DECODER_STATUS_ERROR_UNKNOWN; - if (!fill_picture (decoder, picture)) + if (!fill_picture (decoder, picture, pi)) return GST_VAAPI_DECODER_STATUS_ERROR_UNKNOWN; priv->decoder_state = pi->state;