Commit 40d607d9 authored by Karsten Suehring's avatar Karsten Suehring

remove macro JVET_L0293_CPR

parent 46504ed4
......@@ -254,7 +254,6 @@ void EncApp::xInitLibCfg()
m_cEncLib.setUseMHIntra ( m_MHIntra );
m_cEncLib.setUseTriangle ( m_Triangle );
#if JVET_L0293_CPR
m_cEncLib.setCPRMode ( m_CPRMode );
m_cEncLib.setCPRLocalSearchRangeX ( m_CPRLocalSearchRangeX );
m_cEncLib.setCPRLocalSearchRangeY ( m_CPRLocalSearchRangeY );
......@@ -262,7 +261,6 @@ void EncApp::xInitLibCfg()
m_cEncLib.setCPRHashSearchMaxCand ( m_CPRHashSearchMaxCand );
m_cEncLib.setCPRHashSearchRange4SmallBlk ( m_CPRHashSearchRange4SmallBlk );
m_cEncLib.setCPRFastMethod ( m_CPRFastMethod );
#endif
m_cEncLib.setUseWrapAround ( m_wrapAround );
m_cEncLib.setWrapAroundOffset ( m_wrapAroundOffset );
......
......@@ -855,7 +855,6 @@ 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)")
#if JVET_L0293_CPR
( "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")
......@@ -863,7 +862,6 @@ bool EncAppCfg::parseCfg( int argc, char* argv[] )
( "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")
#endif
("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")
......@@ -1927,9 +1925,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" );
#if JVET_L0293_CPR
xConfirmPara(m_CPRMode, "CPR Mode only allowed with NEXT profile");
#endif
xConfirmPara( m_useFastLCTU, "Fast large CTU can only be applied when encoding with NEXT profile" );
xConfirmPara( m_EMT, "EMT only allowed with NEXT profile" );
xConfirmPara( m_FastEMT, "EMT only allowed with NEXT profile" );
......@@ -3125,9 +3121,7 @@ void EncAppCfg::xPrintParameter()
msg(VERBOSE, "MHIntra:%d ", m_MHIntra);
msg( VERBOSE, "Triangle:%d ", m_Triangle );
}
#if JVET_L0293_CPR
msg(VERBOSE, "CPR:%d ", m_CPRMode);
#endif
msg( VERBOSE, "WrapAround:%d ", m_wrapAround);
if( m_wrapAround )
{
......
......@@ -236,7 +236,6 @@ protected:
bool m_Triangle;
#if JVET_L0293_CPR
unsigned m_CPRMode;
unsigned m_CPRLocalSearchRangeX;
unsigned m_CPRLocalSearchRangeY;
......@@ -244,7 +243,6 @@ protected:
unsigned m_CPRHashSearchMaxCand;
unsigned m_CPRHashSearchRange4SmallBlk;
unsigned m_CPRFastMethod;
#endif
bool m_wrapAround;
unsigned m_wrapAroundOffset;
......
......@@ -746,11 +746,7 @@ void CodingStructure::useSubStructure( const CodingStructure& subStruct, const C
if( cpyResi ) picture->getResiBuf( clippedArea ).copyFrom( subResiBuf );
if( cpyReco ) picture->getRecoBuf( clippedArea ).copyFrom( subRecoBuf );
#if JVET_L0293_CPR
if (!subStruct.m_isTuEnc && (!slice->isIntra() && subStruct.chType != CHANNEL_TYPE_CHROMA))
#else
if( !subStruct.m_isTuEnc && !slice->isIntra() )
#endif
{
// copy motion buffer
MotionBuf ownMB = getMotionBuf ( clippedArea );
......@@ -1303,7 +1299,6 @@ const TransformUnit* CodingStructure::getTURestricted( const Position &pos, cons
}
}
#if JVET_L0293_CPR
CprLumaCoverage CodingStructure::getCprLumaCoverage(const CompArea& chromaArea) const
{
CHECK(chType != CHANNEL_TYPE_CHROMA, "Error");
......@@ -1337,4 +1332,3 @@ CprLumaCoverage CodingStructure::getCprLumaCoverage(const CompArea& chromaArea)
return coverage;
}
#endif
......@@ -58,7 +58,6 @@ enum PictureType
PIC_ORG_RESI,
NUM_PIC_TYPES
};
#if JVET_L0293_CPR
enum CprLumaCoverage
{
CPR_LUMA_COVERAGE_FULL = 0,
......@@ -66,7 +65,6 @@ enum CprLumaCoverage
CPR_LUMA_COVERAGE_NONE,
NUM_CPR_LUMA_COVERAGE,
};
#endif
extern XUCache g_globalUnitCache;
// ---------------------------------------------------------------------------
......@@ -85,9 +83,7 @@ public:
Slice *slice;
UnitScale unitScale[MAX_NUM_COMPONENT];
#if JVET_L0293_CPR
ChannelType chType;
#endif
int baseQP;
int prevQP[MAX_NUM_CHANNEL_TYPE];
......@@ -158,9 +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;
#if JVET_L0293_CPR
CprLumaCoverage getCprLumaCoverage(const CompArea& chromaArea) const;
#endif
// ---------------------------------------------------------------------------
// encoding search utilities
// ---------------------------------------------------------------------------
......
......@@ -114,7 +114,6 @@ 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_L0293_CPR
namespace std
{
template <>
......@@ -135,7 +134,6 @@ namespace std
}
};
}
#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);
......
......@@ -390,14 +390,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;
#if JVET_L0293_CPR
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 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;
#endif
// ====================================================================================================================
// Macro functions
......
......@@ -340,14 +340,12 @@ 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_L0293_CPR
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.bv = pu.mv[REF_PIC_LIST_0];
pu.bv.changePrecision(MV_PRECISION_INTERNAL, MV_PRECISION_INT); // used for only integer resolution
}
#endif
pu.cu->GBiIdx = ( interDirNeighbours[candIdx] == 3 ) ? GBiIdx[candIdx] : GBI_DEFAULT;
}
......
......@@ -298,11 +298,7 @@ bool CprHashMap::cprHashMatch(const Area& lumaArea, std::vector<Position>& cand,
bool wholeBlockMatch = true;
if (lumaArea.width > MIN_PU_SIZE || lumaArea.height > MIN_PU_SIZE)
{
#if JVET_L0293_CPR
if (!cs.isDecomp(bottomRight, cs.chType) || bottomRight.x >= m_picWidth || bottomRight.y >= m_picHeight)
#else
if (!cs.isDecomp(bottomRight, CHANNEL_TYPE_LUMA) || bottomRight.x >= m_picWidth || bottomRight.y >= m_picHeight)
#endif
{
continue;
}
......@@ -317,11 +313,7 @@ bool CprHashMap::cprHashMatch(const Area& lumaArea, std::vector<Position>& cand,
}
else
{
#if JVET_L0293_CPR
if (abs(refBlockPos->x - lumaArea.x) > searchRange4SmallBlk || abs(refBlockPos->y - lumaArea.y) > searchRange4SmallBlk || !cs.isDecomp(bottomRight, cs.chType))
#else
if (abs(refBlockPos->x - lumaArea.x) > searchRange4SmallBlk || abs(refBlockPos->y - lumaArea.y) > searchRange4SmallBlk || !cs.isDecomp(bottomRight, CHANNEL_TYPE_LUMA))
#endif
{
continue;
}
......
......@@ -344,7 +344,6 @@ void InterPrediction::xSubPuMC( PredictionUnit& pu, PelUnitBuf& predBuf, const R
pu.cu->affine = isAffine;
}
#if JVET_L0293_CPR
void InterPrediction::xChromaMC(PredictionUnit &pu, PelUnitBuf& pcYuvPred)
{
// separated tree, chroma
......@@ -372,27 +371,22 @@ void InterPrediction::xChromaMC(PredictionUnit &pu, PelUnitBuf& pcYuvPred)
}
}
}
#endif
void InterPrediction::xPredInterUni(const PredictionUnit& pu, const RefPicList& eRefPicList, PelUnitBuf& pcYuvPred, const bool& bi
, const bool& bioApplied
#if JVET_L0293_CPR
, const bool luma, const bool chroma
#endif
)
{
const SPS &sps = *pu.cs->sps;
int iRefIdx = pu.refIdx[eRefPicList];
Mv mv[3];
#if JVET_L0293_CPR
bool isCPR = false;
if (pu.cs->slice->getRefPic(eRefPicList, iRefIdx)->getPOC() == pu.cs->slice->getPOC())
{
isCPR = true;
}
#endif
if( pu.cu->affine )
{
CHECK( iRefIdx < 0, "iRefIdx incorrect." );
......@@ -414,12 +408,10 @@ void InterPrediction::xPredInterUni(const PredictionUnit& pu, const RefPicList&
for( uint32_t comp = COMPONENT_Y; comp < pcYuvPred.bufs.size() && comp <= m_maxCompIDToPred; comp++ )
{
const ComponentID compID = ComponentID( comp );
#if JVET_L0293_CPR
if (compID == COMPONENT_Y && !luma)
continue;
if (compID != COMPONENT_Y && !chroma)
continue;
#endif
if ( pu.cu->affine )
{
CHECK( bioApplied, "BIO is not allowed with affine" );
......@@ -429,9 +421,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
#if JVET_L0293_CPR
, isCPR
#endif
);
}
......@@ -490,9 +480,7 @@ void InterPrediction::xPredInterBi(PredictionUnit& pu, PelUnitBuf &pcYuvPred)
{
xPredInterUni ( pu, eRefPicList, pcMbBuf, true
, bioApplied
#if JVET_L0293_CPR
, true, true
#endif
);
}
else
......@@ -501,18 +489,14 @@ void InterPrediction::xPredInterBi(PredictionUnit& pu, PelUnitBuf &pcYuvPred)
{
xPredInterUni ( pu, eRefPicList, pcMbBuf, true
, bioApplied
#if JVET_L0293_CPR
, true, true
#endif
);
}
else
{
xPredInterUni( pu, eRefPicList, pcMbBuf, pu.cu->triangle
, bioApplied
#if JVET_L0293_CPR
, true, true
#endif
);
}
}
......@@ -541,9 +525,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
#if JVET_L0293_CPR
, bool isCPR
#endif
)
{
JVET_J0090_SET_REF_PICTURE( refPic, compID );
......@@ -555,13 +537,11 @@ void InterPrediction::xPredInterBlk ( const ComponentID& compID, const Predictio
int xFrac = _mv.hor & ((1 << shiftHor) - 1);
int yFrac = _mv.ver & ((1 << shiftVer) - 1);
#if JVET_L0293_CPR
if (isCPR)
{
xFrac = yFrac = 0;
JVET_J0090_SET_CACHE_ENABLE( false );
}
#endif
PelBuf &dstBuf = dstPic.bufs[compID];
unsigned width = dstBuf.width;
......@@ -634,9 +614,7 @@ void InterPrediction::xPredAffineBlk( const ComponentID& compID, const Predictio
*pu.cs->sps );
xPredInterBlk( compID, pu, refPic, mvTemp, dstPic, bi, clpRng
, false
#if JVET_L0293_CPR
, false
#endif
);
return;
}
......@@ -1223,12 +1201,9 @@ void InterPrediction::xWeightedAverage(const PredictionUnit& pu, const CPelUnitB
}
void InterPrediction::motionCompensation( PredictionUnit &pu, PelUnitBuf &predBuf, const RefPicList &eRefPicList
#if JVET_L0293_CPR
, const bool luma, const bool chroma
#endif
)
{
#if JVET_L0293_CPR
// dual tree handling for CPR as the only ref
if (!luma || !chroma)
{
......@@ -1246,7 +1221,6 @@ void InterPrediction::motionCompensation( PredictionUnit &pu, PelUnitBuf &predBu
}
}
// else, go with regular MC below
#endif
CodingStructure &cs = *pu.cs;
const PPS &pps = *cs.pps;
const SliceType sliceType = cs.slice->getSliceType();
......@@ -1257,9 +1231,7 @@ void InterPrediction::motionCompensation( PredictionUnit &pu, PelUnitBuf &predBu
{
xPredInterUni ( pu, eRefPicList, predBuf, true
, false
#if JVET_L0293_CPR
, true, true
#endif
);
xWeightedPredictionUni( pu, predBuf, eRefPicList, predBuf, -1, m_maxCompIDToPred );
}
......@@ -1267,19 +1239,13 @@ void InterPrediction::motionCompensation( PredictionUnit &pu, PelUnitBuf &predBu
{
xPredInterUni( pu, eRefPicList, predBuf, false
, false
#if JVET_L0293_CPR
, true, true
#endif
);
}
}
else
{
#if JVET_L0293_CPR
if (pu.mergeType != MRG_TYPE_DEFAULT_N && pu.mergeType != MRG_TYPE_CPR)
#else
if( pu.mergeType != MRG_TYPE_DEFAULT_N )
#endif
{
xSubPuMC( pu, predBuf, eRefPicList );
}
......@@ -1287,9 +1253,7 @@ void InterPrediction::motionCompensation( PredictionUnit &pu, PelUnitBuf &predBu
{
xPredInterUni( pu, REF_PIC_LIST_0, predBuf, false
, false
#if JVET_L0293_CPR
, true, true
#endif
);
}
else
......@@ -1301,33 +1265,25 @@ void InterPrediction::motionCompensation( PredictionUnit &pu, PelUnitBuf &predBu
}
void InterPrediction::motionCompensation( CodingUnit &cu, const RefPicList &eRefPicList
#if JVET_L0293_CPR
, const bool luma, const bool chroma
#endif
)
{
for( auto &pu : CU::traversePUs( cu ) )
{
PelUnitBuf predBuf = cu.cs->getPredBuf( pu );
motionCompensation( pu, predBuf, eRefPicList
#if JVET_L0293_CPR
, luma, chroma
#endif
);
}
}
void InterPrediction::motionCompensation( PredictionUnit &pu, const RefPicList &eRefPicList /*= REF_PIC_LIST_X*/
#if JVET_L0293_CPR
, const bool luma, const bool chroma
#endif
)
{
PelUnitBuf predBuf = pu.cs->getPredBuf( pu );
motionCompensation( pu, predBuf, eRefPicList
#if JVET_L0293_CPR
, luma, chroma
#endif
);
}
......
......@@ -105,16 +105,12 @@ protected:
void xPredInterUni ( const PredictionUnit& pu, const RefPicList& eRefPicList, PelUnitBuf& pcYuvPred, const bool& bi
, const bool& bioApplied
#if JVET_L0293_CPR
, const bool luma, const bool chroma
#endif
);
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
#if JVET_L0293_CPR
, bool isCPR
#endif
);
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);
......@@ -133,9 +129,7 @@ protected:
MotionInfo m_SubPuMiBuf[(MAX_CU_SIZE * MAX_CU_SIZE) >> (MIN_CU_LOG2 << 1)];
#if JVET_L0293_CPR
void xChromaMC(PredictionUnit &pu, PelUnitBuf& pcYuvPred);
#endif
#if JVET_J0090_MEMORY_BANDWITH_MEASURE
CacheModel *m_cacheModel;
#endif
......@@ -147,19 +141,13 @@ public:
// inter
void motionCompensation (PredictionUnit &pu, PelUnitBuf& predBuf, const RefPicList &eRefPicList = REF_PIC_LIST_X
#if JVET_L0293_CPR
, const bool luma = true, const bool chroma = true
#endif
);
void motionCompensation (PredictionUnit &pu, const RefPicList &eRefPicList = REF_PIC_LIST_X
#if JVET_L0293_CPR
, const bool luma = true, const bool chroma = true
#endif
);
void motionCompensation (CodingUnit &cu, const RefPicList &eRefPicList = REF_PIC_LIST_X
#if JVET_L0293_CPR
, const bool luma = true, const bool chroma = true
#endif
);
void motionCompensation4Triangle( CodingUnit &cu, MergeCtx &triangleMrgCtx, const bool splitDir, const uint8_t candIdx0, const uint8_t candIdx1 );
......
......@@ -430,13 +430,9 @@ unsigned LoopFilter::xGetBoundaryStrengthSingle ( const CodingUnit& cu, const De
const Slice& sliceQ = *cu.slice;
const Position& cuPosLuma = cu.lumaPos();
#if JVET_L0293_CPR
int shiftHor = cu.Y().valid() ? 0 : ::getComponentScaleX(COMPONENT_Cb, cu.firstPU->chromaFormat);
int shiftVer = cu.Y().valid() ? 0 : ::getComponentScaleY(COMPONENT_Cb, cu.firstPU->chromaFormat);
const Position& posQ = Position{ localPos.x >> shiftHor, localPos.y >> shiftVer };
#else
const Position& posQ = localPos;
#endif
const Position posP = ( edgeDir == EDGE_VER ) ? posQ.offset( -1, 0 ) : posQ.offset( 0, -1 );
const bool sameCU = posP.x >= cuPosLuma.x && posP.y >= cuPosLuma.y;
......
......@@ -106,9 +106,7 @@ struct MotionInfo
Mv mv [ NUM_REF_PIC_LIST_01 ];
int16_t refIdx [ NUM_REF_PIC_LIST_01 ];
#if JVET_L0293_CPR
Mv bv;
#endif
MotionInfo() : isInter( 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
MotionInfo( int i ) : isInter( i != 0 ), interDir( 0 ), sliceIdx( 0 ), refIdx{ 0, 0 } { CHECKD( i != 0, "The argument for this constructor has to be '0'" ); }
......
......@@ -203,7 +203,6 @@ public:
}
};// END CLASS DEFINITION MV
#if JVET_L0293_CPR
namespace std
{
template <>
......@@ -215,7 +214,6 @@ namespace std
}
};
};
#endif
void clipMv ( Mv& rcMv, const struct Position& pos,
const struct Size& size,
const class SPS& sps );
......
......@@ -916,11 +916,7 @@ void Quant::transformSkipQuantOneSample(TransformUnit &tu, const ComponentID &co
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
#if JVET_L0293_CPR
const int iAdd = int64_t(bUseHalfRoundingPoint ? 256 : (tu.cs->slice->isIRAP() ? 171 : 85)) << int64_t(iQBits - 9);
#else
const int iAdd = int64_t(bUseHalfRoundingPoint ? 256 : (tu.cs->slice->getSliceType() == I_SLICE ? 171 : 85)) << int64_t(iQBits - 9);
#endif
TCoeff transformedCoefficient;
// transform-skip
......
......@@ -114,15 +114,11 @@ private:
// for motion cost
Mv m_mvPredictor;
#if JVET_L0293_CPR
Mv m_bvPredictors[2];
#endif
double m_motionLambda;
int m_iCostScale;
#if JVET_L0293_CPR
double m_dCost; // for cpr
#endif
public:
RdCost();
virtual ~RdCost();
......@@ -166,7 +162,6 @@ public:
}
void setCostScale ( int iCostScale ) { m_iCostScale = iCostScale; }
Distortion getCost ( uint32_t b ) { return Distortion( m_motionLambda * b ); }
#if JVET_L0293_CPR
// for cpr
void getMotionCost(int add, bool isTransquantBypass) { m_dCost = m_dLambdaMotionSAD[(isTransquantBypass && m_costMode == COST_MIXED_LOSSLESS_LOSSY_CODING) ? 1 : 0] + add; }
......@@ -270,7 +265,6 @@ public:
return length;
}
#endif
#if ENABLE_SPLIT_PARALLELISM
void copyState( const RdCost& other );
......
......@@ -433,7 +433,6 @@ void Slice::setRefPicList( PicList& rcListPic, bool checkNumPocTotalCurr, bool b
pcRefPic = xGetLongTermRefPic(rcListPic, m_pRPS->getPOC(i), m_pRPS->getCheckLTMSBPresent(i));
}
}
#if JVET_L0293_CPR
if (getSPS()->getSpsNext().getCPRMode())
{
RefPicSetLtCurr[NumPicLtCurr] = getPic();
......@@ -441,7 +440,6 @@ void Slice::setRefPicList( PicList& rcListPic, bool checkNumPocTotalCurr, bool b
getPic()->longTerm = true;
NumPicLtCurr++;
}
#endif
// ref_pic_list_init
Picture* rpsCurrList0[MAX_NUM_REF+1];
Picture* rpsCurrList1[MAX_NUM_REF+1];
......@@ -454,13 +452,11 @@ 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 JVET_L0293_CPR
if (getSPS()->getSpsNext().getCPRMode())
{
CHECK(numPicTotalCurr != 1, "Invalid state");
}
else
#endif
CHECK(numPicTotalCurr != 0, "Invalid state");
}
......@@ -531,13 +527,11 @@ void Slice::setRefPicList( PicList& rcListPic, bool checkNumPocTotalCurr, bool b
m_bIsUsedAsLongTerm[REF_PIC_LIST_1][rIdx] = ( cIdx >= NumPicStCurr0 + NumPicStCurr1 );
}
}
#if JVET_L0293_CPR
if (getSPS()->getSpsNext().getCPRMode())
{
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)
......@@ -568,13 +562,11 @@ int Slice::getNumRpsCurrTempList() const
numRpsCurrTempList++;
}
}
#if JVET_L0293_CPR
if (getSPS()->getSpsNext().getCPRMode())
{
return numRpsCurrTempList + 1;
}
else
#endif
return numRpsCurrTempList;
}
......@@ -1800,9 +1792,7 @@ SPSNext::SPSNext( SPS& sps )
, m_ImvMode ( IMV_OFF )
, m_MTTMode ( 0 )
, m_compositeRefEnabled ( false )
#if JVET_L0293_CPR
, m_CPRMode ( 0 )
#endif
// ADD_NEW_TOOL : (sps extension) add tool enabling flags here (with "false" as default values)
{
}
......
......@@ -853,9 +853,7 @@ private:
bool m_compositeRefEnabled; //composite longterm reference
#if JVET_L0293_CPR
unsigned m_CPRMode;
#endif
// ADD_NEW_TOOL : (sps extension) add tool enabling flags and associated parameters here
......@@ -964,10 +962,8 @@ public:
bool getUseMHIntra () const { return m_MHIntra; }
void setUseTriangle ( bool b ) { m_Triangle = b; }
bool getUseTriangle () const { return m_Triangle; }
#if JVET_L0293_CPR
void setCPRMode (unsigned CPRMode) { m_CPRMode = CPRMode; }
unsigned getCPRMode () const { return m_CPRMode; }
#endif
// ADD_NEW_TOOL : (sps extension) add access functions for tool enabling flags and associated parameters here
};
......
......@@ -88,7 +88,6 @@
#define JVET_L0293_CPR 1 // current picture referencing or intra block copy mode
#define JVET_L0362_QG_FIX 1 // QG is the node of qtDepth + mttDepth <= maxDqpDepth
#define JVET_L0362_QG_FIX_CU_REUSE 1 // fix bug on encoder cu coding info reusing fast algorithm (i.e., reuse cu info when having the same neighbor and the same qp)
......@@ -884,9 +883,7 @@ enum MergeType
{
MRG_TYPE_DEFAULT_N = 0, // 0
MRG_TYPE_SUBPU_ATMVP,
#if JVET_L0293_CPR
MRG_TYPE_CPR,
#endif
NUM_MRG_TYPE // 5
};
......
......@@ -270,9 +270,7 @@ CodingUnit& CodingUnit::operator=( const CodingUnit& other )
GBiIdx = other.GBiIdx;
for (int i = 0; i<2; i++)
refIdxBi[i] = other.refIdxBi[i];
#if JVET_L0293_CPR
cpr = other.cpr;
#endif
return *this;
}
......@@ -303,9 +301,7 @@ void CodingUnit::initData()
GBiIdx = GBI_DEFAULT;
for (int i = 0; i < 2; i++)
refIdxBi[i] = -1;
#if JVET_L0293_CPR
cpr = false;
#endif
}
......@@ -330,10 +326,8 @@ void PredictionUnit::initData()
mmvdMergeIdx = MAX_UINT;
interDir = MAX_UCHAR;
mergeType = MRG_TYPE_DEFAULT_N;
#if JVET_L0293_CPR
bv.setZero();
bvd.setZero();
#endif
for (uint32_t i = 0; i < NUM_REF_PIC_LIST_01; i++)
{
mvpIdx[i] = MAX_UCHAR;
......@@ -372,10 +366,8 @@ PredictionUnit& PredictionUnit::operator=(const InterPredictionData& predData)
mmvdMergeIdx = predData.mmvdMergeIdx;
interDir = predData.interDir;
mergeType = predData.mergeType;
#if JVET_L0293_CPR
bv = predData.bv;
bvd = predData.bvd;
#endif
for (uint32_t i = 0; i < NUM_REF_PIC_LIST_01; i++)
{
mvpIdx[i] = predData.mvpIdx[i];
......@@ -411,10 +403,8 @@ PredictionUnit& PredictionUnit::operator=( const PredictionUnit& other )
mmvdMergeIdx = other.mmvdMergeIdx;
interDir = other.interDir;
mergeType = other.mergeType;
#if JVET_L0293_CPR
bv = other.bv;
bvd = other.bvd;
#endif
for (uint32_t i = 0; i < NUM_REF_PIC_LIST_01; i++)
{
mvpIdx[i] = other.mvpIdx[i];
......
......@@ -310,9 +310,7 @@ struct CodingUnit : public UnitArea
int refIdxBi[2];
// needed for fast imv mode decisions
int8_t imvNumCand;
#if JVET_L0293_CPR
bool cpr;
#endif
CodingUnit() : chType( CH_L ) { }
CodingUnit(const UnitArea &unit);
......@@ -363,10 +361,8 @@ struct InterPredictionData
Mv mvdAffi [NUM_REF_PIC_LIST_01][3];
Mv mvAffi[NUM_REF_PIC_LIST_01][3];
bool mhIntraFlag;
#if JVET_L0293_CPR
Mv bv; // block vector for CPR
Mv bvd; // block vector difference for CPR
#endif