From 1b9e8a25a0a5f7e161a69a3b98303901c7bed6dc Mon Sep 17 00:00:00 2001 From: Gwenole Beauchesne Date: Sat, 26 Apr 2014 08:08:57 +0200 Subject: [PATCH] codecparsers: h264: fix derivation of default scaling lists. When useDefaultScalingMatrixFlag is computed to be 1 while parsing scaling_list(), then the scaling list shall be inferred to be equal to the default list (7.4.2.1.1.1). That default list is really one of Default_4x4_{Intra,Inter} or Default_8x8_{Intra,Inter} and not one from fall-back rule sets A or B. This fixes parsing for FRExt1_Panasonic_D, FRExt2_Panasonic_C, FRExt3_Panasonic_E and FRExt4_Panasonic_B. https://bugzilla.gnome.org/show_bug.cgi?id=724518 Signed-off-by: Gwenole Beauchesne --- gst-libs/gst/codecparsers/gsth264parser.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/gst-libs/gst/codecparsers/gsth264parser.c b/gst-libs/gst/codecparsers/gsth264parser.c index 619bd78d6c..ae4b147b67 100644 --- a/gst-libs/gst/codecparsers/gsth264parser.c +++ b/gst-libs/gst/codecparsers/gsth264parser.c @@ -364,6 +364,14 @@ gst_h264_parser_parse_scaling_list (NalReader * nr, { guint i; + static const guint8 *default_lists[12] = { + default_4x4_intra, default_4x4_intra, default_4x4_intra, + default_4x4_inter, default_4x4_inter, default_4x4_inter, + default_8x8_intra, default_8x8_inter, + default_8x8_intra, default_8x8_inter, + default_8x8_intra, default_8x8_inter + }; + GST_DEBUG ("parsing scaling lists"); for (i = 0; i < 12; i++) { @@ -397,7 +405,8 @@ gst_h264_parser_parse_scaling_list (NalReader * nr, next_scale = (last_scale + delta_scale) & 0xff; } if (j == 0 && next_scale == 0) { - use_default = TRUE; + /* Use default scaling lists (7.4.2.1.1.1) */ + memcpy (scaling_list, default_lists[i], size); break; } last_scale = scaling_list[j] =