Fill the bitplane for VC1 skip picture decoding
authorLi, Xiaowei A <xiaowei.a.li@intel.com>
Wed, 12 Dec 2012 01:16:25 +0000 (09:16 +0800)
committerXiang, Haihao <haihao.xiang@intel.com>
Mon, 17 Dec 2012 03:20:36 +0000 (11:20 +0800)
This is a workaround for VC1 skip picture, the corresponding
bit value in bitplane should be 1 for skip picture, but sometimes
application pass down wrong value.

Signed-off-by: Li,Xiaowei <xiaowei.a.li@intel.com>
src/gen6_mfd.c
src/gen75_mfd.c
src/gen7_mfd.c

index 11489dd..9afa7dd 100755 (executable)
@@ -1423,10 +1423,12 @@ gen6_mfd_vc1_decode_init(VADriverContextP ctx,
     int i;
     dri_bo *bo;
     int width_in_mbs;
+    int picture_type;
 
     assert(decode_state->pic_param && decode_state->pic_param->buffer);
     pic_param = (VAPictureParameterBufferVC1 *)decode_state->pic_param->buffer;
     width_in_mbs = ALIGN(pic_param->coded_width, 16) / 16;
+    picture_type = pic_param->picture_fields.bits.picture_type;
 
     /* reference picture */
     obj_surface = SURFACE(pic_param->forward_reference_picture);
@@ -1526,6 +1528,10 @@ gen6_mfd_vc1_decode_init(VADriverContextP ctx,
                 src_shift = !((src_h * width_in_mbs + src_w) & 1) * 4;
                 src_value = ((src[src_index] >> src_shift) & 0xf);
 
+                if (picture_type == GEN6_VC1_SKIPPED_PICTURE){
+                    src_value |= 0x2;
+                }
+
                 dst_index = src_w / 2;
                 dst[dst_index] = ((dst[dst_index] >> 4) | (src_value << 4));
             }
index 1b0857a..9443c83 100644 (file)
@@ -1734,11 +1734,13 @@ gen75_mfd_vc1_decode_init(VADriverContextP ctx,
     int i;
     dri_bo *bo;
     int width_in_mbs;
+    int picture_type;
 
     assert(decode_state->pic_param && decode_state->pic_param->buffer);
     pic_param = (VAPictureParameterBufferVC1 *)decode_state->pic_param->buffer;
     width_in_mbs = ALIGN(pic_param->coded_width, 16) / 16;
-
+    picture_type = pic_param->picture_fields.bits.picture_type;
     /* reference picture */
     obj_surface = SURFACE(pic_param->forward_reference_picture);
 
@@ -1837,6 +1839,10 @@ gen75_mfd_vc1_decode_init(VADriverContextP ctx,
                 src_shift = !((src_h * width_in_mbs + src_w) & 1) * 4;
                 src_value = ((src[src_index] >> src_shift) & 0xf);
 
+                if (picture_type == GEN7_VC1_SKIPPED_PICTURE){
+                    src_value |= 0x2;
+                }
+
                 dst_index = src_w / 2;
                 dst[dst_index] = ((dst[dst_index] >> 4) | (src_value << 4));
             }
index 43702bc..0777ea8 100755 (executable)
@@ -1398,11 +1398,13 @@ gen7_mfd_vc1_decode_init(VADriverContextP ctx,
     int i;
     dri_bo *bo;
     int width_in_mbs;
-
+    int picture_type;
     assert(decode_state->pic_param && decode_state->pic_param->buffer);
     pic_param = (VAPictureParameterBufferVC1 *)decode_state->pic_param->buffer;
     width_in_mbs = ALIGN(pic_param->coded_width, 16) / 16;
-
+    picture_type = pic_param->picture_fields.bits.picture_type;
     /* reference picture */
     obj_surface = SURFACE(pic_param->forward_reference_picture);
 
@@ -1501,6 +1503,10 @@ gen7_mfd_vc1_decode_init(VADriverContextP ctx,
                 src_shift = !((src_h * width_in_mbs + src_w) & 1) * 4;
                 src_value = ((src[src_index] >> src_shift) & 0xf);
 
+                if (picture_type == GEN7_VC1_SKIPPED_PICTURE){
+                    src_value |= 0x2;
+                }
+
                 dst_index = src_w / 2;
                 dst[dst_index] = ((dst[dst_index] >> 4) | (src_value << 4));
             }