unsigned char correct[6], grow, shrink;
int i;
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;
if (batch == NULL)
batch = encoder_context->base.batch;
weighted_pred_idc = pic_param->pic_fields.bits.weighted_pred_flag;
} else if (slice_type == SLICE_TYPE_B) {
weighted_pred_idc = pic_param->pic_fields.bits.weighted_bipred_idc;
+
+ if (weighted_pred_idc == 2) {
+ /* 8.4.3 - Derivation process for prediction weights (8-279) */
+ luma_log2_weight_denom = 5;
+ chroma_log2_weight_denom = 5;
+ }
}
maxQpN = mfc_context->bit_rate_control_context[bit_rate_control_target].MaxQpNegModifier;
if (slice_type == SLICE_TYPE_I) {
OUT_BCS_BATCH(batch, 0); /*no reference frames and pred_weight_table*/
} else {
- OUT_BCS_BATCH(batch, 0x00010000); /*1 reference frame*/
+ OUT_BCS_BATCH(batch,
+ (1 << 16) | /*1 reference frame*/
+ (chroma_log2_weight_denom << 8) |
+ (luma_log2_weight_denom << 0));
}
OUT_BCS_BATCH(batch,