codecs: Reset the quant matrices for each sequence in mpeg2 decoder.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1929>
This commit is contained in:
He Junyan 2020-12-30 23:00:51 +08:00 committed by Víctor Manuel Jáquez Leal
parent 08b1485862
commit 339a816c81

View file

@ -447,6 +447,11 @@ gst_mpeg2_decoder_handle_sequence (GstMpeg2Decoder * decoder,
return FALSE;
}
/* 6.1.1.6 Sequence header
The quantisation matrices may be redefined each time that a sequence
header occurs in the bitstream */
priv->quant_matrix = QUANT_MATRIX_EXT_INIT;
if (_seq_hdr_is_valid (&priv->seq_hdr) &&
memcmp (&priv->seq_hdr, &seq_hdr, sizeof (seq_hdr)) == 0)
return TRUE;
@ -454,7 +459,6 @@ gst_mpeg2_decoder_handle_sequence (GstMpeg2Decoder * decoder,
priv->seq_ext = SEQ_EXT_INIT;
priv->seq_display_ext = SEQ_DISPLAY_EXT_INIT;
priv->seq_scalable_ext = SEQ_SCALABLE_EXT_INIT;
priv->quant_matrix = QUANT_MATRIX_EXT_INIT;
priv->pic_ext = PIC_HDR_EXT_INIT;
priv->seq_hdr = seq_hdr;