Commit ebc88910 authored by Xiaozhong Xu's avatar Xiaozhong Xu Committed by Xiang Li

add back accidentally changed Cmake files

parent f4e22ea8
......@@ -26,11 +26,6 @@ add_executable( ${EXE_NAME} ${SRC_FILES} ${INC_FILES} ${NATVIS_FILES} ${CMAKE_CU
# include the output directory, where the svnrevision.h file is generated
include_directories(${CMAKE_CURRENT_BINARY_DIR})
target_compile_definitions( ${EXE_NAME} PUBLIC RExt__DECODER_DEBUG_BIT_STATISTICS=1 )
target_compile_definitions( ${EXE_NAME} PUBLIC RExt__DECODER_DEBUG_TOOL_STATISTICS=1 )
if( ENABLE_VTM )
target_compile_definitions( ${EXE_NAME} PUBLIC JEM_TOOLS=0 )
endif()
if( SET_ENABLE_TRACING )
if( ENABLE_TRACING )
......@@ -65,7 +60,7 @@ if( CMAKE_COMPILER_IS_GNUCC AND BUILD_STATIC )
target_compile_definitions( ${EXE_NAME} PUBLIC ENABLE_WPP_STATIC_LINK=1 )
endif()
target_link_libraries( ${EXE_NAME} CommonAnalyserLib DecoderAnalyserLib Utilities Threads::Threads ${ADDITIONAL_LIBS} )
target_link_libraries( ${EXE_NAME} CommonLib DecoderAnalyserLib Utilities Threads::Threads ${ADDITIONAL_LIBS} )
# Add a SVN revision generator
# a custom target that is always built
......
......@@ -26,10 +26,6 @@ add_executable( ${EXE_NAME} ${SRC_FILES} ${INC_FILES} ${NATVIS_FILES} ${CMAKE_CU
# include the output directory, where the svnrevision.h file is generated
include_directories(${CMAKE_CURRENT_BINARY_DIR})
if( ENABLE_VTM )
target_compile_definitions( ${EXE_NAME} PUBLIC JEM_TOOLS=0 )
endif()
if( SET_ENABLE_TRACING )
if( ENABLE_TRACING )
......
......@@ -28,10 +28,6 @@ add_executable( ${EXE_NAME} ${SRC_FILES} ${INC_FILES} ${NATVIS_FILES} ${CMAKE_CU
# include the output directory, where the svnrevision.h file is generated
include_directories(${CMAKE_CURRENT_BINARY_DIR})
if( ENABLE_VTM )
target_compile_definitions( ${EXE_NAME} PUBLIC JEM_TOOLS=0 )
endif()
if( SET_ENABLE_TRACING )
if( ENABLE_TRACING )
target_compile_definitions( ${EXE_NAME} PUBLIC ENABLE_TRACING=1 )
......
......@@ -303,6 +303,15 @@ void EncApp::xInitLibCfg()
#endif
#if JVET_K0157
m_cEncLib.setUseCompositeRef ( m_compositeRefEnabled );
#endif
#if JVET_K0076_CPR
m_cEncLib.setIBCMode ( m_IBCMode );
m_cEncLib.setIBCLocalSearchRangeX ( m_IBCLocalSearchRangeX );
m_cEncLib.setIBCLocalSearchRangeY ( m_IBCLocalSearchRangeY );
m_cEncLib.setIBCHashSearch ( m_IBCHashSearch );
m_cEncLib.setIBCHashSearchMaxCand ( m_IBCHashSearchMaxCand );
m_cEncLib.setIBCHashSearchRange4SmallBlk ( m_IBCHashSearchRange4SmallBlk );
m_cEncLib.setIBCFastMethod ( m_IBCFastMethod );
#endif
// ADD_NEW_TOOL : (encoder app) add setting of tool enabling flags and associated parameters here
......
......@@ -915,6 +915,15 @@ bool EncAppCfg::parseCfg( int argc, char* argv[] )
#endif
#if JVET_K0157
("CompositeLTReference", m_compositeRefEnabled, false, "Enable Composite Long Term Reference Frame")
#endif
#if JVET_K0076_CPR
( "CPR", m_IBCMode, 0u, "IBCMode (0x1:enabled, 0x0:disabled) [default: disabled]")
( "IBCLocalSearchRangeX", m_IBCLocalSearchRangeX, 128u, "Search range of IBC local search in x direction")
( "IBCLocalSearchRangeY", m_IBCLocalSearchRangeY, 128u, "Search range of IBC local search in y direction")
( "IBCHashSearch", m_IBCHashSearch, 1u, "Hash based IBC search")
( "IBCHashSearchMaxCand", m_IBCHashSearchMaxCand, 256u, "Max candidates for hash based IBC search")
( "IBCHashSearchRange4SmallBlk", m_IBCHashSearchRange4SmallBlk, 256u, "Small block search range in based IBC search")
( "IBCFastMethod", m_IBCFastMethod, 6u, "Fast methods for IBC")
#endif
// ADD_NEW_TOOL : (encoder app) add parsing parameters here
......@@ -2036,6 +2045,9 @@ bool EncAppCfg::xCheckParameter()
xConfirmPara( m_ALF, "ALF is only allowed with NEXT profile" );
#endif
xConfirmPara( m_OBMC, "OBMC is only allowed in NEXT profile" );
#endif
#if JVET_K0076_CPR
xConfirmPara(m_IBCMode, "IBC Mode only allowed with NEXT profile");
#endif
xConfirmPara( m_useFastLCTU, "Fast large CTU can only be applied when encoding with NEXT profile" );
#if !JVET_K0220_ENC_CTRL
......@@ -3433,6 +3445,9 @@ void EncAppCfg::xPrintParameter()
#endif
#if JVET_K0157
msg(VERBOSE, "CompositeLTReference:%d ", m_compositeRefEnabled);
#endif
#if JVET_K0076_CPR
msg(VERBOSE, "CPR:%d ", m_IBCMode);
#endif
}
// ADD_NEW_TOOL (add some output indicating the usage of tools)
......
......@@ -285,6 +285,15 @@ protected:
#endif
#if JVET_K0157
bool m_compositeRefEnabled;
#endif
#if JVET_K0076_CPR
unsigned m_IBCMode;
unsigned m_IBCLocalSearchRangeX;
unsigned m_IBCLocalSearchRangeY;
unsigned m_IBCHashSearch;
unsigned m_IBCHashSearchMaxCand;
unsigned m_IBCHashSearchRange4SmallBlk;
unsigned m_IBCFastMethod;
#endif
// ADD_NEW_TOOL : (encoder app) add tool enabling flags and associated parameters here
......
......@@ -44,10 +44,6 @@ set( INC_FILES ${BASE_INC_FILES} ${X86_INC_FILES} ${MD5_INC_FILES} )
# library
add_library( ${LIB_NAME} STATIC ${SRC_FILES} ${INC_FILES} ${NATVIS_FILES} )
if( ENABLE_VTM )
target_compile_definitions( ${LIB_NAME} PUBLIC JEM_TOOLS=0 )
endif()
if( EXTENSION_360_VIDEO )
target_compile_definitions( ${LIB_NAME} PUBLIC EXTENSION_360_VIDEO=1 )
endif()
......
......@@ -77,6 +77,9 @@ public:
Slice *slice;
UnitScale unitScale[MAX_NUM_COMPONENT];
#if JVET_K0076_CPR
ChannelType chType;
#endif
int baseQP;
int prevQP[MAX_NUM_CHANNEL_TYPE];
......
......@@ -114,7 +114,28 @@ struct UnitScale
Size scale( const Size &size ) const { return { size.width >> posx, size.height >> posy }; }
Area scale( const Area &_area ) const { return Area( scale( _area.pos() ), scale( _area.size() ) ); }
};
#if JVET_K0076_CPR
namespace std
{
template <>
struct hash<Position> : public unary_function<Position, size_t>
{
size_t operator()(const Position& value) const
{
return (((unsigned long long)value.x << 32) + value.y);
}
};
template <>
struct hash<Size> : public unary_function<Size, size_t>
{
size_t operator()(const Size& value) const
{
return (((unsigned long long)value.width << 32) + value.height);
}
};
}
#endif
inline size_t rsAddr(const Position &pos, const uint32_t stride, const UnitScale &unitScale )
{
return (size_t)(stride >> unitScale.posx) * (size_t)(pos.y >> unitScale.posy) + (size_t)(pos.x >> unitScale.posx);
......
......@@ -449,7 +449,14 @@ static const int NTAPS_CHROMA = 4; ///< Numb
#if JEM_TOOLS
static const int NTAPS_LUMA_FRUC = 2;
#endif
#if JVET_K0076_CPR
static const int IBC_MAX_CAND_SIZE = 16; // max block size for ibc search
static const int IBC_NUM_CANDIDATES = 64; ///< Maximum number of candidates to store/test
static const int CHROMA_REFINEMENT_CANDIDATES = 8; /// 8 candidates BV to choose from
static const int IBC_FAST_METHOD_NOINTRA_IBCCBF0 = 0x01;
static const int IBC_FAST_METHOD_BUFFERBV = 0X02;
static const int IBC_FAST_METHOD_ADAPTIVE_SEARCHRANGE = 0X04;
#endif
// ====================================================================================================================
// Macro functions
// ====================================================================================================================
......
......@@ -764,7 +764,14 @@ void MergeCtx::setMergeInfo( PredictionUnit& pu, int candIdx )
pu.mvpIdx [REF_PIC_LIST_1] = NOT_VALID;
pu.mvpNum [REF_PIC_LIST_0] = NOT_VALID;
pu.mvpNum [REF_PIC_LIST_1] = NOT_VALID;
#if JVET_K0076_CPR
if (interDirNeighbours[candIdx] == 1 && pu.cs->slice->getRefPic(REF_PIC_LIST_0, mvFieldNeighbours[candIdx << 1].refIdx)->getPOC() == pu.cs->slice->getPOC())
{
pu.cu->ibc = true;
pu.bv = pu.mv[REF_PIC_LIST_0];
pu.bv >>= 2; // used for only integer resolution
}
#endif
#if JEM_TOOLS
if( pu.lumaSize() == pu.cu->lumaSize() )
{
......
......@@ -1836,7 +1836,11 @@ void InterPrediction::motionCompensation( PredictionUnit &pu, PelUnitBuf &predBu
else
{
#if JEM_TOOLS || JVET_K0346
#if JVET_K0076_CPR
if (pu.mergeType != MRG_TYPE_DEFAULT_N && pu.mergeType != MRG_TYPE_IBC)
#else
if( pu.mergeType != MRG_TYPE_DEFAULT_N )
#endif
{
xSubPuMC( pu, predBuf, eRefPicList );
}
......@@ -2944,6 +2948,10 @@ void InterPrediction::xFrucCollectBlkStartMv( PredictionUnit& pu, const MergeCtx
for( int nMergeIndex = 0; nMergeIndex < mergeCtx.numValidMergeCand << 1; nMergeIndex++ )
{
bool mrgTpDflt = ( pu.cs->sps->getSpsNext().getUseSubPuMvp() ) ? mergeCtx.mrgTypeNeighbours[nMergeIndex>>1] == MRG_TYPE_DEFAULT_N : true;
#if JVET_K0076_CPR
if ((mergeCtx.interDirNeighbours[nMergeIndex >> 1] == 1 || mergeCtx.interDirNeighbours[nMergeIndex >> 1] == 3) && pu.cs->slice->getRefPic(REF_PIC_LIST_0, mergeCtx.mvFieldNeighbours[nMergeIndex].refIdx)->getPOC() == pu.cs->slice->getPOC())
continue;
#endif
if( mergeCtx.mvFieldNeighbours[nMergeIndex].refIdx >= 0 && mrgTpDflt )
{
if( nTargetRefIdx >= 0 && ( mergeCtx.mvFieldNeighbours[nMergeIndex].refIdx != nTargetRefIdx || ( nMergeIndex & 0x01 ) != ( int )eTargetRefList ) )
......
......@@ -111,7 +111,9 @@ struct MotionInfo
Mv mv [ NUM_REF_PIC_LIST_01 ];
int16_t refIdx [ NUM_REF_PIC_LIST_01 ];
#if JVET_K0076_CPR
Mv bv;
#endif
#if JEM_TOOLS
MotionInfo() : isInter( false ), usesLIC( false ), interDir( 0 ), sliceIdx( 0 ), refIdx{ NOT_VALID, NOT_VALID } { }
// ensure that MotionInfo(0) produces '\x000....' bit pattern - needed to work with AreaBuf - don't use this constructor for anything else
......
......@@ -281,7 +281,19 @@ public:
}
#endif
};// END CLASS DEFINITION MV
#if JVET_K0076_CPR
namespace std
{
template <>
struct hash<Mv> : public unary_function<Mv, size_t>
{
size_t operator()(const Mv& value) const
{
return (((unsigned long long)value.hor << 32) + value.ver);
}
};
};
#endif
#if JVET_K0357_AMVR
void roundMV( Mv& rcMv, unsigned imvShift );
#endif
......
......@@ -799,7 +799,11 @@ void Quant::quant(TransformUnit &tu, const ComponentID &compID, const CCoeffBuf
const int iQBits = QUANT_SHIFT + cQP.per + iTransformShift;
// QBits will be OK for any internal bit depth as the reduction in transform shift is balanced by an increase in Qp_per due to QpBDOffset
const int64_t iAdd = int64_t(tu.cs->slice->getSliceType() == I_SLICE ? 171 : 85) << int64_t(iQBits - 9);
const int64_t iAdd = int64_t(tu.cs->slice->getSliceType() == I_SLICE
#if JVET_K0076_CPR
|| (tu.cs->slice->getNumRefIdx(REF_PIC_LIST_0) == 1 && tu.cs->slice->getSPS()->getSpsNext().getIBCMode())
#endif
? 171 : 85) << int64_t(iQBits - 9);
#if HEVC_USE_SIGN_HIDING
const int qBits8 = iQBits - 8;
#endif
......
......@@ -131,11 +131,16 @@ private:
// for motion cost
Mv m_mvPredictor;
#if JVET_K0076_CPR
Mv m_bvPredictors[2];
#endif
double m_motionLambda;
int m_iCostScale;
bool m_useQtbt;
#if JVET_K0076_CPR
double m_dCost; // for cpr
#endif
public:
RdCost();
virtual ~RdCost();
......@@ -192,6 +197,112 @@ public:
void setCostScale ( int iCostScale ) { m_iCostScale = iCostScale; }
Distortion getCost ( uint32_t b ) { return Distortion( m_motionLambda * b ); }
#if JVET_K0076_CPR
// for cpr
void getMotionCost(int iAdd, bool bIsTransquantBypass) { m_dCost = m_dLambdaMotionSAD[(bIsTransquantBypass && m_costMode == COST_MIXED_LOSSLESS_LOSSY_CODING) ? 1 : 0] + iAdd; }
void setPredictors(Mv* pcMv)
{
for (int i = 0; i<2; i++)
{
m_bvPredictors[i] = pcMv[i];
}
}
__inline Distortion getBvCostMultiplePreds(int x, int y, bool useIMV)
{
return Distortion((m_dCost * getBitsMultiplePreds(x, y, useIMV)) / 65536.0);
}
unsigned int getBitsMultiplePreds(int x, int y, bool useIMV)
{
int rmvH[2];
int rmvV[2];
rmvH[0] = x - m_bvPredictors[0].getHor();
rmvH[1] = x - m_bvPredictors[1].getHor();
rmvV[0] = y - m_bvPredictors[0].getVer();
rmvV[1] = y - m_bvPredictors[1].getVer();
int absCand[2];
absCand[0] = abs(rmvH[0]) + abs(rmvV[0]);
absCand[1] = abs(rmvH[1]) + abs(rmvV[1]);
int rmvHQP[2];
int rmvVQP[2];
if (x % 4 == 0 && y % 4 == 0 && useIMV)
{
int imvShift = 2;
int offset = 1 << (imvShift - 1);
rmvHQP[0] = (x >> 2) - ((m_bvPredictors[0].getHor() + offset) >> 2);
rmvHQP[1] = (x >> 2) - ((m_bvPredictors[1].getHor() + offset) >> 2);
rmvVQP[0] = (y >> 2) - ((m_bvPredictors[0].getVer() + offset) >> 2);
rmvVQP[1] = (y >> 2) - ((m_bvPredictors[1].getVer() + offset) >> 2);
int absCandQP[2];
absCandQP[0] = abs(rmvHQP[0]) + abs(rmvVQP[0]);
absCandQP[1] = abs(rmvHQP[1]) + abs(rmvVQP[1]);
unsigned int uiCandBits0QP, uiCandBits1QP;
if (absCand[0] < absCand[1])
{
unsigned int uiCandBits0 = getIComponentBits(rmvH[0]) + getIComponentBits(rmvV[0]);
if (absCandQP[0] < absCandQP[1])
{
uiCandBits0QP = getIComponentBits(rmvHQP[0]) + getIComponentBits(rmvVQP[0]);
return uiCandBits0QP < uiCandBits0 ? uiCandBits0QP : uiCandBits0;
}
else
{
uiCandBits1QP = getIComponentBits(rmvHQP[1]) + getIComponentBits(rmvVQP[1]);
return uiCandBits1QP < uiCandBits0 ? uiCandBits1QP : uiCandBits0;
}
}
else
{
unsigned int uiCandBits1 = getIComponentBits(rmvH[1]) + getIComponentBits(rmvV[1]);
if (absCandQP[0] < absCandQP[1])
{
uiCandBits0QP = getIComponentBits(rmvHQP[0]) + getIComponentBits(rmvVQP[0]);
return uiCandBits0QP < uiCandBits1 ? uiCandBits0QP : uiCandBits1;
}
else
{
uiCandBits1QP = getIComponentBits(rmvHQP[1]) + getIComponentBits(rmvVQP[1]);
return uiCandBits1QP < uiCandBits1 ? uiCandBits1QP : uiCandBits1;
}
}
}
else
{
if (absCand[0] < absCand[1])
{
return getIComponentBits(rmvH[0]) + getIComponentBits(rmvV[0]);
}
else
{
return getIComponentBits(rmvH[1]) + getIComponentBits(rmvV[1]);
}
}
}
unsigned int getIComponentBits(int iVal)
{
if (!iVal) return 1;
unsigned int uiLength = 1;
unsigned int uiTemp = (iVal <= 0) ? (-iVal << 1) + 1 : (iVal << 1);
while (1 != uiTemp)
{
uiTemp >>= 1;
uiLength += 2;
}
return uiLength;
}
#endif
#if ENABLE_SPLIT_PARALLELISM
void copyState( const RdCost& other );
#endif
......
......@@ -444,7 +444,15 @@ void Slice::setRefPicList( PicList& rcListPic, bool checkNumPocTotalCurr, bool b
pcRefPic = xGetLongTermRefPic(rcListPic, m_pRPS->getPOC(i), m_pRPS->getCheckLTMSBPresent(i));
}
}
#if JVET_K0076_CPR
if (getSPS()->getSpsNext().getIBCMode())
{
RefPicSetLtCurr[NumPicLtCurr] = getPic();
//getPic()->setIsLongTerm(true);
getPic()->longTerm = true;
NumPicLtCurr++;
}
#endif
// ref_pic_list_init
Picture* rpsCurrList0[MAX_NUM_REF+1];
Picture* rpsCurrList1[MAX_NUM_REF+1];
......@@ -457,7 +465,14 @@ void Slice::setRefPicList( PicList& rcListPic, bool checkNumPocTotalCurr, bool b
// - Otherwise, when the current picture contains a P or B slice, the value of NumPocTotalCurr shall not be equal to 0.
if (getRapPicFlag())
{
CHECK(numPicTotalCurr != 0, "Invalid state");
#if JVET_K0076_CPR
if (getSPS()->getSpsNext().getIBCMode())
{
CHECK(numPicTotalCurr != 1, "Invalid state");
}
else
#endif
CHECK(numPicTotalCurr != 0, "Invalid state");
}
if (m_eSliceType == I_SLICE)
......@@ -527,7 +542,13 @@ void Slice::setRefPicList( PicList& rcListPic, bool checkNumPocTotalCurr, bool b
m_bIsUsedAsLongTerm[REF_PIC_LIST_1][rIdx] = ( cIdx >= NumPicStCurr0 + NumPicStCurr1 );
}
}
#if JVET_K0076_CPR
if (getSPS()->getSpsNext().getIBCMode())
{
m_apcRefPicList[REF_PIC_LIST_0][m_aiNumRefIdx[REF_PIC_LIST_0] - 1] = getPic();
m_bIsUsedAsLongTerm[REF_PIC_LIST_0][m_aiNumRefIdx[REF_PIC_LIST_0] - 1] = true;
}
#endif
// For generalized B
// note: maybe not existed case (always L0 is copied to L1 if L1 is empty)
if( bCopyL0toL1ErrorCase && isInterB() && getNumRefIdx(REF_PIC_LIST_1) == 0)
......@@ -558,7 +579,14 @@ int Slice::getNumRpsCurrTempList() const
numRpsCurrTempList++;
}
}
return numRpsCurrTempList;
#if JVET_K0076_CPR
if (getSPS()->getSpsNext().getIBCMode())
{
return numRpsCurrTempList + 1;
}
else
#endif
return numRpsCurrTempList;
}
void Slice::initEqualRef()
......@@ -1899,6 +1927,9 @@ SPSNext::SPSNext( SPS& sps )
#endif
#if JVET_K0157
, m_compositeRefEnabled ( false )
#endif
#if JVET_K0076_CPR
, m_IBCMode(0)
#endif
// ADD_NEW_TOOL : (sps extension) add tool enabling flags here (with "false" as default values)
{
......
......@@ -939,6 +939,9 @@ private:
#endif
#if JVET_K0157
bool m_compositeRefEnabled; //composite longterm reference
#endif
#if JVET_K0076_CPR
unsigned m_IBCMode;
#endif
// ADD_NEW_TOOL : (sps extension) add tool enabling flags and associated parameters here
......@@ -1164,6 +1167,10 @@ public:
#if JVET_K0157
void setUseCompositeRef(bool b) { m_compositeRefEnabled = b; }
bool getUseCompositeRef() const { return m_compositeRefEnabled; }
#endif
#if JVET_K0076_CPR
void setIBCMode (unsigned IBCMode) { m_IBCMode = IBCMode; }
unsigned getIBCMode () const { return m_IBCMode; }
#endif
// ADD_NEW_TOOL : (sps extension) add access functions for tool enabling flags and associated parameters here
......
......@@ -50,6 +50,8 @@
#include <assert.h>
#include <cassert>
#define JVET_K0076_CPR 1 // current picture referencing or intra block copy mode
#define JVET_K1000_SIMPLIFIED_EMT 1 // EMT with only DCT-2, DCT-8 and DST-7
#define JVET_K0371_ALF 1
......@@ -989,6 +991,9 @@ enum MergeType
MRG_TYPE_FRUC, // 3
MRG_TYPE_FRUC_SET, // 4
#endif
#if JVET_K0076_CPR
MRG_TYPE_IBC, // 5
#endif
#if !JEM_TOOLS && JVET_K0346
MRG_TYPE_SUBPU_ATMVP,
#endif
......
......@@ -284,7 +284,9 @@ CodingUnit& CodingUnit::operator=( const CodingUnit& other )
#if JEM_TOOLS
obmcFlag = other.obmcFlag;
#endif
#if JVET_K0076_CPR
ibc = other.ibc;
#endif
return *this;
}
......@@ -329,6 +331,9 @@ void CodingUnit::initData()
#if JEM_TOOLS
obmcFlag = false;
#endif
#if JVET_K0076_CPR
ibc = false;
#endif
}
......@@ -353,6 +358,10 @@ void PredictionUnit::initData()
#if JEM_TOOLS
frucMrgMode = 0;
mvRefine = false;
#endif
#if JVET_K0076_CPR
bv.setZero();
bvd.setZero();
#endif
for (uint32_t i = 0; i < NUM_REF_PIC_LIST_01; i++)
{
......@@ -389,6 +398,10 @@ PredictionUnit& PredictionUnit::operator=(const InterPredictionData& predData)
#if JEM_TOOLS
frucMrgMode = predData.frucMrgMode;
mvRefine = predData.mvRefine;
#endif
#if JVET_K0076_CPR
bv = predData.bv;
bvd = predData.bvd;
#endif
for (uint32_t i = 0; i < NUM_REF_PIC_LIST_01; i++)
{
......@@ -422,6 +435,10 @@ PredictionUnit& PredictionUnit::operator=( const PredictionUnit& other )
#if JEM_TOOLS
frucMrgMode = other.frucMrgMode;
mvRefine = other.mvRefine;
#endif
#if JVET_K0076_CPR
bv = other.bv;
bvd = other.bvd;
#endif
for (uint32_t i = 0; i < NUM_REF_PIC_LIST_01; i++)
{
......
......@@ -323,7 +323,9 @@ struct CodingUnit : public UnitArea
bool LICFlag;
bool obmcFlag;
#endif
#if JVET_K0076_CPR
bool ibc;
#endif
// needed for fast imv mode decisions
int8_t imvNumCand;
......@@ -378,6 +380,10 @@ struct InterPredictionData
#if JEM_TOOLS || JVET_K_AFFINE
Mv mvdAffi [NUM_REF_PIC_LIST_01][3];
#endif
#if JVET_K0076_CPR
Mv bv; // block vector for intraBC
Mv bvd; // block vector difference for intraBC
#endif
};
struct PredictionUnit : public UnitArea, public IntraPredictionData, public InterPredictionData
......
This diff is collapsed.
......@@ -164,7 +164,11 @@ namespace PU
#if JEM_TOOLS
void spanLICFlags ( PredictionUnit &pu, const bool LICFlag );
bool getInterMergeSubPuMvpCand (const PredictionUnit &pu, MergeCtx &mrgCtx, bool& LICFlag, const int count );
bool getInterMergeSubPuMvpCand (const PredictionUnit &pu, MergeCtx &mrgCtx, bool& LICFlag, const int count
#if JVET_K0076_CPR
, const int countIBC
#endif
);
bool getInterMergeSubPuRecurCand (const PredictionUnit &pu, MergeCtx &mrgCtx, const int count );
#endif
#if JVET_K0357_AMVR
......@@ -207,6 +211,11 @@ namespace PU
bool isLMCModeEnabled (const PredictionUnit &pu, unsigned mode);
#endif
bool isChromaIntraModeCrossCheckMode(const PredictionUnit &pu);
#if JVET_K0076_CPR
void getIntraBCMVPsEncOnly (PredictionUnit &pu, Mv* MvPred, int& nbPred);
bool getDerivedBV (PredictionUnit &pu, const Mv& currentMv, Mv& derivedMv);
bool isBlockVectorValid (PredictionUnit& pu, int xPos, int yPos, int width, int height, int picWidth, int picHeight, int xStartInCU, int yStartInCU, int xBv, int yBv, int ctuSize);
#endif
}
// TU tools
......
......@@ -107,10 +107,6 @@ inline void dtraceModeCost(CodingStructure &cs, double lambda)
if( isIntra && intraModeC == DM_CHROMA_IDX ) intraModeC = 36;
else if( isIntra ) intraModeC = g_intraMode65to33AngMapping[intraModeC];
#endif
#endif
int imvVal = 0;
#if JVET_K0357_AMVR
imvVal = cs.cus[0]->imv;
#endif
#if JEM_TOOLS
DTRACE( g_trace_ctx, D_MODE_COST, "ModeCost: %6lld %3d @(%4d,%4d) [%2dx%2d] %d (qp%d,pm%d,ptSize%d,skip%d,mrg%d,fruc%d,obmc%d,ic%d,imv%d,affn%d,%d,%d) tempCS = %lld (%d,%d)\n",
......@@ -127,7 +123,11 @@ inline void dtraceModeCost(CodingStructure &cs, double lambda)
cs.pus[0]->frucMrgMode,
cs.cus[0]->obmcFlag,
cs.cus[0]->LICFlag,
imvVal,
#if JVET_K0357_AMVR
cs.cus[0]->imv,
#else
0,
#endif
cs.cus[0]->affine,
intraModeL, intraModeC,
tempCost, tempBits, tempDist );
......@@ -144,7 +144,11 @@ inline void dtraceModeCost(CodingStructure &cs, double lambda)
cs.cus[0]->skip,
cs.pus[0]->mergeFlag,
0, 0,
imvVal,
#if JVET_K0357_AMVR
cs.cus[0]->imv,
#else
0,
#endif
0, 0,
intraModeL, intraModeC,
tempCost, tempBits, tempDist );
......
......@@ -15,11 +15,6 @@ endif()
# library
add_library( ${LIB_NAME} STATIC ${SRC_FILES} ${INC_FILES} ${NATVIS_FILES} )
target_compile_definitions( ${LIB_NAME} PUBLIC RExt__DECODER_DEBUG_BIT_STATISTICS=1 )
target_compile_definitions( ${LIB_NAME} PUBLIC RExt__DECODER_DEBUG_TOOL_STATISTICS=1 )
if( ENABLE_VTM )
target_compile_definitions( ${LIB_NAME} PUBLIC JEM_TOOLS=0 )