summaryrefslogtreecommitdiff
path: root/src/gen8_mfd.c
diff options
context:
space:
mode:
authorZhao Yakui <yakui.zhao@intel.com>2015-07-07 01:45:47 +0800
committerZhao, Yakui <yakui.zhao@intel.com>2015-07-06 15:08:54 +0800
commit7bb3658212f49a6f8d3d61b0b5d161aca73c2a11 (patch)
treef401f18af12977a7801f4467f0a4df9d3a192aa2 /src/gen8_mfd.c
parent8d11fd7dd7952551b2d57f900ce1f408a35616a1 (diff)
downloadlibva-intel-driver-7bb3658212f49a6f8d3d61b0b5d161aca73c2a11.tar.gz
H264: Use macroblock pair to calculate H264 decoding parameter under MBAFF flag
Based on the H264 spec the macroblock pair should be used to calculate the corresponding parameters under MBAFF.(mb-adaptive frame-field). Otherwise the wrong parameter is sent to GPU HW. Fix the GPU hang issue in https://bugs.freedesktop.org/show_bug.cgi?id=91207 Tested-by: Lim, Siew Hoon <siew.hoon.lim@intel.com> Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
Diffstat (limited to 'src/gen8_mfd.c')
-rw-r--r--src/gen8_mfd.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/gen8_mfd.c b/src/gen8_mfd.c
index c15184d7..c55cb4e9 100644
--- a/src/gen8_mfd.c
+++ b/src/gen8_mfd.c
@@ -625,14 +625,19 @@ gen8_mfd_avc_slice_state(VADriverContextP ctx,
num_ref_idx_l1 = slice_param->num_ref_idx_l1_active_minus1 + 1;
}
- first_mb_in_slice = slice_param->first_mb_in_slice << mbaff_picture;
+ first_mb_in_slice = slice_param->first_mb_in_slice;
slice_hor_pos = first_mb_in_slice % width_in_mbs;
slice_ver_pos = first_mb_in_slice / width_in_mbs;
+ if (mbaff_picture)
+ slice_ver_pos = slice_ver_pos << 1;
if (next_slice_param) {
- first_mb_in_next_slice = next_slice_param->first_mb_in_slice << mbaff_picture;
+ first_mb_in_next_slice = next_slice_param->first_mb_in_slice;
next_slice_hor_pos = first_mb_in_next_slice % width_in_mbs;
next_slice_ver_pos = first_mb_in_next_slice / width_in_mbs;
+
+ if (mbaff_picture)
+ next_slice_ver_pos = next_slice_ver_pos << 1;
} else {
next_slice_hor_pos = 0;
next_slice_ver_pos = height_in_mbs / (1 + !!pic_param->pic_fields.bits.field_pic_flag);