va: h265dec: Add current picture into reference list for SCC.
authorHe Junyan <junyan.he@intel.com>
Mon, 17 May 2021 11:06:34 +0000 (19:06 +0800)
committerVíctor Manuel Jáquez Leal <vjaquez@igalia.com>
Tue, 25 May 2021 10:11:05 +0000 (12:11 +0200)
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: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2255>

sys/va/gstvah265dec.c

index 795e87d..1e60e6b 100644 (file)
@@ -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]);
   }