Skip to content

Commit

Permalink
Add a hotfix for IPF/Tiles with 2pRC operation
Browse files Browse the repository at this point in the history
  • Loading branch information
adamjw24 committed Jul 30, 2024
1 parent 4488526 commit 982a03a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
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

0 comments on commit 982a03a

Please sign in to comment.