Commit f732de68 authored by Karsten Suehring's avatar Karsten Suehring

remove macro JVET_L0266_HMVP

parent f3c66ebe
...@@ -330,10 +330,8 @@ static const int GBI_NUM = 5; ///< the ...@@ -330,10 +330,8 @@ static const int GBI_NUM = 5; ///< the
static const int GBI_DEFAULT = ((uint8_t)(GBI_NUM >> 1)); ///< Default weighting index representing for w=0.5 static const int GBI_DEFAULT = ((uint8_t)(GBI_NUM >> 1)); ///< Default weighting index representing for w=0.5
static const int GBI_SIZE_CONSTRAINT = 256; ///< disabling GBi if cu size is smaller than 256 static const int GBI_SIZE_CONSTRAINT = 256; ///< disabling GBi if cu size is smaller than 256
#endif #endif
#if JVET_L0266_HMVP
static const int MAX_NUM_HMVP_CANDS = 6; ///< maximum number of HMVP candidates to be stored and used in merge list static const int MAX_NUM_HMVP_CANDS = 6; ///< maximum number of HMVP candidates to be stored and used in merge list
static const int MAX_NUM_HMVP_AVMPCANDS = 4; ///< maximum number of HMVP candidates to be used in AMVP list static const int MAX_NUM_HMVP_AVMPCANDS = 4; ///< maximum number of HMVP candidates to be used in AMVP list
#endif
#if W0038_DB_OPT #if W0038_DB_OPT
static const int MAX_ENCODER_DEBLOCKING_QUALITY_LAYERS = 8 ; static const int MAX_ENCODER_DEBLOCKING_QUALITY_LAYERS = 8 ;
......
...@@ -211,11 +211,9 @@ public: ...@@ -211,11 +211,9 @@ public:
} }
}; };
#endif #endif
#if JVET_L0266_HMVP
struct LutMotionCand struct LutMotionCand
{ {
MotionInfo* motionCand; MotionInfo* motionCand;
int currCnt; int currCnt;
}; };
#endif
#endif // __MOTIONINFO__ #endif // __MOTIONINFO__
...@@ -41,9 +41,7 @@ ...@@ -41,9 +41,7 @@
#include "Picture.h" #include "Picture.h"
#include "dtrace_next.h" #include "dtrace_next.h"
#if JVET_L0266_HMVP
#include "UnitTools.h" #include "UnitTools.h"
#endif
//! \ingroup CommonLib //! \ingroup CommonLib
//! \{ //! \{
...@@ -143,9 +141,7 @@ Slice::Slice() ...@@ -143,9 +141,7 @@ Slice::Slice()
, m_uiMaxTTSizeIChroma ( 0 ) , m_uiMaxTTSizeIChroma ( 0 )
#endif #endif
, m_uiMaxBTSize ( 0 ) , m_uiMaxBTSize ( 0 )
#if JVET_L0266_HMVP
, m_MotionCandLut (NULL) , m_MotionCandLut (NULL)
#endif
{ {
for(uint32_t i=0; i<NUM_REF_PIC_LIST_01; i++) for(uint32_t i=0; i<NUM_REF_PIC_LIST_01; i++)
{ {
...@@ -182,16 +178,12 @@ Slice::Slice() ...@@ -182,16 +178,12 @@ Slice::Slice()
m_saoEnabledFlag[ch] = false; m_saoEnabledFlag[ch] = false;
} }
#if JVET_L0266_HMVP
initMotionLUTs(); initMotionLUTs();
#endif
} }
Slice::~Slice() Slice::~Slice()
{ {
#if JVET_L0266_HMVP
destroyMotionLUTs(); destroyMotionLUTs();
#endif
} }
...@@ -228,9 +220,7 @@ void Slice::initSlice() ...@@ -228,9 +220,7 @@ void Slice::initSlice()
m_subPuMvpSubBlkSizeSliceEnable = false; m_subPuMvpSubBlkSizeSliceEnable = false;
m_subPuMvpSubBlkLog2Size = 2; m_subPuMvpSubBlkLog2Size = 2;
#endif #endif
#if JVET_L0266_HMVP
resetMotionLUTs(); resetMotionLUTs();
#endif
} }
void Slice::setDefaultClpRng( const SPS& sps ) void Slice::setDefaultClpRng( const SPS& sps )
...@@ -1629,7 +1619,6 @@ void Slice::stopProcessingTimer() ...@@ -1629,7 +1619,6 @@ void Slice::stopProcessingTimer()
m_dProcessingTime += (double)(clock()-m_iProcessingStartTime) / CLOCKS_PER_SEC; m_dProcessingTime += (double)(clock()-m_iProcessingStartTime) / CLOCKS_PER_SEC;
m_iProcessingStartTime = 0; m_iProcessingStartTime = 0;
} }
#if JVET_L0266_HMVP
void Slice::initMotionLUTs() void Slice::initMotionLUTs()
{ {
m_MotionCandLut = new LutMotionCand; m_MotionCandLut = new LutMotionCand;
...@@ -1698,7 +1687,6 @@ void Slice::copyMotionLUTs(LutMotionCand* Src, LutMotionCand* Dst) ...@@ -1698,7 +1687,6 @@ void Slice::copyMotionLUTs(LutMotionCand* Src, LutMotionCand* Dst)
memcpy(Dst->motionCand, Src->motionCand, sizeof(MotionInfo)*(std::min(Src->currCnt, MAX_NUM_HMVP_CANDS))); memcpy(Dst->motionCand, Src->motionCand, sizeof(MotionInfo)*(std::min(Src->currCnt, MAX_NUM_HMVP_CANDS)));
Dst->currCnt = Src->currCnt; Dst->currCnt = Src->currCnt;
} }
#endif
unsigned Slice::getMinPictureDistance() const unsigned Slice::getMinPictureDistance() const
{ {
......
...@@ -49,10 +49,8 @@ ...@@ -49,10 +49,8 @@
//! \ingroup CommonLib //! \ingroup CommonLib
//! \{ //! \{
#if JVET_L0266_HMVP
#include "CommonLib/MotionInfo.h" #include "CommonLib/MotionInfo.h"
struct MotionInfo; struct MotionInfo;
#endif
struct Picture; struct Picture;
...@@ -1741,9 +1739,7 @@ private: ...@@ -1741,9 +1739,7 @@ private:
uint32_t m_uiMaxBTSize; uint32_t m_uiMaxBTSize;
AlfSliceParam m_alfSliceParam; AlfSliceParam m_alfSliceParam;
#if JVET_L0266_HMVP
LutMotionCand* m_MotionCandLut; LutMotionCand* m_MotionCandLut;
#endif
public: public:
Slice(); Slice();
...@@ -2026,7 +2022,6 @@ public: ...@@ -2026,7 +2022,6 @@ public:
void setAlfSliceParam( AlfSliceParam& alfSliceParam ) { m_alfSliceParam = alfSliceParam; } void setAlfSliceParam( AlfSliceParam& alfSliceParam ) { m_alfSliceParam = alfSliceParam; }
AlfSliceParam& getAlfSliceParam() { return m_alfSliceParam; } AlfSliceParam& getAlfSliceParam() { return m_alfSliceParam; }
#if JVET_L0266_HMVP
void initMotionLUTs (); void initMotionLUTs ();
void destroyMotionLUTs (); void destroyMotionLUTs ();
void resetMotionLUTs(); void resetMotionLUTs();
...@@ -2039,7 +2034,6 @@ public: ...@@ -2039,7 +2034,6 @@ public:
void updateMotionLUTs(LutMotionCand* lutMC, CodingUnit & cu); void updateMotionLUTs(LutMotionCand* lutMC, CodingUnit & cu);
void copyMotionLUTs(LutMotionCand* Src, LutMotionCand* Dst); void copyMotionLUTs(LutMotionCand* Src, LutMotionCand* Dst);
#endif
protected: protected:
Picture* xGetRefPic (PicList& rcListPic, int poc); Picture* xGetRefPic (PicList& rcListPic, int poc);
......
...@@ -60,10 +60,7 @@ ...@@ -60,10 +60,7 @@
#define JVET_L0285_8BIT_TRANSFORM_CORE 1 // Primary transform using 8-bit cores #define JVET_L0285_8BIT_TRANSFORM_CORE 1 // Primary transform using 8-bit cores
#define JVET_L0266_HMVP 1 //History-based MVP
#if JVET_L0266_HMVP
#define JVET_L0158_L0106_RESET_BUFFER 1 //reset the history buffer on HMVP #define JVET_L0158_L0106_RESET_BUFFER 1 //reset the history buffer on HMVP
#endif
#define JVET_L0265_AFF_MINIMUM4X4 1 //Affine 4x4 chroma subblock #define JVET_L0265_AFF_MINIMUM4X4 1 //Affine 4x4 chroma subblock
......
...@@ -748,7 +748,6 @@ uint32_t PU::getFinalIntraMode( const PredictionUnit &pu, const ChannelType &chT ...@@ -748,7 +748,6 @@ uint32_t PU::getFinalIntraMode( const PredictionUnit &pu, const ChannelType &chT
return uiIntraMode; return uiIntraMode;
} }
#if JVET_L0266_HMVP
bool PU::xCheckSimilarMotion(const int mergeCandIndex, const int prevCnt, const MergeCtx mergeCandList, bool hasPruned[MRG_MAX_NUM_CANDS]) bool PU::xCheckSimilarMotion(const int mergeCandIndex, const int prevCnt, const MergeCtx mergeCandList, bool hasPruned[MRG_MAX_NUM_CANDS])
{ {
for (uint32_t ui = 0; ui < prevCnt; ui++) for (uint32_t ui = 0; ui < prevCnt; ui++)
...@@ -861,7 +860,6 @@ bool PU::addMergeHMVPCand(const Slice &slice, MergeCtx& mrgCtx, bool isCandInter ...@@ -861,7 +860,6 @@ bool PU::addMergeHMVPCand(const Slice &slice, MergeCtx& mrgCtx, bool isCandInter
} }
return false; return false;
} }
#endif
void PU::getInterMergeCandidates( const PredictionUnit &pu, MergeCtx& mrgCtx, void PU::getInterMergeCandidates( const PredictionUnit &pu, MergeCtx& mrgCtx,
#if JVET_L0054_MMVD #if JVET_L0054_MMVD
...@@ -1428,7 +1426,6 @@ void PU::getInterMergeCandidates( const PredictionUnit &pu, MergeCtx& mrgCtx, ...@@ -1428,7 +1426,6 @@ void PU::getInterMergeCandidates( const PredictionUnit &pu, MergeCtx& mrgCtx,
return; return;
} }
#if JVET_L0266_HMVP
int maxNumMergeCandMin1 = maxNumMergeCand - 1; int maxNumMergeCandMin1 = maxNumMergeCand - 1;
if (cnt != maxNumMergeCandMin1) if (cnt != maxNumMergeCandMin1)
{ {
...@@ -1466,7 +1463,6 @@ void PU::getInterMergeCandidates( const PredictionUnit &pu, MergeCtx& mrgCtx, ...@@ -1466,7 +1463,6 @@ void PU::getInterMergeCandidates( const PredictionUnit &pu, MergeCtx& mrgCtx,
return; return;
} }
} }
#endif
#if JVET_L0090_PAIR_AVG #if JVET_L0090_PAIR_AVG
// pairwise-average candidates // pairwise-average candidates
...@@ -1561,11 +1557,7 @@ void PU::getInterMergeCandidates( const PredictionUnit &pu, MergeCtx& mrgCtx, ...@@ -1561,11 +1557,7 @@ void PU::getInterMergeCandidates( const PredictionUnit &pu, MergeCtx& mrgCtx,
uint32_t uiArrayAddr = cnt; uint32_t uiArrayAddr = cnt;
#if !JVET_L0090_PAIR_AVG #if !JVET_L0090_PAIR_AVG
#if JVET_L0266_HMVP
uint32_t uiCutoff = std::min( uiArrayAddr, 3u ); uint32_t uiCutoff = std::min( uiArrayAddr, 3u );
#else
uint32_t uiCutoff = std::min( uiArrayAddr, 4u );
#endif
if (slice.isInterB()) if (slice.isInterB())
{ {
static const uint32_t NUM_PRIORITY_LIST = 12; static const uint32_t NUM_PRIORITY_LIST = 12;
...@@ -2158,7 +2150,6 @@ void PU::fillMvpCand(PredictionUnit &pu, const RefPicList &eRefPicList, const in ...@@ -2158,7 +2150,6 @@ void PU::fillMvpCand(PredictionUnit &pu, const RefPicList &eRefPicList, const in
if ((C0Avail && getColocatedMVP(pu, eRefPicList, posC0, cColMv, refIdx_Col)) || getColocatedMVP(pu, eRefPicList, posC1, cColMv, refIdx_Col)) if ((C0Avail && getColocatedMVP(pu, eRefPicList, posC0, cColMv, refIdx_Col)) || getColocatedMVP(pu, eRefPicList, posC1, cColMv, refIdx_Col))
{ {
#if JVET_L0266_HMVP
if (pu.cu->imv != 0) if (pu.cu->imv != 0)
{ {
cColMv.roundToAmvrSignalPrecision(MV_PRECISION_INTERNAL, pu.cu->imv); cColMv.roundToAmvrSignalPrecision(MV_PRECISION_INTERNAL, pu.cu->imv);
...@@ -2175,19 +2166,14 @@ void PU::fillMvpCand(PredictionUnit &pu, const RefPicList &eRefPicList, const in ...@@ -2175,19 +2166,14 @@ void PU::fillMvpCand(PredictionUnit &pu, const RefPicList &eRefPicList, const in
{ {
pInfo->mvCand[pInfo->numCand++] = cColMv; pInfo->mvCand[pInfo->numCand++] = cColMv;
} }
#else
pInfo->mvCand[pInfo->numCand++] = cColMv;
#endif
} }
} }
#if JVET_L0266_HMVP
if (pInfo->numCand < AMVP_MAX_NUM_CANDS) if (pInfo->numCand < AMVP_MAX_NUM_CANDS)
{ {
const int currRefPOC = cs.slice->getRefPic(eRefPicList, refIdx)->getPOC(); const int currRefPOC = cs.slice->getRefPic(eRefPicList, refIdx)->getPOC();
const RefPicList eRefPicList2nd = (eRefPicList == REF_PIC_LIST_0) ? REF_PIC_LIST_1 : REF_PIC_LIST_0; const RefPicList eRefPicList2nd = (eRefPicList == REF_PIC_LIST_0) ? REF_PIC_LIST_1 : REF_PIC_LIST_0;
addAMVPHMVPCand(pu, eRefPicList, eRefPicList2nd, currRefPOC, *pInfo, pu.cu->imv); addAMVPHMVPCand(pu, eRefPicList, eRefPicList2nd, currRefPOC, *pInfo, pu.cu->imv);
} }
#endif
if (pInfo->numCand > AMVP_MAX_NUM_CANDS) if (pInfo->numCand > AMVP_MAX_NUM_CANDS)
{ {
pInfo->numCand = AMVP_MAX_NUM_CANDS; pInfo->numCand = AMVP_MAX_NUM_CANDS;
...@@ -2867,7 +2853,6 @@ bool PU::addMVPCandWithScaling( const PredictionUnit &pu, const RefPicList &eRef ...@@ -2867,7 +2853,6 @@ bool PU::addMVPCandWithScaling( const PredictionUnit &pu, const RefPicList &eRef
return false; return false;
} }
#if JVET_L0266_HMVP
void PU::addAMVPHMVPCand(const PredictionUnit &pu, const RefPicList eRefPicList, const RefPicList eRefPicList2nd, const int currRefPOC, AMVPInfo &info, uint8_t imv) void PU::addAMVPHMVPCand(const PredictionUnit &pu, const RefPicList eRefPicList, const RefPicList eRefPicList2nd, const int currRefPOC, AMVPInfo &info, uint8_t imv)
{ {
const Slice &slice = *(*pu.cs).slice; const Slice &slice = *(*pu.cs).slice;
...@@ -2916,7 +2901,6 @@ void PU::addAMVPHMVPCand(const PredictionUnit &pu, const RefPicList eRefPicList, ...@@ -2916,7 +2901,6 @@ void PU::addAMVPHMVPCand(const PredictionUnit &pu, const RefPicList eRefPicList,
} }
} }
} }
#endif
bool PU::isBipredRestriction(const PredictionUnit &pu) bool PU::isBipredRestriction(const PredictionUnit &pu)
{ {
if(pu.cu->lumaSize().width == 4 && pu.cu->lumaSize().height ==4 ) if(pu.cu->lumaSize().width == 4 && pu.cu->lumaSize().height ==4 )
......
...@@ -126,7 +126,6 @@ namespace PU ...@@ -126,7 +126,6 @@ namespace PU
bool addMVPCandUnscaled (const PredictionUnit &pu, const RefPicList &eRefPicList, const int &iRefIdx, const Position &pos, const MvpDir &eDir, AMVPInfo &amvpInfo); bool addMVPCandUnscaled (const PredictionUnit &pu, const RefPicList &eRefPicList, const int &iRefIdx, const Position &pos, const MvpDir &eDir, AMVPInfo &amvpInfo);
bool addMVPCandWithScaling (const PredictionUnit &pu, const RefPicList &eRefPicList, const int &iRefIdx, const Position &pos, const MvpDir &eDir, AMVPInfo &amvpInfo); bool addMVPCandWithScaling (const PredictionUnit &pu, const RefPicList &eRefPicList, const int &iRefIdx, const Position &pos, const MvpDir &eDir, AMVPInfo &amvpInfo);
void xInheritedAffineMv ( const PredictionUnit &pu, const PredictionUnit* puNeighbour, RefPicList eRefPicList, Mv rcMv[3] ); void xInheritedAffineMv ( const PredictionUnit &pu, const PredictionUnit* puNeighbour, RefPicList eRefPicList, Mv rcMv[3] );
#if JVET_L0266_HMVP
bool xCheckSimilarMotion(const int mergeCandIndex, const int prevCnt, const MergeCtx mergeCandList, bool hasPruned[MRG_MAX_NUM_CANDS]); bool xCheckSimilarMotion(const int mergeCandIndex, const int prevCnt, const MergeCtx mergeCandList, bool hasPruned[MRG_MAX_NUM_CANDS]);
#if JVET_L0090_PAIR_AVG #if JVET_L0090_PAIR_AVG
bool addMergeHMVPCand(const Slice &slice, MergeCtx& mrgCtx, bool canFastExit, const int& mrgCandIdx, const uint32_t maxNumMergeCandMin1, int &cnt, const int prevCnt, bool isAvailableSubPu, unsigned subPuMvpPos bool addMergeHMVPCand(const Slice &slice, MergeCtx& mrgCtx, bool canFastExit, const int& mrgCandIdx, const uint32_t maxNumMergeCandMin1, int &cnt, const int prevCnt, bool isAvailableSubPu, unsigned subPuMvpPos
...@@ -142,7 +141,6 @@ namespace PU ...@@ -142,7 +141,6 @@ namespace PU
); );
#endif #endif
void addAMVPHMVPCand(const PredictionUnit &pu, const RefPicList eRefPicList, const RefPicList eRefPicList2nd, const int currRefPOC, AMVPInfo &info, uint8_t imv); void addAMVPHMVPCand(const PredictionUnit &pu, const RefPicList eRefPicList, const RefPicList eRefPicList2nd, const int currRefPOC, AMVPInfo &info, uint8_t imv);
#endif
#if JVET_L0271_AFFINE_AMVP_SIMPLIFY #if JVET_L0271_AFFINE_AMVP_SIMPLIFY
bool addAffineMVPCandUnscaled( const PredictionUnit &pu, const RefPicList &refPicList, const int &refIdx, const Position &pos, const MvpDir &dir, AffineAMVPInfo &affiAmvpInfo ); bool addAffineMVPCandUnscaled( const PredictionUnit &pu, const RefPicList &refPicList, const int &refIdx, const Position &pos, const MvpDir &dir, AffineAMVPInfo &affiAmvpInfo );
#endif #endif
......
...@@ -369,12 +369,10 @@ void DecCu::xReconInter(CodingUnit &cu) ...@@ -369,12 +369,10 @@ void DecCu::xReconInter(CodingUnit &cu)
m_pcInterPred->motionCompensation( cu ); m_pcInterPred->motionCompensation( cu );
#endif #endif
} }
#if JVET_L0266_HMVP
#if JVET_L0293_CPR #if JVET_L0293_CPR
if (cu.Y().valid()) if (cu.Y().valid())
#endif #endif
cu.slice->updateMotionLUTs(cu.slice->getMotionLUTs(), cu); cu.slice->updateMotionLUTs(cu.slice->getMotionLUTs(), cu);
#endif
if (cu.firstPU->mhIntraFlag) if (cu.firstPU->mhIntraFlag)
{ {
......
...@@ -76,21 +76,17 @@ void EncCu::create( EncCfg* encCfg ) ...@@ -76,21 +76,17 @@ void EncCu::create( EncCfg* encCfg )
m_pTempCS = new CodingStructure** [numWidths]; m_pTempCS = new CodingStructure** [numWidths];
m_pBestCS = new CodingStructure** [numWidths]; m_pBestCS = new CodingStructure** [numWidths];
#if JVET_L0266_HMVP
m_pTempMotLUTs = new LutMotionCand**[numWidths]; m_pTempMotLUTs = new LutMotionCand**[numWidths];
m_pBestMotLUTs = new LutMotionCand**[numWidths]; m_pBestMotLUTs = new LutMotionCand**[numWidths];
m_pSplitTempMotLUTs = new LutMotionCand**[numWidths]; m_pSplitTempMotLUTs = new LutMotionCand**[numWidths];
#endif
for( unsigned w = 0; w < numWidths; w++ ) for( unsigned w = 0; w < numWidths; w++ )
{ {
m_pTempCS[w] = new CodingStructure* [numHeights]; m_pTempCS[w] = new CodingStructure* [numHeights];
m_pBestCS[w] = new CodingStructure* [numHeights]; m_pBestCS[w] = new CodingStructure* [numHeights];
#if JVET_L0266_HMVP
m_pTempMotLUTs[w] = new LutMotionCand*[numHeights]; m_pTempMotLUTs[w] = new LutMotionCand*[numHeights];
m_pBestMotLUTs[w] = new LutMotionCand*[numHeights]; m_pBestMotLUTs[w] = new LutMotionCand*[numHeights];
m_pSplitTempMotLUTs[w] = new LutMotionCand*[numHeights]; m_pSplitTempMotLUTs[w] = new LutMotionCand*[numHeights];
#endif
for( unsigned h = 0; h < numHeights; h++ ) for( unsigned h = 0; h < numHeights; h++ )
{ {
...@@ -104,7 +100,6 @@ void EncCu::create( EncCfg* encCfg ) ...@@ -104,7 +100,6 @@ void EncCu::create( EncCfg* encCfg )
m_pTempCS[w][h]->create( chromaFormat, Area( 0, 0, width, height ), false ); m_pTempCS[w][h]->create( chromaFormat, Area( 0, 0, width, height ), false );
m_pBestCS[w][h]->create( chromaFormat, Area( 0, 0, width, height ), false ); m_pBestCS[w][h]->create( chromaFormat, Area( 0, 0, width, height ), false );
#if JVET_L0266_HMVP
m_pTempMotLUTs[w][h] = new LutMotionCand ; m_pTempMotLUTs[w][h] = new LutMotionCand ;
m_pBestMotLUTs[w][h] = new LutMotionCand ; m_pBestMotLUTs[w][h] = new LutMotionCand ;
m_pSplitTempMotLUTs[w][h] = new LutMotionCand; m_pSplitTempMotLUTs[w][h] = new LutMotionCand;
...@@ -119,17 +114,14 @@ void EncCu::create( EncCfg* encCfg ) ...@@ -119,17 +114,14 @@ void EncCu::create( EncCfg* encCfg )
m_pBestMotLUTs[w][h]->currCnt = 0; m_pBestMotLUTs[w][h]->currCnt = 0;
m_pBestMotLUTs[w][h]->motionCand = nullptr; m_pBestMotLUTs[w][h]->motionCand = nullptr;
m_pBestMotLUTs[w][h]->motionCand = new MotionInfo[MAX_NUM_HMVP_CANDS]; m_pBestMotLUTs[w][h]->motionCand = new MotionInfo[MAX_NUM_HMVP_CANDS];
#endif
} }
else else
{ {
m_pTempCS[w][h] = nullptr; m_pTempCS[w][h] = nullptr;
m_pBestCS[w][h] = nullptr; m_pBestCS[w][h] = nullptr;
#if JVET_L0266_HMVP
m_pTempMotLUTs[w][h] = nullptr; m_pTempMotLUTs[w][h] = nullptr;
m_pBestMotLUTs[w][h] = nullptr; m_pBestMotLUTs[w][h] = nullptr;
m_pSplitTempMotLUTs[w][h] = nullptr; m_pSplitTempMotLUTs[w][h] = nullptr;
#endif
} }
} }
} }
...@@ -185,7 +177,6 @@ void EncCu::destroy() ...@@ -185,7 +177,6 @@ void EncCu::destroy()
delete m_pBestCS[w][h]; delete m_pBestCS[w][h];
delete m_pTempCS[w][h]; delete m_pTempCS[w][h];
#if JVET_L0266_HMVP
if (m_pTempMotLUTs[w][h]) if (m_pTempMotLUTs[w][h])
{ {
delete[] m_pTempMotLUTs[w][h]->motionCand; delete[] m_pTempMotLUTs[w][h]->motionCand;
...@@ -205,25 +196,20 @@ void EncCu::destroy() ...@@ -205,25 +196,20 @@ void EncCu::destroy()
m_pSplitTempMotLUTs[w][h]->motionCand = nullptr; m_pSplitTempMotLUTs[w][h]->motionCand = nullptr;
delete m_pSplitTempMotLUTs[w][h]; delete m_pSplitTempMotLUTs[w][h];
} }
#endif
} }
delete[] m_pTempCS[w]; delete[] m_pTempCS[w];
delete[] m_pBestCS[w]; delete[] m_pBestCS[w];
#if JVET_L0266_HMVP
delete[] m_pBestMotLUTs[w]; delete[] m_pBestMotLUTs[w];
delete[] m_pTempMotLUTs[w]; delete[] m_pTempMotLUTs[w];
delete[] m_pSplitTempMotLUTs[w]; delete[] m_pSplitTempMotLUTs[w];
#endif
} }
delete[] m_pBestCS; m_pBestCS = nullptr; delete[] m_pBestCS; m_pBestCS = nullptr;
delete[] m_pTempCS; m_pTempCS = nullptr; delete[] m_pTempCS; m_pTempCS = nullptr;
#if JVET_L0266_HMVP
delete[] m_pSplitTempMotLUTs; m_pSplitTempMotLUTs = nullptr; delete[] m_pSplitTempMotLUTs; m_pSplitTempMotLUTs = nullptr;
delete[] m_pBestMotLUTs; m_pBestMotLUTs = nullptr; delete[] m_pBestMotLUTs; m_pBestMotLUTs = nullptr;
delete[] m_pTempMotLUTs; m_pTempMotLUTs = nullptr; delete[] m_pTempMotLUTs; m_pTempMotLUTs = nullptr;
#endif
#if REUSE_CU_RESULTS #if REUSE_CU_RESULTS
m_modeCtrl->destroy(); m_modeCtrl->destroy();
...@@ -377,12 +363,10 @@ void EncCu::compressCtu( CodingStructure& cs, const UnitArea& area, const unsign ...@@ -377,12 +363,10 @@ void EncCu::compressCtu( CodingStructure& cs, const UnitArea& area, const unsign
CodingStructure *tempCS = m_pTempCS[gp_sizeIdxInfo->idxFrom( area.lumaSize().width )][gp_sizeIdxInfo->idxFrom( area.lumaSize().height )]; CodingStructure *tempCS = m_pTempCS[gp_sizeIdxInfo->idxFrom( area.lumaSize().width )][gp_sizeIdxInfo->idxFrom( area.lumaSize().height )];
CodingStructure *bestCS = m_pBestCS[gp_sizeIdxInfo->idxFrom( area.lumaSize().width )][gp_sizeIdxInfo->idxFrom( area.lumaSize().height )]; CodingStructure *bestCS = m_pBestCS[gp_sizeIdxInfo->idxFrom( area.lumaSize().width )][gp_sizeIdxInfo->idxFrom( area.lumaSize().height )];
#if JVET_L0266_HMVP
LutMotionCand *tempMotCandLUTs = m_pTempMotLUTs[gp_sizeIdxInfo->idxFrom(area.lumaSize().width)][gp_sizeIdxInfo->idxFrom(area.lumaSize().height)]; LutMotionCand *tempMotCandLUTs = m_pTempMotLUTs[gp_sizeIdxInfo->idxFrom(area.lumaSize().width)][gp_sizeIdxInfo->idxFrom(area.lumaSize().height)];
LutMotionCand *bestMotCandLUTs = m_pBestMotLUTs[gp_sizeIdxInfo->idxFrom(area.lumaSize().width)][gp_sizeIdxInfo->idxFrom(area.lumaSize().height)]; LutMotionCand *bestMotCandLUTs = m_pBestMotLUTs[gp_sizeIdxInfo->idxFrom(area.lumaSize().width)][gp_sizeIdxInfo->idxFrom(area.lumaSize().height)];
cs.slice->copyMotionLUTs(cs.slice->getMotionLUTs(), tempMotCandLUTs); cs.slice->copyMotionLUTs(cs.slice->getMotionLUTs(), tempMotCandLUTs);
cs.slice->copyMotionLUTs(cs.slice->getMotionLUTs(), bestMotCandLUTs); cs.slice->copyMotionLUTs(cs.slice->getMotionLUTs(), bestMotCandLUTs);
#endif
cs.initSubStructure( *tempCS, partitioner->chType, partitioner->currArea(), false ); cs.initSubStructure( *tempCS, partitioner->chType, partitioner->currArea(), false );
cs.initSubStructure( *bestCS, partitioner->chType, partitioner->currArea(), false ); cs.initSubStructure( *bestCS, partitioner->chType, partitioner->currArea(), false );
...@@ -391,18 +375,14 @@ void EncCu::compressCtu( CodingStructure& cs, const UnitArea& area, const unsign ...@@ -391,18 +375,14 @@ void EncCu::compressCtu( CodingStructure& cs, const UnitArea& area, const unsign
tempCS->prevQP[CH_L] = bestCS->prevQP[CH_L] = prevQP[CH_L]; tempCS->prevQP[CH_L] = bestCS->prevQP[CH_L] = prevQP[CH_L];
xCompressCU( tempCS, bestCS, *partitioner xCompressCU( tempCS, bestCS, *partitioner
#if JVET_L0266_HMVP
, tempMotCandLUTs , tempMotCandLUTs
, bestMotCandLUTs , bestMotCandLUTs
#endif
); );
// all signals were already copied during compression if the CTU was split - at this point only the structures are copied to the top level CS // all signals were already copied during compression if the CTU was split - at this point only the structures are copied to the top level CS
const bool copyUnsplitCTUSignals = bestCS->cus.size() == 1 && KEEP_PRED_AND_RESI_SIGNALS; const bool copyUnsplitCTUSignals = bestCS->cus.size() == 1 && KEEP_PRED_AND_RESI_SIGNALS;
cs.useSubStructure( *bestCS, partitioner->chType, CS::getArea( *bestCS, area, partitioner->chType ), copyUnsplitCTUSignals, false, false, copyUnsplitCTUSignals ); cs.useSubStructure( *bestCS, partitioner->chType, CS::getArea( *bestCS, area, partitioner->chType ), copyUnsplitCTUSignals, false, false, copyUnsplitCTUSignals );
#if JVET_L0266_HMVP
cs.slice->copyMotionLUTs(bestMotCandLUTs, cs.slice->getMotionLUTs()); cs.slice->copyMotionLUTs(bestMotCandLUTs, cs.slice->getMotionLUTs());
#endif
if( !cs.pcv->ISingleTree && cs.slice->isIRAP() && cs.pcv->chrFormat != CHROMA_400 ) if( !cs.pcv->ISingleTree && cs.slice->isIRAP() && cs.pcv->chrFormat != CHROMA_400 )
{ {
...@@ -417,10 +397,8 @@ void EncCu::compressCtu( CodingStructure& cs, const UnitArea& area, const unsign ...@@ -417,10 +397,8 @@ void EncCu::compressCtu( CodingStructure& cs, const UnitArea& area, const unsign
tempCS->prevQP[CH_C] = bestCS->prevQP[CH_C] = prevQP[CH_C]; tempCS->prevQP[CH_C] = bestCS->prevQP[CH_C] = prevQP[CH_C];
xCompressCU( tempCS, bestCS, *partitioner xCompressCU( tempCS, bestCS, *partitioner
#if JVET_L0266_HMVP
, tempMotCandLUTs , tempMotCandLUTs
, bestMotCandLUTs , bestMotCandLUTs
#endif
); );
const bool copyUnsplitCTUSignals = bestCS->cus.size() == 1 && KEEP_PRED_AND_RESI_SIGNALS; const bool copyUnsplitCTUSignals = bestCS->cus.size() == 1 && KEEP_PRED_AND_RESI_SIGNALS;
...@@ -567,15 +545,9 @@ int EncCu::updateCtuDataISlice(const CPelBuf buf) ...@@ -567,15 +545,9 @@ int EncCu::updateCtuDataISlice(const CPelBuf buf)
return( iSumHad ); return( iSumHad );
} }
#if JVET_L0266_HMVP
bool EncCu::xCheckBestMode( CodingStructure *&tempCS, CodingStructure *&bestCS, Partitioner &partitioner, const EncTestMode& encTestMode ) bool EncCu::xCheckBestMode( CodingStructure *&tempCS, CodingStructure *&bestCS, Partitioner &partitioner, const EncTestMode& encTestMode )
#else
void EncCu::xCheckBestMode( CodingStructure *&tempCS, CodingStructure *&bestCS, Partitioner &partitioner, const EncTestMode& encTestMode )
#endif
{ {
#if JVET_L0266_HMVP
bool bestCSUpdated = false; bool bestCSUpdated = false;
#endif
if( !tempCS->cus.empty() ) if( !tempCS->cus.empty() )
{ {
...@@ -607,25 +579,19 @@ void EncCu::xCheckBestMode( CodingStructure *&tempCS, CodingStructure *&bestCS, ...@@ -607,25 +579,19 @@ void EncCu::xCheckBestMode( CodingStructure *&tempCS, CodingStructure *&bestCS,
std::swap( tempCS, bestCS ); std::swap( tempCS, bestCS );
// store temp best CI for next CU coding // store temp best CI for next CU coding
m_CurrCtx->best = m_CABACEstimator->getCtx(); m_CurrCtx->best = m_CABACEstimator->getCtx();
#if JVET_L0266_HMVP