Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a hotfix for IPF/Tiles with 2pRC operation #409

Merged
merged 2 commits into from
Jul 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions source/Lib/CommonLib/TypeDef.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ namespace vvenc {

#define IFP_RC_DETERMINISTIC 0 // Enables Rate Control deterministic behavior (same results) when using IFP

#define TILES_IFP_2PRC_HOTFIX 1 // Fix tiles and IFP with 2pRC operation, TODO: add proper fix, this is more of a dirty hotfix

// ====================================================================================================================
// General settings
// ====================================================================================================================
Expand Down
10 changes: 10 additions & 0 deletions source/Lib/EncoderLib/EncLib.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,16 @@ void EncLib::xInitRCCfg()
m_firstPassCfg.m_SourceHeight = ( m_encCfg.m_SourceHeight >> 1 ) & ( ~7 );
m_firstPassCfg.m_PadSourceWidth = m_firstPassCfg.m_SourceWidth;
m_firstPassCfg.m_PadSourceHeight = m_firstPassCfg.m_SourceHeight;
#if TILES_IFP_2PRC_HOTFIX
if( m_firstPassCfg.m_ifp && (m_firstPassCfg.m_numTileCols > 1 || m_firstPassCfg.m_numTileRows > 1) )
{
// due to sub-sampling, expected different tile configuration in cfg (m_tileRowHeight[], m_tileColumnWidth[])
// currently, disable auto tiles for the first pass
m_firstPassCfg.m_numTileCols = 1;
m_firstPassCfg.m_numTileRows = 1;
m_firstPassCfg.m_picPartitionFlag = false;
}
#endif
}

// preserve some settings
Expand Down