Commit 2e719ae5 authored by Xiang, Haihao's avatar Xiang, Haihao

i965_drv_video: [H.264] fix different slice type in a same picture issue.

parent 74b303f5
......@@ -993,6 +993,8 @@ i965_avc_bsd_pipeline(VADriverContextP ctx, struct decode_state *decode_state)
i965_avc_bsd_frame_store_index(ctx, pic_param);
i965_h264_context->enable_avc_ildb = 0;
i965_h264_context->picture.i_flag = 1;
for (j = 0; j < decode_state->num_slice_params && i965_h264_context->enable_avc_ildb == 0; j++) {
assert(decode_state->slice_params && decode_state->slice_params[j]->buffer);
slice_param = (VASliceParameterBufferH264 *)decode_state->slice_params[j]->buffer;
......@@ -1035,6 +1037,11 @@ i965_avc_bsd_pipeline(VADriverContextP ctx, struct decode_state *decode_state)
(slice_param->slice_type == SLICE_TYPE_SP) ||
(slice_param->slice_type == SLICE_TYPE_B));
if (i965_h264_context->picture.i_flag &&
(slice_param->slice_type != SLICE_TYPE_I ||
slice_param->slice_type != SLICE_TYPE_SI))
i965_h264_context->picture.i_flag = 0;
i965_avc_bsd_slice_state(ctx, pic_param, slice_param);
i965_avc_bsd_buf_base_state(ctx, pic_param, slice_param);
i965_avc_bsd_object(ctx, decode_state, pic_param, slice_param);
......
......@@ -523,7 +523,6 @@ i965_media_h264_vfe_state_extension(VADriverContextP ctx,
struct i965_h264_context *i965_h264_context;
struct i965_vfe_state_ex *vfe_state_ex;
VAPictureParameterBufferH264 *pic_param;
VASliceParameterBufferH264 *slice_param;
int mbaff_frame_flag;
assert(media_state->private_context);
......@@ -531,10 +530,6 @@ i965_media_h264_vfe_state_extension(VADriverContextP ctx,
assert(decode_state->pic_param && decode_state->pic_param->buffer);
pic_param = (VAPictureParameterBufferH264 *)decode_state->pic_param->buffer;
assert(decode_state->slice_params[0] && decode_state->slice_params[0]->buffer);
slice_param = (VASliceParameterBufferH264 *)decode_state->slice_params[0]->buffer;
mbaff_frame_flag = (pic_param->seq_fields.bits.mb_adaptive_frame_field_flag &&
!pic_param->pic_fields.bits.field_pic_flag);
......@@ -556,16 +551,12 @@ i965_media_h264_vfe_state_extension(VADriverContextP ctx,
vfe_state_ex->vfex1.avc.residual_data_fix_offset_flag = !!RESIDUAL_DATA_OFFSET;
vfe_state_ex->vfex1.avc.residual_data_offset = RESIDUAL_DATA_OFFSET;
if (slice_param->slice_type == SLICE_TYPE_I ||
slice_param->slice_type == SLICE_TYPE_SI)
if (i965_h264_context->picture.i_flag) {
vfe_state_ex->vfex1.avc.sub_field_present_flag = PRESENT_NOMV; /* NoMV */
else
vfe_state_ex->vfex1.avc.sub_field_present_flag = PRESENT_MV_WO; /* Both MV and W/O */
if (vfe_state_ex->vfex1.avc.sub_field_present_flag == 0) {
vfe_state_ex->vfex1.avc.weight_grf_offset = 0;
vfe_state_ex->vfex1.avc.residual_grf_offset = 0;
} else {
vfe_state_ex->vfex1.avc.sub_field_present_flag = PRESENT_MV_WO; /* Both MV and W/O */
vfe_state_ex->vfex1.avc.weight_grf_offset = 4;
vfe_state_ex->vfex1.avc.residual_grf_offset = 6;
}
......
......@@ -37,6 +37,7 @@ struct i965_h264_context
unsigned int width_in_mbs;
unsigned int height_in_mbs;
int mbaff_frame_flag;
int i_flag;
} picture;
int enable_avc_ildb;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment