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

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

parent 93369272
...@@ -1156,8 +1156,8 @@ void CABACReader::pred_mode( CodingUnit& cu ) ...@@ -1156,8 +1156,8 @@ void CABACReader::pred_mode( CodingUnit& cu )
void CABACReader::pcm_flag( CodingUnit& cu, Partitioner &partitioner ) void CABACReader::pcm_flag( CodingUnit& cu, Partitioner &partitioner )
{ {
const SPS& sps = *cu.cs->sps; const SPS& sps = *cu.cs->sps;
if( !sps.getPCMEnabledFlag() || partitioner.currArea().lwidth() > (1 << sps.getPCMLog2MaxSize()) || partitioner.currArea().lwidth() < (1 << sps.getPCMLog2MinSize()) if( !sps.getPCMEnabledFlag() || cu.lwidth() > (1 << sps.getPCMLog2MaxSize()) || cu.lwidth() < (1 << sps.getPCMLog2MinSize())
|| partitioner.currArea().lheight() > (1 << sps.getPCMLog2MaxSize()) || partitioner.currArea().lheight() < (1 << sps.getPCMLog2MinSize()) ) || cu.lheight() > (1 << sps.getPCMLog2MaxSize()) || cu.lheight() < (1 << sps.getPCMLog2MinSize()) )
{ {
cu.ipcm = false; cu.ipcm = false;
return; return;
...@@ -1285,7 +1285,7 @@ void CABACReader::extend_ref_line(CodingUnit& cu) ...@@ -1285,7 +1285,7 @@ void CABACReader::extend_ref_line(CodingUnit& cu)
return; return;
#endif #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; cu.firstPU->multiRefIdx = 0;
return; return;
...@@ -3024,7 +3024,7 @@ void CABACReader::emt_cu_flag( CodingUnit& cu ) ...@@ -3024,7 +3024,7 @@ void CABACReader::emt_cu_flag( CodingUnit& cu )
#if JVET_M0102_INTRA_SUBPARTITIONS #if JVET_M0102_INTRA_SUBPARTITIONS
void CABACReader::isp_mode( CodingUnit& cu ) 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; cu.ispMode = NOT_INTRA_SUBPARTITIONS;
return; return;
......
...@@ -897,8 +897,8 @@ void CABACWriter::pcm_data( const CodingUnit& cu, Partitioner& partitioner ) ...@@ -897,8 +897,8 @@ void CABACWriter::pcm_data( const CodingUnit& cu, Partitioner& partitioner )
void CABACWriter::pcm_flag( const CodingUnit& cu, Partitioner& partitioner ) void CABACWriter::pcm_flag( const CodingUnit& cu, Partitioner& partitioner )
{ {
const SPS& sps = *cu.cs->sps; const SPS& sps = *cu.cs->sps;
if( !sps.getPCMEnabledFlag() || partitioner.currArea().lwidth() > (1 << sps.getPCMLog2MaxSize()) || partitioner.currArea().lwidth() < (1 << sps.getPCMLog2MinSize()) if( !sps.getPCMEnabledFlag() || cu.lwidth() > (1 << sps.getPCMLog2MaxSize()) || cu.lwidth() < (1 << sps.getPCMLog2MinSize())
|| partitioner.currArea().lheight() > (1 << sps.getPCMLog2MaxSize()) || partitioner.currArea().lheight() < (1 << sps.getPCMLog2MinSize()) ) || cu.lheight() > (1 << sps.getPCMLog2MaxSize()) || cu.lheight() < (1 << sps.getPCMLog2MinSize()) )
{ {
return; return;
} }
...@@ -1047,7 +1047,7 @@ void CABACWriter::extend_ref_line(const CodingUnit& cu) ...@@ -1047,7 +1047,7 @@ void CABACWriter::extend_ref_line(const CodingUnit& cu)
return; return;
#endif #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; return;
} }
...@@ -2877,7 +2877,7 @@ void CABACWriter::emt_cu_flag( const CodingUnit& cu ) ...@@ -2877,7 +2877,7 @@ void CABACWriter::emt_cu_flag( const CodingUnit& cu )
#if JVET_M0102_INTRA_SUBPARTITIONS #if JVET_M0102_INTRA_SUBPARTITIONS
void CABACWriter::isp_mode( const CodingUnit& cu ) 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" ); CHECK( cu.ispMode != NOT_INTRA_SUBPARTITIONS, "error: cu.intraSubPartitions != 0" );
return; return;
......
...@@ -1736,12 +1736,12 @@ void EncCu::xCheckRDCostIntra( CodingStructure *&tempCS, CodingStructure *&bestC ...@@ -1736,12 +1736,12 @@ void EncCu::xCheckRDCostIntra( CodingStructure *&tempCS, CodingStructure *&bestC
m_CABACEstimator->cu_skip_flag ( cu ); m_CABACEstimator->cu_skip_flag ( cu );
} }
m_CABACEstimator->pred_mode ( cu ); m_CABACEstimator->pred_mode ( cu );
m_CABACEstimator->pcm_data ( cu, partitioner );
m_CABACEstimator->extend_ref_line( cu ); m_CABACEstimator->extend_ref_line( cu );
#if JVET_M0102_INTRA_SUBPARTITIONS #if JVET_M0102_INTRA_SUBPARTITIONS
m_CABACEstimator->isp_mode ( cu ); m_CABACEstimator->isp_mode ( cu );
#endif #endif
m_CABACEstimator->cu_pred_data ( cu ); m_CABACEstimator->cu_pred_data ( cu );
m_CABACEstimator->pcm_data ( cu, partitioner );
// Encode Coefficients // Encode Coefficients
CUCtx cuCtx; CUCtx cuCtx;
......
...@@ -1472,10 +1472,6 @@ void IntraSearch::xEncIntraHeader(CodingStructure &cs, Partitioner &partitioner, ...@@ -1472,10 +1472,6 @@ void IntraSearch::xEncIntraHeader(CodingStructure &cs, Partitioner &partitioner,
m_CABACEstimator->cu_skip_flag( cu ); m_CABACEstimator->cu_skip_flag( cu );
m_CABACEstimator->pred_mode ( 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) ) if( CU::isIntra(cu) )
{ {
m_CABACEstimator->pcm_data( cu, partitioner ); m_CABACEstimator->pcm_data( cu, partitioner );
...@@ -1484,6 +1480,10 @@ void IntraSearch::xEncIntraHeader(CodingStructure &cs, Partitioner &partitioner, ...@@ -1484,6 +1480,10 @@ void IntraSearch::xEncIntraHeader(CodingStructure &cs, Partitioner &partitioner,
return; 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); PredictionUnit &pu = *cs.getPU(partitioner.currArea().lumaPos(), partitioner.chType);
......
Supports Markdown
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