diff --git a/src/gen7_mfd.c b/src/gen7_mfd.c index 7ab2955..2ba9450 100755 --- a/src/gen7_mfd.c +++ b/src/gen7_mfd.c @@ -814,7 +814,7 @@ gen7_mfd_avc_decode_picture(VADriverContextP ctx, { struct intel_batchbuffer *batch = gen7_mfd_context->base.batch; VAPictureParameterBufferH264 *pic_param; - VASliceParameterBufferH264 *slice_param, *next_slice_param, *next_slice_group_param; + VASliceParameterBufferH264 *slice_param, *next_slice_param, *next_slice_group_param, *prev_slice_param = NULL; dri_bo *slice_data_bo; int i, j; @@ -855,12 +855,16 @@ gen7_mfd_avc_decode_picture(VADriverContextP ctx, else next_slice_param = next_slice_group_param; - gen7_mfd_avc_directmode_state(ctx, decode_state, pic_param, slice_param, gen7_mfd_context); - gen7_mfd_avc_ref_idx_state(ctx, pic_param, slice_param, gen7_mfd_context); - gen7_mfd_avc_weightoffset_state(ctx, pic_param, slice_param, gen7_mfd_context); - gen7_mfd_avc_slice_state(ctx, pic_param, slice_param, next_slice_param, gen7_mfd_context); - gen7_mfd_avc_bsd_object(ctx, pic_param, slice_param, slice_data_bo, next_slice_param, gen7_mfd_context); - slice_param++; + if (prev_slice_param == NULL || + prev_slice_param->first_mb_in_slice < slice_param->first_mb_in_slice) { + gen7_mfd_avc_directmode_state(ctx, decode_state, pic_param, slice_param, gen7_mfd_context); + gen7_mfd_avc_ref_idx_state(ctx, pic_param, slice_param, gen7_mfd_context); + gen7_mfd_avc_weightoffset_state(ctx, pic_param, slice_param, gen7_mfd_context); + gen7_mfd_avc_slice_state(ctx, pic_param, slice_param, next_slice_param, gen7_mfd_context); + gen7_mfd_avc_bsd_object(ctx, pic_param, slice_param, slice_data_bo, next_slice_param, gen7_mfd_context); + } + + prev_slice_param = slice_param++; } }