diff options
author | Xiang, Haihao <haihao.xiang@intel.com> | 2013-09-30 13:12:17 +0800 |
---|---|---|
committer | Xiang, Haihao <haihao.xiang@intel.com> | 2013-11-13 15:29:47 +0800 |
commit | 5f01b4f23db1afebebdec1e70939a28083443940 (patch) | |
tree | 5064cc69d4c2f92bb49554964676f78c878eebf2 /src/gen6_mfc.c | |
parent | 37e75533107a20c2ae3367aa6076c00e7c7bff13 (diff) | |
download | libva-intel-driver-5f01b4f23db1afebebdec1e70939a28083443940.tar.gz libva-intel-driver-5f01b4f23db1afebebdec1e70939a28083443940.tar.bz2 libva-intel-driver-5f01b4f23db1afebebdec1e70939a28083443940.zip |
Follow the input Picture/Slice parameters to generate slice header/data
Signed-off-by: Xiang, Haihao <haihao.xiang@intel.com>
(cherry picked from commit f5a694e64d0163178c28dc25d9a3e7b9b1b5d162)
Diffstat (limited to 'src/gen6_mfc.c')
-rw-r--r-- | src/gen6_mfc.c | 32 |
1 files changed, 21 insertions, 11 deletions
diff --git a/src/gen6_mfc.c b/src/gen6_mfc.c index d152ed9..4d13e1f 100644 --- a/src/gen6_mfc.c +++ b/src/gen6_mfc.c @@ -360,16 +360,29 @@ gen6_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) */ @@ -394,14 +407,11 @@ gen6_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) | |