break;
+ case VAConfigAttribEncMaxSlices:
+ 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;
+ }else if (profile == VAProfileHEVCMain ||
+ profile == VAProfileHEVCMain10) {
+ attrib_list[i].value = I965_MAX_NUM_SLICE;
+ }
+ } else if (entrypoint == VAEntrypointEncSliceLP) {
+ if ((profile == VAProfileH264ConstrainedBaseline ||
+ profile == VAProfileH264Main ||
+ profile == VAProfileH264High) ||
+ profile == VAProfileH264StereoHigh ||
+ profile == VAProfileH264MultiviewHigh)
+ attrib_list[i].value = I965_MAX_NUM_SLICE;
+ } else
+ attrib_list[i].value = VA_ATTRIB_NOT_SUPPORTED;
+
+ break;
+
default:
/* Do nothing */
attrib_list[i].value = VA_ATTRIB_NOT_SUPPORTED;
obj_config->wrapper_config = VA_INVALID_ID;
for (i = 0; i < num_attribs; i++) {
+ // add it later and ignore the user input for VAConfigAttribEncMaxSlices
+ if(attrib_list[i].type == VAConfigAttribEncMaxSlices)
+ continue;
vaStatus = i965_ensure_config_attribute(obj_config, &attrib_list[i]);
if (vaStatus != VA_STATUS_SUCCESS)
break;
vaStatus = VA_STATUS_ERROR_UNSUPPORTED_RT_FORMAT;
}
+ if (vaStatus == VA_STATUS_SUCCESS) {
+ VAConfigAttrib attrib;
+ attrib.type = VAConfigAttribEncMaxSlices;
+ attrib.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.value = 1;
+ else
+ attrib.value = I965_MAX_NUM_SLICE;
+ }else if (profile == VAProfileHEVCMain ||
+ profile == VAProfileHEVCMain10) {
+ attrib.value = I965_MAX_NUM_SLICE;
+ }
+ } else if (entrypoint == VAEntrypointEncSliceLP) {
+ if ((profile == VAProfileH264ConstrainedBaseline ||
+ profile == VAProfileH264Main ||
+ profile == VAProfileH264High) ||
+ 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) &&
(profile == VAProfileVP9Profile0) &&
(entrypoint == VAEntrypointVLD) &&
if (!obj_buffer || !obj_buffer->buffer_store || !obj_buffer->buffer_store->bo)
goto error;
+ if (encode_state->num_slice_params_ext > encoder_context->max_slice_or_seg_num )
+ goto error;
+
encode_state->coded_buf_object = obj_buffer;
for (i = 0; i < 16; i++) {
if (!obj_buffer || !obj_buffer->buffer_store || !obj_buffer->buffer_store->bo)
goto error;
+ if (encode_state->num_slice_params_ext > encoder_context->max_slice_or_seg_num )
+ goto error;
+
encode_state->coded_buf_object = obj_buffer;
for (i = 0; i < 15; i++) {
encoder_context->quality_level = ENCODER_DEFAULT_QUALITY;
encoder_context->quality_range = 1;
encoder_context->layer.num_layers = 1;
+ encoder_context->max_slice_or_seg_num = 1;
if (obj_config->entrypoint == VAEntrypointEncSliceLP)
encoder_context->low_power_mode = 1;
if (encoder_context->codec == CODEC_H264)
encoder_context->context_roi = 1;
}
+ if (obj_config->attrib_list[i].type == VAConfigAttribEncMaxSlices) {
+ if (encoder_context->codec == CODEC_H264 ||
+ encoder_context->codec == CODEC_HEVC)
+ encoder_context->max_slice_or_seg_num = obj_config->attrib_list[i].value;
+ }
}
if (vme_context_init) {