Commit 02f25974 authored by Alberto Gonzalez's avatar Alberto Gonzalez

Commit nº 5 (08-03-2023)

```------------------------------------------------------
Revisados los constructores de copia hasta PelUnitBufPool
```

---------------------------------------------------------
parent dd34037e
......@@ -1080,6 +1080,21 @@ private:
public:
PelUnitBufPool();
PelUnitBufPool(const PelUnitBufPool& other)
: m_pelStoragePool(other.m_pelStoragePool)
, m_pelUnitBufPool(other.m_pelUnitBufPool)
, m_chromaFormat(other.m_chromaFormat)
, m_ctuArea(other.m_ctuArea)
{
m_pelStoragePool = Pool<PelStorage>(other.m_pelStoragePool);
m_pelUnitBufPool = Pool<PelUnitBuf>(other.m_pelUnitBufPool);
for (auto& kv: other.m_map)
{
m_map[kv.first] = m_pelStoragePool.get(); // hacer una copia profunda de la PelStorage
m_map[kv.first]->copyFrom(*kv.second);
}
}
~PelUnitBufPool();
void initPelUnitBufPool(ChromaFormat chromaFormat, int ctuWidth, int ctuHeight);
......
......@@ -95,6 +95,7 @@ CodingStructure::CodingStructure(XuPool &xuPool)
firstColorSpaceTestOnly = false;
}
void CodingStructure::destroy()
{
picture = nullptr;
......
......@@ -959,5 +959,8 @@ Ctx::Ctx(const BinProbModel_Std *dummy) : m_bpmType(BpmType::STD), m_CtxStore_St
Ctx::Ctx(const Ctx &ctx) : m_bpmType(ctx.m_bpmType), m_CtxStore_Std(ctx.m_CtxStore_Std)
{
::memcpy( m_GRAdaptStats, ctx.m_GRAdaptStats, sizeof( unsigned ) * RExt__GOLOMB_RICE_ADAPTATION_STATISTICS_SETS );
//ALBERTO
m_baseLevel = ctx.m_baseLevel;
//END ALBERTO
}
......@@ -1408,6 +1408,16 @@ template<typename T> class Pool
std::vector<T *> m_items;
public:
////ALBERTO
Pool() = default;
Pool(const Pool& other)
{
for (auto& item : other.m_items)
{
m_items.push_back(new T(*item));
}
}
////END ALBERTO
~Pool() { deleteEntries(); }
void deleteEntries()
......
......@@ -6105,13 +6105,6 @@ EncCu EncCu::copy(EncCu& original)
/*COPIAMOS VECTOR QUE CONTIENE CTXPAIR*/
std::vector<CtxPair> m_ctxBufferCopy(original.m_ctxBuffer.size());
for (size_t i = 0; i < original.m_ctxBuffer.size(); i++)
{
CtxPair newCtxPair;
newCtxPair.start = Ctx(original.m_ctxBuffer[i].start);
newCtxPair.best = Ctx(original.m_ctxBuffer[i].best);
m_ctxBufferCopy[i] = newCtxPair;
}
copy.m_ctxBuffer = m_ctxBufferCopy;
/*COPIAMOS PUNTERO CTXPAIR*/
......@@ -6130,10 +6123,10 @@ EncCu EncCu::copy(EncCu& original)
copy.m_cuChromaQpOffsetIdxPlus1 = original.m_cuChromaQpOffsetIdxPlus1;
/*COPIAMOS OBJETO XUPOOL*/
copy.m_unitPool = *(new XuPool(original.m_unitPool));
copy.m_unitPool = XuPool(original.m_unitPool);
/*COPIAMOS OBJETO PelUnitBufPool*/
copy.m_pelUnitBufPool = *(new PelUnitBufPool(original.m_pelUnitBufPool));
copy.m_pelUnitBufPool = PelUnitBufPool(original.m_pelUnitBufPool);
/*COPIAMOS PUNTEROS TRIPLES CODINGSTRUCTURE*/
CodingStructure*** m_pTempCSCopy = new CodingStructure**;
......
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