summaryrefslogtreecommitdiff
path: root/src/gen75_mfc.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/gen75_mfc.c')
-rw-r--r--src/gen75_mfc.c18
1 files changed, 7 insertions, 11 deletions
diff --git a/src/gen75_mfc.c b/src/gen75_mfc.c
index e16e649..c2b26d6 100644
--- a/src/gen75_mfc.c
+++ b/src/gen75_mfc.c
@@ -1261,17 +1261,14 @@ gen75_mfc_avc_software_batchbuffer(VADriverContextP ctx,
struct encode_state *encode_state,
struct intel_encoder_context *encoder_context)
{
+ struct gen6_mfc_context *mfc_context = encoder_context->mfc_context;
struct i965_driver_data *i965 = i965_driver_data(ctx);
struct intel_batchbuffer *batch;
dri_bo *batch_bo;
int i;
int buffer_size;
- VAEncSequenceParameterBufferH264 *pSequenceParameter = (VAEncSequenceParameterBufferH264 *)encode_state->seq_param_ext->buffer;
- int width_in_mbs = pSequenceParameter->picture_width_in_mbs;
- int height_in_mbs = pSequenceParameter->picture_height_in_mbs;
- buffer_size = width_in_mbs * height_in_mbs * 64;
- batch = intel_batchbuffer_new(&i965->intel, I915_EXEC_BSD, buffer_size);
+ batch = mfc_context->aux_batchbuffer;
batch_bo = batch->buffer;
for (i = 0; i < encode_state->num_slice_params_ext; i++) {
gen75_mfc_avc_pipeline_slice_programing(ctx, encode_state, encoder_context, i, batch);
@@ -1285,7 +1282,9 @@ gen75_mfc_avc_software_batchbuffer(VADriverContextP ctx,
ADVANCE_BCS_BATCH(batch);
dri_bo_reference(batch_bo);
+
intel_batchbuffer_free(batch);
+ mfc_context->aux_batchbuffer = NULL;
return batch_bo;
}
@@ -2339,18 +2338,14 @@ gen75_mfc_mpeg2_software_slice_batchbuffer(VADriverContextP ctx,
struct encode_state *encode_state,
struct intel_encoder_context *encoder_context)
{
+ struct gen6_mfc_context *mfc_context = encoder_context->mfc_context;
struct i965_driver_data *i965 = i965_driver_data(ctx);
struct intel_batchbuffer *batch;
- VAEncSequenceParameterBufferMPEG2 *seq_param = (VAEncSequenceParameterBufferMPEG2 *)encode_state->seq_param_ext->buffer;
VAEncSliceParameterBufferMPEG2 *next_slice_group_param = NULL;
dri_bo *batch_bo;
int i;
- int buffer_size;
- int width_in_mbs = ALIGN(seq_param->picture_width, 16) / 16;
- int height_in_mbs = ALIGN(seq_param->picture_height, 16) / 16;
- buffer_size = width_in_mbs * height_in_mbs * 64;
- batch = intel_batchbuffer_new(&i965->intel, I915_EXEC_BSD, buffer_size);
+ batch = mfc_context->aux_batchbuffer;
batch_bo = batch->buffer;
for (i = 0; i < encode_state->num_slice_params_ext; i++) {
@@ -2371,6 +2366,7 @@ gen75_mfc_mpeg2_software_slice_batchbuffer(VADriverContextP ctx,
dri_bo_reference(batch_bo);
intel_batchbuffer_free(batch);
+ mfc_context->aux_batchbuffer = NULL;
return batch_bo;
}