Commit d7cb218d authored by Frank Bossen's avatar Frank Bossen

Merge branch 'M0483-Change-CPR-to-IBC-tmp' into 'master'

M0483 change cpr to ibc tmp

See merge request !170
parents 02116053 7341c1e7
Pipeline #557 passed with stage
...@@ -111,7 +111,7 @@ LMChroma : 1 # use CCLM only ...@@ -111,7 +111,7 @@ LMChroma : 1 # use CCLM only
DepQuant : 1 DepQuant : 1
IMV : 2 IMV : 2
ALF : 1 ALF : 1
CPR : 0 # turned off in CTC IBC : 0 # turned off in CTC
# Fast tools # Fast tools
PBIntraFast : 1 PBIntraFast : 1
......
...@@ -128,7 +128,7 @@ DepQuant : 1 ...@@ -128,7 +128,7 @@ DepQuant : 1
IMV : 2 IMV : 2
ALF : 1 ALF : 1
MHIntra : 1 MHIntra : 1
CPR : 0 # turned off in CTC IBC : 0 # turned off in CTC
# Fast tools # Fast tools
PBIntraFast : 1 PBIntraFast : 1
......
...@@ -131,7 +131,7 @@ GBi : 1 ...@@ -131,7 +131,7 @@ GBi : 1
GBiFast : 1 GBiFast : 1
MHIntra : 1 MHIntra : 1
Triangle : 1 Triangle : 1
CPR : 0 # turned off in CTC IBC : 0 # turned off in CTC
# Fast tools # Fast tools
PBIntraFast : 1 PBIntraFast : 1
......
...@@ -146,7 +146,7 @@ GBiFast : 1 ...@@ -146,7 +146,7 @@ GBiFast : 1
BIO : 1 BIO : 1
MHIntra : 1 MHIntra : 1
Triangle : 1 Triangle : 1
CPR : 0 # turned off in CTC IBC : 0 # turned off in CTC
# Fast tools # Fast tools
PBIntraFast : 1 PBIntraFast : 1
......
...@@ -258,13 +258,13 @@ void EncApp::xInitLibCfg() ...@@ -258,13 +258,13 @@ void EncApp::xInitLibCfg()
m_cEncLib.setUseMHIntra ( m_MHIntra ); m_cEncLib.setUseMHIntra ( m_MHIntra );
m_cEncLib.setUseTriangle ( m_Triangle ); m_cEncLib.setUseTriangle ( m_Triangle );
m_cEncLib.setCPRMode ( m_CPRMode ); m_cEncLib.setIBCMode ( m_IBCMode );
m_cEncLib.setCPRLocalSearchRangeX ( m_CPRLocalSearchRangeX ); m_cEncLib.setIBCLocalSearchRangeX ( m_IBCLocalSearchRangeX );
m_cEncLib.setCPRLocalSearchRangeY ( m_CPRLocalSearchRangeY ); m_cEncLib.setIBCLocalSearchRangeY ( m_IBCLocalSearchRangeY );
m_cEncLib.setCPRHashSearch ( m_CPRHashSearch ); m_cEncLib.setIBCHashSearch ( m_IBCHashSearch );
m_cEncLib.setCPRHashSearchMaxCand ( m_CPRHashSearchMaxCand ); m_cEncLib.setIBCHashSearchMaxCand ( m_IBCHashSearchMaxCand );
m_cEncLib.setCPRHashSearchRange4SmallBlk ( m_CPRHashSearchRange4SmallBlk ); m_cEncLib.setIBCHashSearchRange4SmallBlk ( m_IBCHashSearchRange4SmallBlk );
m_cEncLib.setCPRFastMethod ( m_CPRFastMethod ); m_cEncLib.setIBCFastMethod ( m_IBCFastMethod );
m_cEncLib.setUseWrapAround ( m_wrapAround ); m_cEncLib.setUseWrapAround ( m_wrapAround );
m_cEncLib.setWrapAroundOffset ( m_wrapAroundOffset ); m_cEncLib.setWrapAroundOffset ( m_wrapAroundOffset );
......
...@@ -865,13 +865,13 @@ bool EncAppCfg::parseCfg( int argc, char* argv[] ) ...@@ -865,13 +865,13 @@ bool EncAppCfg::parseCfg( int argc, char* argv[] )
("MHIntra", m_MHIntra, false, "Enable MHIntra mode") ("MHIntra", m_MHIntra, false, "Enable MHIntra mode")
("Triangle", m_Triangle, false, "Enable triangular shape motion vector prediction (0:off, 1:on)") ("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]") ( "IBC", m_IBCMode, 0u, "IBCMode (0x1:enabled, 0x0:disabled) [default: disabled]")
( "CPRLocalSearchRangeX", m_CPRLocalSearchRangeX, 128u, "Search range of CPR local search in x direction") ( "IBCLocalSearchRangeX", m_IBCLocalSearchRangeX, 128u, "Search range of IBC local search in x direction")
( "CPRLocalSearchRangeY", m_CPRLocalSearchRangeY, 128u, "Search range of CPR local search in y direction") ( "IBCLocalSearchRangeY", m_IBCLocalSearchRangeY, 128u, "Search range of IBC local search in y direction")
( "CPRHashSearch", m_CPRHashSearch, 1u, "Hash based CPR search") ( "IBCHashSearch", m_IBCHashSearch, 1u, "Hash based IBC search")
( "CPRHashSearchMaxCand", m_CPRHashSearchMaxCand, 256u, "Max candidates for hash based CPR search") ( "IBCHashSearchMaxCand", m_IBCHashSearchMaxCand, 256u, "Max candidates for hash based IBC search")
( "CPRHashSearchRange4SmallBlk", m_CPRHashSearchRange4SmallBlk, 256u, "Small block search range in based CPR search") ( "IBCHashSearchRange4SmallBlk", m_IBCHashSearchRange4SmallBlk, 256u, "Small block search range in based IBC search")
( "CPRFastMethod", m_CPRFastMethod, 6u, "Fast methods for CPR") ( "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]") ("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") ("WrapAroundOffset", m_wrapAroundOffset, 0u, "Offset in luma samples used for computing the horizontal wrap-around position")
...@@ -1934,7 +1934,7 @@ bool EncAppCfg::xCheckParameter() ...@@ -1934,7 +1934,7 @@ bool EncAppCfg::xCheckParameter()
xConfirmPara( m_DisableMotionCompression, "Disable motion data compression only allowed with NEXT profile" ); 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_MTT, "Multi type tree is only allowed with NEXT profile" );
xConfirmPara( m_ImvMode, "IMV 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" ); xConfirmPara( m_useFastLCTU, "Fast large CTU can only be applied when encoding with NEXT profile" );
#if JVET_M0464_UNI_MTS #if JVET_M0464_UNI_MTS
xConfirmPara( m_MTS, "MTS only allowed with NEXT profile" ); xConfirmPara( m_MTS, "MTS only allowed with NEXT profile" );
...@@ -3146,7 +3146,7 @@ void EncAppCfg::xPrintParameter() ...@@ -3146,7 +3146,7 @@ void EncAppCfg::xPrintParameter()
msg(VERBOSE, "MHIntra:%d ", m_MHIntra); msg(VERBOSE, "MHIntra:%d ", m_MHIntra);
msg( VERBOSE, "Triangle:%d ", m_Triangle ); msg( VERBOSE, "Triangle:%d ", m_Triangle );
} }
msg(VERBOSE, "CPR:%d ", m_CPRMode); msg(VERBOSE, "IBC:%d ", m_IBCMode);
msg( VERBOSE, "WrapAround:%d ", m_wrapAround); msg( VERBOSE, "WrapAround:%d ", m_wrapAround);
if( m_wrapAround ) if( m_wrapAround )
{ {
......
...@@ -239,13 +239,13 @@ protected: ...@@ -239,13 +239,13 @@ protected:
bool m_Triangle; bool m_Triangle;
unsigned m_CPRMode; unsigned m_IBCMode;
unsigned m_CPRLocalSearchRangeX; unsigned m_IBCLocalSearchRangeX;
unsigned m_CPRLocalSearchRangeY; unsigned m_IBCLocalSearchRangeY;
unsigned m_CPRHashSearch; unsigned m_IBCHashSearch;
unsigned m_CPRHashSearchMaxCand; unsigned m_IBCHashSearchMaxCand;
unsigned m_CPRHashSearchRange4SmallBlk; unsigned m_IBCHashSearchRange4SmallBlk;
unsigned m_CPRFastMethod; unsigned m_IBCFastMethod;
bool m_wrapAround; bool m_wrapAround;
unsigned m_wrapAroundOffset; unsigned m_wrapAroundOffset;
......
...@@ -1299,7 +1299,7 @@ const TransformUnit* CodingStructure::getTURestricted( const Position &pos, cons ...@@ -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"); CHECK(chType != CHANNEL_TYPE_CHROMA, "Error");
...@@ -1307,7 +1307,7 @@ CprLumaCoverage CodingStructure::getCprLumaCoverage(const CompArea& chromaArea) ...@@ -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())); 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)); lumaArea = clipArea(lumaArea, picture->block(COMPONENT_Y));
const unsigned int fullArea = lumaArea.area(); 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 y = 0; y < lumaArea.height; y += MIN_PU_SIZE)
{ {
for (SizeType x = 0; x < lumaArea.width; x += MIN_PU_SIZE) for (SizeType x = 0; x < lumaArea.width; x += MIN_PU_SIZE)
...@@ -1315,19 +1315,19 @@ CprLumaCoverage CodingStructure::getCprLumaCoverage(const CompArea& chromaArea) ...@@ -1315,19 +1315,19 @@ CprLumaCoverage CodingStructure::getCprLumaCoverage(const CompArea& chromaArea)
Position pos = lumaArea.offset(x, y); Position pos = lumaArea.offset(x, y);
if (picture->cs->getMotionInfo(pos).isInter) // need to change if inter slice allows dualtree if (picture->cs->getMotionInfo(pos).isInter) // need to change if inter slice allows dualtree
{ {
cprArea += unitAreaSubBlock; ibcArea += unitAreaSubBlock;
} }
} }
} }
CprLumaCoverage coverage = CPR_LUMA_COVERAGE_FULL; IbcLumaCoverage coverage = IBC_LUMA_COVERAGE_FULL;
if (cprArea == 0) 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; return coverage;
......
...@@ -58,12 +58,12 @@ enum PictureType ...@@ -58,12 +58,12 @@ enum PictureType
PIC_ORG_RESI, PIC_ORG_RESI,
NUM_PIC_TYPES NUM_PIC_TYPES
}; };
enum CprLumaCoverage enum IbcLumaCoverage
{ {
CPR_LUMA_COVERAGE_FULL = 0, IBC_LUMA_COVERAGE_FULL = 0,
CPR_LUMA_COVERAGE_PARTIAL, IBC_LUMA_COVERAGE_PARTIAL,
CPR_LUMA_COVERAGE_NONE, IBC_LUMA_COVERAGE_NONE,
NUM_CPR_LUMA_COVERAGE, NUM_IBC_LUMA_COVERAGE,
}; };
extern XUCache g_globalUnitCache; extern XUCache g_globalUnitCache;
...@@ -154,7 +154,7 @@ public: ...@@ -154,7 +154,7 @@ public:
cCUTraverser traverseCUs(const UnitArea& _unit, const ChannelType _chType) const; cCUTraverser traverseCUs(const UnitArea& _unit, const ChannelType _chType) const;
cPUTraverser traversePUs(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; cTUTraverser traverseTUs(const UnitArea& _unit, const ChannelType _chType) const;
CprLumaCoverage getCprLumaCoverage(const CompArea& chromaArea) const; IbcLumaCoverage getIbcLumaCoverage(const CompArea& chromaArea) const;
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
// encoding search utilities // encoding search utilities
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
......
...@@ -396,12 +396,12 @@ static const int TRIANGLE_MAX_NUM_CANDS = 40; ...@@ -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_MAX_NUM_SATD_CANDS = 3;
static const int TRIANGLE_MIN_SIZE = 8 * 8; 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 IBC_MAX_CAND_SIZE = 16; // max block size for ibc search
static const int CPR_NUM_CANDIDATES = 64; ///< Maximum number of candidates to store/test 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 CHROMA_REFINEMENT_CANDIDATES = 8; /// 8 candidates BV to choose from
static const int CPR_FAST_METHOD_NOINTRA_CPRCBF0 = 0x01; static const int IBC_FAST_METHOD_NOINTRA_IBCCBF0 = 0x01;
static const int CPR_FAST_METHOD_BUFFERBV = 0X02; static const int IBC_FAST_METHOD_BUFFERBV = 0X02;
static const int CPR_FAST_METHOD_ADAPTIVE_SEARCHRANGE = 0X04; static const int IBC_FAST_METHOD_ADAPTIVE_SEARCHRANGE = 0X04;
// ==================================================================================================================== // ====================================================================================================================
// Macro functions // Macro functions
......
...@@ -472,7 +472,7 @@ void MergeCtx::setMergeInfo( PredictionUnit& pu, int candIdx ) ...@@ -472,7 +472,7 @@ void MergeCtx::setMergeInfo( PredictionUnit& pu, int candIdx )
pu.mvpNum [REF_PIC_LIST_1] = NOT_VALID; 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()) 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 = pu.mv[REF_PIC_LIST_0];
pu.bv.changePrecision(MV_PRECISION_INTERNAL, MV_PRECISION_INT); // used for only integer resolution pu.bv.changePrecision(MV_PRECISION_INTERNAL, MV_PRECISION_INT); // used for only integer resolution
} }
......
...@@ -31,46 +31,46 @@ ...@@ -31,46 +31,46 @@
* THE POSSIBILITY OF SUCH DAMAGE. * THE POSSIBILITY OF SUCH DAMAGE.
*/ */
/** \file CprHashMap.cpp /** \file IbcHashMap.cpp
\brief CPR hash map encoder class \brief IBC hash map encoder class
*/ */
#include "CommonLib/dtrace_codingstruct.h" #include "CommonLib/dtrace_codingstruct.h"
#include "CommonLib/Picture.h" #include "CommonLib/Picture.h"
#include "CommonLib/UnitTools.h" #include "CommonLib/UnitTools.h"
#include "CprHashMap.h" #include "IbcHashMap.h"
using namespace std; using namespace std;
//! \ingroup CprHashMap //! \ingroup IbcHashMap
//! \{ //! \{
// ==================================================================================================================== // ====================================================================================================================
// Constructor / destructor / create / destroy // Constructor / destructor / create / destroy
// ==================================================================================================================== // ====================================================================================================================
CprHashMap::CprHashMap() IbcHashMap::IbcHashMap()
{ {
m_picWidth = 0; m_picWidth = 0;
m_picHeight = 0; m_picHeight = 0;
m_pos2Hash = NULL; m_pos2Hash = NULL;
m_computeCrc32c = xxComputeCrc32c16bit; m_computeCrc32c = xxComputeCrc32c16bit;
#if ENABLE_SIMD_OPT_CPR #if ENABLE_SIMD_OPT_IBC
#ifdef TARGET_SIMD_X86 #ifdef TARGET_SIMD_X86
initCprHashMapX86(); initIbcHashMapX86();
#endif #endif
#endif #endif
} }
CprHashMap::~CprHashMap() IbcHashMap::~IbcHashMap()
{ {
destroy(); 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) if (picWidth != m_picWidth || picHeight != m_picHeight)
{ {
...@@ -87,7 +87,7 @@ void CprHashMap::init(const int picWidth, const int picHeight) ...@@ -87,7 +87,7 @@ void CprHashMap::init(const int picWidth, const int picHeight)
} }
} }
void CprHashMap::destroy() void IbcHashMap::destroy()
{ {
if (m_pos2Hash != NULL) if (m_pos2Hash != NULL)
{ {
...@@ -168,7 +168,7 @@ static const uint32_t crc32Table[256] = { ...@@ -168,7 +168,7 @@ static const uint32_t crc32Table[256] = {
0xBE2DA0A5L, 0x4C4623A6L, 0x5F16D052L, 0xAD7D5351L 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 void *buf = &pel;
const uint8_t *p = (const uint8_t *)buf; const uint8_t *p = (const uint8_t *)buf;
...@@ -184,7 +184,7 @@ uint32_t CprHashMap::xxComputeCrc32c16bit(uint32_t crc, const Pel pel) ...@@ -184,7 +184,7 @@ uint32_t CprHashMap::xxComputeCrc32c16bit(uint32_t crc, const Pel pel)
// CRC calculation in C code // 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++) for (int y = 0; y < height; y++)
{ {
...@@ -198,7 +198,7 @@ unsigned int CprHashMap::xxCalcBlockHash(const Pel* pel, const int stride, const ...@@ -198,7 +198,7 @@ unsigned int CprHashMap::xxCalcBlockHash(const Pel* pel, const int stride, const
} }
template<ChromaFormat chromaFormat> 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 chromaScalingX = getChannelTypeScaleX(CHANNEL_TYPE_CHROMA, chromaFormat);
const int chromaScalingY = getChannelTypeScaleY(CHANNEL_TYPE_CHROMA, chromaFormat); const int chromaScalingY = getChannelTypeScaleY(CHANNEL_TYPE_CHROMA, chromaFormat);
...@@ -243,7 +243,7 @@ void CprHashMap::xxBuildPicHashMap(const PelUnitBuf& pic) ...@@ -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(); m_hash2Pos.clear();
...@@ -267,7 +267,7 @@ void CprHashMap::rebuildPicHashMap(const PelUnitBuf& pic) ...@@ -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(); cand.clear();
...@@ -332,7 +332,7 @@ bool CprHashMap::cprHashMatch(const Area& lumaArea, std::vector<Position>& cand, ...@@ -332,7 +332,7 @@ bool CprHashMap::cprHashMatch(const Area& lumaArea, std::vector<Position>& cand,
return cand.size() > 0; 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 maxX = std::min((int)(lumaArea.x + lumaArea.width), m_picWidth);
int maxY = std::min((int)(lumaArea.y + lumaArea.height), m_picHeight); int maxY = std::min((int)(lumaArea.y + lumaArea.height), m_picHeight);
......
...@@ -31,12 +31,12 @@ ...@@ -31,12 +31,12 @@
* THE POSSIBILITY OF SUCH DAMAGE. * THE POSSIBILITY OF SUCH DAMAGE.
*/ */
/** \file CprHashMap.h /** \file IbcHashMap.h
\brief CPR hash map encoder class (header) \brief IBC hash map encoder class (header)
*/ */
#ifndef __CPRHASHMAP__ #ifndef __IBCHASHMAP__
#define __CPRHASHMAP__ #define __IBCHASHMAP__
// Include files // Include files
#include "CommonLib/CommonDef.h" #include "CommonLib/CommonDef.h"
...@@ -55,7 +55,7 @@ ...@@ -55,7 +55,7 @@
// Class definition // Class definition
// ==================================================================================================================== // ====================================================================================================================
class CprHashMap class IbcHashMap
{ {
private: private:
int m_picWidth; int m_picWidth;
...@@ -73,23 +73,23 @@ private: ...@@ -73,23 +73,23 @@ private:
public: public:
uint32_t (*m_computeCrc32c) (uint32_t crc, const Pel pel); uint32_t (*m_computeCrc32c) (uint32_t crc, const Pel pel);
CprHashMap(); IbcHashMap();
virtual ~CprHashMap(); virtual ~IbcHashMap();
void init(const int picWidth, const int picHeight); void init(const int picWidth, const int picHeight);
void destroy(); void destroy();
void rebuildPicHashMap(const PelUnitBuf& pic); 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); int getHashHitRatio(const Area& lumaArea);
#ifdef TARGET_SIMD_X86 #ifdef TARGET_SIMD_X86
void initCprHashMapX86(); void initIbcHashMapX86();
template <X86_VEXT vext> template <X86_VEXT vext>
void _initCprHashMapX86(); void _initIbcHashMapX86();
#endif #endif
}; };
//! \} //! \}
#endif // __CPRHASHMAP__ #endif // __IBCHASHMAP__
...@@ -374,10 +374,10 @@ void InterPrediction::xPredInterUni(const PredictionUnit& pu, const RefPicList& ...@@ -374,10 +374,10 @@ void InterPrediction::xPredInterUni(const PredictionUnit& pu, const RefPicList&
int iRefIdx = pu.refIdx[eRefPicList]; int iRefIdx = pu.refIdx[eRefPicList];
Mv mv[3]; Mv mv[3];
bool isCPR = false; bool isIBC = false;
if (pu.cs->slice->getRefPic(eRefPicList, iRefIdx)->getPOC() == pu.cs->slice->getPOC()) if (pu.cs->slice->getRefPic(eRefPicList, iRefIdx)->getPOC() == pu.cs->slice->getPOC())
{ {
isCPR = true; isIBC = true;
} }
if( pu.cu->affine ) if( pu.cu->affine )
{ {
...@@ -413,7 +413,7 @@ void InterPrediction::xPredInterUni(const PredictionUnit& pu, const RefPicList& ...@@ -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 ) xPredInterBlk( compID, pu, pu.cu->slice->getRefPic( eRefPicList, iRefIdx ), mv[0], pcYuvPred, bi, pu.cu->slice->clpRng( compID )
, bioApplied , bioApplied
, isCPR , isIBC
); );
} }
...@@ -524,7 +524,7 @@ void InterPrediction::xPredInterBi(PredictionUnit& pu, PelUnitBuf &pcYuvPred) ...@@ -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 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 , const bool& bioApplied
, bool isCPR , bool isIBC
) )
{ {
JVET_J0090_SET_REF_PICTURE( refPic, compID ); JVET_J0090_SET_REF_PICTURE( refPic, compID );
...@@ -536,7 +536,7 @@ void InterPrediction::xPredInterBlk ( const ComponentID& compID, const Predictio ...@@ -536,7 +536,7 @@ void InterPrediction::xPredInterBlk ( const ComponentID& compID, const Predictio
int xFrac = _mv.hor & ((1 << shiftHor) - 1); int xFrac = _mv.hor & ((1 << shiftHor) - 1);
int yFrac = _mv.ver & ((1 << shiftVer) - 1);