int width_in_mbs, height_in_mbs;
obj_surface->free_private_data = gen7_mfd_free_avc_surface;
- width_in_mbs = ((pic_param->picture_width_in_mbs_minus1 + 1) & 0xff);
- height_in_mbs = ((pic_param->picture_height_in_mbs_minus1 + 1) & 0xff); /* frame height */
+ width_in_mbs = pic_param->picture_width_in_mbs_minus1 + 1;
+ height_in_mbs = pic_param->picture_height_in_mbs_minus1 + 1; /* frame height */
if (!gen7_avc_surface) {
gen7_avc_surface = calloc(sizeof(struct gen7_avc_surface), 1);
"direct mv w/r buffer",
width_in_mbs * height_in_mbs * 64,
0x1000);
+ assert(gen7_avc_surface->dmv_top);
}
if (gen7_avc_surface->dmv_bottom_flag &&
"direct mv w/r buffer",
width_in_mbs * height_in_mbs * 64,
0x1000);
+ assert(gen7_avc_surface->dmv_bottom);
}
}
mbaff_frame_flag = (pic_param->seq_fields.bits.mb_adaptive_frame_field_flag &&
!pic_param->pic_fields.bits.field_pic_flag);
- width_in_mbs = ((pic_param->picture_width_in_mbs_minus1 + 1) & 0xff);
- height_in_mbs = ((pic_param->picture_height_in_mbs_minus1 + 1) & 0xff); /* frame height */
+ width_in_mbs = pic_param->picture_width_in_mbs_minus1 + 1;
+ height_in_mbs = pic_param->picture_height_in_mbs_minus1 + 1; /* frame height */
/* MFX unit doesn't support 4:2:2 and 4:4:4 picture */
assert(pic_param->seq_fields.bits.chroma_format_idc == 0 || /* monochrome picture */
struct object_surface *obj_surface;
dri_bo *bo;
int i, j, enable_avc_ildb = 0;
- int width_in_mbs;
+ unsigned int width_in_mbs, height_in_mbs;
for (j = 0; j < decode_state->num_slice_params && enable_avc_ildb == 0; j++) {
assert(decode_state->slice_params && decode_state->slice_params[j]->buffer);
assert(decode_state->pic_param && decode_state->pic_param->buffer);
pic_param = (VAPictureParameterBufferH264 *)decode_state->pic_param->buffer;
gen7_mfd_avc_frame_store_index(ctx, pic_param, gen7_mfd_context);
- width_in_mbs = ((pic_param->picture_width_in_mbs_minus1 + 1) & 0xff);
+ width_in_mbs = pic_param->picture_width_in_mbs_minus1 + 1;
+ height_in_mbs = pic_param->picture_height_in_mbs_minus1 + 1;
+ assert(width_in_mbs > 0 && width_in_mbs <= 256); /* 4K */
+ assert(height_in_mbs > 0 && height_in_mbs <= 256);
/* Current decoded picture */
va_pic = &pic_param->CurrPic;