From: Gwenole Beauchesne Date: Mon, 2 Apr 2012 16:42:12 +0000 (+0200) Subject: mpeg2: fix calculation of macroblock_offset. X-Git-Tag: 0.3.7~12 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=49b1dca2d37f42e105ab735be5615cdaa8c35243;p=platform%2Fupstream%2Fgstreamer-vaapi.git mpeg2: fix calculation of macroblock_offset. Fix decoding of streams with extra slice() information before the first macroblock(). e.g. this fixes sony-ct3.bs from conformance test. --- diff --git a/NEWS b/NEWS index 17867ef..05c54ca 100644 --- a/NEWS +++ b/NEWS @@ -5,7 +5,8 @@ Copyright (C) 2011 Collabora Version 0.3.7 - DD.Apr.2012 * Fix vaapidecode to report unsupported codec profiles -* Fix decoding of MPEG-2 High profile streams compatible with Main profile +* Fix MPEG-2 decoding of streams with extra slice() information +* Fix MPEG-2 decoding of High profile streams compatible with Main profile * Don't forcibly resize user provided X windows (Holger Kaelberer) * Recalculate render rect only if caps are negotiated (Holger Kaelberer) diff --git a/gst-libs/gst/vaapi/gstvaapidecoder_mpeg2.c b/gst-libs/gst/vaapi/gstvaapidecoder_mpeg2.c index 3333c2e..38ecb33 100644 --- a/gst-libs/gst/vaapi/gstvaapidecoder_mpeg2.c +++ b/gst-libs/gst/vaapi/gstvaapidecoder_mpeg2.c @@ -870,7 +870,7 @@ decode_slice( guint macroblock_offset; guint8 slice_vertical_position_extension; guint8 quantiser_scale_code; - guint8 intra_slice_flag, intra_slice = 0; + guint8 intra_slice = 0; guint8 extra_bit_slice, junk8; GST_DEBUG("slice %d @ %p, %u bytes)", slice_no, buf, buf_size); @@ -896,11 +896,8 @@ decode_slice( READ_UINT8(&br, quantiser_scale_code, 5); READ_UINT8(&br, extra_bit_slice, 1); if (extra_bit_slice == 1) { - READ_UINT8(&br, intra_slice_flag, 1); - if (intra_slice_flag) { - READ_UINT8(&br, intra_slice, 1); - READ_UINT8(&br, junk8, 7); - } + READ_UINT8(&br, intra_slice, 1); + READ_UINT8(&br, junk8, 7); READ_UINT8(&br, extra_bit_slice, 1); while (extra_bit_slice == 1) { READ_UINT8(&br, junk8, 8);