diff --git a/source/Lib/DecoderLib/CABACReader.cpp b/source/Lib/DecoderLib/CABACReader.cpp index 0f7937f98dba31e10c12853ea6029b3cc293d36c..26593059406d27e4bfe374ce690c25911ebc7969 100644 --- a/source/Lib/DecoderLib/CABACReader.cpp +++ b/source/Lib/DecoderLib/CABACReader.cpp @@ -4256,8 +4256,6 @@ void CABACReader::mip_pred_modes( CodingUnit &cu ) void CABACReader::mip_pred_mode( PredictionUnit &pu ) { #if JVET_P0803_COMBINED_MIP_CLEANUP - CHECK( pu.lwidth() > MIP_MAX_WIDTH || pu.lheight() > MIP_MAX_HEIGHT, "Error: block size not supported" ); - pu.mipTransposedFlag = bool(m_BinDecoder.decodeBinEP()); uint32_t mipMode; diff --git a/source/Lib/EncoderLib/IntraSearch.cpp b/source/Lib/EncoderLib/IntraSearch.cpp index 1169828082c0bf587ba1afb296d810ddbbef8d89..4de25cec81fa56d6af3fc53cdd3cc088df1a8255 100644 --- a/source/Lib/EncoderLib/IntraSearch.cpp +++ b/source/Lib/EncoderLib/IntraSearch.cpp @@ -469,7 +469,8 @@ bool IntraSearch::estIntraPredLumaQT( CodingUnit &cu, Partitioner &partitioner, const bool fastMip = sps.getUseMIP() && m_pcEncCfg->getUseFastMIP(); #if JVET_P0803_COMBINED_MIP_CLEANUP const bool mipAllowed = sps.getUseMIP() && isLuma(partitioner.chType) && ((cu.lfnstIdx == 0) || allowLfnstWithMip(cu.firstPU->lumaSize())); - const bool testMip = mipAllowed && !(cu.lwidth() > (8 * cu.lheight()) || cu.lheight() > (8 * cu.lwidth())) && !(cu.lwidth() > MIP_MAX_WIDTH || cu.lheight() > MIP_MAX_HEIGHT); + const bool testMip = mipAllowed && !(cu.lwidth() > (8 * cu.lheight()) || cu.lheight() > (8 * cu.lwidth())); + const bool supportedMipBlkSize = pu.lwidth() <= MIP_MAX_WIDTH && pu.lheight() <= MIP_MAX_HEIGHT; #else const bool mipAllowed = sps.getUseMIP() && isLuma(partitioner.chType) && pu.lwidth() <= cu.cs->sps->getMaxTbSize() && pu.lheight() <= cu.cs->sps->getMaxTbSize() && ((cu.lfnstIdx == 0) || allowLfnstWithMip(cu.firstPU->lumaSize())); const bool testMip = mipAllowed && mipModesAvailable(pu.Y()); @@ -521,7 +522,7 @@ bool IntraSearch::estIntraPredLumaQT( CodingUnit &cu, Partitioner &partitioner, distParamSad.applyWeight = false; distParamHad.applyWeight = false; - if( testMip) + if( testMip && supportedMipBlkSize ) { numModesForFullRD += fastMip? std::max(numModesForFullRD, floorLog2(std::min(pu.lwidth(), pu.lheight())) - 1) : numModesForFullRD; } @@ -742,6 +743,22 @@ bool IntraSearch::estIntraPredLumaQT( CodingUnit &cu, Partitioner &partitioner, LFNSTSaveFlag = false; } //*** Derive MIP candidates using Hadamard + if( testMip && ! supportedMipBlkSize ) + { + // avoid estimation for unsupported blk sizes + const int transpOff = getNumModesMip( pu.Y() ); + const int numModesFull = (transpOff << 1); + for( uint32_t uiModeFull = 0; uiModeFull < numModesFull; uiModeFull++ ) + { + const bool isTransposed = (uiModeFull >= transpOff ? true : false); + const uint32_t uiMode = (isTransposed ? uiModeFull - transpOff : uiModeFull); + + numModesForFullRD++; + uiRdModeList.push_back( ModeInfo(true, isTransposed, 0, NOT_INTRA_SUBPARTITIONS, uiMode) ); + CandCostList.push_back(0); + } + } + else if (testMip) { cu.mipFlag = true;