diff --git a/source/Lib/EncoderLib/EncCu.cpp b/source/Lib/EncoderLib/EncCu.cpp index 82baa81d0bb273fd46b9d58e0a555200201360a1..d992a46a5556d7a0a667969c3d4ed297ed51cc08 100644 --- a/source/Lib/EncoderLib/EncCu.cpp +++ b/source/Lib/EncoderLib/EncCu.cpp @@ -6103,20 +6103,107 @@ EncCu EncCu::copy(EncCu& original) copy.m_ctxBuffer = m_ctxBufferCopy; if (original.m_CurrCtx != NULL) /*Puede ser nulo*/ { - CtxPair m_CurrCtxCopy(*original.m_CurrCtx); - copy.m_CurrCtx = &m_CurrCtxCopy; + CtxPair* m_CurrCtxCopy = new CtxPair(*original.m_CurrCtx); + copy.m_CurrCtx = m_CurrCtxCopy; } else { copy.m_CurrCtx = NULL; } - CtxPool m_ctxPoolCopy(*original.m_ctxPool); - copy.m_ctxPool = &m_ctxPoolCopy; + CtxPool* m_ctxPoolCopy = new CtxPool(*original.m_ctxPool); + copy.m_ctxPool = m_ctxPoolCopy; copy.m_cuChromaQpOffsetIdxPlus1 = original.m_cuChromaQpOffsetIdxPlus1; XuPool m_unitPoolCopy(original.m_unitPool); copy.m_unitPool = m_unitPoolCopy; + PelUnitBufPool m_pelUnitBufPoolCopy(original.m_pelUnitBufPool); + copy.m_pelUnitBufPool = m_pelUnitBufPoolCopy; + + + CodingStructure*** m_pTempCSCopy = new CodingStructure**; + *m_pTempCSCopy = new CodingStructure*; + **m_pTempCSCopy = **original.m_pTempCS; // Copia los datos del objeto apuntado por m_pTempCS en la nueva variable + copy.m_pTempCS = m_pTempCSCopy; + + CodingStructure*** m_pBestCSCopy = new CodingStructure**; + *m_pBestCSCopy = new CodingStructure*; + **m_pBestCSCopy = **original.m_pBestCS; // Copia los datos del objeto apuntado por m_pBestCS en la nueva variable + copy.m_pBestCS = m_pBestCSCopy; + + CodingStructure*** m_pTempCS2Copy = new CodingStructure**; + *m_pTempCS2Copy = new CodingStructure*; + **m_pTempCS2Copy = **original.m_pTempCS2; // Copia los datos del objeto apuntado por m_pTempCS2 en la nueva variable + copy.m_pTempCS2 = m_pTempCS2Copy; + + CodingStructure*** m_pBestCS2Copy = new CodingStructure**; + *m_pBestCS2Copy = new CodingStructure*; + **m_pBestCS2Copy = **original.m_pBestCS2; // Copia los datos del objeto apuntado por m_pBestCS2 en la nueva variable + copy.m_pBestCS2 = m_pBestCS2Copy; + + EncCfg* m_pcEncCfgCopy = new EncCfg(*original.m_pcEncCfg); + copy.m_pcEncCfg = m_pcEncCfgCopy; + + IntraSearch* m_pcIntraSearchCopy = new IntraSearch(*original.m_pcIntraSearch); + copy.m_pcIntraSearch = m_pcIntraSearchCopy; + + InterSearch* m_pcInterSearchCopy = new InterSearch(*original.m_pcInterSearch); + copy.m_pcInterSearch = m_pcInterSearchCopy; + + TrQuant* m_pcTrQuantCopy = new TrQuant(*original.m_pcTrQuant); + copy.m_pcTrQuant = m_pcTrQuantCopy; + + RdCost* m_pcRdCostCopy = new RdCost(*original.m_pcRdCost); + copy.m_pcRdCost = m_pcRdCostCopy; + + EncSlice* m_pcSliceEncoderCopy = new EncSlice(*original.m_pcSliceEncoder); + copy.m_pcSliceEncoder = m_pcSliceEncoderCopy; + + DeblockingFilter* m_deblockingFilterCopy = new DeblockingFilter(*original.m_deblockingFilter); + copy.m_deblockingFilter = m_deblockingFilterCopy; + + CABACWriter* m_CABACEstimatorCopy = new CABACWriter(*original.m_CABACEstimator); + copy.m_CABACEstimator = m_CABACEstimatorCopy; + + RateCtrl* m_pcRateCtrlCopy = new RateCtrl(*original.m_pcRateCtrl); + copy.m_pcRateCtrl = m_pcRateCtrlCopy; + + IbcHashMap* m_ibcHashMapCopy = new IbcHashMap(original.m_ibcHashMap); + copy.m_ibcHashMap = *m_ibcHashMapCopy; + + EncModeCtrlMTnoRQT* m_modeCtrlDerived = dynamic_cast(original.m_modeCtrl); //Downcasting + EncModeCtrl* m_modeCtrlCopy = new EncModeCtrlMTnoRQT(*m_modeCtrlDerived); //Upcasting + copy.m_modeCtrl = m_modeCtrlCopy; + + FastGeoCostList* m_geoCostListCopy = new FastGeoCostList(original.m_geoCostList); + copy.m_geoCostList = *m_geoCostListCopy; + + copy.m_AFFBestSATDCost = original.m_AFFBestSATDCost; + copy.m_mergeBestSATDCost = original.m_mergeBestSATDCost; + + for (int i = 0; i < (MAX_CU_SIZE * MAX_CU_SIZE) >> (MIN_CU_LOG2 << 1); i++) + { + copy.m_SubPuMiBuf[i] = *new MotionInfo(original.m_SubPuMiBuf[i]); //obtenemos el original, creamos nuevo y asignamos contenido al array copia + } + + copy.m_ctuIbcSearchRangeX = original.m_ctuIbcSearchRangeX; + copy.m_ctuIbcSearchRangeY = original.m_ctuIbcSearchRangeY; + + copy.m_bestBcwIdx = original.m_bestBcwIdx; + copy.m_bestBcwCost = original.m_bestBcwCost; + + + //static const MergeIdxPair m_geoModeTest[GEO_MAX_NUM_CANDS]; + for (int i = 0; i < 2; i++) { + copy.m_sbtCostSave[i] = original.m_sbtCostSave[i]; + } + + GeoComboCostList* m_comboListCopy = new GeoComboCostList(original.m_comboList); + copy.m_comboList = *m_comboListCopy; + + MergeItemList* m_mergeItemListCopy = new MergeItemList(original.m_mergeItemList); + copy.m_mergeItemList = *m_mergeItemListCopy; + //@TODO return copy; diff --git a/source/Lib/EncoderLib/EncCu.h b/source/Lib/EncoderLib/EncCu.h index 189e757a91ae5751439dfa0970364a5d1d14f402..b605b02d0892dc96c2cd7b5ad34e5b7250005916 100644 --- a/source/Lib/EncoderLib/EncCu.h +++ b/source/Lib/EncoderLib/EncCu.h @@ -233,17 +233,17 @@ public: Ctx best; }; - std::vector m_ctxBuffer; //copy checked - CtxPair* m_CurrCtx; //copy not checked because null - CtxPool *m_ctxPool; //copy checked + std::vector m_ctxBuffer; //copy + CtxPair* m_CurrCtx; //copy + CtxPool *m_ctxPool; //copy // Data : encoder control int m_cuChromaQpOffsetIdxPlus1; // if 0, then cu_chroma_qp_offset_flag will be 0, otherwise cu_chroma_qp_offset_flag will be 1. copy checked - XuPool m_unitPool; //copy not - PelUnitBufPool m_pelUnitBufPool; + XuPool m_unitPool; //copy + PelUnitBufPool m_pelUnitBufPool;//copy - CodingStructure ***m_pTempCS; + CodingStructure ***m_pTempCS; //copy CodingStructure ***m_pBestCS; CodingStructure ***m_pTempCS2; CodingStructure ***m_pBestCS2; diff --git a/source/Lib/EncoderLib/EncSlice.cpp b/source/Lib/EncoderLib/EncSlice.cpp index 5a00bf34dd80073251683c9eedfcc9d52ee72745..7a6aa8ae2849ef7ae0bab0a8a17747973ed02361 100644 --- a/source/Lib/EncoderLib/EncSlice.cpp +++ b/source/Lib/EncoderLib/EncSlice.cpp @@ -1895,10 +1895,11 @@ void EncSlice::encodeCtus( Picture* pcPic, const bool bCompressEntireSlice, cons { //ALBERTO EncCu m_pcCuEncoder_copy = m_pcCuEncoder->copy(*m_pcCuEncoder); + bool stopDebugger1 = true; //END ALBERTO m_pcCuEncoder->compressCtu(cs, ctuArea, ctuRsAddr, prevQP, currQP); - bool stopDebugger = true; + bool stopDebugger2 = true; #if GREEN_METADATA_SEI_ENABLED FeatureCounterStruct m_featureCounter = pcPic->getFeatureCounter(); countFeatures(m_featureCounter, cs,ctuArea);