Commit 777c69c2 authored by Gwenole Beauchesne's avatar Gwenole Beauchesne Committed by Xiang, Haihao

Move initialization of render_state->interleaved_uv to vaCreateContext().

parent 5438f92b
...@@ -697,6 +697,7 @@ i965_CreateContext(VADriverContextP ctx, ...@@ -697,6 +697,7 @@ i965_CreateContext(VADriverContextP ctx,
VAContextID *context) /* out */ VAContextID *context) /* out */
{ {
struct i965_driver_data *i965 = i965_driver_data(ctx); struct i965_driver_data *i965 = i965_driver_data(ctx);
struct i965_render_state *render_state = &i965->render_state;
struct object_config *obj_config = CONFIG(config_id); struct object_config *obj_config = CONFIG(config_id);
struct object_context *obj_context = NULL; struct object_context *obj_context = NULL;
VAStatus vaStatus = VA_STATUS_SUCCESS; VAStatus vaStatus = VA_STATUS_SUCCESS;
...@@ -718,6 +719,16 @@ i965_CreateContext(VADriverContextP ctx, ...@@ -718,6 +719,16 @@ i965_CreateContext(VADriverContextP ctx,
return vaStatus; return vaStatus;
} }
switch (obj_config->profile) {
case VAProfileH264Baseline:
case VAProfileH264Main:
case VAProfileH264High:
render_state->interleaved_uv = 1;
break;
default:
render_state->interleaved_uv = 0;
}
obj_context->context_id = contextID; obj_context->context_id = contextID;
*context = contextID; *context = contextID;
memset(&obj_context->decode_state, 0, sizeof(obj_context->decode_state)); memset(&obj_context->decode_state, 0, sizeof(obj_context->decode_state));
...@@ -1112,7 +1123,6 @@ VAStatus ...@@ -1112,7 +1123,6 @@ VAStatus
i965_EndPicture(VADriverContextP ctx, VAContextID context) i965_EndPicture(VADriverContextP ctx, VAContextID context)
{ {
struct i965_driver_data *i965 = i965_driver_data(ctx); struct i965_driver_data *i965 = i965_driver_data(ctx);
struct i965_render_state *render_state = &i965->render_state;
struct object_context *obj_context = CONTEXT(context); struct object_context *obj_context = CONTEXT(context);
struct object_config *obj_config; struct object_config *obj_config;
VAContextID config; VAContextID config;
...@@ -1128,17 +1138,6 @@ i965_EndPicture(VADriverContextP ctx, VAContextID context) ...@@ -1128,17 +1138,6 @@ i965_EndPicture(VADriverContextP ctx, VAContextID context)
obj_config = CONFIG(config); obj_config = CONFIG(config);
assert(obj_config); assert(obj_config);
switch (obj_config->profile) {
case VAProfileH264Baseline:
case VAProfileH264Main:
case VAProfileH264High:
render_state->interleaved_uv = 1;
break;
default:
render_state->interleaved_uv = 0;
}
i965_media_decode_picture(ctx, obj_config->profile, &obj_context->decode_state); i965_media_decode_picture(ctx, obj_config->profile, &obj_context->decode_state);
obj_context->decode_state.current_render_target = -1; obj_context->decode_state.current_render_target = -1;
obj_context->decode_state.num_slice_params = 0; obj_context->decode_state.num_slice_params = 0;
......
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