summaryrefslogtreecommitdiff
path: root/src/gen6_mfc.c
diff options
context:
space:
mode:
authorZhou Chang <chang.zhou@intel.com>2012-04-06 15:56:42 +0800
committerXiang, Haihao <haihao.xiang@intel.com>2012-04-06 16:07:02 +0800
commited5ef86f1feed33ffd4ee20b169ed28560ff73a3 (patch)
tree236a90a25d19ce3904a65c0829cae4b7e8fc6479 /src/gen6_mfc.c
parentcb7a21a1a06575567a075e4566857d8863384520 (diff)
Added interlace mode check, just a workaround.
Diffstat (limited to 'src/gen6_mfc.c')
-rw-r--r--src/gen6_mfc.c33
1 files changed, 31 insertions, 2 deletions
diff --git a/src/gen6_mfc.c b/src/gen6_mfc.c
index 6d40748..eb2ab96 100644
--- a/src/gen6_mfc.c
+++ b/src/gen6_mfc.c
@@ -1599,17 +1599,46 @@ gen6_mfc_avc_hardware_batchbuffer(VADriverContextP ctx,
#endif
+int interlace_check(VADriverContextP ctx,
+ struct encode_state *encode_state,
+ struct intel_encoder_context *encoder_context) {
+ struct gen6_mfc_context *mfc_context = encoder_context->mfc_context;
+ VAEncSliceParameterBufferH264 *pSliceParameter;
+ int i;
+ int mbCount = 0;
+ int width_in_mbs = (mfc_context->surface_state.width + 15) / 16;
+ int height_in_mbs = (mfc_context->surface_state.height + 15) / 16;
+
+ for (i = 0; i < encode_state->num_slice_params_ext; i++) {
+ pSliceParameter = (VAEncSliceParameterBufferH264 *)encode_state->slice_params_ext[i]->buffer;
+ mbCount += pSliceParameter->num_macroblocks;
+ }
+
+ if ( mbCount == ( width_in_mbs * height_in_mbs ) )
+ return 0;
+
+ return 1;
+}
+
+
static void
gen6_mfc_avc_pipeline_programing(VADriverContextP ctx,
struct encode_state *encode_state,
struct intel_encoder_context *encoder_context)
{
struct intel_batchbuffer *batch = encoder_context->base.batch;
+ dri_bo *slice_batch_bo;
+
+ if ( interlace_check(ctx, encode_state, encoder_context) ) {
+ fprintf(stderr, "Current VA driver don't support interlace mode!\n");
+ assert(0);
+ return;
+ }
#if __SOFTWARE__
- dri_bo *slice_batch_bo = gen6_mfc_avc_software_batchbuffer(ctx, encode_state, encoder_context);
+ slice_batch_bo = gen6_mfc_avc_software_batchbuffer(ctx, encode_state, encoder_context);
#else
- dri_bo *slice_batch_bo = gen6_mfc_avc_hardware_batchbuffer(ctx, encode_state, encoder_context);
+ slice_batch_bo = gen6_mfc_avc_hardware_batchbuffer(ctx, encode_state, encoder_context);
#endif
// begin programing