diff --git a/source/Lib/CommonLib/TypeDef.h b/source/Lib/CommonLib/TypeDef.h index 56871e4b7a7d14dad32945cf69736cc399a4c9bd..7c9bfb7f912acf63159326bec5cf44fa8dddf375 100644 --- a/source/Lib/CommonLib/TypeDef.h +++ b/source/Lib/CommonLib/TypeDef.h @@ -50,6 +50,8 @@ #include <assert.h> #include <cassert> +#define JVET_P0385_UNIFIED_MV_ROUNDING 1 + #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;