decoder: hevc: Fix the decoding of dependent slice segment
authorSreerenj Balachandran <sreerenj.balachandran@intel.com>
Wed, 5 Aug 2015 02:23:20 +0000 (05:23 +0300)
committerSreerenj Balachandran <sreerenj.balachandran@intel.com>
Wed, 5 Aug 2015 02:23:20 +0000 (05:23 +0300)
Decoding process for reference picture list construction needs to be
invoked only for P and B slice and the value for slice_type of dependent slice
segment should be taken from the previous independent slice segment header
of the same pic.

https://bugzilla.gnome.org/show_bug.cgi?id=753226

Signed-off-by: Sreerenj Balachandran <sreerenj.balachandran@intel.com>
gst-libs/gst/vaapi/gstvaapidecoder_h265.c

index 25d0ebe..4767fbc 100644 (file)
@@ -1620,10 +1620,6 @@ init_picture_refs (GstVaapiDecoderH265 * decoder,
   memset (priv->RefPicList1, 0, sizeof (GstVaapiPictureH265 *) * 16);
   priv->RefPicList0_count = priv->RefPicList1_count = 0;
 
-  if ((slice_hdr->type != GST_H265_B_SLICE) &&
-      (slice_hdr->type != GST_H265_P_SLICE))
-    return;
-
   if (slice_hdr->dependent_slice_segment_flag) {
     GstH265SliceHdr *tmp = &priv->prev_independent_slice_pi->data.slice_hdr;
     num_ref_idx_l0_active_minus1 = tmp->num_ref_idx_l0_active_minus1;
@@ -1637,6 +1633,11 @@ init_picture_refs (GstVaapiDecoderH265 * decoder,
     type = slice_hdr->type;
   }
 
+  /* decoding process for reference picture list construction needs to be
+   * invoked only for P and B slice */
+  if (type == GST_H265_I_SLICE)
+    return;
+
   NumRpsCurrTempList0 =
       MAX ((num_ref_idx_l0_active_minus1 + 1), priv->NumPocTotalCurr);
   NumRpsCurrTempList1 =