diff options
author | Xiang, Haihao <haihao.xiang@intel.com> | 2013-10-08 13:27:55 +0800 |
---|---|---|
committer | Xiang, Haihao <haihao.xiang@intel.com> | 2014-02-27 10:22:45 +0800 |
commit | 8a9e85578e2af131f7efbf2e08074fde0cd225a6 (patch) | |
tree | e66f119f59671bf865823d4a56bd14885485c400 /src/gen8_mfc.c | |
parent | 65f7e017b70c745ab4233d9f585fa688e90aeb02 (diff) | |
download | libva-intel-driver-8a9e85578e2af131f7efbf2e08074fde0cd225a6.tar.gz libva-intel-driver-8a9e85578e2af131f7efbf2e08074fde0cd225a6.tar.bz2 libva-intel-driver-8a9e85578e2af131f7efbf2e08074fde0cd225a6.zip |
Follow the input Picture/Slice parameters for SLICE_STATE command on BDW
Signed-off-by: Xiang, Haihao <haihao.xiang@intel.com>
Diffstat (limited to 'src/gen8_mfc.c')
-rw-r--r-- | src/gen8_mfc.c | 32 |
1 files changed, 21 insertions, 11 deletions
diff --git a/src/gen8_mfc.c b/src/gen8_mfc.c index 6979b06..b86f6a8 100644 --- a/src/gen8_mfc.c +++ b/src/gen8_mfc.c @@ -744,16 +744,29 @@ gen8_mfc_avc_slice_state(VADriverContextP ctx, int weighted_pred_idc = 0; unsigned int luma_log2_weight_denom = slice_param->luma_log2_weight_denom; unsigned int chroma_log2_weight_denom = slice_param->chroma_log2_weight_denom; - int bslice = 0; + int num_ref_l0 = 0, num_ref_l1 = 0; if (batch == NULL) batch = encoder_context->base.batch; - if (slice_type == SLICE_TYPE_P) { + if (slice_type == SLICE_TYPE_I) { + luma_log2_weight_denom = 0; + chroma_log2_weight_denom = 0; + } else if (slice_type == SLICE_TYPE_P) { weighted_pred_idc = pic_param->pic_fields.bits.weighted_pred_flag; + num_ref_l0 = pic_param->num_ref_idx_l0_active_minus1 + 1; + + if (slice_param->num_ref_idx_active_override_flag) + num_ref_l0 = slice_param->num_ref_idx_l0_active_minus1 + 1; } else if (slice_type == SLICE_TYPE_B) { weighted_pred_idc = pic_param->pic_fields.bits.weighted_bipred_idc; - bslice = 1; + num_ref_l0 = pic_param->num_ref_idx_l0_active_minus1 + 1; + num_ref_l1 = pic_param->num_ref_idx_l1_active_minus1 + 1; + + if (slice_param->num_ref_idx_active_override_flag) { + num_ref_l0 = slice_param->num_ref_idx_l0_active_minus1 + 1; + num_ref_l1 = slice_param->num_ref_idx_l1_active_minus1 + 1; + } if (weighted_pred_idc == 2) { /* 8.4.3 - Derivation process for prediction weights (8-279) */ @@ -778,14 +791,11 @@ gen8_mfc_avc_slice_state(VADriverContextP ctx, OUT_BCS_BATCH(batch, MFX_AVC_SLICE_STATE | (11 - 2) ); OUT_BCS_BATCH(batch, slice_type); /*Slice Type: I:P:B Slice*/ - if (slice_type == SLICE_TYPE_I) { - OUT_BCS_BATCH(batch, 0); /*no reference frames and pred_weight_table*/ - } else { - OUT_BCS_BATCH(batch, - (1 << 16) | (bslice << 24) | /*1 reference frame*/ - (chroma_log2_weight_denom << 8) | - (luma_log2_weight_denom << 0)); - } + OUT_BCS_BATCH(batch, + (num_ref_l0 << 16) | + (num_ref_l1 << 24) | + (chroma_log2_weight_denom << 8) | + (luma_log2_weight_denom << 0)); OUT_BCS_BATCH(batch, (weighted_pred_idc << 30) | |