diff --git a/source/App/EncoderApp/EncApp.cpp b/source/App/EncoderApp/EncApp.cpp index 736a9e4c464b1dbfa6dbd77599a2eec900c96809..93bf0194c23c886cb794efd1a729e6265099ec41 100644 --- a/source/App/EncoderApp/EncApp.cpp +++ b/source/App/EncoderApp/EncApp.cpp @@ -238,9 +238,7 @@ void EncApp::xInitLibCfg() m_cEncLib.setFastIntraEMT ( m_FastEMT & m_EMT & 1 ); m_cEncLib.setInterEMT ( ( m_EMT >> 1 ) & 1 ); m_cEncLib.setFastInterEMT ( ( m_FastEMT >> 1 ) & ( m_EMT >> 1 ) & 1 ); -#if JVET_K0157 m_cEncLib.setUseCompositeRef ( m_compositeRefEnabled ); -#endif // ADD_NEW_TOOL : (encoder app) add setting of tool enabling flags and associated parameters here m_cEncLib.setMaxCUWidth ( m_QTBT ? m_uiCTUSize : m_uiMaxCUWidth ); diff --git a/source/App/EncoderApp/EncAppCfg.cpp b/source/App/EncoderApp/EncAppCfg.cpp index 33ff87aae665bdce8bff8a28f4a82c327cce4c88..52be0b4aebf2d94a4cc514722f788aaa756f302f 100644 --- a/source/App/EncoderApp/EncAppCfg.cpp +++ b/source/App/EncoderApp/EncAppCfg.cpp @@ -843,9 +843,7 @@ bool EncAppCfg::parseCfg( int argc, char* argv[] ) "\t1: Enable fast methods only for Intra EMT\n" "\t2: Enable fast methods only for Inter EMT\n" "\t3: Enable fast methods for both Intra & Inter EMT\n") -#if JVET_K0157 ("CompositeLTReference", m_compositeRefEnabled, false, "Enable Composite Long Term Reference Frame") -#endif // ADD_NEW_TOOL : (encoder app) add parsing parameters here ("LCTUFast", m_useFastLCTU, false, "Fast methods for large CTU") @@ -1275,7 +1273,6 @@ bool EncAppCfg::parseCfg( int argc, char* argv[] ) po::ErrorReporter err; const list<const char*>& argv_unhandled = po::scanArgv(opts, argc, (const char**) argv, err); -#if JVET_K0157 if (m_compositeRefEnabled) { for (int i = 0; i < m_iGOPSize; i++) @@ -1288,7 +1285,6 @@ bool EncAppCfg::parseCfg( int argc, char* argv[] ) } } } -#endif for (list<const char*>::const_iterator it = argv_unhandled.begin(); it != argv_unhandled.end(); it++) { @@ -1920,9 +1916,7 @@ bool EncAppCfg::xCheckParameter() 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" ); -#if JVET_K0157 xConfirmPara(m_compositeRefEnabled, "Composite Reference Frame is only allowed with NEXT profile"); -#endif // ADD_NEW_TOOL : (parameter check) add a check for next tools here } else @@ -2365,9 +2359,7 @@ bool EncAppCfg::xCheckParameter() xConfirmPara( m_intraConstraintFlag, "IntraConstraintFlag cannot be 1 for inter sequences"); } -#if JVET_K0157 int multipleFactor = m_compositeRefEnabled ? 2 : 1; -#endif bool verifiedGOP=false; bool errorGOP=false; int checkGOP=1; @@ -2388,11 +2380,7 @@ bool EncAppCfg::xCheckParameter() for(int i=0; i<m_iGOPSize; i++) { -#if JVET_K0157 if (m_GOPList[i].m_POC == m_iGOPSize * multipleFactor) -#else - if(m_GOPList[i].m_POC==m_iGOPSize) -#endif { xConfirmPara( m_GOPList[i].m_temporalId!=0 , "The last frame in each GOP must have temporal ID = 0 " ); } @@ -2426,11 +2414,7 @@ bool EncAppCfg::xCheckParameter() while(!verifiedGOP&&!errorGOP) { int curGOP = (checkGOP-1)%m_iGOPSize; -#if JVET_K0157 int curPOC = ((checkGOP - 1) / m_iGOPSize)*m_iGOPSize * multipleFactor + m_GOPList[curGOP].m_POC; -#else - int curPOC = ((checkGOP-1)/m_iGOPSize)*m_iGOPSize + m_GOPList[curGOP].m_POC; -#endif if(m_GOPList[curGOP].m_POC<0) { msg( WARNING, "\nError: found fewer Reference Picture Sets than GOPSize\n"); @@ -2457,11 +2441,7 @@ bool EncAppCfg::xCheckParameter() found=true; for(int k=0; k<m_iGOPSize; k++) { -#if JVET_K0157 if (absPOC % (m_iGOPSize * multipleFactor) == m_GOPList[k].m_POC % (m_iGOPSize * multipleFactor)) -#else - if(absPOC%m_iGOPSize == m_GOPList[k].m_POC%m_iGOPSize) -#endif { if(m_GOPList[k].m_temporalId==m_GOPList[curGOP].m_temporalId) { @@ -2513,11 +2493,7 @@ bool EncAppCfg::xCheckParameter() { //step backwards in coding order and include any extra available pictures we might find useful to replace the ones with POC < 0. int offGOP = (checkGOP-1+offset)%m_iGOPSize; -#if JVET_K0157 int offPOC = ((checkGOP - 1 + offset) / m_iGOPSize)*(m_iGOPSize * multipleFactor) + m_GOPList[offGOP].m_POC; -#else - int offPOC = ((checkGOP-1+offset)/m_iGOPSize)*m_iGOPSize + m_GOPList[offGOP].m_POC; -#endif if(offPOC>=0&&m_GOPList[offGOP].m_temporalId<=m_GOPList[curGOP].m_temporalId) { bool newRef=false; @@ -3134,9 +3110,7 @@ void EncAppCfg::xPrintParameter() #endif msg( VERBOSE, "LMChroma:%d ", m_LMChroma ); msg( VERBOSE, "EMT: %1d(intra) %1d(inter) ", m_EMT & 1, ( m_EMT >> 1 ) & 1 ); -#if JVET_K0157 msg(VERBOSE, "CompositeLTReference:%d ", m_compositeRefEnabled); -#endif } // ADD_NEW_TOOL (add some output indicating the usage of tools) diff --git a/source/App/EncoderApp/EncAppCfg.h b/source/App/EncoderApp/EncAppCfg.h index 455380da7cf272811b2bb04d9350d76b2199e856..c30670b9872dad3e6d8897be13b525a73cc39825 100644 --- a/source/App/EncoderApp/EncAppCfg.h +++ b/source/App/EncoderApp/EncAppCfg.h @@ -220,9 +220,7 @@ protected: int m_EMT; ///< XZ: Enhanced Multiple Transform int m_FastEMT; ///< XZ: Fast Methods of Enhanced Multiple Transform -#if JVET_K0157 bool m_compositeRefEnabled; -#endif // ADD_NEW_TOOL : (encoder app) add tool enabling flags and associated parameters here unsigned m_uiMaxCUWidth; ///< max. CU width in pixel diff --git a/source/Lib/CommonLib/Picture.cpp b/source/Lib/CommonLib/Picture.cpp index 525b8cc5fd7f134105e491908a4942e9551a86f1..dad3fc9cbf5fb3a640925c13422c9fed5fa02219 100644 --- a/source/Lib/CommonLib/Picture.cpp +++ b/source/Lib/CommonLib/Picture.cpp @@ -728,10 +728,8 @@ Picture::Picture() { m_prevQP[i] = -1; } -#if JVET_K0157 m_spliceIdx = NULL; m_ctuNums = 0; -#endif } void Picture::create(const ChromaFormat &_chromaFormat, const Size &size, const unsigned _maxCUSize, const unsigned _margin, const bool _decoder) @@ -792,13 +790,11 @@ void Picture::destroy() tileMap = nullptr; } #endif -#if JVET_K0157 if (m_spliceIdx) { delete[] m_spliceIdx; m_spliceIdx = NULL; } -#endif } void Picture::createTempBuffers( const unsigned _maxCUSize ) @@ -914,14 +910,12 @@ void Picture::finalInit( const SPS& sps, const PPS& pps ) tileMap = new TileMap; tileMap->create( sps, pps ); #endif -#if JVET_K0157 if (m_spliceIdx == NULL) { m_ctuNums = cs->pcv->sizeInCtus; m_spliceIdx = new int[m_ctuNums]; memset(m_spliceIdx, 0, m_ctuNums * sizeof(int)); } -#endif } void Picture::allocateNewSlice() @@ -1133,7 +1127,6 @@ Pel* Picture::getOrigin( const PictureType &type, const ComponentID compID ) con } -#if JVET_K0157 void Picture::createSpliceIdx(int nums) { m_ctuNums = nums; @@ -1153,4 +1146,3 @@ bool Picture::getSpliceFull() return false; return true; } -#endif diff --git a/source/Lib/CommonLib/Picture.h b/source/Lib/CommonLib/Picture.h index b580df850cf287718c937ca84b58a7fc4fa00ec1..1e4e5c321a7bd20fa78edb78778d56c22b56b31f 100644 --- a/source/Lib/CommonLib/Picture.h +++ b/source/Lib/CommonLib/Picture.h @@ -226,12 +226,10 @@ struct Picture : public UnitArea void setBorderExtension( bool bFlag) { m_bIsBorderExtended = bFlag;} Pel* getOrigin( const PictureType &type, const ComponentID compID ) const; -#if JVET_K0157 int getSpliceIdx(uint32_t idx) const { return m_spliceIdx[idx]; } void setSpliceIdx(uint32_t idx, int poc) { m_spliceIdx[idx] = poc; } void createSpliceIdx(int nums); bool getSpliceFull(); -#endif public: bool m_bIsBorderExtended; @@ -248,10 +246,8 @@ public: uint32_t layer; uint32_t depth; -#if JVET_K0157 int* m_spliceIdx; int m_ctuNums; -#endif #if ENABLE_SPLIT_PARALLELISM #if ENABLE_WPP_PARALLELISM diff --git a/source/Lib/CommonLib/Slice.cpp b/source/Lib/CommonLib/Slice.cpp index 12516ef6a1ed6a48a3ea6ead84efe143a476e8c8..6023e01bc877a3e7a47d9a804bb897eb9b9e5323 100644 --- a/source/Lib/CommonLib/Slice.cpp +++ b/source/Lib/CommonLib/Slice.cpp @@ -1303,9 +1303,7 @@ int Slice::checkThatAllRefPicsAreAvailable( PicList& rcListPic, const ReferenceP /** Function for constructing an explicit Reference Picture Set out of the available pictures in a referenced Reference Picture Set */ void Slice::createExplicitReferencePictureSetFromReference(PicList& rcListPic, const ReferencePictureSet *pReferencePictureSet, bool isRAP, int pocRandomAccess, bool bUseRecoveryPoint, const bool bEfficientFieldIRAPEnabled -#if JVET_K0157 , bool isEncodeLtRef, bool isCompositeRefEnable -#endif ) { Picture* rpcPic; @@ -1346,11 +1344,7 @@ void Slice::createExplicitReferencePictureSetFromReference(PicList& rcListPic, c } else { -#if JVET_K0157 if (bEfficientFieldIRAPEnabled && rpcPic->getPOC() == this->getAssociatedIRAPPOC() && this->getAssociatedIRAPPOC() == this->getPOC() + (isCompositeRefEnable ? 2 : 1)) -#else - if(bEfficientFieldIRAPEnabled && rpcPic->getPOC() == this->getAssociatedIRAPPOC() && this->getAssociatedIRAPPOC() == this->getPOC()+1) -#endif { irapIsInRPS = true; } @@ -1369,11 +1363,7 @@ void Slice::createExplicitReferencePictureSetFromReference(PicList& rcListPic, c while ( iterPic != rcListPic.end()) { rpcPic = *(iterPic++); -#if JVET_K0157 if (rpcPic->getPOC() == this->getAssociatedIRAPPOC() && this->getAssociatedIRAPPOC() == this->getPOC() + (isCompositeRefEnable ? 2 : 1)) -#else - if(rpcPic->getPOC() == this->getAssociatedIRAPPOC() && this->getAssociatedIRAPPOC() == this->getPOC()+1) -#endif { pLocalRPS->setDeltaPOC(k, 1); pLocalRPS->setUsed(k, true); @@ -1383,7 +1373,6 @@ void Slice::createExplicitReferencePictureSetFromReference(PicList& rcListPic, c } } } -#if JVET_K0157 if (isCompositeRefEnable && isEncodeLtRef) { useNewRPS = true; @@ -1429,7 +1418,6 @@ void Slice::createExplicitReferencePictureSetFromReference(PicList& rcListPic, c } } } -#endif pLocalRPS->setNumberOfNegativePictures(nrOfNegativePictures); pLocalRPS->setNumberOfPositivePictures(nrOfPositivePictures); pLocalRPS->setNumberOfPictures(nrOfNegativePictures+nrOfPositivePictures); @@ -1665,9 +1653,7 @@ SPSNext::SPSNext( SPS& sps ) , m_subPuMrgMode ( 0 ) , m_ImvMode ( IMV_OFF ) , m_MTTMode ( 0 ) -#if JVET_K0157 , m_compositeRefEnabled ( false ) -#endif // ADD_NEW_TOOL : (sps extension) add tool enabling flags here (with "false" as default values) { } diff --git a/source/Lib/CommonLib/Slice.h b/source/Lib/CommonLib/Slice.h index ffc4478f94bf0e42f33217c51b95adaf43c7a249..57acda967f0835978a34a19b2612f9a557d29927 100644 --- a/source/Lib/CommonLib/Slice.h +++ b/source/Lib/CommonLib/Slice.h @@ -834,9 +834,7 @@ private: // multi type tree (QTBT + triple split) unsigned m_MTTMode; -#if JVET_K0157 bool m_compositeRefEnabled; //composite longterm reference -#endif // ADD_NEW_TOOL : (sps extension) add tool enabling flags and associated parameters here public: @@ -914,10 +912,8 @@ public: unsigned getMTTMode () const { return m_MTTMode; } void setMTTMode ( unsigned mode ) { m_MTTMode = mode; m_MTTEnabled = ( m_MTTMode != 0 ); } -#if JVET_K0157 void setUseCompositeRef(bool b) { m_compositeRefEnabled = b; } bool getUseCompositeRef() const { return m_compositeRefEnabled; } -#endif // ADD_NEW_TOOL : (sps extension) add access functions for tool enabling flags and associated parameters here }; @@ -1699,9 +1695,7 @@ public: bool isStepwiseTemporalLayerSwitchingPointCandidate( PicList& rcListPic ) const; int checkThatAllRefPicsAreAvailable( PicList& rcListPic, const ReferencePictureSet *pReferencePictureSet, bool printErrors, int pocRandomAccess = 0, bool bUseRecoveryPoint = false) const; void createExplicitReferencePictureSetFromReference(PicList& rcListPic, const ReferencePictureSet *pReferencePictureSet, bool isRAP, int pocRandomAccess, bool bUseRecoveryPoint, const bool bEfficientFieldIRAPEnabled -#if JVET_K0157 , bool isEncodeLtRef, bool isCompositeRefEnable -#endif ); void setMaxNumMergeCand(uint32_t val ) { m_maxNumMergeCand = val; } uint32_t getMaxNumMergeCand() const { return m_maxNumMergeCand; } diff --git a/source/Lib/CommonLib/TypeDef.h b/source/Lib/CommonLib/TypeDef.h index 693e457d970a186ee7553ac22a8d4a50d10f348f..8c3c2a7c86dee09fa87a11de0b5723d64dfb0496 100644 --- a/source/Lib/CommonLib/TypeDef.h +++ b/source/Lib/CommonLib/TypeDef.h @@ -159,7 +159,6 @@ #define HEVC_USE_SIGN_HIDING 1 #endif -#define JVET_K0157 1 #define KEEP_PRED_AND_RESI_SIGNALS 0 diff --git a/source/Lib/EncoderLib/Analyze.h b/source/Lib/EncoderLib/Analyze.h index 2e5e4736054211ade625a795d717096a26d9026b..fe4087cb8f81b49fa90f35b634eb80b8de2a3111 100644 --- a/source/Lib/EncoderLib/Analyze.h +++ b/source/Lib/EncoderLib/Analyze.h @@ -86,16 +86,12 @@ public: Analyze() { clear(); } void addResult( double psnr[MAX_NUM_COMPONENT], double bits, const double MSEyuvframe[MAX_NUM_COMPONENT] -#if JVET_K0157 , bool isEncodeLtRef -#endif ) { m_dAddBits += bits; -#if JVET_K0157 if (isEncodeLtRef) return; -#endif for(uint32_t i=0; i<MAX_NUM_COMPONENT; i++) { m_dPSNRSum[i] += psnr[i]; diff --git a/source/Lib/EncoderLib/EncCfg.h b/source/Lib/EncoderLib/EncCfg.h index eca5a222d1ee9e938e4bed20b93207d468993923..871fca519e72a4a6a1eb1d704544cb7a097f89bf 100644 --- a/source/Lib/EncoderLib/EncCfg.h +++ b/source/Lib/EncoderLib/EncCfg.h @@ -203,9 +203,7 @@ protected: #if ENABLE_WPP_PARALLELISM bool m_AltDQPCoding; #endif -#if JVET_K0157 bool m_compositeRefEnabled; //composite reference -#endif // ADD_NEW_TOOL : (encoder lib) add tool enabling flags and associated parameters here bool m_useFastLCTU; @@ -641,10 +639,8 @@ public: -#if JVET_K0157 void setUseCompositeRef (bool b) { m_compositeRefEnabled = b; } bool getUseCompositeRef () const { return m_compositeRefEnabled; } -#endif // ADD_NEW_TOOL : (encoder lib) add access functions here diff --git a/source/Lib/EncoderLib/EncGOP.cpp b/source/Lib/EncoderLib/EncGOP.cpp index 4f6f59ec459fc231c01f6813d0e23480353cf1a9..f73f71b70e207030a0bc257223af99870e88810a 100644 --- a/source/Lib/EncoderLib/EncGOP.cpp +++ b/source/Lib/EncoderLib/EncGOP.cpp @@ -110,7 +110,6 @@ EncGOP::EncGOP() #endif m_bInitAMaxBT = true; -#if JVET_K0157 m_bgPOC = -1; m_picBg = NULL; m_picOrig = NULL; @@ -118,7 +117,6 @@ EncGOP::EncGOP() m_isUseLTRef = false; m_isPrepareLTRef = true; m_lastLTRefPoc = 0; -#endif } EncGOP::~EncGOP() @@ -148,7 +146,6 @@ void EncGOP::destroy() m_pcDeblockingTempPicYuv = NULL; } #endif -#if JVET_K0157 if (m_picBg) { m_picBg->destroy(); @@ -161,7 +158,6 @@ void EncGOP::destroy() delete m_picOrig; m_picOrig = NULL; } -#endif } void EncGOP::init ( EncLib* pcEncLib ) @@ -1308,9 +1304,7 @@ void trySkipOrDecodePicture( bool& decPic, bool& encPic, const EncCfg& cfg, Pict void EncGOP::compressGOP( int iPOCLast, int iNumPicRcvd, PicList& rcListPic, std::list<PelUnitBuf*>& rcListPicYuvRecOut, bool isField, bool isTff, const InputColourSpaceConversion snr_conversion, const bool printFrameMSE -#if JVET_K0157 , bool isEncodeLtRef -#endif ) { // TODO: Split this function up. @@ -1322,9 +1316,7 @@ void EncGOP::compressGOP( int iPOCLast, int iNumPicRcvd, PicList& rcListPic, AccessUnit::iterator itLocationToPushSliceHeaderNALU; // used to store location where NALU containing slice header is to be inserted xInitGOP(iPOCLast, iNumPicRcvd, isField -#if JVET_K0157 , isEncodeLtRef -#endif ); m_iNumPicCoded = 0; @@ -1364,18 +1356,12 @@ void EncGOP::compressGOP( int iPOCLast, int iNumPicRcvd, PicList& rcListPic, /////////////////////////////////////////////////////////////////////////////////////////////////// Initial to start encoding int iTimeOffset; int pocCurr; -#if JVET_K0157 int multipleFactor = m_pcCfg->getUseCompositeRef() ? 2 : 1; -#endif if(iPOCLast == 0) //case first frame or first top field { pocCurr=0; -#if JVET_K0157 iTimeOffset = multipleFactor; -#else - iTimeOffset = 1; -#endif } else if(iPOCLast == 1 && isField) //case first bottom field, just like the first frame, the poc computation is not right anymore, we set the right value { @@ -1384,24 +1370,16 @@ void EncGOP::compressGOP( int iPOCLast, int iNumPicRcvd, PicList& rcListPic, } else { -#if JVET_K0157 pocCurr = iPOCLast - iNumPicRcvd * multipleFactor + m_pcCfg->getGOPEntry(iGOPid).m_POC - ((isField && m_iGopSize>1) ? 1 : 0); -#else - pocCurr = iPOCLast - iNumPicRcvd + m_pcCfg->getGOPEntry(iGOPid).m_POC - ((isField && m_iGopSize>1) ? 1:0); -#endif iTimeOffset = m_pcCfg->getGOPEntry(iGOPid).m_POC; } -#if JVET_K0157 if (m_pcCfg->getUseCompositeRef() && isEncodeLtRef) { pocCurr++; iTimeOffset--; } if (pocCurr / multipleFactor >= m_pcCfg->getFramesToBeEncoded()) -#else - if(pocCurr>=m_pcCfg->getFramesToBeEncoded()) -#endif { if (m_pcCfg->getEfficientFieldIRAPEnabled()) { @@ -1449,9 +1427,7 @@ void EncGOP::compressGOP( int iPOCLast, int iNumPicRcvd, PicList& rcListPic, m_pcSliceEncoder->setSliceSegmentIdx(0); m_pcSliceEncoder->initEncSlice(pcPic, iPOCLast, pocCurr, iGOPid, pcSlice, isField -#if JVET_K0157 , isEncodeLtRef -#endif ); DTRACE_UPDATE( g_trace_ctx, ( std::make_pair( "poc", pocCurr ) ) ); @@ -1515,7 +1491,6 @@ void EncGOP::compressGOP( int iPOCLast, int iNumPicRcvd, PicList& rcListPic, } pcSlice->decodingRefreshMarking(m_pocCRA, m_bRefreshPending, rcListPic, m_pcCfg->getEfficientFieldIRAPEnabled()); -#if JVET_K0157 if (m_pcCfg->getUseCompositeRef() && isEncodeLtRef) { setUseLTRef(true); @@ -1540,9 +1515,6 @@ void EncGOP::compressGOP( int iPOCLast, int iNumPicRcvd, PicList& rcListPic, { m_pcEncLib->selectReferencePictureSet(pcSlice, pocCurr, iGOPid, -1); } -#else - m_pcEncLib->selectReferencePictureSet(pcSlice, pocCurr, iGOPid); -#endif if (!m_pcCfg->getEfficientFieldIRAPEnabled()) { if ( pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_LP @@ -1564,9 +1536,7 @@ void EncGOP::compressGOP( int iPOCLast, int iNumPicRcvd, PicList& rcListPic, ) { pcSlice->createExplicitReferencePictureSetFromReference(rcListPic, pcSlice->getRPS(), pcSlice->isIRAP(), m_iLastRecoveryPicPOC, m_pcCfg->getDecodingRefreshType() == 3, m_pcCfg->getEfficientFieldIRAPEnabled() -#if JVET_K0157 , isEncodeLtRef, m_pcCfg->getUseCompositeRef() -#endif ); } @@ -1635,17 +1605,12 @@ void EncGOP::compressGOP( int iPOCLast, int iNumPicRcvd, PicList& rcListPic, } } } -#if JVET_K0157 if (pcSlice->getRPSidx() == -1) arrangeLongtermPicturesInRPS(pcSlice, rcListPic); -#else - arrangeLongtermPicturesInRPS(pcSlice, rcListPic); -#endif RefPicListModification* refPicListModification = pcSlice->getRefPicListModification(); refPicListModification->setRefPicListModificationFlagL0(0); refPicListModification->setRefPicListModificationFlagL1(0); -#if JVET_K0157 if (m_pcCfg->getUseCompositeRef() && getUseLTRef() && (pocCurr > getLastLTRefPoc())) { pcSlice->setNumRefIdx(REF_PIC_LIST_0, min(m_pcCfg->getGOPEntry(iGOPid).m_numRefPicsActive + 1, pcSlice->getRPS()->getNumberOfPictures())); @@ -1659,10 +1624,6 @@ void EncGOP::compressGOP( int iPOCLast, int iNumPicRcvd, PicList& rcListPic, if (pcPic->cs->sps->getSpsNext().getUseCompositeRef() && getPrepareLTRef()) { arrangeCompositeReference(pcSlice, rcListPic, pocCurr); } -#else - pcSlice->setNumRefIdx(REF_PIC_LIST_0,min(m_pcCfg->getGOPEntry(iGOPid).m_numRefPicsActive,pcSlice->getRPS()->getNumberOfPictures())); - pcSlice->setNumRefIdx(REF_PIC_LIST_1,min(m_pcCfg->getGOPEntry(iGOPid).m_numRefPicsActive,pcSlice->getRPS()->getNumberOfPictures())); -#endif // Set reference list pcSlice->setRefPicList ( rcListPic ); @@ -2151,12 +2112,10 @@ void EncGOP::compressGOP( int iPOCLast, int iNumPicRcvd, PicList& rcListPic, pcPic->slices[s]->setAlfSliceParam( alfSliceParam ); } } -#if JVET_K0157 if (pcPic->cs->sps->getSpsNext().getUseCompositeRef() && getPrepareLTRef()) { updateCompositeReference(pcSlice, rcListPic, pocCurr); } -#endif } else // skip enc picture { @@ -2350,9 +2309,7 @@ void EncGOP::compressGOP( int iPOCLast, int iNumPicRcvd, PicList& rcListPic, double PSNR_Y; xCalculateAddPSNRs(isField, isTff, iGOPid, pcPic, accessUnit, rcListPic, encTime, snr_conversion, printFrameMSE, &PSNR_Y -#if JVET_K0157 , isEncodeLtRef -#endif ); // Only produce the Green Metadata SEI message with the last picture. @@ -2417,9 +2374,7 @@ void EncGOP::compressGOP( int iPOCLast, int iNumPicRcvd, PicList& rcListPic, pcPic->reconstructed = true; m_bFirst = false; m_iNumPicCoded++; -#if JVET_K0157 if (!(pcPic->cs->sps->getSpsNext().getUseCompositeRef() && isEncodeLtRef)) -#endif m_totalCoded ++; /* logging: insert a newline at end of picture period */ @@ -2569,18 +2524,12 @@ uint64_t EncGOP::preLoopFilterPicAndCalcDist( Picture* pcPic ) // Protected member functions // ==================================================================================================================== void EncGOP::xInitGOP( int iPOCLast, int iNumPicRcvd, bool isField -#if JVET_K0157 , bool isEncodeLtRef -#endif ) { CHECK(!( iNumPicRcvd > 0 ), "Unspecified error"); // Exception for the first frames -#if JVET_K0157 if ((isField && (iPOCLast == 0 || iPOCLast == 1)) || (!isField && (iPOCLast == 0)) || isEncodeLtRef) -#else - if ( ( isField && (iPOCLast == 0 || iPOCLast == 1) ) || (!isField && (iPOCLast == 0)) ) -#endif { m_iGopSize = 1; } @@ -2611,12 +2560,8 @@ void EncGOP::xGetBuffer( PicList& rcListPic, iTimeOffset--; } -#if JVET_K0157 int multipleFactor = m_pcCfg->getUseCompositeRef() ? 2 : 1; for (i = 0; i < (iNumPicRcvd * multipleFactor - iTimeOffset + 1); i += multipleFactor) -#else - for ( i = 0; i < (iNumPicRcvd - iTimeOffset + 1); i++ ) -#endif { iterPicYuvRec--; } @@ -2873,15 +2818,11 @@ double EncGOP::xFindDistortionPlaneWPSNR(const CPelBuf& pic0, const CPelBuf& pic #endif void EncGOP::xCalculateAddPSNRs( const bool isField, const bool isFieldTopFieldFirst, const int iGOPid, Picture* pcPic, const AccessUnit&accessUnit, PicList &rcListPic, const int64_t dEncTime, const InputColourSpaceConversion snr_conversion, const bool printFrameMSE, double* PSNR_Y -#if JVET_K0157 , bool isEncodeLtRef -#endif ) { xCalculateAddPSNR(pcPic, pcPic->getRecoBuf(), accessUnit, (double)dEncTime, snr_conversion, printFrameMSE, PSNR_Y -#if JVET_K0157 , isEncodeLtRef -#endif ); //In case of field coding, compute the interlaced PSNR for both fields @@ -2938,17 +2879,13 @@ void EncGOP::xCalculateAddPSNRs( const bool isField, const bool isFieldTopFieldF if ((pcPic->topField && isFieldTopFieldFirst) || (!pcPic->topField && !isFieldTopFieldFirst)) { xCalculateInterlacedAddPSNR(pcPic, correspondingFieldPic, pcPic->getRecoBuf(), correspondingFieldPic->getRecoBuf(), snr_conversion, printFrameMSE, PSNR_Y -#if JVET_K0157 , isEncodeLtRef -#endif ); } else { xCalculateInterlacedAddPSNR(correspondingFieldPic, pcPic, correspondingFieldPic->getRecoBuf(), pcPic->getRecoBuf(), snr_conversion, printFrameMSE, PSNR_Y -#if JVET_K0157 , isEncodeLtRef -#endif ); } } @@ -2956,9 +2893,7 @@ void EncGOP::xCalculateAddPSNRs( const bool isField, const bool isFieldTopFieldF } void EncGOP::xCalculateAddPSNR(Picture* pcPic, PelUnitBuf cPicD, const AccessUnit& accessUnit, double dEncTime, const InputColourSpaceConversion conversion, const bool printFrameMSE, double* PSNR_Y -#if JVET_K0157 , bool isEncodeLtRef -#endif ) { const SPS& sps = *pcPic->cs->sps; @@ -3089,9 +3024,7 @@ void EncGOP::xCalculateAddPSNR(Picture* pcPic, PelUnitBuf cPicD, const AccessUni //===== add PSNR ===== m_gcAnalyzeAll.addResult(dPSNR, (double)uibits, MSEyuvframe -#if JVET_K0157 , isEncodeLtRef -#endif ); #if EXTENSION_360_VIDEO m_ext360.addResult(m_gcAnalyzeAll); @@ -3099,9 +3032,7 @@ void EncGOP::xCalculateAddPSNR(Picture* pcPic, PelUnitBuf cPicD, const AccessUni if (pcSlice->isIntra()) { m_gcAnalyzeI.addResult(dPSNR, (double)uibits, MSEyuvframe -#if JVET_K0157 , isEncodeLtRef -#endif ); *PSNR_Y = dPSNR[COMPONENT_Y]; #if EXTENSION_360_VIDEO @@ -3111,9 +3042,7 @@ void EncGOP::xCalculateAddPSNR(Picture* pcPic, PelUnitBuf cPicD, const AccessUni if (pcSlice->isInterP()) { m_gcAnalyzeP.addResult(dPSNR, (double)uibits, MSEyuvframe -#if JVET_K0157 , isEncodeLtRef -#endif ); *PSNR_Y = dPSNR[COMPONENT_Y]; #if EXTENSION_360_VIDEO @@ -3123,9 +3052,7 @@ void EncGOP::xCalculateAddPSNR(Picture* pcPic, PelUnitBuf cPicD, const AccessUni if (pcSlice->isInterB()) { m_gcAnalyzeB.addResult(dPSNR, (double)uibits, MSEyuvframe -#if JVET_K0157 , isEncodeLtRef -#endif ); *PSNR_Y = dPSNR[COMPONENT_Y]; #if EXTENSION_360_VIDEO @@ -3210,9 +3137,7 @@ void EncGOP::xCalculateAddPSNR(Picture* pcPic, PelUnitBuf cPicD, const AccessUni void EncGOP::xCalculateInterlacedAddPSNR( Picture* pcPicOrgFirstField, Picture* pcPicOrgSecondField, PelUnitBuf cPicRecFirstField, PelUnitBuf cPicRecSecondField, const InputColourSpaceConversion conversion, const bool printFrameMSE, double* PSNR_Y -#if JVET_K0157 , bool isEncodeLtRef -#endif ) { const SPS &sps = *pcPicOrgFirstField->cs->sps; @@ -3290,9 +3215,7 @@ void EncGOP::xCalculateInterlacedAddPSNR( Picture* pcPicOrgFirstField, Picture* //===== add PSNR ===== m_gcAnalyzeAll_in.addResult (dPSNR, (double)uibits, MSEyuvframe -#if JVET_K0157 , isEncodeLtRef -#endif ); *PSNR_Y = dPSNR[COMPONENT_Y]; @@ -3323,21 +3246,13 @@ NalUnitType EncGOP::getNalUnitType(int pocCurr, int lastIDR, bool isField) return NAL_UNIT_CODED_SLICE_IDR_W_RADL; } -#if JVET_K0157 if (m_pcCfg->getEfficientFieldIRAPEnabled() && isField && pocCurr == (m_pcCfg->getUseCompositeRef() ? 2: 1)) -#else - if (m_pcCfg->getEfficientFieldIRAPEnabled() && isField && pocCurr == 1) -#endif { // to avoid the picture becoming an IRAP return NAL_UNIT_CODED_SLICE_TRAIL_R; } -#if JVET_K0157 if (m_pcCfg->getDecodingRefreshType() != 3 && (pocCurr - isField) % (m_pcCfg->getIntraPeriod() * (m_pcCfg->getUseCompositeRef() ? 2 : 1)) == 0) -#else - if (m_pcCfg->getDecodingRefreshType() != 3 && (pocCurr - isField) % m_pcCfg->getIntraPeriod() == 0) -#endif { if (m_pcCfg->getDecodingRefreshType() == 1) { @@ -3556,7 +3471,6 @@ void EncGOP::arrangeLongtermPicturesInRPS(Slice *pcSlice, PicList& rcListPic) } } -#if JVET_K0157 void EncGOP::arrangeCompositeReference(Slice* pcSlice, PicList& rcListPic, int pocCurr) { Picture* curPic = NULL; @@ -3771,7 +3685,6 @@ void EncGOP::updateCompositeReference(Slice* pcSlice, PicList& rcListPic, int po m_picBg->setBorderExtension(true); } } -#endif void EncGOP::applyDeblockingFilterMetric( Picture* pcPic, uint32_t uiNumSlices ) { diff --git a/source/Lib/EncoderLib/EncGOP.h b/source/Lib/EncoderLib/EncGOP.h index cfaf8b619366711738dfd0e72438a98aeacbf2e7..288ce0f05b03991330340f7a180f77b22e8ac8bd 100644 --- a/source/Lib/EncoderLib/EncGOP.h +++ b/source/Lib/EncoderLib/EncGOP.h @@ -129,7 +129,6 @@ private: SEIWriter m_seiWriter; -#if JVET_K0157 Picture * m_picBg; Picture * m_picOrig; int m_bgPOC; @@ -137,7 +136,6 @@ private: bool m_isPrepareLTRef; bool m_isUseLTRef; int m_lastLTRefPoc; -#endif //--Adaptive Loop filter EncSampleAdaptiveOffset* m_pcSAO; EncAdaptiveLoopFilter* m_pcALF; @@ -179,9 +177,7 @@ public: void init ( EncLib* pcEncLib ); void compressGOP ( int iPOCLast, int iNumPicRcvd, PicList& rcListPic, std::list<PelUnitBuf*>& rcListPicYuvRec, bool isField, bool isTff, const InputColourSpaceConversion snr_conversion, const bool printFrameMSE -#if JVET_K0157 , bool isEncodeLtRef -#endif ); void xAttachSliceDataToNalUnit (OutputNALUnit& rNalu, OutputBitstream* pcBitstreamRedirect); @@ -189,7 +185,6 @@ public: int getGOPSize() { return m_iGopSize; } PicList* getListPic() { return m_pcListPic; } -#if JVET_K0157 void setPicBg(Picture* tmpPicBg) { m_picBg = tmpPicBg; } Picture* getPicBg() const { return m_picBg; } void setPicOrig(Picture* tmpPicBg) { m_picOrig = tmpPicBg; } @@ -205,7 +200,6 @@ public: void setLastLTRefPoc(int iLastLTRefPoc) { m_lastLTRefPoc = iLastLTRefPoc; } int getLastLTRefPoc() const { return m_lastLTRefPoc; } -#endif void printOutSummary ( uint32_t uiNumAllPicCoded, bool isField, const bool printMSEBasedSNR, const bool printSequenceMSE, const bool printHexPsnr, const BitDepths &bitDepths ); #if W0038_DB_OPT uint64_t preLoopFilterPicAndCalcDist( Picture* pcPic ); @@ -213,10 +207,8 @@ public: EncSlice* getSliceEncoder() { return m_pcSliceEncoder; } NalUnitType getNalUnitType( int pocCurr, int lastIdr, bool isField ); void arrangeLongtermPicturesInRPS(Slice *, PicList& ); -#if JVET_K0157 void arrangeCompositeReference(Slice* pcSlice, PicList& rcListPic, int pocCurr); void updateCompositeReference(Slice* pcSlice, PicList& rcListPic, int pocCurr); -#endif #if EXTENSION_360_VIDEO Analyze& getAnalyzeAllData() { return m_gcAnalyzeAll; } @@ -231,29 +223,21 @@ protected: protected: void xInitGOP ( int iPOCLast, int iNumPicRcvd, bool isField -#if JVET_K0157 , bool isEncodeLtRef -#endif ); void xGetBuffer ( PicList& rcListPic, std::list<PelUnitBuf*>& rcListPicYuvRecOut, int iNumPicRcvd, int iTimeOffset, Picture*& rpcPic, int pocCurr, bool isField ); void xCalculateAddPSNRs(const bool isField, const bool isFieldTopFieldFirst, const int iGOPid, Picture* pcPic, const AccessUnit&accessUnit, PicList &rcListPic, int64_t dEncTime, const InputColourSpaceConversion snr_conversion, const bool printFrameMSE, double* PSNR_Y -#if JVET_K0157 , bool isEncodeLtRef -#endif ); void xCalculateAddPSNR(Picture* pcPic, PelUnitBuf cPicD, const AccessUnit&, double dEncTime, const InputColourSpaceConversion snr_conversion, const bool printFrameMSE, double* PSNR_Y -#if JVET_K0157 , bool isEncodeLtRef -#endif ); void xCalculateInterlacedAddPSNR( Picture* pcPicOrgFirstField, Picture* pcPicOrgSecondField, PelUnitBuf cPicRecFirstField, PelUnitBuf cPicRecSecondField, const InputColourSpaceConversion snr_conversion, const bool printFrameMSE, double* PSNR_Y -#if JVET_K0157 , bool isEncodeLtRef -#endif ); uint64_t xFindDistortionPlane(const CPelBuf& pic0, const CPelBuf& pic1, const uint32_t rshift diff --git a/source/Lib/EncoderLib/EncLib.cpp b/source/Lib/EncoderLib/EncLib.cpp index 475a3dd348c090fbfdcebbcea3f1bf1705f88eb5..3460e0c9f90b54afe65158eaddff8021b9bd8ced 100644 --- a/source/Lib/EncoderLib/EncLib.cpp +++ b/source/Lib/EncoderLib/EncLib.cpp @@ -87,9 +87,7 @@ void EncLib::create () -#if JVET_K0157 m_iPOCLast = m_compositeRefEnabled ? -2 : -1; -#endif // create processing unit classes m_cGOPEncoder. create( ); m_cSliceEncoder. create( getSourceWidth(), getSourceHeight(), m_chromaFormatIDC, m_maxCUWidth, m_maxCUHeight, m_maxTotalCUDepth ); @@ -217,12 +215,10 @@ void EncLib::init( bool isFieldCoding, AUWriterIf* auWriterIf ) omp_set_nested( true ); #endif -#if JVET_K0157 if (sps0.getSpsNext().getUseCompositeRef()) { sps0.setLongTermRefsPresent(true); } -#endif #if U0132_TARGET_BITS_SATURATION if (m_RCCpbSaturationEnabled) @@ -252,14 +248,12 @@ void EncLib::init( bool isFieldCoding, AUWriterIf* auWriterIf ) xInitPPS(pps1, sps0); } #endif -#if JVET_K0157 if (sps0.getSpsNext().getUseCompositeRef()) { PPS &pps2 = *(m_ppsMap.allocatePS(2)); xInitPPS(pps2, sps0); xInitPPSforLT(pps2); } -#endif // initialize processing unit classes m_cGOPEncoder. init( this ); @@ -358,7 +352,6 @@ void EncLib::init( bool isFieldCoding, AUWriterIf* auWriterIf ) #if ENABLE_WPP_PARALLELISM m_entropyCodingSyncContextStateVec.resize( pps0.pcv->heightInCtus ); #endif -#if JVET_K0157 if (sps0.getSpsNext().getUseCompositeRef()) { Picture *picBg = new Picture; @@ -373,7 +366,6 @@ void EncLib::init( bool isFieldCoding, AUWriterIf* auWriterIf ) picOrig->getOrigBuf().fill(0); m_cGOPEncoder.setPicOrig(picOrig); } -#endif } #if HEVC_USE_SCALING_LISTS @@ -459,14 +451,12 @@ void EncLib::xInitScalingLists(SPS &sps, PPS &pps) } #endif -#if JVET_K0157 void EncLib::xInitPPSforLT(PPS& pps) { pps.setOutputFlagPresentFlag(true); pps.setDeblockingFilterControlPresentFlag(true); pps.setPPSDeblockingFilterDisabledFlag(true); } -#endif // ==================================================================================================================== // Public member functions @@ -510,7 +500,6 @@ void EncLib::deletePicBuffer() void EncLib::encode( bool flush, PelStorage* pcPicYuvOrg, PelStorage* cPicYuvTrueOrg, const InputColourSpaceConversion snrCSC, std::list<PelUnitBuf*>& rcListPicYuvRecOut, int& iNumEncoded ) { -#if JVET_K0157 if (m_compositeRefEnabled && m_cGOPEncoder.getPicBg()->getSpliceFull() && m_iPOCLast >= 10 && m_iNumPicRcvd == 0 && m_cGOPEncoder.getEncodedLTRef() == false) { Picture* picCurr = NULL; @@ -541,7 +530,6 @@ void EncLib::encode( bool flush, PelStorage* pcPicYuvOrg, PelStorage* cPicYuvTru iNumEncoded = 0; m_iNumPicRcvd = 0; } -#endif //PROF_ACCUM_AND_START_NEW_SET( getProfilerPic(), P_GOP_LEVEL ); if (pcPicYuvOrg != NULL) { @@ -552,11 +540,7 @@ void EncLib::encode( bool flush, PelStorage* pcPicYuvOrg, PelStorage* cPicYuvTru int ppsID=-1; // Use default PPS ID if (getWCGChromaQPControl().isEnabled()) { -#if JVET_K0157 ppsID = getdQPs()[m_iPOCLast / (m_compositeRefEnabled ? 2 : 1) + 1]; -#else - ppsID=getdQPs()[ m_iPOCLast+1 ]; -#endif ppsID+=(getSwitchPOC() != -1 && (m_iPOCLast+1 >= getSwitchPOC())?1:0); } xGetNewPicBuffer( rcListPicYuvRecOut, @@ -598,9 +582,7 @@ void EncLib::encode( bool flush, PelStorage* pcPicYuvOrg, PelStorage* cPicYuvTru // compress GOP m_cGOPEncoder.compressGOP(m_iPOCLast, m_iNumPicRcvd, m_cListPic, rcListPicYuvRecOut, false, false, snrCSC, m_printFrameMSE -#if JVET_K0157 , false -#endif ); if ( m_RCEnableRateControl ) @@ -690,9 +672,7 @@ void EncLib::encode( bool flush, PelStorage* pcPicYuvOrg, PelStorage* pcPicYuvTr { // compress GOP m_cGOPEncoder.compressGOP(m_iPOCLast, m_iNumPicRcvd, m_cListPic, rcListPicYuvRecOut, true, isTff, snrCSC, m_printFrameMSE -#if JVET_K0157 , false -#endif ); iNumEncoded += m_iNumPicRcvd; @@ -781,11 +761,7 @@ void EncLib::xGetNewPicBuffer ( std::list<PelUnitBuf*>& rcListPicYuvRecOut, Pict rpcPic->reconstructed = false; rpcPic->referenced = true; -#if JVET_K0157 m_iPOCLast += (m_compositeRefEnabled ? 2 : 1); -#else - m_iPOCLast++; -#endif m_iNumPicRcvd++; } @@ -875,9 +851,7 @@ void EncLib::xInitSPS(SPS &sps) #endif sps.getSpsNext().setUseIntraEMT ( m_IntraEMT ); sps.getSpsNext().setUseInterEMT ( m_InterEMT ); -#if JVET_K0157 sps.getSpsNext().setUseCompositeRef ( m_compositeRefEnabled ); -#endif // ADD_NEW_TOOL : (encoder lib) set tool enabling flags and associated parameters here @@ -1551,19 +1525,15 @@ void EncLib::xInitRPS(SPS &sps, bool isFieldCoding) // determines what Reference Picture Set to use // for a specific slice (with POC = POCCurr) void EncLib::selectReferencePictureSet(Slice* slice, int POCCurr, int GOPid -#if JVET_K0157 , int ltPoc -#endif ) { -#if JVET_K0157 bool isEncodeLtRef = (POCCurr == ltPoc); if (m_compositeRefEnabled && isEncodeLtRef) { POCCurr++; } int rIdx = GOPid; -#endif slice->setRPSidx(GOPid); for(int extraNum=m_iGOPSize; extraNum<m_extraRPSs+m_iGOPSize; extraNum++) @@ -1578,9 +1548,7 @@ void EncLib::selectReferencePictureSet(Slice* slice, int POCCurr, int GOPid if(POCIndex == m_GOPList[extraNum].m_POC) { slice->setRPSidx(extraNum); -#if JVET_K0157 rIdx = extraNum; -#endif } } else @@ -1588,9 +1556,7 @@ void EncLib::selectReferencePictureSet(Slice* slice, int POCCurr, int GOPid if(POCCurr==m_GOPList[extraNum].m_POC) { slice->setRPSidx(extraNum); -#if JVET_K0157 rIdx = extraNum; -#endif } } } @@ -1598,12 +1564,9 @@ void EncLib::selectReferencePictureSet(Slice* slice, int POCCurr, int GOPid if(POCCurr == 1 && slice->getPic()->fieldPic) { slice->setRPSidx(m_iGOPSize+m_extraRPSs); -#if JVET_K0157 rIdx = m_iGOPSize + m_extraRPSs; -#endif } -#if JVET_K0157 ReferencePictureSet *rps = const_cast<ReferencePictureSet *>(slice->getSPS()->getRPSList()->getReferencePictureSet(slice->getRPSidx())); if (m_compositeRefEnabled && ltPoc != -1 && !isEncodeLtRef) { @@ -1666,9 +1629,6 @@ void EncLib::selectReferencePictureSet(Slice* slice, int POCCurr, int GOPid slice->setRPSidx(-1); return; } -#else - const ReferencePictureSet *rps = (slice->getSPS()->getRPSList()->getReferencePictureSet(slice->getRPSidx())); -#endif slice->setRPS(rps); } @@ -1819,11 +1779,7 @@ int EncCfg::getQPForPicture(const uint32_t gopIndex, const Slice *pSlice) const const int* pdQPs = getdQPs(); if ( pdQPs ) { -#if JVET_K0157 qp += pdQPs[pSlice->getPOC() / (m_compositeRefEnabled ? 2 : 1)]; -#else - qp += pdQPs[ pSlice->getPOC() ]; -#endif } #endif diff --git a/source/Lib/EncoderLib/EncLib.h b/source/Lib/EncoderLib/EncLib.h index 50e648e462b67b121b019f54e5b0cb518a027529..09ed431d054b3ccd4279a3bae1fcbfaaa6912c3f 100644 --- a/source/Lib/EncoderLib/EncLib.h +++ b/source/Lib/EncoderLib/EncLib.h @@ -146,9 +146,7 @@ protected: #if HEVC_USE_SCALING_LISTS void xInitScalingLists (SPS &sps, PPS &pps); ///< initialize scaling lists #endif -#if JVET_K0157 void xInitPPSforLT(PPS& pps); -#endif void xInitHrdParameters(SPS &sps); ///< initialize HRD parameters #if HEVC_TILES_WPP @@ -208,9 +206,7 @@ public: void selectReferencePictureSet(Slice* slice, int POCCurr, int GOPid -#if JVET_K0157 , int ltPoc -#endif ); int getReferencePictureSetIdxForSOP(int POCCurr, int GOPid ); diff --git a/source/Lib/EncoderLib/EncModeCtrl.cpp b/source/Lib/EncoderLib/EncModeCtrl.cpp index 79e6d338eb3eb5fb32f4a434f3c30401845a8fa8..2871f8c41a76a533b22ed10e07a4fc7bb9c6f006 100644 --- a/source/Lib/EncoderLib/EncModeCtrl.cpp +++ b/source/Lib/EncoderLib/EncModeCtrl.cpp @@ -826,15 +826,11 @@ void EncModeCtrlMTnoRQT::initCTUEncoding( const Slice &slice ) if( m_pcEncCfg->getUseE0023FastEnc() ) { -#if JVET_K0157 if (m_pcEncCfg->getUseCompositeRef()) m_skipThreshold = ( ( slice.getMinPictureDistance() <= PICTURE_DISTANCE_TH * 2 ) ? FAST_SKIP_DEPTH : SKIP_DEPTH ); else m_skipThreshold = ((slice.getMinPictureDistance() <= PICTURE_DISTANCE_TH) ? FAST_SKIP_DEPTH : SKIP_DEPTH); -#else - m_skipThreshold = ((slice.getMinPictureDistance() <= PICTURE_DISTANCE_TH) ? FAST_SKIP_DEPTH : SKIP_DEPTH); -#endif } else { diff --git a/source/Lib/EncoderLib/EncSlice.cpp b/source/Lib/EncoderLib/EncSlice.cpp index 123b5af2df8b5ec2bad20169a1e0e9c26d612d9e..7250bb6bdbf55b53310076ac315c6b2e3ff8d3dc 100644 --- a/source/Lib/EncoderLib/EncSlice.cpp +++ b/source/Lib/EncoderLib/EncSlice.cpp @@ -274,9 +274,7 @@ static int applyQPAdaptationChroma (Picture* const pcPic, Slice* const pcSlice, \param isField true for field coding */ void EncSlice::initEncSlice(Picture* pcPic, const int pocLast, const int pocCurr, const int iGOPid, Slice*& rpcSlice, const bool isField -#if JVET_K0157 , bool isEncodeLtRef -#endif ) { double dQP; @@ -286,7 +284,6 @@ void EncSlice::initEncSlice(Picture* pcPic, const int pocLast, const int pocCurr rpcSlice->setSliceBits(0); rpcSlice->setPic( pcPic ); rpcSlice->initSlice(); -#if JVET_K0157 int multipleFactor = pcPic->cs->sps->getSpsNext().getUseCompositeRef() ? 2 : 1; if (pcPic->cs->sps->getSpsNext().getUseCompositeRef() && isEncodeLtRef) { @@ -296,9 +293,6 @@ void EncSlice::initEncSlice(Picture* pcPic, const int pocLast, const int pocCurr { rpcSlice->setPicOutputFlag(true); } -#else - rpcSlice->setPicOutputFlag( true ); -#endif rpcSlice->setPOC( pocCurr ); rpcSlice->setDepQuantEnabledFlag( m_pcCfg->getDepQuantEnabledFlag() ); #if HEVC_USE_SIGN_HIDING @@ -320,11 +314,7 @@ void EncSlice::initEncSlice(Picture* pcPic, const int pocLast, const int pocCurr } else { -#if JVET_K0157 poc = poc % (m_pcCfg->getGOPSize() * multipleFactor); -#else - poc = poc % m_pcCfg->getGOPSize(); -#endif } if ( poc == 0 ) @@ -333,19 +323,11 @@ void EncSlice::initEncSlice(Picture* pcPic, const int pocLast, const int pocCurr } else { -#if JVET_K0157 int step = m_pcCfg->getGOPSize() * multipleFactor; -#else - int step = m_pcCfg->getGOPSize(); -#endif depth = 0; for( int i=step>>1; i>=1; i>>=1 ) { -#if JVET_K0157 for (int j = i; j<(m_pcCfg->getGOPSize() * multipleFactor); j += step) -#else - for ( int j=i; j<m_pcCfg->getGOPSize(); j+=step ) -#endif { if ( j == poc ) { @@ -375,19 +357,11 @@ void EncSlice::initEncSlice(Picture* pcPic, const int pocLast, const int pocCurr { if(m_pcCfg->getDecodingRefreshType() == 3) { -#if JVET_K0157 eSliceType = (pocLast == 0 || pocCurr % (m_pcCfg->getIntraPeriod() * multipleFactor) == 0 || m_pcGOPEncoder->getGOPSize() == 0) ? I_SLICE : eSliceType; -#else - eSliceType = (pocLast == 0 || pocCurr % m_pcCfg->getIntraPeriod() == 0 || m_pcGOPEncoder->getGOPSize() == 0) ? I_SLICE : eSliceType; -#endif } else { -#if JVET_K0157 eSliceType = (pocLast == 0 || (pocCurr - (isField ? 1 : 0)) % (m_pcCfg->getIntraPeriod() * multipleFactor) == 0 || m_pcGOPEncoder->getGOPSize() == 0) ? I_SLICE : eSliceType; -#else - eSliceType = (pocLast == 0 || (pocCurr - (isField ? 1 : 0)) % m_pcCfg->getIntraPeriod() == 0 || m_pcGOPEncoder->getGOPSize() == 0) ? I_SLICE : eSliceType; -#endif } } @@ -630,19 +604,11 @@ void EncSlice::initEncSlice(Picture* pcPic, const int pocLast, const int pocCurr { if(m_pcCfg->getDecodingRefreshType() == 3) { -#if JVET_K0157 eSliceType = (pocLast == 0 || (pocCurr) % (m_pcCfg->getIntraPeriod() * multipleFactor) == 0 || m_pcGOPEncoder->getGOPSize() == 0) ? I_SLICE : eSliceType; -#else - eSliceType = (pocLast == 0 || (pocCurr) % m_pcCfg->getIntraPeriod() == 0 || m_pcGOPEncoder->getGOPSize() == 0) ? I_SLICE : eSliceType; -#endif } else { -#if JVET_K0157 eSliceType = (pocLast == 0 || (pocCurr - (isField ? 1 : 0)) % (m_pcCfg->getIntraPeriod() * multipleFactor) == 0 || m_pcGOPEncoder->getGOPSize() == 0) ? I_SLICE : eSliceType; -#else - eSliceType = (pocLast == 0 || (pocCurr - (isField ? 1 : 0)) % m_pcCfg->getIntraPeriod() == 0 || m_pcGOPEncoder->getGOPSize() == 0) ? I_SLICE : eSliceType; -#endif } } diff --git a/source/Lib/EncoderLib/EncSlice.h b/source/Lib/EncoderLib/EncSlice.h index 836bc4d7caccc05776643776ac7e4dbc2792c25b..542a41256cd1a3c145dadbff4c7415f4a4308fb1 100644 --- a/source/Lib/EncoderLib/EncSlice.h +++ b/source/Lib/EncoderLib/EncSlice.h @@ -131,9 +131,7 @@ public: /// preparation of slice encoding (reference marking, QP and lambda) void initEncSlice ( Picture* pcPic, const int pocLast, const int pocCurr, const int iGOPid, Slice*& rpcSlice, const bool isField -#if JVET_K0157 , bool isEncodeLtRef -#endif ); void resetQP ( Picture* pic, int sliceQP, double lambda ); diff --git a/source/Lib/EncoderLib/InterSearch.cpp b/source/Lib/EncoderLib/InterSearch.cpp index 07bbb5e47e6ccc87365f5df4195da8ce1f776846..49f394439297c68c7fc7a20c830eb501ce70405a 100644 --- a/source/Lib/EncoderLib/InterSearch.cpp +++ b/source/Lib/EncoderLib/InterSearch.cpp @@ -1615,7 +1615,6 @@ void InterSearch::xMotionEstimation(PredictionUnit& pu, PelUnitBuf& origBuf, Ref cStruct.iRefStride = buf.stride; cStruct.piRefY = buf.buf; cStruct.imvShift = pu.cu->imv << 1; -#if JVET_K0157 cStruct.inCtuSearch = false; cStruct.zeroMV = false; { @@ -1624,7 +1623,6 @@ void InterSearch::xMotionEstimation(PredictionUnit& pu, PelUnitBuf& origBuf, Ref cStruct.inCtuSearch = true; } } -#endif auto blkCache = dynamic_cast<CacheBlkInfoCtrl*>( m_modeCtrl ); @@ -1656,9 +1654,7 @@ void InterSearch::xMotionEstimation(PredictionUnit& pu, PelUnitBuf& origBuf, Ref if( !bQTBTMV ) { xSetSearchRange(pu, (bBi ? rcMv : rcMvPred), iSrchRng, cStruct.searchRange -#if JVET_K0157 , cStruct -#endif ); } cStruct.subShiftMode = m_pcEncCfg->getFastInterSearchMode() == FASTINTERSEARCH_MODE1 || m_pcEncCfg->getFastInterSearchMode() == FASTINTERSEARCH_MODE3 ? 2 : 0; @@ -1723,9 +1719,7 @@ void InterSearch::xSetSearchRange ( const PredictionUnit& pu, const Mv& cMvPred, const int iSrchRng, SearchRange& sr -#if JVET_K0157 , IntTZSearchStruct& cStruct -#endif ) { #if !REMOVE_MV_ADAPT_PREC @@ -1763,7 +1757,6 @@ void InterSearch::xSetSearchRange ( const PredictionUnit& pu, sr.right = mvBR.hor; sr.bottom = mvBR.ver; -#if JVET_K0157 if (pu.cs->sps->getSpsNext().getUseCompositeRef() && cStruct.inCtuSearch) { Position posRB = pu.Y().bottomRight(); @@ -1790,7 +1783,6 @@ void InterSearch::xSetSearchRange ( const PredictionUnit& pu, cStruct.zeroMV = 1; } } -#endif } @@ -1969,9 +1961,7 @@ void InterSearch::xTZSearch( const PredictionUnit& pu, Mv currBestMv(cStruct.iBestX, cStruct.iBestY ); currBestMv <<= 2; xSetSearchRange(pu, currBestMv, m_iSearchRange >> (bFastSettings ? 1 : 0), sr -#if JVET_K0157 , cStruct -#endif ); } @@ -2243,9 +2233,7 @@ void InterSearch::xTZSearchSelective( const PredictionUnit& pu, Mv currBestMv(cStruct.iBestX, cStruct.iBestY ); currBestMv <<= 2; xSetSearchRange( pu, currBestMv, m_iSearchRange, sr -#if JVET_K0157 , cStruct -#endif ); } @@ -2445,11 +2433,7 @@ void InterSearch::xPatternSearchFracDIF( CPelBuf cPatternRoi(cStruct.piRefY + iOffset, cStruct.iRefStride, *cStruct.pcPatternKey); -#if JVET_K0157 if (cStruct.imvShift || (pu.cs->sps->getSpsNext().getUseCompositeRef() && cStruct.zeroMV)) -#else - if( cStruct.imvShift ) -#endif { m_pcRdCost->setDistParam( m_cDistParam, *cStruct.pcPatternKey, cStruct.piRefY + iOffset, cStruct.iRefStride, m_lumaClpRng.bd, COMPONENT_Y, 0, 1, m_pcEncCfg->getUseHADME() && !bIsLosslessCoded ); ruiCost = m_cDistParam.distFunc( m_cDistParam ); diff --git a/source/Lib/EncoderLib/InterSearch.h b/source/Lib/EncoderLib/InterSearch.h index a46bd570fd367e0e7040cb67313ecb18908cd648..bcb4c92613cf90b6f40310669717e379f5510e8a 100644 --- a/source/Lib/EncoderLib/InterSearch.h +++ b/source/Lib/EncoderLib/InterSearch.h @@ -161,10 +161,8 @@ protected: uint8_t ucPointNr; int subShiftMode; unsigned imvShift; -#if JVET_K0157 bool inCtuSearch; bool zeroMV; -#endif } IntTZSearchStruct; // sub-functions for ME @@ -274,9 +272,7 @@ protected: const Mv& cMvPred, const int iSrchRng, SearchRange& sr -#if JVET_K0157 , IntTZSearchStruct & cStruct -#endif ); void xPatternSearchFast ( const PredictionUnit& pu,