From c4bb5f06c9be56f5e9ee92ff8c1f2408b28e3444 Mon Sep 17 00:00:00 2001 From: He Junyan Date: Mon, 17 May 2021 19:06:34 +0800 Subject: [PATCH] va: h265dec: Add current picture into reference list for SCC. The current picture is not in the DPB, so we need to add it manually to the reference list when SCC is enabled. Part-of: --- sys/va/gstvah265dec.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/sys/va/gstvah265dec.c b/sys/va/gstvah265dec.c index 795e87de42..1e60e6b5db 100644 --- a/sys/va/gstvah265dec.c +++ b/sys/va/gstvah265dec.c @@ -760,6 +760,20 @@ gst_va_h265_dec_start_picture (GstH265Decoder * decoder, } g_array_unref (ref_list); + /* 7.4.3.3.3, the current decoded picture is marked as "used for + long-term reference". Current picture is not in the DPB now. */ + if (pps->pps_scc_extension_params.pps_curr_pic_ref_enabled_flag && i < 15) { + pic_param->base.ReferenceFrames[i].picture_id = + gst_va_decode_picture_get_surface (gst_h265_picture_get_user_data + (picture)); + pic_param->base.ReferenceFrames[i].pic_order_cnt = picture->pic_order_cnt; + pic_param->base.ReferenceFrames[i].flags |= + VA_PICTURE_HEVC_LONG_TERM_REFERENCE; + pic_param->base.ReferenceFrames[i].flags |= + _find_frame_rps_type (decoder, picture); + i++; + } + for (; i < 15; i++) _init_vaapi_pic (&pic_param->base.ReferenceFrames[i]); }