summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLi, Xiaowei A <xiaowei.a.li@intel.com>2012-12-12 09:16:25 +0800
committerXiang, Haihao <haihao.xiang@intel.com>2013-01-23 13:00:00 +0800
commit7803fcae62c868c26f24425df04aee0405342563 (patch)
tree26a57a5934974eea6d1f6a8ece4531d431ac9d07
parente8d3f90fc18ca3726e6b34156ba56ee92c2a2524 (diff)
downloadvaapi-intel-driver-7803fcae62c868c26f24425df04aee0405342563.tar.gz
vaapi-intel-driver-7803fcae62c868c26f24425df04aee0405342563.tar.bz2
vaapi-intel-driver-7803fcae62c868c26f24425df04aee0405342563.zip
Fill the bitplane for VC1 skip picture decoding
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> (cherry picked from commit a76acf6441a414bb5dd601485ed8ed790218bb13)
-rwxr-xr-xsrc/gen6_mfd.c6
-rw-r--r--src/gen75_mfd.c8
-rwxr-xr-xsrc/gen7_mfd.c10
3 files changed, 21 insertions, 3 deletions
diff --git a/src/gen6_mfd.c b/src/gen6_mfd.c
index a0f7489..68e1900 100755
--- a/src/gen6_mfd.c
+++ b/src/gen6_mfd.c
@@ -1386,10 +1386,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);
@@ -1489,6 +1491,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));
}
diff --git a/src/gen75_mfd.c b/src/gen75_mfd.c
index fc1139e..9ca32cb 100644
--- a/src/gen75_mfd.c
+++ b/src/gen75_mfd.c
@@ -1690,11 +1690,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);
@@ -1793,6 +1795,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));
}
diff --git a/src/gen7_mfd.c b/src/gen7_mfd.c
index da4a2d3..0fb7249 100755
--- a/src/gen7_mfd.c
+++ b/src/gen7_mfd.c
@@ -1338,11 +1338,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);
@@ -1441,6 +1443,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));
}