From 10639eb88972bf89656af694b8bf8c4b41255c69 Mon Sep 17 00:00:00 2001 From: Gwenole Beauchesne Date: Thu, 24 Jan 2013 18:14:28 +0100 Subject: [PATCH] codecparsers: vc1: fix bitplanes decoding (DIFF6 or NORM6 residual bytes). Fix parsing of residual bytes. This is a two-step process. First, remaining colums of full vertical resolution () need to be processed. Next, remaining bytes in the first row can be processed, while taking into account the fact that we may have filled in the first columns already. So, this is not full horizontal resolution. The following figure helps in understanding the expected order of operations, for a 8x5 MBs bitplane. 5 5 6 6 6 6 6 6 5 5 1 1 1 2 2 2 5 5 1 1 1 2 2 2 5 5 3 3 3 4 4 4 5 5 3 3 3 4 4 4 So, after tiles 1 to 4 are decoded, vertical tile 5 needs to be processed (2x5 MBs) and then the horizontal tile 6 (6x1 MBs). https://bugzilla.gnome.org/show_bug.cgi?id=692461 Signed-off-by: Gwenole Beauchesne --- gst-libs/gst/codecparsers/gstvc1parser.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gst-libs/gst/codecparsers/gstvc1parser.c b/gst-libs/gst/codecparsers/gstvc1parser.c index 6df75e51c9..a7ab430add 100644 --- a/gst-libs/gst/codecparsers/gstvc1parser.c +++ b/gst-libs/gst/codecparsers/gstvc1parser.c @@ -556,7 +556,7 @@ bitplane_decoding (GstBitReader * br, guint8 * data, if (x) { if (data) - pdata = data + y * stride; + pdata = data; if (!decode_colskip (br, pdata, x, height, stride, invert_mask)) goto failed; } @@ -564,7 +564,7 @@ bitplane_decoding (GstBitReader * br, guint8 * data, if (y) { if (data) pdata = data + x; - if (!decode_rowskip (br, pdata, width, y, stride, invert_mask)) + if (!decode_rowskip (br, pdata, width - x, y, stride, invert_mask)) goto failed; } break;