diff --git a/source/Lib/CommonLib/CommonDef.h b/source/Lib/CommonLib/CommonDef.h index 422d36dc57a7097d7742e6ffd6d049d8018850cb..f491e1bebbde8e385f7444236f43364ed204d580 100644 --- a/source/Lib/CommonLib/CommonDef.h +++ b/source/Lib/CommonLib/CommonDef.h @@ -223,7 +223,11 @@ static const int RVM_VCEGAM10_M = 4; static const int MAX_REF_LINE_IDX = 3; //highest refLine offset in the list static const int MRL_NUM_REF_LINES = 3; //number of candidates in the array +#if JVET_P0418_ALIGN_MLRP_CCLM +static const int MULTI_REF_LINE_IDX[4] = { 0, 1, 2, 0 }; +#else static const int MULTI_REF_LINE_IDX[4] = { 0, 1, 3, 0 }; +#endif static const int PRED_REG_MIN_WIDTH = 4; // Minimum prediction region width for ISP subblocks diff --git a/source/Lib/CommonLib/ContextModelling.h b/source/Lib/CommonLib/ContextModelling.h index 3ca1424a3c2325c5c3a3a40917aff7123f71d2e0..f746b9d8346c6f2d4e789ea0d7a300e4dd04ef57 100644 --- a/source/Lib/CommonLib/ContextModelling.h +++ b/source/Lib/CommonLib/ContextModelling.h @@ -336,6 +336,9 @@ public: unsigned templateAbsSumTS( int scanPos, const TCoeff* coeff ) { +#if JVET_P0562_TS_RESIDUAL_CODING_SIMP + return 1; +#else const uint32_t posY = m_scan[scanPos].y; const uint32_t posX = m_scan[scanPos].x; const TCoeff* posC = coeff + posX + posY * m_width; @@ -358,6 +361,7 @@ public: }; return auiGoRicePars[ std::min(sum, 31) ]; +#endif } int regBinLimit; diff --git a/source/Lib/CommonLib/Rom.cpp b/source/Lib/CommonLib/Rom.cpp index 1fb7ab4ef06fe613e439d061d02f2411fb2c1712..2822b75b3a7159c83f7514770c59d1ad8d9663f1 100644 --- a/source/Lib/CommonLib/Rom.cpp +++ b/source/Lib/CommonLib/Rom.cpp @@ -547,10 +547,15 @@ const uint8_t g_aucIntraModeNumFast_NotUseMPM[MAX_CU_DEPTH] = }; const uint8_t g_chroma422IntraAngleMappingTable[NUM_INTRA_MODE] = +#if JVET_P0111_CHROMA_422_FIX +// * H * D * * * * * * * * V * * * * * * * * +//0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, DM +{ 0, 1, 61, 62, 63, 64, 65, 66, 2, 3, 5, 6, 8, 10, 12, 13, 14, 16, 18, 20, 22, 23, 24, 26, 28, 30, 31, 33, 34, 35, 36, 37, 38, 39, 40, 41, 41, 42, 43, 43, 44, 44, 45, 45, 46, 47, 48, 48, 49, 49, 50, 51, 51, 52, 52, 53, 54, 55, 55, 56, 56, 57, 57, 58, 59, 59, 60, DM_CHROMA_IDX }; +#else // H D V //0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, DM { 0, 1, 61, 62, 63, 64, 65, 66, 2, 3, 4, 6, 8, 10, 12, 13, 14, 16, 18, 20, 22, 23, 24, 26, 28, 30, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 44, 44, 45, 46, 46, 46, 47, 48, 48, 48, 49, 50, 51, 52, 52, 52, 53, 54, 54, 54, 55, 56, 56, 56, 57, 58, 59, 60, DM_CHROMA_IDX }; - +#endif diff --git a/source/Lib/CommonLib/TypeDef.h b/source/Lib/CommonLib/TypeDef.h index 83b4aa5c48a5cd6f5236485744de4083357dd654..5e6541df40716e7c694eefc6c98e729cedd70fd4 100644 --- a/source/Lib/CommonLib/TypeDef.h +++ b/source/Lib/CommonLib/TypeDef.h @@ -52,6 +52,16 @@ #define JVET_P0042_FIX_INTER_DIR_CTX 1 // JVET-P0042: Fix overlap in context between the bi-pred flag for 8x8 CUs and the L0/L1 flag for all size CUs +#define JVET_P0111_CHROMA_422_FIX 1 // JVET-P0422: Bug fix of chroma 422 intra mode mapping + +#define JVET_P0516_PLT_BINARIZATION 1 // JVET-P0516: PLT is always signaled when pred mode is euqal to 1 (intra mode) + +#define JVET_P0562_TS_RESIDUAL_CODING_SIMP 1 // JVET-P0562: Fix the Rice parameter equal to 1 for the remainder of TS residual coding + +#define JVET_P0385_UNIFIED_MV_ROUNDING 1 + +#define JVET_P0418_ALIGN_MLRP_CCLM 1 // JVET-P0418: Align MLRP with CCLM in terms of reference lines/columns + #define JVET_O0145_ENTRYPOINT_SIGNALLING 0 // JVET-O0145: Not signalling num_entry_point_offsets but derive it at decoder #define JVET_O0625_ALF_PADDING 1 // JVET-O0625/O0654/O0662: Unified padding method in ALF diff --git a/source/Lib/CommonLib/UnitTools.cpp b/source/Lib/CommonLib/UnitTools.cpp index c62d8b7bd39ce38ff89d92615dcf12dd702afb0f..237a2c34b4183472ca5d301af7a3b51fcacc315d 100755 --- a/source/Lib/CommonLib/UnitTools.cpp +++ b/source/Lib/CommonLib/UnitTools.cpp @@ -2843,7 +2843,9 @@ bool PU::getInterMergeSubPuMvpCand(const PredictionUnit &pu, MergeCtx& mrgCtx, b /////////////////////////////////////////////////////////////////////// //////// GET Initial Temporal Vector //////// /////////////////////////////////////////////////////////////////////// +#if !JVET_P0385_UNIFIED_MV_ROUNDING int mvPrec = MV_FRACTIONAL_BITS_INTERNAL; +#endif Mv cTempVector = cTMv; bool tempLICFlag = false; @@ -2865,8 +2867,15 @@ bool PU::getInterMergeSubPuMvpCand(const PredictionUnit &pu, MergeCtx& mrgCtx, b bool found = false; cTempVector = cTMv; + +#if JVET_P0385_UNIFIED_MV_ROUNDING + cTempVector.changePrecision(MV_PRECISION_SIXTEENTH, MV_PRECISION_INT); + int tempX = cTempVector.getHor(); + int tempY = cTempVector.getVer(); +#else int tempX = cTempVector.getHor() >> mvPrec; int tempY = cTempVector.getVer() >> mvPrec; +#endif centerPos.x = puPos.x + (puSize.width >> 1) + tempX; centerPos.y = puPos.y + (puSize.height >> 1) + tempY; diff --git a/source/Lib/DecoderLib/CABACReader.cpp b/source/Lib/DecoderLib/CABACReader.cpp index 18f9cf99d8f7b608a6f59f0344b8e8545abaf05d..f130de9d49a126ceb5eced519bbec1a5fa478fc8 100644 --- a/source/Lib/DecoderLib/CABACReader.cpp +++ b/source/Lib/DecoderLib/CABACReader.cpp @@ -1111,7 +1111,11 @@ void CABACReader::pred_mode( CodingUnit& cu ) else { cu.predMode = m_BinDecoder.decodeBin(Ctx::PredMode(DeriveCtx::CtxPredModeFlag(cu))) ? MODE_INTRA : MODE_INTER; +#if JVET_P0516_PLT_BINARIZATION + if (CU::isIntra(cu) && cu.cs->slice->getSPS()->getPLTMode() && cu.lwidth() <= 64 && cu.lheight() <= 64) +#else if (!CU::isIntra(cu) && cu.cs->slice->getSPS()->getPLTMode() && cu.lwidth() <= 64 && cu.lheight() <= 64) +#endif { if (m_BinDecoder.decodeBin(Ctx::PLTFlag(0))) { diff --git a/source/Lib/EncoderLib/CABACWriter.cpp b/source/Lib/EncoderLib/CABACWriter.cpp index 38fc232ba43ae1539e3cc57994174aaadb5999c8..afa561e6ac5c0e7b1b0b1b58e086982d336c794a 100644 --- a/source/Lib/EncoderLib/CABACWriter.cpp +++ b/source/Lib/EncoderLib/CABACWriter.cpp @@ -789,8 +789,13 @@ void CABACWriter::pred_mode( const CodingUnit& cu ) m_BinEncoder.encodeBin((CU::isPLT(cu)), Ctx::PLTFlag(0)); return; } +#if JVET_P0516_PLT_BINARIZATION + m_BinEncoder.encodeBin((CU::isIntra(cu) || CU::isPLT(cu)), Ctx::PredMode(DeriveCtx::CtxPredModeFlag(cu))); + if ((CU::isIntra(cu) || CU::isPLT(cu)) && cu.cs->slice->getSPS()->getPLTMode() && cu.lwidth() <= 64 && cu.lheight() <= 64) +#else m_BinEncoder.encodeBin((CU::isIntra(cu)), Ctx::PredMode(DeriveCtx::CtxPredModeFlag(cu))); if (!CU::isIntra(cu) && cu.cs->slice->getSPS()->getPLTMode() && cu.lwidth() <= 64 && cu.lheight() <= 64) +#endif { m_BinEncoder.encodeBin((CU::isPLT(cu)), Ctx::PLTFlag(0)); }