summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXiang, Haihao <haihao.xiang@intel.com>2011-03-14 09:52:54 +0800
committerXiang, Haihao <haihao.xiang@intel.com>2011-03-14 09:52:54 +0800
commit116424c35d3b61c0c6ac4c2c6d50ff30500a4356 (patch)
tree81aeb519c513129e39368f371c6b4d9c8396d11d
parentbdc106e3f10038e76de3c9745804dc2db2363f28 (diff)
downloadlibva-116424c35d3b61c0c6ac4c2c6d50ff30500a4356.tar.gz
i965_drv_video/VC1: fix data offset for Main/Simple profile
Signed-off-by: Xiang, Haihao <haihao.xiang@intel.com>
-rw-r--r--i965_drv_video/gen6_mfd.c20
1 files changed, 13 insertions, 7 deletions
diff --git a/i965_drv_video/gen6_mfd.c b/i965_drv_video/gen6_mfd.c
index eb035e7..ed2a337 100644
--- a/i965_drv_video/gen6_mfd.c
+++ b/i965_drv_video/gen6_mfd.c
@@ -1950,19 +1950,23 @@ gen6_mfd_vc1_directmode_state(VADriverContextP ctx, struct decode_state *decode_
}
static int
-gen6_mfd_vc1_get_macroblock_bit_offset(uint8_t *buf, int in_slice_data_bit_offset)
+gen6_mfd_vc1_get_macroblock_bit_offset(uint8_t *buf, int in_slice_data_bit_offset, int profile)
{
int out_slice_data_bit_offset;
int slice_header_size = in_slice_data_bit_offset / 8;
int i, j;
- for (i = 0, j = 0; i < slice_header_size; i++, j++) {
- if (!buf[j] && !buf[j + 1] && buf[j + 2] == 3 && buf[j + 3] < 4) {
- i++, j += 2;
+ if (profile != 3)
+ out_slice_data_bit_offset = in_slice_data_bit_offset;
+ else {
+ for (i = 0, j = 0; i < slice_header_size; i++, j++) {
+ if (!buf[j] && !buf[j + 1] && buf[j + 2] == 3 && buf[j + 3] < 4) {
+ i++, j += 2;
+ }
}
- }
- out_slice_data_bit_offset = 8 * j + in_slice_data_bit_offset % 8;
+ out_slice_data_bit_offset = 8 * j + in_slice_data_bit_offset % 8;
+ }
return out_slice_data_bit_offset;
}
@@ -1980,7 +1984,9 @@ gen6_mfd_vc1_bsd_object(VADriverContextP ctx,
dri_bo_map(slice_data_bo, 0);
slice_data = (uint8_t *)(slice_data_bo->virtual + slice_param->slice_data_offset);
- macroblock_offset = gen6_mfd_vc1_get_macroblock_bit_offset(slice_data, slice_param->macroblock_offset);
+ macroblock_offset = gen6_mfd_vc1_get_macroblock_bit_offset(slice_data,
+ slice_param->macroblock_offset,
+ pic_param->sequence_fields.bits.profile);
dri_bo_unmap(slice_data_bo);
if (next_slice_param)