profile != VAProfileMPEG2Simple)
attrib_list[i].value |= VA_RC_CBR;
- if (profile == VAProfileVP9Profile0 ||
- profile == VAProfileH264ConstrainedBaseline ||
- profile == VAProfileH264Main ||
- profile == VAProfileH264High ||
+ if (profile == VAProfileVP8Version0_3 ||
+ profile == VAProfileVP9Profile0 ||
profile == VAProfileHEVCMain)
attrib_list[i].value |= VA_RC_VBR;
+ if (profile == VAProfileH264ConstrainedBaseline ||
+ profile == VAProfileH264Main ||
+ profile == VAProfileH264High)
+ attrib_list[i].value = i965->codec_info->h264_brc_mode;
+
break;
} else if (entrypoint == VAEntrypointEncSliceLP) {
struct i965_driver_data * const i965 = i965_driver_data(ctx);
break;
case VAConfigAttribEncMaxRefFrames:
- if (entrypoint == VAEntrypointEncSlice)
+ if (entrypoint == VAEntrypointEncSlice) {
attrib_list[i].value = (1 << 16) | (1 << 0);
- else if (entrypoint == VAEntrypointEncSliceLP) {
+ if (profile == VAProfileH264ConstrainedBaseline ||
+ profile == VAProfileH264Main ||
+ profile == VAProfileH264High ||
+ profile == VAProfileH264StereoHigh ||
+ profile == VAProfileH264MultiviewHigh) {
+ if (IS_GEN9(i965->intel.device_info))
+ attrib_list[i].value = (2 << 16) | (8 << 0);
+ }
+ } else if (entrypoint == VAEntrypointEncSliceLP) {
/* Don't support B frame for low power mode */
if (profile == VAProfileH264ConstrainedBaseline ||
profile == VAProfileH264Main ||
case VAConfigAttribEncROI:
if (entrypoint == VAEntrypointEncSlice ||
entrypoint == VAEntrypointEncSliceLP) {
+ VAConfigAttribValEncROI *roi_config =
+ (VAConfigAttribValEncROI *) & (attrib_list[i].value);
if (profile == VAProfileH264ConstrainedBaseline ||
profile == VAProfileH264Main ||
entrypoint == VAEntrypointEncSlice)
attrib_list[i].value = 0;
else {
-
- VAConfigAttribValEncROI *roi_config =
- (VAConfigAttribValEncROI *) & (attrib_list[i].value);
-
if (entrypoint == VAEntrypointEncSliceLP) {
roi_config->bits.num_roi_regions = 3;
roi_config->bits.roi_rc_priority_support = 0;
roi_config->bits.roi_rc_qp_delat_support = 1;
}
}
+ } else if (profile == VAProfileHEVCMain ||
+ profile == VAProfileHEVCMain10) {
+ roi_config->bits.num_roi_regions =
+ I965_MAX_NUM_ROI_REGIONS;
+ roi_config->bits.roi_rc_priority_support = 1;
+ roi_config->bits.roi_rc_qp_delat_support = 1;
} else {
attrib_list[i].value = 0;
}
break;
case VAConfigAttribEncMaxSlices:
+ attrib_list[i].value = VA_ATTRIB_NOT_SUPPORTED;
if (entrypoint == VAEntrypointEncSlice) {
if ((profile == VAProfileH264ConstrainedBaseline ||
profile == VAProfileH264Main ||
profile == VAProfileH264High) ||
profile == VAProfileH264StereoHigh ||
profile == VAProfileH264MultiviewHigh) {
- if (IS_GEN9(i965->intel.device_info))
- attrib_list[i].value = 1;
- else
- attrib_list[i].value = I965_MAX_NUM_SLICE;
+ attrib_list[i].value = I965_MAX_NUM_SLICE;
} else if (profile == VAProfileHEVCMain ||
profile == VAProfileHEVCMain10) {
- attrib_list[i].value = 1;
+ attrib_list[i].value = I965_MAX_NUM_SLICE;
}
} else if (entrypoint == VAEntrypointEncSliceLP) {
if ((profile == VAProfileH264ConstrainedBaseline ||
profile == VAProfileH264StereoHigh ||
profile == VAProfileH264MultiviewHigh)
attrib_list[i].value = I965_MAX_NUM_SLICE;
- } else
- attrib_list[i].value = VA_ATTRIB_NOT_SUPPORTED;
+ }
break;
+ case VAConfigAttribEncSliceStructure:
+ attrib_list[i].value = VA_ATTRIB_NOT_SUPPORTED;
+ if (entrypoint == VAEntrypointEncSlice) {
+ if ((profile == VAProfileH264ConstrainedBaseline ||
+ profile == VAProfileH264Main ||
+ profile == VAProfileH264High) ||
+ profile == VAProfileH264StereoHigh ||
+ profile == VAProfileH264MultiviewHigh ||
+ profile == VAProfileHEVCMain ||
+ profile == VAProfileHEVCMain10) {
+ attrib_list[i].value = VA_ENC_SLICE_STRUCTURE_ARBITRARY_MACROBLOCKS;
+ }
+ }
+
+ break;
default:
/* Do nothing */
attrib_list[i].value = VA_ATTRIB_NOT_SUPPORTED;
for (i = 0; i < num_attribs; i++) {
// add it later and ignore the user input for VAConfigAttribEncMaxSlices
- if (attrib_list[i].type == VAConfigAttribEncMaxSlices)
+ if (attrib_list[i].type == VAConfigAttribEncMaxSlices ||
+ attrib_list[i].type == VAConfigAttribEncSliceStructure)
continue;
vaStatus = i965_ensure_config_attribute(obj_config, &attrib_list[i]);
if (vaStatus != VA_STATUS_SUCCESS)
profile == VAProfileH264High) ||
profile == VAProfileH264StereoHigh ||
profile == VAProfileH264MultiviewHigh) {
- if (IS_GEN9(i965->intel.device_info))
- attrib.value = 1;
- else
- attrib.value = I965_MAX_NUM_SLICE;
+ attrib.value = I965_MAX_NUM_SLICE;
} else if (profile == VAProfileHEVCMain ||
- profile == VAProfileHEVCMain10) {
- attrib.value = 1;
- }
+ profile == VAProfileHEVCMain10)
+ attrib.value = I965_MAX_NUM_SLICE;
} else if (entrypoint == VAEntrypointEncSliceLP) {
if ((profile == VAProfileH264ConstrainedBaseline ||
profile == VAProfileH264Main ||
profile == VAProfileH264StereoHigh ||
profile == VAProfileH264MultiviewHigh)
attrib.value = I965_MAX_NUM_SLICE;
- } else
- attrib.value = VA_ATTRIB_NOT_SUPPORTED;
+ }
+
+ if (attrib.value != VA_ATTRIB_NOT_SUPPORTED)
+ vaStatus = i965_append_config_attribute(obj_config, &attrib);
+ }
+
+ if (vaStatus == VA_STATUS_SUCCESS) {
+ VAConfigAttrib attrib;
+ attrib.type = VAConfigAttribEncSliceStructure;
+ attrib.value = VA_ATTRIB_NOT_SUPPORTED;
+ if (entrypoint == VAEntrypointEncSlice) {
+ if ((profile == VAProfileH264ConstrainedBaseline ||
+ profile == VAProfileH264Main ||
+ profile == VAProfileH264High) ||
+ profile == VAProfileH264StereoHigh ||
+ profile == VAProfileH264MultiviewHigh) {
+ attrib.value = VA_ENC_SLICE_STRUCTURE_ARBITRARY_MACROBLOCKS;
+ }
+ }
if (attrib.value != VA_ATTRIB_NOT_SUPPORTED)
vaStatus = i965_append_config_attribute(obj_config, &attrib);
obj_surface->height = memory_attibute->data_size / obj_surface->width;
else
obj_surface->height = memory_attibute->offsets[1] / obj_surface->width;
- ASSERT_RET(IS_ALIGNED(obj_surface->height, 16), VA_STATUS_ERROR_INVALID_PARAMETER);
- ASSERT_RET(obj_surface->height >= obj_surface->orig_height, VA_STATUS_ERROR_INVALID_PARAMETER);
+
+ if (memory_attibute->num_planes > 1) {
+ ASSERT_RET(IS_ALIGNED(obj_surface->height, 16), VA_STATUS_ERROR_INVALID_PARAMETER);
+ ASSERT_RET(obj_surface->height >= obj_surface->orig_height, VA_STATUS_ERROR_INVALID_PARAMETER);
+ }
if (tiling) {
ASSERT_RET(IS_ALIGNED(obj_surface->width, 128), VA_STATUS_ERROR_INVALID_PARAMETER);
- ASSERT_RET(IS_ALIGNED(obj_surface->height, 32), VA_STATUS_ERROR_INVALID_PARAMETER);
+
+ if (memory_attibute->num_planes > 1)
+ ASSERT_RET(IS_ALIGNED(obj_surface->height, 32), VA_STATUS_ERROR_INVALID_PARAMETER);
} else {
ASSERT_RET(IS_ALIGNED(obj_surface->width, i965->codec_info->min_linear_wpitch), VA_STATUS_ERROR_INVALID_PARAMETER);
- ASSERT_RET(IS_ALIGNED(obj_surface->height, i965->codec_info->min_linear_hpitch), VA_STATUS_ERROR_INVALID_PARAMETER);
+
+ if (memory_attibute->num_planes > 1)
+ ASSERT_RET(IS_ALIGNED(obj_surface->height, i965->codec_info->min_linear_hpitch), VA_STATUS_ERROR_INVALID_PARAMETER);
}
obj_surface->x_cb_offset = 0; /* X offset is always 0 */
i965_release_buffer_store(&obj_context->codec_state.decode.pic_param);
i965_release_buffer_store(&obj_context->codec_state.decode.iq_matrix);
+ i965_release_buffer_store(&obj_context->codec_state.decode.huffman_table);
i965_release_buffer_store(&obj_context->codec_state.decode.bit_plane);
for (i = 0; i < obj_context->codec_state.decode.num_slice_params; i++)