codecs: h265decoder: Don't drain DPB on EOB/EOS/IDR nalu
authorSeungha Yang <seungha@centricular.com>
Mon, 2 Nov 2020 15:57:46 +0000 (00:57 +0900)
committerGStreamer Merge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Mon, 2 Nov 2020 20:20:56 +0000 (20:20 +0000)
DPB bumping decision per end-of-bitstream, end-of-sequence or IDR nal
should done by spec. In short, draining on EOB/EOS/IDR is undefined
behavior as per spec.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1755>

gst-libs/gst/codecs/gsth265decoder.c

index 51b2230..0898452 100644 (file)
@@ -515,7 +515,6 @@ gst_h265_decoder_preprocess_slice (GstH265Decoder * self, GstH265Slice * slice)
 {
   GstH265DecoderPrivate *priv = self->priv;
   const GstH265SliceHdr *slice_hdr = &slice->header;
-  const GstH265NalUnit *nalu = &slice->nalu;
 
   if (priv->current_picture && slice_hdr->first_slice_segment_in_pic_flag) {
     GST_WARNING_OBJECT (self,
@@ -524,11 +523,6 @@ gst_h265_decoder_preprocess_slice (GstH265Decoder * self, GstH265Slice * slice)
     return FALSE;
   }
 
-  if (GST_H265_IS_NAL_TYPE_IDR (nalu->type)) {
-    GST_DEBUG_OBJECT (self, "IDR nalu, clear dpb");
-    gst_h265_decoder_drain_internal (self);
-  }
-
   return TRUE;
 }
 
@@ -648,11 +642,9 @@ gst_h265_decoder_decode_nal (GstH265Decoder * self, GstH265NalUnit * nalu,
       priv->prev_nal_is_eos = FALSE;
       break;
     case GST_H265_NAL_EOB:
-      gst_h265_decoder_drain (GST_VIDEO_DECODER (self));
       priv->new_bitstream = TRUE;
       break;
     case GST_H265_NAL_EOS:
-      gst_h265_decoder_drain (GST_VIDEO_DECODER (self));
       priv->prev_nal_is_eos = TRUE;
       break;
     default: