Commit d466acdb authored by Santiago de Luxán Hernández's avatar Santiago de Luxán Hernández Committed by Frank Bossen

Fix for Ticket #209: Exception thrown in 'estIntraPredChromaQT' function

parent 93369272
......@@ -1156,8 +1156,8 @@ void CABACReader::pred_mode( CodingUnit& cu )
void CABACReader::pcm_flag( CodingUnit& cu, Partitioner &partitioner )
{
const SPS& sps = *cu.cs->sps;
if( !sps.getPCMEnabledFlag() || partitioner.currArea().lwidth() > (1 << sps.getPCMLog2MaxSize()) || partitioner.currArea().lwidth() < (1 << sps.getPCMLog2MinSize())
|| partitioner.currArea().lheight() > (1 << sps.getPCMLog2MaxSize()) || partitioner.currArea().lheight() < (1 << sps.getPCMLog2MinSize()) )
if( !sps.getPCMEnabledFlag() || cu.lwidth() > (1 << sps.getPCMLog2MaxSize()) || cu.lwidth() < (1 << sps.getPCMLog2MinSize())
|| cu.lheight() > (1 << sps.getPCMLog2MaxSize()) || cu.lheight() < (1 << sps.getPCMLog2MinSize()) )
{
cu.ipcm = false;
return;
......@@ -1285,7 +1285,7 @@ void CABACReader::extend_ref_line(CodingUnit& cu)
return;
#endif
if (!cu.Y().valid() || cu.predMode != MODE_INTRA || !isLuma(cu.chType))
if (!cu.Y().valid() || cu.predMode != MODE_INTRA || !isLuma(cu.chType) || cu.ipcm)
{
cu.firstPU->multiRefIdx = 0;
return;
......@@ -3024,7 +3024,7 @@ void CABACReader::emt_cu_flag( CodingUnit& cu )
#if JVET_M0102_INTRA_SUBPARTITIONS
void CABACReader::isp_mode( CodingUnit& cu )
{
if( !CU::isIntra( cu ) || !isLuma( cu.chType ) || cu.firstPU->multiRefIdx )
if( !CU::isIntra( cu ) || !isLuma( cu.chType ) || cu.firstPU->multiRefIdx || cu.ipcm )
{
cu.ispMode = NOT_INTRA_SUBPARTITIONS;
return;
......
......@@ -897,8 +897,8 @@ void CABACWriter::pcm_data( const CodingUnit& cu, Partitioner& partitioner )
void CABACWriter::pcm_flag( const CodingUnit& cu, Partitioner& partitioner )
{
const SPS& sps = *cu.cs->sps;
if( !sps.getPCMEnabledFlag() || partitioner.currArea().lwidth() > (1 << sps.getPCMLog2MaxSize()) || partitioner.currArea().lwidth() < (1 << sps.getPCMLog2MinSize())
|| partitioner.currArea().lheight() > (1 << sps.getPCMLog2MaxSize()) || partitioner.currArea().lheight() < (1 << sps.getPCMLog2MinSize()) )
if( !sps.getPCMEnabledFlag() || cu.lwidth() > (1 << sps.getPCMLog2MaxSize()) || cu.lwidth() < (1 << sps.getPCMLog2MinSize())
|| cu.lheight() > (1 << sps.getPCMLog2MaxSize()) || cu.lheight() < (1 << sps.getPCMLog2MinSize()) )
{
return;
}
......@@ -1047,7 +1047,7 @@ void CABACWriter::extend_ref_line(const CodingUnit& cu)
return;
#endif
if (!cu.Y().valid() || cu.predMode != MODE_INTRA || !isLuma(cu.chType))
if (!cu.Y().valid() || cu.predMode != MODE_INTRA || !isLuma(cu.chType) || cu.ipcm)
{
return;
}
......@@ -2877,7 +2877,7 @@ void CABACWriter::emt_cu_flag( const CodingUnit& cu )
#if JVET_M0102_INTRA_SUBPARTITIONS
void CABACWriter::isp_mode( const CodingUnit& cu )
{
if( !CU::isIntra( cu ) || !isLuma( cu.chType ) || cu.firstPU->multiRefIdx )
if( !CU::isIntra( cu ) || !isLuma( cu.chType ) || cu.firstPU->multiRefIdx || cu.ipcm )
{
CHECK( cu.ispMode != NOT_INTRA_SUBPARTITIONS, "error: cu.intraSubPartitions != 0" );
return;
......
......@@ -1736,12 +1736,12 @@ void EncCu::xCheckRDCostIntra( CodingStructure *&tempCS, CodingStructure *&bestC
m_CABACEstimator->cu_skip_flag ( cu );
}
m_CABACEstimator->pred_mode ( cu );
m_CABACEstimator->pcm_data ( cu, partitioner );
m_CABACEstimator->extend_ref_line( cu );
#if JVET_M0102_INTRA_SUBPARTITIONS
m_CABACEstimator->isp_mode ( cu );
#endif
m_CABACEstimator->cu_pred_data ( cu );
m_CABACEstimator->pcm_data ( cu, partitioner );
// Encode Coefficients
CUCtx cuCtx;
......
......@@ -1472,10 +1472,6 @@ void IntraSearch::xEncIntraHeader(CodingStructure &cs, Partitioner &partitioner,
m_CABACEstimator->cu_skip_flag( cu );
m_CABACEstimator->pred_mode ( cu );
}
m_CABACEstimator->extend_ref_line(cu);
#if JVET_M0102_INTRA_SUBPARTITIONS
m_CABACEstimator->isp_mode ( cu );
#endif
if( CU::isIntra(cu) )
{
m_CABACEstimator->pcm_data( cu, partitioner );
......@@ -1484,6 +1480,10 @@ void IntraSearch::xEncIntraHeader(CodingStructure &cs, Partitioner &partitioner,
return;
}
}
m_CABACEstimator->extend_ref_line(cu);
#if JVET_M0102_INTRA_SUBPARTITIONS
m_CABACEstimator->isp_mode ( cu );
#endif
}
PredictionUnit &pu = *cs.getPU(partitioner.currArea().lumaPos(), partitioner.chType);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment