Commit 8a1114b7 authored by Alberto Gonzalez's avatar Alberto Gonzalez

Commit 3

```-------------------------------------------------------------
EncSlice se ha llamado al constructor de EncCu para crear un nuevo objeto antes y después de llamar a compressCtu (líneas 1897-1903)
```

---------------------------------------------------------
Secundariamente:
- Añadido atributo InstraSearch
- Definido constructor de copia de ModeInfo
- Definido constructor de copia de ISPTestedModeInfo
- Definido constructor de copia de EncModeCtrlMTnoRQT
- Definido constructor de copia de IntraSearch
- Continuar definición constructor de copia de InterSearch
------------------------------------------------------------
CONTINUAR CON ATRIBUTOS DE EncCU en la línea marcada con el comentario ///////////CONTINUAR////////////
REVISAR CONSTRUCTOR DE INTRASEARCH PARA ASEGURAR EXCLUSIÓN ENTRE LOS ATRIBUTOS
------------------------------------------------------------
Hasta este punto el encoder funciona con una media de 115 segundos por cada ejecucción
parent c5404035
......@@ -68,7 +68,94 @@ const MergeIdxPair EncCu::m_geoModeTest[GEO_MAX_NUM_CANDS] = {
};
EncCu::EncCu() {}
// ALBERTO
EncCu::EncCu(const EncCu& other) : DecCu(other), m_ibcHashMap(other.m_ibcHashMap), m_geoCostList(other.m_geoCostList), m_comboList(other.m_comboList)
#if JVET_AC0139_UNIFIED_MERGE
,m_mergeItemList(m_mergeItemList)
///////////CONTINUAR////////////
#endif
{
m_bestModeUpdated = other.m_bestModeUpdated;
m_ctxBuffer = other.m_ctxBuffer;
m_CurrCtx = other.m_CurrCtx ? new CtxPair(*other.m_CurrCtx) : nullptr;
m_ctxPool = other.m_ctxPool ? new CtxPool(*other.m_ctxPool) : nullptr;
m_cuChromaQpOffsetIdxPlus1 = other.m_cuChromaQpOffsetIdxPlus1;
m_unitPool = XuPool(other.m_unitPool);
m_pelUnitBufPool = PelUnitBufPool(other.m_pelUnitBufPool);
m_pTempCS = new CodingStructure**(*other.m_pTempCS);
*m_pTempCS = new CodingStructure*();
**m_pTempCS = (**other.m_pTempCS) ? new CodingStructure(***other.m_pTempCS) : nullptr;
m_pBestCS = new CodingStructure**(*other.m_pBestCS);
*m_pBestCS = new CodingStructure*();
**m_pBestCS = (**other.m_pBestCS) ? new CodingStructure(***other.m_pBestCS) : nullptr;
m_pTempCS2 = new CodingStructure**(*other.m_pTempCS2);
*m_pTempCS2 = new CodingStructure*();
**m_pTempCS2 = (**other.m_pTempCS2) ? new CodingStructure(***other.m_pTempCS2) : nullptr;
m_pBestCS2 = new CodingStructure**(*other.m_pBestCS2);
*m_pBestCS2 = new CodingStructure*();
**m_pBestCS2 = (**other.m_pBestCS2) ? new CodingStructure(***other.m_pBestCS2) : nullptr;
m_pcEncCfg = other.m_pcEncCfg ? new EncCfg(*other.m_pcEncCfg) : nullptr;
m_pcIntraSearch = other.m_pcIntraSearch ? new IntraSearch(*other.m_pcIntraSearch) : nullptr;
m_pcInterSearch = other.m_pcInterSearch ? new InterSearch(*other.m_pcInterSearch) : nullptr;
m_pcTrQuant = other.m_pcTrQuant ? new TrQuant(*other.m_pcTrQuant) : nullptr;
m_pcRdCost = other.m_pcRdCost ? new RdCost(*other.m_pcRdCost) : nullptr;
m_pcSliceEncoder = other.m_pcSliceEncoder ? new EncSlice(*other.m_pcSliceEncoder) : nullptr;
m_deblockingFilter = other.m_deblockingFilter ? new DeblockingFilter(*other.m_deblockingFilter) : nullptr;
m_CABACEstimator = other.m_CABACEstimator ? new CABACWriter(*other.m_CABACEstimator) : nullptr;
m_pcRateCtrl = other.m_pcRateCtrl ? new RateCtrl(*other.m_pcRateCtrl) : nullptr;
m_modeCtrl = other.m_modeCtrl ? new EncModeCtrlMTnoRQT(*(dynamic_cast<EncModeCtrlMTnoRQT*>(other.m_modeCtrl))) : nullptr; //REVISAR M_MODE_CTRL COMPLETO ANTES DE CONTINUAR/////////////////////////////////////////////////////////////////
#if !JVET_AC0139_UNIFIED_MERGE
std::array<PelStorage, GEO_MAX_TRY_WEIGHTED_SAD> m_geoWeightedBuffers; // weighted prediction pixels
for (int i = 0; i < m_geoWeightedBuffers.size(); i++)
{
m_geoWeightedBuffers[i] = other.m_geoWeightedBuffers[i];
}
#endif
m_AFFBestSATDCost = other.m_AFFBestSATDCost;
m_mergeBestSATDCost = m_mergeBestSATDCost;
for (int i = 0; i< (MAX_CU_SIZE * MAX_CU_SIZE) >> (MIN_CU_LOG2 << 1) ;i++)
{
m_SubPuMiBuf[i] = MotionInfo(other.m_SubPuMiBuf[i]);
}
m_ctuIbcSearchRangeX = other.m_ctuIbcSearchRangeX;
m_ctuIbcSearchRangeY = other.m_ctuIbcSearchRangeY;
for (int i = 0; i < m_bestBcwIdx.size(); i++)
{
m_bestBcwIdx[i] = other.m_bestBcwIdx[i];
}
for (int i = 0; i < m_bestBcwCost.size(); i++)
{
m_bestBcwCost[i] = other.m_bestBcwCost[i];
}
for (int i = 0; i < 2; i++)
{
m_sbtCostSave[i] = other.m_sbtCostSave[i];
}
///////////CONTINUAR////////////
}
// END ALBERTO
void EncCu::create( EncCfg* encCfg )
{
unsigned uiMaxWidth = encCfg->getMaxCUWidth();
......
......@@ -326,37 +326,7 @@ public:
EncCfg* getEncCfg() const { return m_pcEncCfg; }
//ALBERTO
EncCu(const EncCu& other) : DecCu(other)
{
m_bestModeUpdated = other.m_bestModeUpdated;
m_ctxBuffer = other.m_ctxBuffer;
m_CurrCtx = other.m_CurrCtx ? new CtxPair(*other.m_CurrCtx) : nullptr;
m_ctxPool = other.m_ctxPool ? new CtxPool(*other.m_ctxPool) : nullptr;
m_cuChromaQpOffsetIdxPlus1 = other.m_cuChromaQpOffsetIdxPlus1;
m_unitPool = XuPool(other.m_unitPool);
m_pelUnitBufPool = PelUnitBufPool(other.m_pelUnitBufPool);
m_pTempCS = new CodingStructure**(*other.m_pTempCS);
*m_pTempCS = new CodingStructure*();
**m_pTempCS = (**other.m_pTempCS) ? new CodingStructure(***other.m_pTempCS) : nullptr;
m_pBestCS = new CodingStructure**(*other.m_pBestCS);
*m_pBestCS = new CodingStructure*();
**m_pBestCS = (**other.m_pBestCS) ? new CodingStructure(***other.m_pBestCS) : nullptr;
m_pTempCS2 = new CodingStructure**(*other.m_pTempCS2);
*m_pTempCS2 = new CodingStructure*();
**m_pTempCS2 = (**other.m_pTempCS2) ? new CodingStructure(***other.m_pTempCS2) : nullptr;
m_pBestCS2 = new CodingStructure**(*other.m_pBestCS2);
*m_pBestCS2 = new CodingStructure*();
**m_pBestCS2 = (**other.m_pBestCS2) ? new CodingStructure(***other.m_pBestCS2) : nullptr;
m_pcEncCfg = other.m_pcEncCfg ? new EncCfg(*other.m_pcEncCfg) : nullptr;
m_pcIntraSearch = other.m_pcIntraSearch ? new IntraSearch(*other.m_pcIntraSearch) : nullptr;
///////////CONTINUAR////////////
}
EncCu(const EncCu& other);
//END ALBERTO
EncCu();
~EncCu();
......
......@@ -64,6 +64,8 @@ void EncModeCtrl::init( EncCfg *pCfg, RateCtrl *pRateCtrl, RdCost* pRdCost )
#endif
}
bool EncModeCtrl::tryModeMaster( const EncTestMode& encTestmode, const CodingStructure &cs, Partitioner& partitioner )
{
return tryMode( encTestmode, cs, partitioner );
......
......@@ -347,6 +347,12 @@ public:
//END ALBERTO
virtual ~EncModeCtrl () {}
//ALBERTO
const EncCfg* getEncCfg()
{
return m_pcEncCfg;
}
//END ALBERTO
virtual void create ( const EncCfg& cfg ) = 0;
virtual void destroy () = 0;
virtual void initCTUEncoding ( const Slice &slice ) = 0;
......
......@@ -120,6 +120,81 @@ InterSearch::InterSearch()
m_histBestMtsIdx = MtsType::NONE;
}
InterSearch::InterSearch(const InterSearch& other) : InterPrediction(other), AffineGradientSearch(other)
{
if (other.m_modeCtrl && other.m_modeCtrl->getEncCfg())
{
m_modeCtrl = new EncModeCtrlMTnoRQT();
m_modeCtrl->create(*other.m_modeCtrl->getEncCfg());
/*EncModeCtrl(const EncModeCtrl& other)
{
m_pcEncCfg = other.m_pcEncCfg ? new EncCfg(*other.m_pcEncCfg) : nullptr;
m_pcRateCtrl = other.m_pcRateCtrl ? new class RateCtrl(*other.m_pcRateCtrl) : nullptr;
m_pcRdCost = other.m_pcRdCost ? new RdCost(*other.m_pcRdCost) : nullptr;
m_slice = other.m_slice ? new Slice(*other.m_slice) : nullptr;
for (int i = 0; i < LUMA_LEVEL_TO_DQP_LUT_MAXSIZE; i++)
{
m_lumaLevelToDeltaQPLUT[i] = other.m_lumaLevelToDeltaQPLUT[i];
}
m_lumaQPOffset = other.m_lumaQPOffset;
m_bimQPMap = new std::map<int, int*>;
*m_bimQPMap = *other.m_bimQPMap;
for (auto& pair: *m_bimQPMap)
{
int* value = pair.second;
int* copy = new int(*value);
pair.second = copy;
}
m_fastDeltaQP = other.m_fastDeltaQP;
m_ComprCUCtxList = other.m_ComprCUCtxList;
m_pcInterSearch = other.m_pcInterSearch ? new InterSearch(*other.m_pcInterSearch) : nullptr;
m_doPlt = other.m_doPlt;
}*/
}
else
{
m_modeCtrl = nullptr;
}
//? new EncModeCtrlMTnoRQT(*static_cast<EncModeCtrlMTnoRQT*>(other.m_modeCtrl)) : nullptr; // CONTINUAR/////////////////////////////////////////////////////////////////
for (int i = 0; i < NUM_REF_PIC_LIST_01; i++)
{
m_tmpPredStorage[i].createFromBuf(other.m_tmpPredStorage[i]);
}
m_tmpStorageCtu.createFromBuf(other.m_tmpStorageCtu);
m_tmpAffiStorage.createFromBuf(other.m_tmpAffiStorage);
m_tmpAffiError = other.m_tmpAffiError ? new Pel(*other.m_tmpAffiError) : nullptr;
for (int i = 0; i < 2; i++)
{
m_tmpAffiDeri[i] = other.m_tmpAffiDeri[i] ? new int(*other.m_tmpAffiDeri[i]) : nullptr;
}
m_pSplitCS = new CodingStructure***();
*m_pSplitCS = new CodingStructure**();
**m_pSplitCS = new CodingStructure*();
*** m_pSplitCS = other.m_pSplitCS && *other.m_pSplitCS && **other.m_pSplitCS && ***other.m_pSplitCS ? new CodingStructure(****other.m_pSplitCS) : nullptr;
m_pFullCS = new CodingStructure***();
*m_pFullCS = new CodingStructure**();
**m_pFullCS = new CodingStructure*();
*** m_pFullCS = other.m_pFullCS && *other.m_pFullCS && **other.m_pFullCS && ***other.m_pFullCS ? new CodingStructure(****other.m_pFullCS) : nullptr;
m_pSaveCS = new CodingStructure*();
*m_pSaveCS = other.m_pSaveCS && *other.m_pSaveCS ? new CodingStructure(**other.m_pSaveCS) : nullptr;
/*ClpRng m_lumaClpRng;
uint32_t m_estWeightIdxBits[BCW_NUM];
BcwMotionParam m_uniMotions;
bool m_affineModeSelected;
std::unordered_map<Position, std::unordered_map<Size, BlkRecord>> m_ctuRecord;
AffineMVInfo* m_affMVList;*/
}
void InterSearch::destroy()
{
......
......@@ -55,6 +55,9 @@
#include <unordered_map>
#include <vector>
#include "EncReshape.h"
//! \ingroup EncoderLib
//! \{
......@@ -70,7 +73,6 @@ struct BlkRecord
std::unordered_map<Mv, Distortion> bvRecord;
};
class EncModeCtrl;
struct AffineMVInfo
{
RefSetArray<Mv[3]> affMVs;
......@@ -192,6 +194,9 @@ protected:
public:
InterSearch();
//ALBERTO
InterSearch(const InterSearch& other);
//END ALBERTO
virtual ~InterSearch();
void init(EncCfg *pcEncCfg, TrQuant *pcTrQuant, int searchRange, int bipredSearchRange,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment