Newer
Older
this->BestEncInfoCache ::copyState( *pOther, area );
#endif
this->SaveLoadEncInfoSbt ::copyState( *pOther );

Karsten Suehring
committed
m_skipThreshold = pOther->m_skipThreshold;
}
int EncModeCtrlMTnoRQT::getNumParallelJobs( const CodingStructure &cs, Partitioner& partitioner ) const
{

Karsten Suehring
committed
if( partitioner.canSplit( CU_TRIH_SPLIT, cs ) )

Karsten Suehring
committed
{

Karsten Suehring
committed
}
else if( partitioner.canSplit( CU_TRIV_SPLIT, cs ) )

Karsten Suehring
committed
{

Karsten Suehring
committed
}
else if( partitioner.canSplit( CU_HORZ_SPLIT, cs ) )

Karsten Suehring
committed
{
numJobs = 4;
}

Karsten Suehring
committed
{

Karsten Suehring
committed
}
else if( partitioner.canSplit( CU_QUAD_SPLIT, cs ) )

Karsten Suehring
committed
{
numJobs = 2;
}
else if( partitioner.canSplit( CU_DONT_SPLIT, cs ) )
{
numJobs = 1;

Karsten Suehring
committed
}
CHECK( numJobs >= NUM_RESERVERD_SPLIT_JOBS, "More jobs specified than allowed" );
return numJobs;
}
bool EncModeCtrlMTnoRQT::isParallelSplit( const CodingStructure &cs, Partitioner& partitioner ) const
{
if( partitioner.getImplicitSplit( cs ) != CU_DONT_SPLIT || cs.picture->scheduler.getSplitJobId() != 0 ) return false;
if( cs.pps->getUseDQP() && partitioner.currQgEnable() ) return false;

Karsten Suehring
committed
const int numJobs = getNumParallelJobs( cs, partitioner );
const int numPxl = partitioner.currArea().Y().area();
const int parlAt = m_pcEncCfg->getNumSplitThreads() <= 3 ? 1024 : 256;
if( cs.slice->isIntra() && numJobs > 2 && ( numPxl == parlAt || !partitioner.canSplit( CU_QUAD_SPLIT, cs ) ) ) return true;
if( !cs.slice->isIntra() && numJobs > 1 && ( numPxl == parlAt || !partitioner.canSplit( CU_QUAD_SPLIT, cs ) ) ) return true;

Karsten Suehring
committed
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
}
bool EncModeCtrlMTnoRQT::parallelJobSelector( const EncTestMode& encTestmode, const CodingStructure &cs, Partitioner& partitioner ) const
{
// Job descriptors
// - 1: all non-split modes
// - 2: QT-split
// - 3: all vertical modes but TT_V
// - 4: all horizontal modes but TT_H
// - 5: TT_V
// - 6: TT_H
switch( cs.picture->scheduler.getSplitJobId() )
{
case 1:
// be sure to execute post dont split
return !isModeSplit( encTestmode );
break;
case 2:
return encTestmode.type == ETM_SPLIT_QT;
break;
case 3:
return encTestmode.type == ETM_SPLIT_BT_V;

Karsten Suehring
committed
break;
case 4:
return encTestmode.type == ETM_SPLIT_BT_H;

Karsten Suehring
committed
break;
case 5:
return encTestmode.type == ETM_SPLIT_TT_V;
break;
case 6:
return encTestmode.type == ETM_SPLIT_TT_H;
break;
default:
THROW( "Unknown job-ID for parallelization of EncModeCtrlMTnoRQT: " << cs.picture->scheduler.getSplitJobId() );
break;
}
}
#endif