diff --git a/_studio/enctools/aenc/include/aenc.h b/_studio/enctools/aenc/include/aenc.h index 53cc8f2b5d..c25d1e4680 100644 --- a/_studio/enctools/aenc/include/aenc.h +++ b/_studio/enctools/aenc/include/aenc.h @@ -63,7 +63,7 @@ extern "C" { mfxU32 Type; //FrameType, e.g. MFX_FRAMETYPE_I mfxI32 DeltaQP; mfxU32 ClassAPQ; - mfxU32 SpatialComplexity; + mfxU32 ClassCmplx; mfxU32 KeepInDPB; mfxU32 RemoveFromDPBSize; mfxU32 RemoveFromDPB[32]; @@ -79,7 +79,7 @@ extern "C" { mfxStatus MFX_CDECL AEncProcessFrame(mfxHDL pthis, mfxU32 POC, mfxU8* InFrame, mfxI32 pitch, AEncFrame* OutFrame); mfxU16 MFX_CDECL AEncGetIntraDecision(mfxHDL pthis, mfxU32 displayOrder); mfxU16 MFX_CDECL AEncGetPersistenceMap(mfxHDL pthis, mfxU32 displayOrder, mfxU8 PMap[AENC_MAP_SIZE]); - void MFX_CDECL AEncUpdateFrame(mfxHDL pthis, mfxU32 displayOrder, mfxU32 bits, mfxU32 QpY); + void MFX_CDECL AEncUpdateFrame(mfxHDL pthis, mfxU32 displayOrder, mfxU32 bits, mfxU32 QpY, mfxU32 ClassCmplx); #ifdef __cplusplus } // extern "C" diff --git a/_studio/enctools/include/mfx_enctools_brc.h b/_studio/enctools/include/mfx_enctools_brc.h index 4e16a4ec37..1fda45ccf3 100644 --- a/_studio/enctools/include/mfx_enctools_brc.h +++ b/_studio/enctools/include/mfx_enctools_brc.h @@ -41,6 +41,7 @@ namespace EncToolsBRC constexpr mfxF64 RACA_SCALE = 128.0; constexpr mfxU8 TOTAL_NUM_AV1_SEGMENTS_FOR_ENCTOOLS = 7; + /* NalHrdConformance | VuiNalHrdParameters | Result -------------------------------------------------------------- @@ -149,7 +150,6 @@ class cBRCParams mfxU16 mHasALTR; // When mHasALTR, LTR marking decision (on/off) based on content. mfxU32 codecId; bool mMBBRC; // Enable Macroblock-CU level QP control (true/false) - bool lowPower; public: cBRCParams() : @@ -205,8 +205,7 @@ class cBRCParams mLaScale(0), mHasALTR(0), codecId(0), - mMBBRC(false), - lowPower(0) + mMBBRC(false) {} mfxStatus Init(mfxEncToolsCtrl const & ctrl, bool bMBBRC, bool bFieldMode); diff --git a/_studio/enctools/src/mfx_enctools_aenc.cpp b/_studio/enctools/src/mfx_enctools_aenc.cpp index 6aeb25e57b..93aaed67ef 100644 --- a/_studio/enctools/src/mfx_enctools_aenc.cpp +++ b/_studio/enctools/src/mfx_enctools_aenc.cpp @@ -173,7 +173,7 @@ mfxStatus AEnc_EncTool::ReportEncResult(mfxU32 displayOrder, mfxEncToolsBRCEncod mfxStatus sts = FindOutFrame(displayOrder); MFX_CHECK_STS(sts); - AEncUpdateFrame(m_aenc, displayOrder, pEncRes.CodedFrameSize*8, pEncRes.QpY); + AEncUpdateFrame(m_aenc, displayOrder, pEncRes.CodedFrameSize*8, pEncRes.QpY, (*m_frameIt).ClassCmplx); return MFX_ERR_NONE; } @@ -187,7 +187,6 @@ mfxStatus AEnc_EncTool::GetSCDecision(mfxU32 displayOrder, mfxEncToolsHintPreEnc pPreEncSC->SceneChangeFlag = static_cast((*m_frameIt).SceneChanged); pPreEncSC->RepeatedFrameFlag = static_cast((*m_frameIt).RepeatedFrame); pPreEncSC->TemporalComplexity = static_cast((*m_frameIt).TemporalComplexity); - pPreEncSC->SpatialComplexity = static_cast((*m_frameIt).SpatialComplexity); return sts; } diff --git a/_studio/enctools/src/mfx_enctools_brc.cpp b/_studio/enctools/src/mfx_enctools_brc.cpp index be6ad5dad1..87eb1a311b 100644 --- a/_studio/enctools/src/mfx_enctools_brc.cpp +++ b/_studio/enctools/src/mfx_enctools_brc.cpp @@ -126,7 +126,6 @@ mfxStatus cBRCParams::Init(mfxEncToolsCtrl const & ctrl, bool bMBBRC, bool field bFieldMode= fieldMode; codecId = ctrl.CodecId; - lowPower = IsOn(ctrl.LowPower); targetbps = ctrl.TargetKbps * 1000; maxbps = ctrl.MaxKbps * 1000; @@ -1042,9 +1041,10 @@ mfxStatus BRC_EncToolBase::UpdateFrame(mfxU32 dispOrder, mfxEncToolsBRCStatus *p mfxU16 isIntra = frameStruct.frameType & (MFX_FRAMETYPE_IDR | MFX_FRAMETYPE_I); bool bIdr = (picType == MFX_FRAMETYPE_IDR); mfxF64 qstep = QP2Qstep(qpY, m_par.quantOffset); - mfxU32 ParFrameCmplx = 0; - mfxU16 ParSceneChange = (ParFrameCmplx || frameStruct.LaAvgEncodedSize) ? frameStruct.sceneChange : 0; + mfxU16 ParSceneChange = (frameStruct.frameCmplx || frameStruct.LaAvgEncodedSize) ? frameStruct.sceneChange : 0; + mfxU32 ParFrameCmplx = frameStruct.frameCmplx; + if (isIntra && !ParFrameCmplx) ParFrameCmplx = frameStruct.LaAvgEncodedSize; mfxU16 ParQpModulation = frameStruct.qpModulation; mfxU16 miniGoPSize = frameStruct.miniGopSize == 0 ? m_par.gopRefDist : frameStruct.miniGopSize; if (ParQpModulation == MFX_QP_MODULATION_NOT_DEFINED @@ -1145,8 +1145,8 @@ mfxStatus BRC_EncToolBase::UpdateFrame(mfxU32 dispOrder, mfxEncToolsBRCStatus *p pFrameSts->FrameStatus.MinFrameSize = (m_hrdSpec->GetMinFrameSizeInBits(frameStruct.encOrder,bIdr) + 7) >> 3; //printf("%d: poc %d, size %d QP %d (%d %d), HRD sts %d, maxFrameSize %d, type %d \n",frame_par->EncodedOrder, frame_par->DisplayOrder, bitsEncoded, m_ctx.Quant, m_ctx.QuantMin, m_ctx.QuantMax, brcSts, m_hrd.GetMaxFrameSize(), frame_par->FrameType); } - bool bCalcSetI = (isIntra && (ParFrameCmplx > 0 || frameStruct.LaAvgEncodedSize) && frameStruct.encOrder == m_ctx.LastIEncOrder // We could set Qp - && ((ParSceneChange > 0 || frameStruct.encOrder == 0) && m_ctx.LastIQpSet == m_ctx.LastIQpMin)); // We did set Qp and/or was SceneChange + bool bCalcSetI = (isIntra && ParFrameCmplx > 0 && frameStruct.encOrder == m_ctx.LastIEncOrder // We could set Qp + && ((ParSceneChange > 0 || frameStruct.encOrder == 0) && m_ctx.LastIQpSet == m_ctx.LastIQpMin)); // We did set Qp and/or was SceneChange if ((e2pe > BRC_SCENE_CHANGE_RATIO2 && bitsEncoded > 4 * m_par.inputBitsPerFrame) || bCalcSetI ) @@ -1263,9 +1263,9 @@ mfxStatus BRC_EncToolBase::UpdateFrame(mfxU32 dispOrder, mfxEncToolsBRCStatus *p mfxF64 lFR = std::min(m_par.gopPicSize - 1, 4); mfxF64 lowFrameSizeI = std::min(maxFrameSize, lFR *(mfxF64)m_par.inputBitsPerFrame); // Did we set the qp? - if (isIntra && (ParFrameCmplx > 0 || frameStruct.LaAvgEncodedSize) // We could set Qp + if (isIntra && ParFrameCmplx > 0 // We could set Qp && frameStruct.encOrder == m_ctx.LastIEncOrder && m_ctx.LastIQpSet == m_ctx.LastIQpMin // We did set Qp - && frameStruct.numRecode == 0 && bitsEncoded < (lowFrameSizeI / 2.0) && quant > quantMin) // We can & should recode + && frameStruct.numRecode == 0 && bitsEncoded < (lowFrameSizeI / 2.0) && quant > quantMin) // We can & should recode { // too small; do something mfxI32 quant_new = GetNewQP(bitsEncoded, (mfxU32)lowFrameSizeI, quantMin, quantMax, quant, m_par.quantOffset, 0.78, false, true); @@ -1418,7 +1418,7 @@ mfxStatus BRC_EncToolBase::UpdateFrame(mfxU32 dispOrder, mfxEncToolsBRCStatus *p m_ctx.totalDeviation += ((mfxF64)bitsEncoded - m_par.inputBitsPerFrame); - //printf("------------------ %d (%d)) Total deviation %f, old scene %d, bNeedUpdateQP %d, m_ctx.Quant %d, type %d, m_ctx.fAbLong %f m_par.inputBitsPerFrame %f\n", frameStruct.encOrder, frameStruct.dispOrder,m_ctx.totalDeviation, oldScene , bNeedUpdateQP, m_ctx.Quant,picType, m_ctx.fAbLong, m_par.inputBitsPerFrame); + //printf("------------------ %d (%d)) Total deviation %f, old scene %d, bNeedUpdateQP %d, m_ctx.Quant %d, type %d, m_ctx.fAbLong %f m_par.inputBitsPerFrame %f\n", frame_par->EncodedOrder, frame_par->DisplayOrder,m_ctx.totalDeviation, oldScene , bNeedUpdateQP, m_ctx.Quant,picType, m_ctx.fAbLong, m_par.inputBitsPerFrame); if (m_par.HRDConformance != MFX_BRC_NO_HRD) { m_hrdSpec->Update(bitsEncoded, frameStruct.encOrder, bIdr); @@ -1605,35 +1605,11 @@ mfxI32 BRC_EncToolBase::GetLaQpEst(mfxU32 LaAvgEncodedSize, mfxF64 inputBitsPerF { if (m_par.codecId == MFX_CODEC_AVC) { - if(m_par.mLaQp != 26 || !frameStruct.frameCmplx || !m_par.lowPower) { - laQp = (mfxI32)(0.679f*laQ + 0.465f); // NN V L - } else { - mfxF32 R = (mfxF32) ((1.5 * m_par.width * m_par.height) / (inputBitsPerFrame * m_par.frameRate / 1000.0)); - mfxF32 SC = (mfxF32) frameStruct.frameCmplx; - mfxF32 C = std::max(SC / (128*64), 0.03f); - mfxF32 B = (mfxF32)laScaledSize / (mfxF32) (1.5 * m_par.width * m_par.height); - mfxF32 F = (mfxF32) (std::max(std::min(m_par.frameRate, 61.0), 23.0)); - const mfxF32 Alpha=0.094160103f, Beta=0.70605035f, Gamma=0.551621897f, Delta=0.042768353f, Epsilon=0.457860107f; - mfxF32 Q = Alpha * powf(R, Beta) * powf(F, Epsilon) * powf(B, Gamma) * powf(C, Delta); - mfxF32 Qp = 6.f * (logf(Q)/logf(2.f)) + 2.f; - laQp = (mfxI32) (Qp); - } + laQp = (mfxI32)(0.679f*laQ + 0.465f); // NN V L } else { - if(m_par.mLaQp != 26 || !frameStruct.frameCmplx || !m_par.lowPower) { - laQp = (mfxI32)(0.6634f*laQ - 0.035f); // NN V L - } else { - mfxF32 R = (mfxF32) ((1.5 * m_par.width * m_par.height) / (inputBitsPerFrame * m_par.frameRate / 1000.0)); - mfxF32 SC = (mfxF32) frameStruct.frameCmplx; - mfxF32 C = std::max(SC / (128*64), 0.03f); - mfxF32 B = (mfxF32)laScaledSize / (mfxF32) (1.5 * m_par.width * m_par.height); - mfxF32 F = (mfxF32) (std::max(std::min(m_par.frameRate, 61.0), 23.0)); - const mfxF32 Alpha=0.095227005f, Beta=0.661596921f, Gamma=0.486806893f, Delta=0.078518546f, Epsilon=0.446383738f; - mfxF32 Q = Alpha * powf(R, Beta) * powf(F, Epsilon) * powf(B, Gamma) * powf(C, Delta); - mfxF32 Qp = 6.f * (logf(Q)/logf(2.f)) + 3.f; - laQp = (mfxI32) (Qp); - } + laQp = (mfxI32)(0.6634f*laQ - 0.035f); // NN V L } } else @@ -1663,7 +1639,7 @@ mfxStatus BRC_EncToolBase::ProcessFrame(mfxU32 dispOrder, mfxEncToolsBRCQuantCon mfxU16 ParSceneChange = frameStruct.sceneChange; mfxU16 ParLongTerm = frameStruct.longTerm; - mfxU32 ParFrameCmplx = 0; // Used only for LA models for now + mfxU32 ParFrameCmplx = frameStruct.frameCmplx; mfxU16 ParQpModulation = frameStruct.qpModulation; mfxI32 ParQpDeltaP = 0; mfxU16 miniGoPSize = frameStruct.miniGopSize == 0 ? m_par.gopRefDist : frameStruct.miniGopSize; @@ -2039,10 +2015,9 @@ mfxStatus BRC_EncToolBase::ProcessFrame(mfxU32 dispOrder, mfxEncToolsBRCQuantCon } frameStruct.qp = qp - m_par.quantOffset; - //printf("EncOrder %d recode %d type %d ctrl->QpY %d, qp %d PyrLayer %d QpMod %d quantOffset %d - // Cmplx %ld LaCurEncodedSize %d LaAvgEncodedSize %d Deviation %f\n", - // frameStruct.encOrder, frameStruct.numRecode, type, frameStruct.qp, qp, frameStruct.pyrLayer, ParQpModulation, m_par.quantOffset, - // ParFrameCmplx, frameStruct.LaCurEncodedSize, frameStruct.LaAvgEncodedSize, m_ctx.totalDeviation); + //printf("EncOrder %d type %d ctrl->QpY %d, qp %d PyrLayer %d QpMod %d quantOffset %d Cmplx %ld LaCurEncodedSize %d LaAvgEncodedSize %d\n", + // frameStruct.encOrder, type, frameStruct.qp, qp, frameStruct.pyrLayer, ParQpModulation, m_par.quantOffset, + // ParFrameCmplx, frameStruct.LaCurEncodedSize, frameStruct.LaAvgEncodedSize); if (isIntra) { m_ctx.LastIQpSetOrder = frameStruct.encOrder; @@ -2098,7 +2073,6 @@ mfxStatus BRC_EncToolBase::SetFrameStruct(mfxU32 dispOrder, mfxEncToolsBRCFrameP frStruct.encOrder = pFrameStruct.EncodeOrder; frStruct.longTerm = pFrameStruct.LongTerm; frStruct.sceneChange = pFrameStruct.SceneChange; - frStruct.frameCmplx = pFrameStruct.SpatialComplexity; frStruct.PersistenceMapNZ = pFrameStruct.PersistenceMapNZ; memcpy(frStruct.PersistenceMap, pFrameStruct.PersistenceMap, sizeof(frStruct.PersistenceMap)); m_FrameStruct.push_back(frStruct); @@ -2112,7 +2086,6 @@ mfxStatus BRC_EncToolBase::SetFrameStruct(mfxU32 dispOrder, mfxEncToolsBRCFrameP (*frameStruct).numRecode++; // ??? check (*frameStruct).longTerm = pFrameStruct.LongTerm; (*frameStruct).sceneChange = pFrameStruct.SceneChange; - (*frameStruct).frameCmplx = pFrameStruct.SpatialComplexity; (*frameStruct).PersistenceMapNZ = pFrameStruct.PersistenceMapNZ; memcpy((*frameStruct).PersistenceMap, pFrameStruct.PersistenceMap, sizeof((*frameStruct).PersistenceMap)); diff --git a/_studio/mfx_lib/encode_hw/av1/agnostic/base/av1ehw_base_data.h b/_studio/mfx_lib/encode_hw/av1/agnostic/base/av1ehw_base_data.h index 613ade4340..cfaf970af6 100644 --- a/_studio/mfx_lib/encode_hw/av1/agnostic/base/av1ehw_base_data.h +++ b/_studio/mfx_lib/encode_hw/av1/agnostic/base/av1ehw_base_data.h @@ -771,11 +771,10 @@ namespace Base /* Scene Change parameter */ mfxU16 SceneChange = 0; #if defined(MFX_ENABLE_ENCTOOLS) - mfxU16 SpatialComplexity = 0; /* Persistence Map */ mfxU16 PersistenceMapNZ; mfxU8 PersistenceMap[MFX_ENCTOOLS_PREENC_MAP_SIZE]; -#endif +#endif }; using RepeatedFrames = std::vector; diff --git a/_studio/mfx_lib/encode_hw/av1/agnostic/base/av1ehw_base_enctools.cpp b/_studio/mfx_lib/encode_hw/av1/agnostic/base/av1ehw_base_enctools.cpp index d3b59ee283..6024118a49 100644 --- a/_studio/mfx_lib/encode_hw/av1/agnostic/base/av1ehw_base_enctools.cpp +++ b/_studio/mfx_lib/encode_hw/av1/agnostic/base/av1ehw_base_enctools.cpp @@ -903,7 +903,6 @@ mfxStatus AV1EncTools::BRCGetCtrl(StorageW& global, StorageW& s_task, extFrameData.FrameType = task.FrameType; extFrameData.PyramidLayer = (mfxU16) task.PyramidLevel; extFrameData.SceneChange = task.GopHints.SceneChange; - extFrameData.SpatialComplexity = task.GopHints.SpatialComplexity; extFrameData.PersistenceMapNZ = task.GopHints.PersistenceMapNZ; if (extFrameData.PersistenceMapNZ) memcpy(extFrameData.PersistenceMap, task.GopHints.PersistenceMap, sizeof(extFrameData.PersistenceMap)); @@ -1106,7 +1105,6 @@ mfxStatus AV1EncTools::QueryPreEncTask(StorageW& /*global*/, StorageW& s_task) task.GopHints.MiniGopSize = preEncodeGOP.MiniGopSize; task.GopHints.FrameType = preEncodeGOP.FrameType; task.GopHints.SceneChange = preEncodeSChg.SceneChangeFlag; - task.GopHints.SpatialComplexity = preEncodeSChg.SpatialComplexity; task.GopHints.PersistenceMapNZ = preEncodeSChg.PersistenceMapNZ; if (preEncodeSChg.PersistenceMapNZ) memcpy(task.GopHints.PersistenceMap, preEncodeSChg.PersistenceMap, sizeof(task.GopHints.PersistenceMap)); diff --git a/_studio/mfx_lib/encode_hw/h264/include/mfx_h264_encode_hw_utils.h b/_studio/mfx_lib/encode_hw/h264/include/mfx_h264_encode_hw_utils.h index c944b630e1..df3a9322c6 100644 --- a/_studio/mfx_lib/encode_hw/h264/include/mfx_h264_encode_hw_utils.h +++ b/_studio/mfx_lib/encode_hw/h264/include/mfx_h264_encode_hw_utils.h @@ -1062,11 +1062,8 @@ namespace MfxHwH264Encode #endif , m_TCBRCTargetFrameSize(0) , m_SceneChange(0) -#if defined(MFX_ENABLE_ENCTOOLS) - , m_SpatialComplexity(0) , m_PersistenceMapNZ(0) - , m_PersistenceMap{} -#endif + , m_PersistenceMap{} #if defined(MFX_ENABLE_MCTF_IN_AVC) , m_doMCTFIntraFiltering(0) #endif @@ -1365,11 +1362,8 @@ namespace MfxHwH264Encode #endif mfxU32 m_TCBRCTargetFrameSize; mfxU32 m_SceneChange; -#if defined(MFX_ENABLE_ENCTOOLS) - mfxU16 m_SpatialComplexity; mfxU16 m_PersistenceMapNZ; - mfxU8 m_PersistenceMap[128]; -#endif + mfxU8 m_PersistenceMap[128]; #if defined(MFX_ENABLE_MCTF_IN_AVC) mfxU32 m_doMCTFIntraFiltering; #endif @@ -2274,8 +2268,7 @@ class H264EncTools { MFX_CHECK(m_pEncTools != 0, MFX_ERR_NOT_INITIALIZED); MFX_CHECK(IsOn(m_EncToolConfig.AdaptiveI) || - IsOn(m_EncToolConfig.AdaptiveLTR) || - IsOn(m_EncToolConfig.BRC), MFX_ERR_NOT_INITIALIZED); + IsOn(m_EncToolConfig.AdaptiveLTR), MFX_ERR_NOT_INITIALIZED); mfxEncToolsTaskParam par = {}; par.DisplayOrder = displayOrder; @@ -2361,10 +2354,9 @@ class H264EncTools extFrameStruct.PyramidLayer = frame_par->PyramidLayer; extFrameStruct.LongTerm = frame_par->LongTerm; extFrameStruct.SceneChange = frame_par->SceneChange; - extFrameStruct.SpatialComplexity = task.m_SpatialComplexity; extFrameStruct.PersistenceMapNZ = task.m_PersistenceMapNZ; if (task.m_PersistenceMapNZ) - memcpy(extFrameStruct.PersistenceMap, task.m_PersistenceMap, sizeof(task.m_PersistenceMap)); + memcpy(extFrameStruct.PersistenceMap, task.m_PersistenceMap, sizeof(task.m_PersistenceMap)); extParams.push_back((mfxExtBuffer *)&extFrameStruct); if (frame_par->OptimalFrameSizeInBytes | frame_par->LaAvgEncodedSize) diff --git a/_studio/mfx_lib/encode_hw/h264/src/mfx_h264_encode_hw.cpp b/_studio/mfx_lib/encode_hw/h264/src/mfx_h264_encode_hw.cpp index da23b4a442..422e3c0654 100644 --- a/_studio/mfx_lib/encode_hw/h264/src/mfx_h264_encode_hw.cpp +++ b/_studio/mfx_lib/encode_hw/h264/src/mfx_h264_encode_hw.cpp @@ -3219,15 +3219,14 @@ mfxStatus ImplementationAvc::FillPreEncParams(DdiTask &task) } } - if (m_encTools.IsAdaptiveI() || m_encTools.IsAdaptiveLTR() || m_encTools.IsBRC()) { + if (m_encTools.IsAdaptiveI() || m_encTools.IsAdaptiveLTR()) { mfxEncToolsHintPreEncodeSceneChange schg = {}; sts = m_encTools.QueryPreEncSChg(task.m_frameOrder, schg); MFX_CHECK_STS(sts); task.m_SceneChange = schg.SceneChangeFlag; - task.m_SpatialComplexity = schg.SpatialComplexity; task.m_PersistenceMapNZ = schg.PersistenceMapNZ; if(task.m_PersistenceMapNZ) - memcpy(task.m_PersistenceMap, schg.PersistenceMap, sizeof(task.m_PersistenceMap)); + memcpy(task.m_PersistenceMap, schg.PersistenceMap, sizeof(task.m_PersistenceMap)); } if (m_encTools.IsAdaptiveLTR() || m_encTools.IsAdaptiveRef()) diff --git a/_studio/mfx_lib/encode_hw/hevc/agnostic/base/hevcehw_base_data.h b/_studio/mfx_lib/encode_hw/hevc/agnostic/base/hevcehw_base_data.h index d9bfb09c68..dc81586b75 100644 --- a/_studio/mfx_lib/encode_hw/hevc/agnostic/base/hevcehw_base_data.h +++ b/_studio/mfx_lib/encode_hw/hevc/agnostic/base/hevcehw_base_data.h @@ -753,12 +753,9 @@ namespace Base mfxU32 QPModulaton = 0; /* Scene Change parameter */ mfxU16 SceneChange = 0; -#if defined(MFX_ENABLE_ENCTOOLS) - mfxU16 SpatialComplexity = 0; /* Maps */ mfxU16 PersistenceMapNZ; mfxU8 PersistenceMap[128]; -#endif }; struct mfxBRCHints { diff --git a/_studio/mfx_lib/encode_hw/hevc/agnostic/base/hevcehw_base_enctools.cpp b/_studio/mfx_lib/encode_hw/hevc/agnostic/base/hevcehw_base_enctools.cpp index 86758304fa..71e2b5908b 100644 --- a/_studio/mfx_lib/encode_hw/hevc/agnostic/base/hevcehw_base_enctools.cpp +++ b/_studio/mfx_lib/encode_hw/hevc/agnostic/base/hevcehw_base_enctools.cpp @@ -830,7 +830,6 @@ mfxStatus HevcEncTools::BRCGetCtrl(StorageW& global , StorageW& s_task, extFrameData.FrameType = task.FrameType; extFrameData.PyramidLayer = (mfxU16) task.PyramidLevel; extFrameData.SceneChange = task.GopHints.SceneChange; - extFrameData.SpatialComplexity = task.GopHints.SpatialComplexity; extFrameData.PersistenceMapNZ = task.GopHints.PersistenceMapNZ; memcpy(extFrameData.PersistenceMap, task.GopHints.PersistenceMap, sizeof(extFrameData.PersistenceMap)); @@ -1010,8 +1009,8 @@ mfxStatus HevcEncTools::QueryPreEncTask(StorageW& global, StorageW& s_task) task.GopHints.MiniGopSize = preEncodeGOP.MiniGopSize; task.GopHints.FrameType = preEncodeGOP.FrameType; task.GopHints.SceneChange = preEncodeSChg.SceneChangeFlag; - task.GopHints.SpatialComplexity = preEncodeSChg.SpatialComplexity; task.GopHints.PersistenceMapNZ = preEncodeSChg.PersistenceMapNZ; + if (qpMapHint.QpMapFilled) task.bCUQPMap = true; memcpy(task.GopHints.PersistenceMap, preEncodeSChg.PersistenceMap, sizeof(task.GopHints.PersistenceMap)); diff --git a/contrib/aenc/libaenc.a b/contrib/aenc/libaenc.a index e30bc0f547..b6982ead80 100644 Binary files a/contrib/aenc/libaenc.a and b/contrib/aenc/libaenc.a differ