Commit 7341c1e7 authored by Yu Han's avatar Yu Han Committed by Frank Bossen

M0483 change cpr to ibc tmp

parent 02116053
......@@ -111,7 +111,7 @@ LMChroma : 1 # use CCLM only
DepQuant : 1
IMV : 2
ALF : 1
CPR : 0 # turned off in CTC
IBC : 0 # turned off in CTC
# Fast tools
PBIntraFast : 1
......
......@@ -128,7 +128,7 @@ DepQuant : 1
IMV : 2
ALF : 1
MHIntra : 1
CPR : 0 # turned off in CTC
IBC : 0 # turned off in CTC
# Fast tools
PBIntraFast : 1
......
......@@ -131,7 +131,7 @@ GBi : 1
GBiFast : 1
MHIntra : 1
Triangle : 1
CPR : 0 # turned off in CTC
IBC : 0 # turned off in CTC
# Fast tools
PBIntraFast : 1
......
......@@ -146,7 +146,7 @@ GBiFast : 1
BIO : 1
MHIntra : 1
Triangle : 1
CPR : 0 # turned off in CTC
IBC : 0 # turned off in CTC
# Fast tools
PBIntraFast : 1
......
......@@ -258,13 +258,13 @@ void EncApp::xInitLibCfg()
m_cEncLib.setUseMHIntra ( m_MHIntra );
m_cEncLib.setUseTriangle ( m_Triangle );
m_cEncLib.setCPRMode ( m_CPRMode );
m_cEncLib.setCPRLocalSearchRangeX ( m_CPRLocalSearchRangeX );
m_cEncLib.setCPRLocalSearchRangeY ( m_CPRLocalSearchRangeY );
m_cEncLib.setCPRHashSearch ( m_CPRHashSearch );
m_cEncLib.setCPRHashSearchMaxCand ( m_CPRHashSearchMaxCand );
m_cEncLib.setCPRHashSearchRange4SmallBlk ( m_CPRHashSearchRange4SmallBlk );
m_cEncLib.setCPRFastMethod ( m_CPRFastMethod );
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 );
m_cEncLib.setUseWrapAround ( m_wrapAround );
m_cEncLib.setWrapAroundOffset ( m_wrapAroundOffset );
......
......@@ -865,13 +865,13 @@ bool EncAppCfg::parseCfg( int argc, char* argv[] )
("MHIntra", m_MHIntra, false, "Enable MHIntra mode")
("Triangle", m_Triangle, false, "Enable triangular shape motion vector prediction (0:off, 1:on)")
( "CPR", m_CPRMode, 0u, "CPRMode (0x1:enabled, 0x0:disabled) [default: disabled]")
( "CPRLocalSearchRangeX", m_CPRLocalSearchRangeX, 128u, "Search range of CPR local search in x direction")
( "CPRLocalSearchRangeY", m_CPRLocalSearchRangeY, 128u, "Search range of CPR local search in y direction")
( "CPRHashSearch", m_CPRHashSearch, 1u, "Hash based CPR search")
( "CPRHashSearchMaxCand", m_CPRHashSearchMaxCand, 256u, "Max candidates for hash based CPR search")
( "CPRHashSearchRange4SmallBlk", m_CPRHashSearchRange4SmallBlk, 256u, "Small block search range in based CPR search")
( "CPRFastMethod", m_CPRFastMethod, 6u, "Fast methods for CPR")
( "IBC", 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")
("WrapAround", m_wrapAround, false, "Enable horizontal wrap-around motion compensation for inter prediction (0:off, 1:on) [default: off]")
("WrapAroundOffset", m_wrapAroundOffset, 0u, "Offset in luma samples used for computing the horizontal wrap-around position")
......@@ -1934,7 +1934,7 @@ bool EncAppCfg::xCheckParameter()
xConfirmPara( m_DisableMotionCompression, "Disable motion data compression only allowed with NEXT profile" );
xConfirmPara( m_MTT, "Multi type tree is only allowed with NEXT profile" );
xConfirmPara( m_ImvMode, "IMV is only allowed with NEXT profile" );
xConfirmPara(m_CPRMode, "CPR Mode only allowed with NEXT profile");
xConfirmPara(m_IBCMode, "IBC Mode only allowed with NEXT profile");
xConfirmPara( m_useFastLCTU, "Fast large CTU can only be applied when encoding with NEXT profile" );
#if JVET_M0464_UNI_MTS
xConfirmPara( m_MTS, "MTS only allowed with NEXT profile" );
......@@ -3146,7 +3146,7 @@ void EncAppCfg::xPrintParameter()
msg(VERBOSE, "MHIntra:%d ", m_MHIntra);
msg( VERBOSE, "Triangle:%d ", m_Triangle );
}
msg(VERBOSE, "CPR:%d ", m_CPRMode);
msg(VERBOSE, "IBC:%d ", m_IBCMode);
msg( VERBOSE, "WrapAround:%d ", m_wrapAround);
if( m_wrapAround )
{
......
......@@ -239,13 +239,13 @@ protected:
bool m_Triangle;
unsigned m_CPRMode;
unsigned m_CPRLocalSearchRangeX;
unsigned m_CPRLocalSearchRangeY;
unsigned m_CPRHashSearch;
unsigned m_CPRHashSearchMaxCand;
unsigned m_CPRHashSearchRange4SmallBlk;
unsigned m_CPRFastMethod;
unsigned m_IBCMode;
unsigned m_IBCLocalSearchRangeX;
unsigned m_IBCLocalSearchRangeY;
unsigned m_IBCHashSearch;
unsigned m_IBCHashSearchMaxCand;
unsigned m_IBCHashSearchRange4SmallBlk;
unsigned m_IBCFastMethod;
bool m_wrapAround;
unsigned m_wrapAroundOffset;
......
......@@ -1299,7 +1299,7 @@ const TransformUnit* CodingStructure::getTURestricted( const Position &pos, cons
}
}
CprLumaCoverage CodingStructure::getCprLumaCoverage(const CompArea& chromaArea) const
IbcLumaCoverage CodingStructure::getIbcLumaCoverage(const CompArea& chromaArea) const
{
CHECK(chType != CHANNEL_TYPE_CHROMA, "Error");
......@@ -1307,7 +1307,7 @@ CprLumaCoverage CodingStructure::getCprLumaCoverage(const CompArea& chromaArea)
CompArea lumaArea = CompArea(COMPONENT_Y, chromaArea.chromaFormat, chromaArea.lumaPos(), recalcSize(chromaArea.chromaFormat, CHANNEL_TYPE_CHROMA, CHANNEL_TYPE_LUMA, chromaArea.size()));
lumaArea = clipArea(lumaArea, picture->block(COMPONENT_Y));
const unsigned int fullArea = lumaArea.area();
unsigned int cprArea = 0;
unsigned int ibcArea = 0;
for (SizeType y = 0; y < lumaArea.height; y += MIN_PU_SIZE)
{
for (SizeType x = 0; x < lumaArea.width; x += MIN_PU_SIZE)
......@@ -1315,19 +1315,19 @@ CprLumaCoverage CodingStructure::getCprLumaCoverage(const CompArea& chromaArea)
Position pos = lumaArea.offset(x, y);
if (picture->cs->getMotionInfo(pos).isInter) // need to change if inter slice allows dualtree
{
cprArea += unitAreaSubBlock;
ibcArea += unitAreaSubBlock;
}
}
}
CprLumaCoverage coverage = CPR_LUMA_COVERAGE_FULL;
if (cprArea == 0)
IbcLumaCoverage coverage = IBC_LUMA_COVERAGE_FULL;
if (ibcArea == 0)
{
coverage = CPR_LUMA_COVERAGE_NONE;
coverage = IBC_LUMA_COVERAGE_NONE;
}
else if (cprArea < fullArea)
else if (ibcArea < fullArea)
{
coverage = CPR_LUMA_COVERAGE_PARTIAL;
coverage = IBC_LUMA_COVERAGE_PARTIAL;
}
return coverage;
......
......@@ -58,12 +58,12 @@ enum PictureType
PIC_ORG_RESI,
NUM_PIC_TYPES
};
enum CprLumaCoverage
enum IbcLumaCoverage
{
CPR_LUMA_COVERAGE_FULL = 0,
CPR_LUMA_COVERAGE_PARTIAL,
CPR_LUMA_COVERAGE_NONE,
NUM_CPR_LUMA_COVERAGE,
IBC_LUMA_COVERAGE_FULL = 0,
IBC_LUMA_COVERAGE_PARTIAL,
IBC_LUMA_COVERAGE_NONE,
NUM_IBC_LUMA_COVERAGE,
};
extern XUCache g_globalUnitCache;
......@@ -154,7 +154,7 @@ public:
cCUTraverser traverseCUs(const UnitArea& _unit, const ChannelType _chType) const;
cPUTraverser traversePUs(const UnitArea& _unit, const ChannelType _chType) const;
cTUTraverser traverseTUs(const UnitArea& _unit, const ChannelType _chType) const;
CprLumaCoverage getCprLumaCoverage(const CompArea& chromaArea) const;
IbcLumaCoverage getIbcLumaCoverage(const CompArea& chromaArea) const;
// ---------------------------------------------------------------------------
// encoding search utilities
// ---------------------------------------------------------------------------
......
......@@ -396,12 +396,12 @@ static const int TRIANGLE_MAX_NUM_CANDS = 40;
static const int TRIANGLE_MAX_NUM_SATD_CANDS = 3;
static const int TRIANGLE_MIN_SIZE = 8 * 8;
static const int CPR_MAX_CAND_SIZE = 16; // max block size for cpr search
static const int CPR_NUM_CANDIDATES = 64; ///< Maximum number of candidates to store/test
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 CPR_FAST_METHOD_NOINTRA_CPRCBF0 = 0x01;
static const int CPR_FAST_METHOD_BUFFERBV = 0X02;
static const int CPR_FAST_METHOD_ADAPTIVE_SEARCHRANGE = 0X04;
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;
// ====================================================================================================================
// Macro functions
......
......@@ -472,7 +472,7 @@ void MergeCtx::setMergeInfo( PredictionUnit& pu, int candIdx )
pu.mvpNum [REF_PIC_LIST_1] = NOT_VALID;
if (interDirNeighbours[candIdx] == 1 && pu.cs->slice->getRefPic(REF_PIC_LIST_0, mvFieldNeighbours[candIdx << 1].refIdx)->getPOC() == pu.cs->slice->getPOC())
{
pu.cu->cpr = true;
pu.cu->ibc = true;
pu.bv = pu.mv[REF_PIC_LIST_0];
pu.bv.changePrecision(MV_PRECISION_INTERNAL, MV_PRECISION_INT); // used for only integer resolution
}
......
......@@ -31,46 +31,46 @@
* THE POSSIBILITY OF SUCH DAMAGE.
*/
/** \file CprHashMap.cpp
\brief CPR hash map encoder class
/** \file IbcHashMap.cpp
\brief IBC hash map encoder class
*/
#include "CommonLib/dtrace_codingstruct.h"
#include "CommonLib/Picture.h"
#include "CommonLib/UnitTools.h"
#include "CprHashMap.h"
#include "IbcHashMap.h"
using namespace std;
//! \ingroup CprHashMap
//! \ingroup IbcHashMap
//! \{
// ====================================================================================================================
// Constructor / destructor / create / destroy
// ====================================================================================================================
CprHashMap::CprHashMap()
IbcHashMap::IbcHashMap()
{
m_picWidth = 0;
m_picHeight = 0;
m_pos2Hash = NULL;
m_computeCrc32c = xxComputeCrc32c16bit;
#if ENABLE_SIMD_OPT_CPR
#if ENABLE_SIMD_OPT_IBC
#ifdef TARGET_SIMD_X86
initCprHashMapX86();
initIbcHashMapX86();
#endif
#endif
}
CprHashMap::~CprHashMap()
IbcHashMap::~IbcHashMap()
{
destroy();
}
void CprHashMap::init(const int picWidth, const int picHeight)
void IbcHashMap::init(const int picWidth, const int picHeight)
{
if (picWidth != m_picWidth || picHeight != m_picHeight)
{
......@@ -87,7 +87,7 @@ void CprHashMap::init(const int picWidth, const int picHeight)
}
}
void CprHashMap::destroy()
void IbcHashMap::destroy()
{
if (m_pos2Hash != NULL)
{
......@@ -168,7 +168,7 @@ static const uint32_t crc32Table[256] = {
0xBE2DA0A5L, 0x4C4623A6L, 0x5F16D052L, 0xAD7D5351L
};
uint32_t CprHashMap::xxComputeCrc32c16bit(uint32_t crc, const Pel pel)
uint32_t IbcHashMap::xxComputeCrc32c16bit(uint32_t crc, const Pel pel)
{
const void *buf = &pel;
const uint8_t *p = (const uint8_t *)buf;
......@@ -184,7 +184,7 @@ uint32_t CprHashMap::xxComputeCrc32c16bit(uint32_t crc, const Pel pel)
// CRC calculation in C code
////////////////////////////////////////////////////////
unsigned int CprHashMap::xxCalcBlockHash(const Pel* pel, const int stride, const int width, const int height, unsigned int crc)
unsigned int IbcHashMap::xxCalcBlockHash(const Pel* pel, const int stride, const int width, const int height, unsigned int crc)
{
for (int y = 0; y < height; y++)
{
......@@ -198,7 +198,7 @@ unsigned int CprHashMap::xxCalcBlockHash(const Pel* pel, const int stride, const
}
template<ChromaFormat chromaFormat>
void CprHashMap::xxBuildPicHashMap(const PelUnitBuf& pic)
void IbcHashMap::xxBuildPicHashMap(const PelUnitBuf& pic)
{
const int chromaScalingX = getChannelTypeScaleX(CHANNEL_TYPE_CHROMA, chromaFormat);
const int chromaScalingY = getChannelTypeScaleY(CHANNEL_TYPE_CHROMA, chromaFormat);
......@@ -243,7 +243,7 @@ void CprHashMap::xxBuildPicHashMap(const PelUnitBuf& pic)
}
}
void CprHashMap::rebuildPicHashMap(const PelUnitBuf& pic)
void IbcHashMap::rebuildPicHashMap(const PelUnitBuf& pic)
{
m_hash2Pos.clear();
......@@ -267,7 +267,7 @@ void CprHashMap::rebuildPicHashMap(const PelUnitBuf& pic)
}
}
bool CprHashMap::cprHashMatch(const Area& lumaArea, std::vector<Position>& cand, const CodingStructure& cs, const int maxCand, const int searchRange4SmallBlk)
bool IbcHashMap::ibcHashMatch(const Area& lumaArea, std::vector<Position>& cand, const CodingStructure& cs, const int maxCand, const int searchRange4SmallBlk)
{
cand.clear();
......@@ -332,7 +332,7 @@ bool CprHashMap::cprHashMatch(const Area& lumaArea, std::vector<Position>& cand,
return cand.size() > 0;
}
int CprHashMap::getHashHitRatio(const Area& lumaArea)
int IbcHashMap::getHashHitRatio(const Area& lumaArea)
{
int maxX = std::min((int)(lumaArea.x + lumaArea.width), m_picWidth);
int maxY = std::min((int)(lumaArea.y + lumaArea.height), m_picHeight);
......
......@@ -31,12 +31,12 @@
* THE POSSIBILITY OF SUCH DAMAGE.
*/
/** \file CprHashMap.h
\brief CPR hash map encoder class (header)
/** \file IbcHashMap.h
\brief IBC hash map encoder class (header)
*/
#ifndef __CPRHASHMAP__
#define __CPRHASHMAP__
#ifndef __IBCHASHMAP__
#define __IBCHASHMAP__
// Include files
#include "CommonLib/CommonDef.h"
......@@ -55,7 +55,7 @@
// Class definition
// ====================================================================================================================
class CprHashMap
class IbcHashMap
{
private:
int m_picWidth;
......@@ -73,23 +73,23 @@ private:
public:
uint32_t (*m_computeCrc32c) (uint32_t crc, const Pel pel);
CprHashMap();
virtual ~CprHashMap();
IbcHashMap();
virtual ~IbcHashMap();
void init(const int picWidth, const int picHeight);
void destroy();
void rebuildPicHashMap(const PelUnitBuf& pic);
bool cprHashMatch(const Area& lumaArea, std::vector<Position>& cand, const CodingStructure& cs, const int maxCand, const int searchRange4SmallBlk);
bool ibcHashMatch(const Area& lumaArea, std::vector<Position>& cand, const CodingStructure& cs, const int maxCand, const int searchRange4SmallBlk);
int getHashHitRatio(const Area& lumaArea);
#ifdef TARGET_SIMD_X86
void initCprHashMapX86();
void initIbcHashMapX86();
template <X86_VEXT vext>
void _initCprHashMapX86();
void _initIbcHashMapX86();
#endif
};
//! \}
#endif // __CPRHASHMAP__
#endif // __IBCHASHMAP__
......@@ -374,10 +374,10 @@ void InterPrediction::xPredInterUni(const PredictionUnit& pu, const RefPicList&
int iRefIdx = pu.refIdx[eRefPicList];
Mv mv[3];
bool isCPR = false;
bool isIBC = false;
if (pu.cs->slice->getRefPic(eRefPicList, iRefIdx)->getPOC() == pu.cs->slice->getPOC())
{
isCPR = true;
isIBC = true;
}
if( pu.cu->affine )
{
......@@ -413,7 +413,7 @@ void InterPrediction::xPredInterUni(const PredictionUnit& pu, const RefPicList&
{
xPredInterBlk( compID, pu, pu.cu->slice->getRefPic( eRefPicList, iRefIdx ), mv[0], pcYuvPred, bi, pu.cu->slice->clpRng( compID )
, bioApplied
, isCPR
, isIBC
);
}
......@@ -524,7 +524,7 @@ void InterPrediction::xPredInterBi(PredictionUnit& pu, PelUnitBuf &pcYuvPred)
void InterPrediction::xPredInterBlk ( const ComponentID& compID, const PredictionUnit& pu, const Picture* refPic, const Mv& _mv, PelUnitBuf& dstPic, const bool& bi, const ClpRng& clpRng
, const bool& bioApplied
, bool isCPR
, bool isIBC
)
{
JVET_J0090_SET_REF_PICTURE( refPic, compID );
......@@ -536,7 +536,7 @@ void InterPrediction::xPredInterBlk ( const ComponentID& compID, const Predictio
int xFrac = _mv.hor & ((1 << shiftHor) - 1);
int yFrac = _mv.ver & ((1 << shiftVer) - 1);
if (isCPR)
if (isIBC)
{
xFrac = yFrac = 0;
JVET_J0090_SET_CACHE_ENABLE( false );
......@@ -1077,7 +1077,7 @@ void InterPrediction::motionCompensation( PredictionUnit &pu, PelUnitBuf &predBu
, const bool luma, const bool chroma
)
{
// dual tree handling for CPR as the only ref
// dual tree handling for IBC as the only ref
if (!luma || !chroma)
{
if (!luma && chroma)
......@@ -1118,7 +1118,7 @@ void InterPrediction::motionCompensation( PredictionUnit &pu, PelUnitBuf &predBu
}
else
{
if (pu.mergeType != MRG_TYPE_DEFAULT_N && pu.mergeType != MRG_TYPE_CPR)
if (pu.mergeType != MRG_TYPE_DEFAULT_N && pu.mergeType != MRG_TYPE_IBC)
{
xSubPuMC( pu, predBuf, eRefPicList );
}
......
......@@ -110,7 +110,7 @@ protected:
void xPredInterBi ( PredictionUnit& pu, PelUnitBuf &pcYuvPred );
void xPredInterBlk ( const ComponentID& compID, const PredictionUnit& pu, const Picture* refPic, const Mv& _mv, PelUnitBuf& dstPic, const bool& bi, const ClpRng& clpRng
, const bool& bioApplied
, bool isCPR
, bool isIBC
);
void xAddBIOAvg4 (const Pel* src0, int src0Stride, const Pel* src1, int src1Stride, Pel *dst, int dstStride, const Pel *gradX0, const Pel *gradX1, const Pel *gradY0, const Pel*gradY1, int gradStride, int width, int height, int tmpx, int tmpy, int shift, int offset, const ClpRng& clpRng);
......
......@@ -118,7 +118,7 @@ private:
double m_motionLambda;
int m_iCostScale;
double m_dCost; // for cpr
double m_dCost; // for ibc
public:
RdCost();
virtual ~RdCost();
......@@ -162,7 +162,7 @@ public:
}
void setCostScale ( int iCostScale ) { m_iCostScale = iCostScale; }
Distortion getCost ( uint32_t b ) { return Distortion( m_motionLambda * b ); }
// for cpr
// for ibc
void getMotionCost(int add, bool isTransquantBypass) { m_dCost = m_dLambdaMotionSAD[(isTransquantBypass && m_costMode == COST_MIXED_LOSSLESS_LOSSY_CODING) ? 1 : 0] + add; }
void setPredictors(Mv* pcMv)
......
......@@ -432,7 +432,7 @@ void Slice::setRefPicList( PicList& rcListPic, bool checkNumPocTotalCurr, bool b
pcRefPic = xGetLongTermRefPic(rcListPic, m_pRPS->getPOC(i), m_pRPS->getCheckLTMSBPresent(i));
}
}
if (getSPS()->getSpsNext().getCPRMode())
if (getSPS()->getSpsNext().getIBCMode())
{
RefPicSetLtCurr[NumPicLtCurr] = getPic();
//getPic()->setIsLongTerm(true);
......@@ -451,7 +451,7 @@ 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())
{
if (getSPS()->getSpsNext().getCPRMode())
if (getSPS()->getSpsNext().getIBCMode())
{
CHECK(numPicTotalCurr != 1, "Invalid state");
}
......@@ -526,7 +526,7 @@ void Slice::setRefPicList( PicList& rcListPic, bool checkNumPocTotalCurr, bool b
m_bIsUsedAsLongTerm[REF_PIC_LIST_1][rIdx] = ( cIdx >= NumPicStCurr0 + NumPicStCurr1 );
}
}
if (getSPS()->getSpsNext().getCPRMode())
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;
......@@ -561,7 +561,7 @@ int Slice::getNumRpsCurrTempList() const
numRpsCurrTempList++;
}
}
if (getSPS()->getSpsNext().getCPRMode())
if (getSPS()->getSpsNext().getIBCMode())
{
return numRpsCurrTempList + 1;
}
......@@ -1781,7 +1781,7 @@ SPSNext::SPSNext( SPS& sps )
, m_ImvMode ( IMV_OFF )
, m_MTTMode ( 0 )
, m_compositeRefEnabled ( false )
, m_CPRMode ( 0 )
, m_IBCMode ( 0 )
// ADD_NEW_TOOL : (sps extension) add tool enabling flags here (with "false" as default values)
{
}
......
......@@ -842,7 +842,7 @@ private:
unsigned m_MTTMode;
bool m_compositeRefEnabled; //composite longterm reference
unsigned m_CPRMode;
unsigned m_IBCMode;
public:
SPSNext( SPS& sps );
......@@ -914,8 +914,8 @@ public:
bool getUseMHIntra () const { return m_MHIntra; }
void setUseTriangle ( bool b ) { m_Triangle = b; }
bool getUseTriangle () const { return m_Triangle; }
void setCPRMode (unsigned CPRMode) { m_CPRMode = CPRMode; }
unsigned getCPRMode () const { return m_CPRMode; }
void setIBCMode (unsigned IBCMode) { m_IBCMode = IBCMode; }
unsigned getIBCMode () const { return m_IBCMode; }
};
......
......@@ -60,7 +60,7 @@
#define JVET_M0502_PRED_MODE_CTX 1
#define JVET_M0407_CPR_RANGE 1 // extend CPR search range to some part of left CTU
#define JVET_M0407_IBC_RANGE 1 // extend IBC search range to some part of left CTU
#define JVET_M0464_UNI_MTS 1
#define JVET_M0068_M0171_MMVD_CLEANUP 1 // MMVD cleanup with 1) flip removal, 2) L1 zero vector fix, 3) bi-pred restriction after merge/MMVD
......@@ -867,7 +867,7 @@ enum MergeType
{
MRG_TYPE_DEFAULT_N = 0, // 0
MRG_TYPE_SUBPU_ATMVP,
MRG_TYPE_CPR,
MRG_TYPE_IBC,
NUM_MRG_TYPE // 5
};
......
......@@ -272,7 +272,7 @@ CodingUnit& CodingUnit::operator=( const CodingUnit& other )
GBiIdx = other.GBiIdx;
for (int i = 0; i<2; i++)
refIdxBi[i] = other.refIdxBi[i];
cpr = other.cpr;
ibc = other.ibc;
#if JVET_M0444_SMVD
smvdMode = other.smvdMode;
#endif
......@@ -309,7 +309,7 @@ void CodingUnit::initData()
GBiIdx = GBI_DEFAULT;
for (int i = 0; i < 2; i++)
refIdxBi[i] = -1;
cpr = false;
ibc = false;
#if JVET_M0444_SMVD
smvdMode = 0;
#endif
......
......@@ -312,7 +312,7 @@ struct CodingUnit : public UnitArea
int refIdxBi[2];
// needed for fast imv mode decisions
int8_t imvNumCand;
bool cpr;
bool ibc;
#if JVET_M0444_SMVD
uint8_t smvdMode;
#endif
......@@ -366,8 +366,8 @@ struct InterPredictionData
Mv mvdAffi [NUM_REF_PIC_LIST_01][3];
Mv mvAffi[NUM_REF_PIC_LIST_01][3];
bool mhIntraFlag;
Mv bv; // block vector for CPR
Mv bvd; // block vector difference for CPR
Mv bv; // block vector for IBC
Mv bvd; // block vector difference for IBC
};
struct PredictionUnit : public UnitArea, public IntraPredictionData, public InterPredictionData
......
This diff is collapsed.
......@@ -139,7 +139,7 @@ namespace PU
);
bool getInterMergeSubPuMvpCand(const PredictionUnit &pu, MergeCtx &mrgCtx, bool& LICFlag, const int count
, int mmvdList
, const int countCPR
, const int countIBC
);
bool getInterMergeSubPuRecurCand(const PredictionUnit &pu, MergeCtx &mrgCtx, const int count);
bool isBiPredFromDifferentDir (const PredictionUnit &pu);
......@@ -158,7 +158,7 @@ namespace PU
bool getTriangleWeights (const PredictionUnit &pu, MergeCtx &triangleMrgCtx, const uint8_t candIdx0, const uint8_t candIdx1);
void spanTriangleMotionInfo ( PredictionUnit &pu, MergeCtx &triangleMrgCtx, const uint8_t mergeIdx, const bool splitDir, const uint8_t candIdx0, const uint8_t candIdx1);
int32_t mappingRefPic (const PredictionUnit &pu, int32_t refPicPoc, bool targetRefPicList);
void getCprMVPsEncOnly(PredictionUnit &pu, Mv* MvPred, int& nbPred);
void getIbcMVPsEncOnly(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);
}
......
......@@ -668,7 +668,7 @@ void writeAllData(const CodingStructure& cs, const UnitArea& ctuArea)
DTRACE_BLOCK_SCALAR(g_trace_ctx, D_BLOCK_STATISTICS_ALL, cu, GetBlockStatisticName(BlockStatistic::IMVMode), cu.imv);
DTRACE_BLOCK_SCALAR(g_trace_ctx, D_BLOCK_STATISTICS_ALL, cu, GetBlockStatisticName(BlockStatistic::RootCbf), cu.rootCbf);
DTRACE_BLOCK_SCALAR(g_trace_ctx, D_BLOCK_STATISTICS_ALL, cu, GetBlockStatisticName(BlockStatistic::GBIIndex), cu.GBiIdx);
DTRACE_BLOCK_SCALAR(g_trace_ctx, D_BLOCK_STATISTICS_ALL, cu, GetBlockStatisticName(BlockStatistic::CPRFlag), cu.cpr);
DTRACE_BLOCK_SCALAR(g_trace_ctx, D_BLOCK_STATISTICS_ALL, cu, GetBlockStatisticName(BlockStatistic::IBCFlag), cu.ibc);
}
break;
......
......@@ -108,7 +108,7 @@ enum class BlockStatistic {
TriangleMVL0, //<< currently only uni-prediction enabled
TriangleMVL1, //<< currently only uni-prediction enabled
GBIIndex,
CPRFlag,
IBCFlag,
// for dual tree
// general
Depth_Chroma,
......@@ -192,7 +192,7 @@ static const std::map<BlockStatistic, std::tuple<std::string, BlockStatisticType
{ BlockStatistic::TriangleMVL0, std::tuple<std::string, BlockStatisticType, std::string>{"TriangleMVL0", BlockStatisticType::VectorPolygon, "Scale: 4"}},
{ BlockStatistic::TriangleMVL1, std::tuple<std::string, BlockStatisticType, std::string>{"TriangleMVL1", BlockStatisticType::VectorPolygon, "Scale: 4"}},
{ BlockStatistic::GBIIndex, std::tuple<std::string, BlockStatisticType, std::string>{"GBIIndex", BlockStatisticType::Integer, "[0, 4]"}},
{ BlockStatistic::CPRFlag, std::tuple<std::string, BlockStatisticType, std::string>{"CPRFlag", BlockStatisticType::Flag, ""}},
{ BlockStatistic::IBCFlag, std::tuple<std::string, BlockStatisticType, std::string>{"IBCFlag", BlockStatisticType::Flag, ""}},
// for dual tree
{ BlockStatistic::Depth_Chroma, std::tuple<std::string, BlockStatisticType, std::string>{"Depth_Chroma", BlockStatisticType::Integer, "[0, 10]"}}, // todo: actual limits?
{ BlockStatistic::QT_Depth_Chroma, std::tuple<std::string, BlockStatisticType, std::string>{"QT_Depth_Chroma", BlockStatisticType::Integer, "[0, 10]"}}, // todo: actual limits?
......
......@@ -33,11 +33,11 @@
/**
* \file
* \brief Implementation of CprHashMap class
* \brief Implementation of IbcHashMap class
*/
#include "CommonDefX86.h"
#include "../CprHashMap.h"
#include "../IbcHashMap.h"
#ifdef TARGET_SIMD_X86
......@@ -50,12 +50,12 @@ static uint32_t simdComputeCrc32c16bit(uint32_t crc, const Pel pel)
}
template <X86_VEXT vext>
void CprHashMap::_initCprHashMapX86()
void IbcHashMap::_initIbcHashMapX86()
{
m_computeCrc32c = simdComputeCrc32c16bit<vext>;
}
template void CprHashMap::_initCprHashMapX86<SIMDX86>();
template void IbcHashMap::_initIbcHashMapX86<SIMDX86>();
#endif //#ifdef TARGET_SIMD_X86
......
......@@ -48,7 +48,7 @@
#include "CommonLib/AdaptiveLoopFilter.h"
#include "CommonLib/CprHashMap.h"
#include "CommonLib/IbcHashMap.h"
#ifdef TARGET_SIMD_X86
......@@ -167,8 +167,8 @@ void AdaptiveLoopFilter::initAdaptiveLoopFilterX86()
}
#endif
#if ENABLE_SIMD_OPT_CPR
void CprHashMap::initCprHashMapX86()
#if ENABLE_SIMD_OPT_IBC
void IbcHashMap::initIbcHashMapX86()
{
auto vext = read_x86_extension_flags();
switch (vext)
......@@ -177,7 +177,7 @@ void CprHashMap::initCprHashMapX86()