Skip to content

Commit

Permalink
Revert "Use EncTool + Noisy Content Check to enable ACQM + dblk " (#4…
Browse files Browse the repository at this point in the history
…254)

This reverts commit 3af64c8

Co-authored-by: kaiyixix <[email protected]>
  • Loading branch information
gfxVPLsdm and kaiyixix authored Dec 26, 2022
1 parent 6f7ecc1 commit e210283
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 42 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,15 @@ inline bool IsBRC(const mfxExtEncToolsConfig &config)
IsOn(config.BRC);
}


inline bool IsEncToolsOptSet(const mfxExtEncToolsConfig& config)
{
return
(config.AdaptiveB | config.AdaptiveI | config.AdaptiveLTR | config.AdaptivePyramidQuantB
| config.AdaptivePyramidQuantP | config.AdaptiveQuantMatrices | config.AdaptiveRefB
| config.AdaptiveRefP | config.BRC | config.BRCBufferHints | config.SceneChange);
}

bool HEVCEHW::Base::IsEncToolsOptOn(const mfxExtEncToolsConfig &config, bool bGameStreaming)
{
return
Expand Down Expand Up @@ -303,14 +312,7 @@ static void SetDefaultConfig(const mfxVideoParam &video, mfxExtEncToolsConfig &c
bool lplaAssistedBRC = IsOn(config.BRC) && isSWLACondition(video);
SetDefaultOpt(config.BRCBufferHints, lplaAssistedBRC);
SetDefaultOpt(config.AdaptiveMBQP, bMBQPSupport && lplaAssistedBRC && IsOn(pExtOpt2->MBBRC));
#ifdef ONEVPL_EXPERIMENTAL
if (IsEncToolsOptSet(config) && pExtOpt3->ContentInfo == MFX_CONTENT_NOISY_VIDEO)
SetDefaultOpt(config.AdaptiveQuantMatrices, true);
else
SetDefaultOpt(config.AdaptiveQuantMatrices, false);
#else
SetDefaultOpt(config.AdaptiveQuantMatrices, false);
#endif
}
#ifdef MFX_ENABLE_ENCTOOLS_LPLA
else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,24 +100,6 @@ namespace Base
bool IsEncToolsOptOn(const mfxExtEncToolsConfig &config, bool bGameStreaming);
bool IsLPLAEncToolsOn(const mfxExtEncToolsConfig &config, bool bGameStreaming);

inline bool IsEncToolsOptSet(const mfxExtEncToolsConfig& config)
{
return
(config.AdaptiveB | config.AdaptiveI | config.AdaptiveLTR | config.AdaptivePyramidQuantB
| config.AdaptivePyramidQuantP | config.AdaptiveQuantMatrices | config.AdaptiveRefB
| config.AdaptiveRefP | config.BRC | config.BRCBufferHints | config.SceneChange);
}

inline int EncToolsDeblockingBetaOffset()
{
return 4; // Currently hard coded to best tested value when using enctools
}

inline int EncToolsDeblockingAlphaTcOffset()
{
return 2; // Currently hard coded to best tested value when using enctools
}

} //Base
} //namespace HEVCEHW

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,6 @@
#include <numeric>
#include <set>

#ifdef MFX_ENABLE_ENCTOOLS
#include "hevcehw_base_enctools.h"
#endif

using namespace HEVCEHW;
using namespace HEVCEHW::Base;

Expand Down Expand Up @@ -2024,19 +2020,6 @@ class GetDefault
pps.deblocking_filter_control_present_flag = 1;
pps.deblocking_filter_disabled_flag = !!CO2.DisableDeblockingIdc;
pps.deblocking_filter_override_enabled_flag = 1; // to disable deblocking per frame

#if defined(MFX_ENABLE_ENCTOOLS)
#if defined(ONEVPL_EXPERIMENTAL)
const mfxExtEncToolsConfig* pConfig = ExtBuffer::Get(par);
bool bEncTools = IsEncToolsOptSet(*pConfig);

if (bEncTools && CO3.ScenarioInfo != MFX_SCENARIO_GAME_STREAMING && CO3.ContentInfo == MFX_CONTENT_NOISY_VIDEO) {
pps.beta_offset_div2 = mfxI8(EncToolsDeblockingBetaOffset() * 0.5 * !pps.deblocking_filter_disabled_flag);
pps.tc_offset_div2 = mfxI8(EncToolsDeblockingAlphaTcOffset() * 0.5 * !pps.deblocking_filter_disabled_flag);
}
#endif
#endif

pps.scaling_list_data_present_flag = 0;
pps.lists_modification_present_flag = 1;
pps.log2_parallel_merge_level_minus2 = 0;
Expand Down

0 comments on commit e210283

Please sign in to comment.