summaryrefslogtreecommitdiff
path: root/i965_avc_bsd.c
diff options
context:
space:
mode:
authorXiang, Haihao <haihao.xiang@intel.com>2010-04-19 13:31:23 +0800
committerXiang, Haihao <haihao.xiang@intel.com>2010-04-19 13:31:23 +0800
commitf217718d0251cf2d175ed96d80dc87007d5630b8 (patch)
treeca607740b17f719f444b90cf048c332efea84179 /i965_avc_bsd.c
parentdf2a83da054f7668e174836a2d3377bd6d267b1c (diff)
downloadlibva-intel-driver-f217718d0251cf2d175ed96d80dc87007d5630b8.tar.gz
libva-intel-driver-f217718d0251cf2d175ed96d80dc87007d5630b8.tar.bz2
libva-intel-driver-f217718d0251cf2d175ed96d80dc87007d5630b8.zip
i965_drv_video: [H.264] fix weight 128 issue
Diffstat (limited to 'i965_avc_bsd.c')
-rw-r--r--i965_avc_bsd.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/i965_avc_bsd.c b/i965_avc_bsd.c
index 157bf16..d00fe7d 100644
--- a/i965_avc_bsd.c
+++ b/i965_avc_bsd.c
@@ -263,16 +263,17 @@ i965_avc_bsd_slice_state(VADriverContextP ctx,
cmd_len += 16;
}
- if (pic_param->pic_fields.bits.weighted_pred_flag == 1 ||
- pic_param->pic_fields.bits.weighted_bipred_idc == 1) {
+ if ((slice_param->slice_type == SLICE_TYPE_P ||
+ slice_param->slice_type == SLICE_TYPE_SP) &&
+ (pic_param->pic_fields.bits.weighted_pred_flag == 1)) {
present_flag |= PRESENT_WEIGHT_OFFSET_L0;
cmd_len += 48;
}
- if (pic_param->pic_fields.bits.weighted_bipred_idc == 1) {
- present_flag |= PRESENT_WEIGHT_OFFSET_L1;
- cmd_len += 48;
- assert(slice_param->slice_type == SLICE_TYPE_B);
+ if ((slice_param->slice_type == SLICE_TYPE_B) &&
+ (pic_param->pic_fields.bits.weighted_bipred_idc == 1)) {
+ present_flag |= PRESENT_WEIGHT_OFFSET_L0 | PRESENT_WEIGHT_OFFSET_L1;
+ cmd_len += 96;
}
BEGIN_BCS_BATCH(ctx, cmd_len);
@@ -346,7 +347,8 @@ i965_avc_bsd_slice_state(VADriverContextP ctx,
weightoffsets[j * 6 + 4] = slice_param->chroma_offset_l0[j][1];
weightoffsets[j * 6 + 5] = slice_param->chroma_weight_l0[j][1];
- if (pic_param->pic_fields.bits.weighted_bipred_idc == 1) {
+ if (pic_param->pic_fields.bits.weighted_pred_flag == 1 ||
+ pic_param->pic_fields.bits.weighted_bipred_idc == 1) {
if (i965_h264_context->use_hw_w128) {
if (slice_param->luma_weight_l0[j] == 128)
i965_h264_context->weight128_luma_l0 |= (1 << j);