codecs: h265decoder: Don't drain DPB on EOB/EOS/IDR nalu

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>
This commit is contained in:
Seungha Yang 2020-11-03 00:57:46 +09:00 committed by GStreamer Merge Bot
parent 849b7a315c
commit 16b4fe3d0b

View 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: