#include "gen6_mfc.h"
#include "i965_post_processing.h"
+#include "i965_encoder_api.h"
static struct intel_fraction
reduce_fraction(struct intel_fraction f)
struct object_surface *obj_surface;
VAStatus status;
VARectangle rect;
+ int format = VA_RT_FORMAT_YUV420;
+ unsigned int fourcc = VA_FOURCC_NV12;
/* releae the temporary surface */
if (encoder_context->is_tmp_id) {
}
}
+ if (VAProfileHEVCMain10 == profile) {
+ format = VA_RT_FORMAT_YUV420_10BPP;
+ fourcc = VA_FOURCC_P010;
+ }
+
rect.x = 0;
rect.y = 0;
rect.width = obj_surface->orig_width;
status = i965_CreateSurfaces(ctx,
obj_surface->orig_width,
obj_surface->orig_height,
- VA_RT_FORMAT_YUV420,
+ format,
1,
&encoder_context->input_yuv_surface);
ASSERT_RET(status == VA_STATUS_SUCCESS, status);
obj_surface = SURFACE(encoder_context->input_yuv_surface);
encode_state->input_yuv_object = obj_surface;
assert(obj_surface);
- i965_check_alloc_surface_bo(ctx, obj_surface, 1, VA_FOURCC_NV12, SUBSAMPLE_YUV420);
+ i965_check_alloc_surface_bo(ctx, obj_surface, 1, fourcc, SUBSAMPLE_YUV420);
dst_surface.base = (struct object_base *)obj_surface;
dst_surface.type = I965_SURFACE_TYPE_SURFACE;
encoder_context->brc.need_reset = 1;
}
- if (encoder_context->brc.window_size != misc->window_size) {
+ if (encoder_context->brc.window_size != misc->window_size ||
+ encoder_context->brc.initial_qp != misc->initial_qp ||
+ encoder_context->brc.min_qp != misc->min_qp) {
encoder_context->brc.window_size = misc->window_size;
+ encoder_context->brc.initial_qp = misc->initial_qp;
+ encoder_context->brc.min_qp = misc->min_qp;
encoder_context->brc.need_reset = 1;
}
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++) {
hw_init_func vme_context_init,
hw_init_func mfc_context_init)
{
+ struct i965_driver_data *i965 = i965_driver_data(ctx);
struct intel_driver_data *intel = intel_driver_data(ctx);
struct intel_encoder_context *encoder_context = calloc(1, sizeof(struct intel_encoder_context));
int 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 (obj_config->entrypoint == VAEntrypointEncSliceLP)
encoder_context->quality_range = ENCODER_LP_QUALITY_RANGE;
+ else if(IS_GEN9(i965->intel.device_info)){
+ encoder_context->quality_level = ENCODER_DEFAULT_QUALITY_AVC;
+ encoder_context->quality_range = ENCODER_QUALITY_RANGE_AVC;
+ }
else
encoder_context->quality_range = ENCODER_QUALITY_RANGE;
break;
case VAProfileH264StereoHigh:
case VAProfileH264MultiviewHigh:
+ if(IS_GEN9(i965->intel.device_info)){
+ encoder_context->quality_level = ENCODER_DEFAULT_QUALITY_AVC;
+ encoder_context->quality_range = ENCODER_QUALITY_RANGE_AVC;
+ }
encoder_context->codec = CODEC_H264_MVC;
break;
case VAProfileVP8Version0_3:
encoder_context->codec = CODEC_VP8;
+ encoder_context->quality_range = ENCODER_QUALITY_RANGE;
+
break;
case VAProfileHEVCMain:
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) {