From 8eed6f2ab92e194f5b4e61e5db8aac51c32f25fc Mon Sep 17 00:00:00 2001 From: Carl-Anton Ingmarsson Date: Tue, 22 Jun 2010 14:25:17 +0200 Subject: [PATCH] vdpauh264dec: fix initialization of fallback scaling matrix --- sys/vdpau/h264/gsth264parser.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/sys/vdpau/h264/gsth264parser.c b/sys/vdpau/h264/gsth264parser.c index 8de7c2fdbc..ea37b944e6 100644 --- a/sys/vdpau/h264/gsth264parser.c +++ b/sys/vdpau/h264/gsth264parser.c @@ -539,11 +539,6 @@ gst_h264_parser_parse_picture (GstH264Parser * parser, guint8 * data, pic = g_slice_new (GstH264Picture); - /* set default values for fields that might not be present in the bitstream - and have valid defaults */ - pic->slice_group_id = NULL; - pic->transform_8x8_mode_flag = 0; - READ_UE_ALLOWED (&reader, pic->id, 0, 255); READ_UE_ALLOWED (&reader, seq_parameter_set_id, 0, 31); seq = g_hash_table_lookup (parser->sequences, &seq_parameter_set_id); @@ -554,6 +549,13 @@ gst_h264_parser_parse_picture (GstH264Parser * parser, guint8 * data, } pic->sequence = seq; + /* set default values for fields that might not be present in the bitstream + and have valid defaults */ + pic->slice_group_id = NULL; + pic->transform_8x8_mode_flag = 0; + memcpy (&pic->scaling_lists_4x4, &seq->scaling_lists_4x4, 96); + memcpy (&pic->scaling_lists_8x8, &seq->scaling_lists_8x8, 384); + READ_UINT8 (&reader, pic->entropy_coding_mode_flag, 1); READ_UINT8 (&reader, pic->pic_order_present_flag, 1); READ_UE_ALLOWED (&reader, pic->num_slice_groups_minus1, 0, 7); @@ -621,9 +623,6 @@ gst_h264_parser_parse_picture (GstH264Parser * parser, guint8 * data, default_8x8_inter, default_8x8_intra, seq->chroma_format_idc)) goto error; } - } else { - memcpy (&pic->scaling_lists_4x4, &seq->scaling_lists_4x4, 96); - memcpy (&pic->scaling_lists_8x8, &seq->scaling_lists_8x8, 384); } READ_SE_ALLOWED (&reader, pic->second_chroma_qp_index_offset, -12, 12);