From cbd2114ede7c748c1f73e7a2b4f8f82030ba5c57 Mon Sep 17 00:00:00 2001 From: Jabin_Wu Date: Thu, 5 Sep 2019 22:00:43 +0800 Subject: [PATCH] [Encode] Set Log2WeightDenomLuma to 0 in MFX AVC SLICE STATE AVC VDEnc implicit mode weighted prediction requires Log2WeightDenomLuma = 0 in MFX AVC SLICE STATE. Change-Id: I949a305d49e233ea27ea54663e2eba63ea3efedf --- .../common/hw/vdbox/mhw_vdbox_mfx_generic.h | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/media_driver/agnostic/common/hw/vdbox/mhw_vdbox_mfx_generic.h b/media_driver/agnostic/common/hw/vdbox/mhw_vdbox_mfx_generic.h index 92afbd7aa39..b4d1b71299e 100644 --- a/media_driver/agnostic/common/hw/vdbox/mhw_vdbox_mfx_generic.h +++ b/media_driver/agnostic/common/hw/vdbox/mhw_vdbox_mfx_generic.h @@ -763,9 +763,17 @@ class MhwVdboxMfxInterfaceGeneric : public MhwVdboxMfxInterface cmd.DW3.WeightedPredictionIndicator = picParams->weighted_bipred_idc; if (picParams->weighted_bipred_idc == IMPLICIT_WEIGHTED_INTER_PRED_MODE) { - // SNB requirement - cmd.DW2.Log2WeightDenomLuma = 5; - cmd.DW2.Log2WeightDenomChroma = 5; + if (avcSliceState->bVdencInUse) + { + cmd.DW2.Log2WeightDenomLuma = 0; + cmd.DW2.Log2WeightDenomChroma = 0; + } + else + { + // SNB requirement + cmd.DW2.Log2WeightDenomLuma = 5; + cmd.DW2.Log2WeightDenomChroma = 5; + } } cmd.DW9.Roundinterenable = avcSliceState->bRoundingInterEnable;