diff --git a/source/Lib/CommonLib/TypeDef.h b/source/Lib/CommonLib/TypeDef.h index dc4a2bb999116529b5f521737ef4f7079c4379bc..f65b687a88c2156cd0c4775897f7cc7a7ac9819c 100644 --- a/source/Lib/CommonLib/TypeDef.h +++ b/source/Lib/CommonLib/TypeDef.h @@ -52,6 +52,8 @@ #define JVET_N0462_FIX_CTX_MODELING 1 // Fix context modeling of inter_pred_idc +#define JVET_N0175_N0251_N0384_IBC_SMALL_CTU 1 // IBC search range arrangement for small CTU sizes + #define JVET_N0286_SIMPLIFIED_GBI_IDX 1 // Simplified coding of the GBi index #define JVET_N600_AMVR_TPM_CTX_REDUCTION 1 diff --git a/source/Lib/CommonLib/UnitTools.cpp b/source/Lib/CommonLib/UnitTools.cpp index 4ecabb63e7e5f98bd375fe0578eb3f09863472c9..d6148aedd6113ff12ff860d766551cbf7ec13747 100644 --- a/source/Lib/CommonLib/UnitTools.cpp +++ b/source/Lib/CommonLib/UnitTools.cpp @@ -1925,12 +1925,21 @@ bool PU::isBlockVectorValid(PredictionUnit& pu, int xPos, int yPos, int width, i } // in the same CTU line +#if JVET_N0175_N0251_N0384_IBC_SMALL_CTU + int numLeftCTUs = (1 << ((7 - ctuSizeLog2) << 1)) - ((ctuSizeLog2 < 7) ? 1 : 0); + if ((refRightX >> ctuSizeLog2 <= xPos >> ctuSizeLog2) && (refLeftX >> ctuSizeLog2 >= (xPos >> ctuSizeLog2) - numLeftCTUs)) +#else if ((refRightX >> ctuSizeLog2 <= xPos >> ctuSizeLog2) && (refLeftX >> ctuSizeLog2 >= (xPos >> ctuSizeLog2) - 1)) +#endif { // in the same CTU, or left CTU // if part of ref block is in the left CTU, some area can be referred from the not-yet updated local CTU buffer +#if JVET_N0175_N0251_N0384_IBC_SMALL_CTU + if (((refLeftX >> ctuSizeLog2) == ((xPos >> ctuSizeLog2) - 1)) && (ctuSizeLog2 == 7)) +#else if ((refLeftX >> ctuSizeLog2) == ((xPos >> ctuSizeLog2) - 1)) +#endif { // ref block's collocated block in current CTU const Position refPosCol = pu.Y().topLeft().offset(xBv + ctuSize, yBv);