diff --git a/source/Lib/CommonLib/CodingStructure.cpp b/source/Lib/CommonLib/CodingStructure.cpp index cdca5464e4050806fe86261556c5f2d292261b99..74ffcabacb5d0dd6c1804add4beb4c77b5944ab1 100644 --- a/source/Lib/CommonLib/CodingStructure.cpp +++ b/source/Lib/CommonLib/CodingStructure.cpp @@ -1352,7 +1352,7 @@ const CodingUnit* CodingStructure::getCURestricted( const Position &pos, const C int ctuSizeBit = g_aucLog2[curCu.cs->sps->getMaxCUWidth()]; int xNbY = cu ? cu->blocks[_chType].x << getChannelTypeScaleX( _chType, curCu.chromaFormat ) : 0; int xCurr = curCu.blocks[_chType].x << getChannelTypeScaleX( _chType, curCu.chromaFormat ); - if( cu && CU::isSameSliceAndTile( *cu, curCu ) && ( cu->cs != curCu.cs || cu->idx <= curCu.idx ) && (xNbY >> ctuSizeBit) < (xCurr >> ctuSizeBit) + NUM_WPP_DELAY_IN_CTU ) + if( cu && CU::isSameSliceAndTile( *cu, curCu ) && ( cu->cs != curCu.cs || cu->idx <= curCu.idx ) && (xNbY >> ctuSizeBit) < (xCurr >> ctuSizeBit) + 1 ) #else if( cu && CU::isSameSliceAndTile( *cu, curCu ) && ( cu->cs != curCu.cs || cu->idx <= curCu.idx ) ) #endif @@ -1376,7 +1376,7 @@ const CodingUnit* CodingStructure::getCURestricted( const Position &pos, const u int ctuSizeBit = cu ? g_aucLog2[cu->cs->sps->getMaxCUWidth()] : 0; int xNbY = cu ? pos.x << getChannelTypeScaleX( _chType, cu->chromaFormat ) : 0; int xCurr = cu ? curPos.x << getChannelTypeScaleX( _chType, cu->chromaFormat ) : 0; - return ( cu && cu->slice->getIndependentSliceIdx() == curSliceIdx && cu->tileIdx == curTileIdx && (xNbY >> ctuSizeBit) < (xCurr >> ctuSizeBit) + NUM_WPP_DELAY_IN_CTU ) ? cu : nullptr; + return ( cu && cu->slice->getIndependentSliceIdx() == curSliceIdx && cu->tileIdx == curTileIdx && (xNbY >> ctuSizeBit) < (xCurr >> ctuSizeBit) + 1 ) ? cu : nullptr; #else return ( cu && cu->slice->getIndependentSliceIdx() == curSliceIdx && cu->tileIdx == curTileIdx ) ? cu : nullptr; #endif @@ -1391,7 +1391,7 @@ const PredictionUnit* CodingStructure::getPURestricted( const Position &pos, con int ctuSizeBit = g_aucLog2[curPu.cs->sps->getMaxCUWidth()]; int xNbY = pos.x << getChannelTypeScaleX( _chType, curPu.chromaFormat ); int xCurr = curPu.blocks[_chType].x << getChannelTypeScaleX( _chType, curPu.chromaFormat ); - if( pu && CU::isSameSliceAndTile( *pu->cu, *curPu.cu ) && ( pu->cs != curPu.cs || pu->idx <= curPu.idx ) && (xNbY >> ctuSizeBit) < (xCurr >> ctuSizeBit) + NUM_WPP_DELAY_IN_CTU ) + if( pu && CU::isSameSliceAndTile( *pu->cu, *curPu.cu ) && ( pu->cs != curPu.cs || pu->idx <= curPu.idx ) && (xNbY >> ctuSizeBit) < (xCurr >> ctuSizeBit) + 1 ) #else if( pu && CU::isSameSliceAndTile( *pu->cu, *curPu.cu ) && ( pu->cs != curPu.cs || pu->idx <= curPu.idx ) ) #endif @@ -1413,7 +1413,7 @@ const TransformUnit* CodingStructure::getTURestricted( const Position &pos, cons int ctuSizeBit = g_aucLog2[curTu.cs->sps->getMaxCUWidth()]; int xNbY = pos.x << getChannelTypeScaleX( _chType, curTu.chromaFormat ); int xCurr = curTu.blocks[_chType].x << getChannelTypeScaleX( _chType, curTu.chromaFormat ); - if( tu && CU::isSameSliceAndTile( *tu->cu, *curTu.cu ) && ( tu->cs != curTu.cs || tu->idx <= curTu.idx ) && (xNbY >> ctuSizeBit) < (xCurr >> ctuSizeBit) + NUM_WPP_DELAY_IN_CTU ) + if( tu && CU::isSameSliceAndTile( *tu->cu, *curTu.cu ) && ( tu->cs != curTu.cs || tu->idx <= curTu.idx ) && (xNbY >> ctuSizeBit) < (xCurr >> ctuSizeBit) + 1 ) #else if( tu && CU::isSameSliceAndTile( *tu->cu, *curTu.cu ) && ( tu->cs != curTu.cs || tu->idx <= curTu.idx ) ) #endif diff --git a/source/Lib/CommonLib/CommonDef.h b/source/Lib/CommonLib/CommonDef.h index e988c8e688a6112bbf0ef5a226ec35b3fa088fe7..ab8ec6554b21ba644256d0a40ea3df75b245f37b 100644 --- a/source/Lib/CommonLib/CommonDef.h +++ b/source/Lib/CommonLib/CommonDef.h @@ -147,9 +147,6 @@ static const int NOT_VALID = -1; static const int MAX_TILES = 128; ///< max. number of tiles for which a brick configuration can be read static const int MAX_NUM_BRICKS_PER_TILE = 8; ///< max. number brick per tile, for which a configuration can be read #endif -#if JVET_N0150_ONE_CTU_DELAY_WPP -static const int NUM_WPP_DELAY_IN_CTU = 1; -#endif static const int AMVP_MAX_NUM_CANDS = 2; ///< AMVP: advanced motion vector prediction - max number of final candidates static const int AMVP_MAX_NUM_CANDS_MEM = 3; ///< AMVP: advanced motion vector prediction - max number of candidates diff --git a/source/Lib/DecoderLib/DecSlice.cpp b/source/Lib/DecoderLib/DecSlice.cpp index 5c207ed690928a0368907b9465eb32526d3f65b8..28b741d45ee04836373647339af1da257267ae2a 100644 --- a/source/Lib/DecoderLib/DecSlice.cpp +++ b/source/Lib/DecoderLib/DecSlice.cpp @@ -225,13 +225,13 @@ void DecSlice::decompressSlice( Slice* slice, InputBitstream* bitstream, int deb } #if JVET_N0857_TILES_BRICKS #if JVET_N0150_ONE_CTU_DELAY_WPP - if( cs.getCURestricted( pos.offset(maxCUSize*(NUM_WPP_DELAY_IN_CTU-1), -1), pos, slice->getIndependentSliceIdx(), tileMap.getBrickIdxRsMap( pos ), CH_L ) ) + if( cs.getCURestricted( pos.offset(0, -1), pos, slice->getIndependentSliceIdx(), tileMap.getBrickIdxRsMap( pos ), CH_L ) ) #else if( cs.getCURestricted( pos.offset(maxCUSize, -1), slice->getIndependentSliceIdx(), tileMap.getBrickIdxRsMap( pos ), CH_L ) ) #endif #else #if JVET_N0150_ONE_CTU_DELAY_WPP - if( cs.getCURestricted( pos.offset(maxCUSize*(NUM_WPP_DELAY_IN_CTU-1), -1), pos, slice->getIndependentSliceIdx(), tileMap.getTileIdxMap( pos ), CH_L ) ) + if( cs.getCURestricted( pos.offset(0, -1), pos, slice->getIndependentSliceIdx(), tileMap.getTileIdxMap( pos ), CH_L ) ) #else if( cs.getCURestricted( pos.offset(maxCUSize, -1), slice->getIndependentSliceIdx(), tileMap.getTileIdxMap( pos ), CH_L ) ) #endif @@ -274,7 +274,7 @@ void DecSlice::decompressSlice( Slice* slice, InputBitstream* bitstream, int deb m_pcCuDecoder->decompressCtu( cs, ctuArea ); #if JVET_N0150_ONE_CTU_DELAY_WPP - if( ctuXPosInCtus == tileXPosInCtus+(NUM_WPP_DELAY_IN_CTU-1) && wavefrontsEnabled ) + if( ctuXPosInCtus == tileXPosInCtus && wavefrontsEnabled ) #else if( ctuXPosInCtus == tileXPosInCtus+1 && wavefrontsEnabled ) #endif diff --git a/source/Lib/EncoderLib/EncSlice.cpp b/source/Lib/EncoderLib/EncSlice.cpp index 30ade5724a387a96f87a160dfcdf68b779a9a278..a133caeb9e13b7d99a9d0d339660f31e81077f94 100644 --- a/source/Lib/EncoderLib/EncSlice.cpp +++ b/source/Lib/EncoderLib/EncSlice.cpp @@ -1711,13 +1711,13 @@ void EncSlice::encodeCtus( Picture* pcPic, const bool bCompressEntireSlice, cons pCABACWriter->initCtxModels( *pcSlice ); #if JVET_N0857_TILES_BRICKS #if JVET_N0150_ONE_CTU_DELAY_WPP - if( cs.getCURestricted( pos.offset(pcv.maxCUWidth*(NUM_WPP_DELAY_IN_CTU-1), -1), pos, pcSlice->getIndependentSliceIdx(), tileMap.getBrickIdxRsMap( pos ), CH_L ) ) + if( cs.getCURestricted( pos.offset(0, -1), pos, pcSlice->getIndependentSliceIdx(), tileMap.getBrickIdxRsMap( pos ), CH_L ) ) #else if( cs.getCURestricted( pos.offset(pcv.maxCUWidth, -1), pcSlice->getIndependentSliceIdx(), tileMap.getBrickIdxRsMap( pos ), CH_L ) ) #endif #else #if JVET_N0150_ONE_CTU_DELAY_WPP - if( cs.getCURestricted( pos.offset(pcv.maxCUWidth*(NUM_WPP_DELAY_IN_CTU-1), -1), pos, pcSlice->getIndependentSliceIdx(), tileMap.getTileIdxMap( pos ), CH_L ) ) + if( cs.getCURestricted( pos.offset(0, -1), pos, pcSlice->getIndependentSliceIdx(), tileMap.getTileIdxMap( pos ), CH_L ) ) #else if( cs.getCURestricted( pos.offset(pcv.maxCUWidth, -1), pcSlice->getIndependentSliceIdx(), tileMap.getTileIdxMap( pos ), CH_L ) ) #endif @@ -1882,7 +1882,7 @@ void EncSlice::encodeCtus( Picture* pcPic, const bool bCompressEntireSlice, cons // Store probabilities of second CTU in line into buffer - used only if wavefront-parallel-processing is enabled. #if JVET_N0150_ONE_CTU_DELAY_WPP - if( ctuXPosInCtus == tileXPosInCtus + (NUM_WPP_DELAY_IN_CTU-1) && pEncLib->getEntropyCodingSyncEnabledFlag() ) + if( ctuXPosInCtus == tileXPosInCtus && pEncLib->getEntropyCodingSyncEnabledFlag() ) #else if( ctuXPosInCtus == tileXPosInCtus + 1 && pEncLib->getEntropyCodingSyncEnabledFlag() ) #endif @@ -2065,13 +2065,13 @@ void EncSlice::encodeSlice ( Picture* pcPic, OutputBitstream* pcSubstreams, ui } #if JVET_N0857_TILES_BRICKS #if JVET_N0150_ONE_CTU_DELAY_WPP - if( cs.getCURestricted( pos.offset( pcv.maxCUWidth*(NUM_WPP_DELAY_IN_CTU-1), -1 ), pos, pcSlice->getIndependentSliceIdx(), tileMap.getBrickIdxRsMap( pos ), CH_L ) ) + if( cs.getCURestricted( pos.offset( 0, -1 ), pos, pcSlice->getIndependentSliceIdx(), tileMap.getBrickIdxRsMap( pos ), CH_L ) ) #else if( cs.getCURestricted( pos.offset( pcv.maxCUWidth, -1 ), pcSlice->getIndependentSliceIdx(), tileMap.getBrickIdxRsMap( pos ), CH_L ) ) #endif #else #if JVET_N0150_ONE_CTU_DELAY_WPP - if( cs.getCURestricted( pos.offset( pcv.maxCUWidth*(NUM_WPP_DELAY_IN_CTU-1), -1 ), pos, pcSlice->getIndependentSliceIdx(), tileMap.getTileIdxMap( pos ), CH_L ) ) + if( cs.getCURestricted( pos.offset( 0, -1 ), pos, pcSlice->getIndependentSliceIdx(), tileMap.getTileIdxMap( pos ), CH_L ) ) #else if( cs.getCURestricted( pos.offset( pcv.maxCUWidth, -1 ), pcSlice->getIndependentSliceIdx(), tileMap.getTileIdxMap( pos ), CH_L ) ) #endif @@ -2092,7 +2092,7 @@ void EncSlice::encodeSlice ( Picture* pcPic, OutputBitstream* pcSubstreams, ui // store probabilities of second CTU in line into buffer #if JVET_N0150_ONE_CTU_DELAY_WPP - if( ctuXPosInCtus == tileXPosInCtus + (NUM_WPP_DELAY_IN_CTU-1) && wavefrontsEnabled ) + if( ctuXPosInCtus == tileXPosInCtus && wavefrontsEnabled ) #else if( ctuXPosInCtus == tileXPosInCtus + 1 && wavefrontsEnabled ) #endif