Commit ff10c667 authored by Alberto Gonzalez's avatar Alberto Gonzalez

Commit concept fork

```--------------------------------------------------------------
Código funcionando para 4 threads
```

--------------------------------------------------------------
parent b8cc94aa
This diff is collapsed.
...@@ -320,23 +320,21 @@ private: ...@@ -320,23 +320,21 @@ private:
#endif #endif
public: public:
/// copy parameters from encoder class
void init ( EncLib* pcEncLib, const SPS& sps );
//ALBERTO CONCEPT FORK //ALBERTO CONCEPT FORK
void createSharedVector(); void createSharedVector();
void repartLevel(); /*void repartLevel();
int repartStart(); int repartStart();
int repartEnd(); int repartEnd();
void initStructVectorBeforeRepartStart(int repartStartNode); void initStructVectorBeforeRepartStart(int repartStartNode);
int thread1NumberOfChild(int numberOfNodesPerThread); int thread1NumberOfChild(int numberOfNodesPerThread);*/
void initStructVector(); void initStructVector();
void updateFatherAndThreadNumbersLevel0(int posPadreActual,int thread1ChildNumber,int numberOfNodesPerThread); void updateFatherAndThreadNumbersLevel0(int posPadreActual);//,int thread1ChildNumber,int numberOfNodesPerThread);
void updateFatherAndThreadNumbers(int LevelLowIndex, int LevelUpIndex, int posPadreActual, int i,int LevelActualIndex,int& childCounter,int thread1ChildNumber,int& threadNumber,int numberOfNodesPerThread); void updateFatherAndThreadNumbers(int LevelLowIndex, int LevelUpIndex, int posPadreActual, int i);//,int LevelActualIndex,int& childCounter,int thread1ChildNumber,int& threadNumber,int numberOfNodesPerThread);
void cleanCostModeVector();
// END ALBERTO CONCEPT FORK // END ALBERTO CONCEPT FORK
/// copy parameters from encoder class
void init ( EncLib* pcEncLib, const SPS& sps );
void setDecCuReshaperInEncCU(EncReshape* pcReshape, ChromaFormat chromaFormatIdc) void setDecCuReshaperInEncCU(EncReshape* pcReshape, ChromaFormat chromaFormatIdc)
{ {
initDecCuReshaper((Reshape*) pcReshape, chromaFormatIdc); initDecCuReshaper((Reshape*) pcReshape, chromaFormatIdc);
...@@ -347,9 +345,10 @@ public: ...@@ -347,9 +345,10 @@ public:
/// destroy internal buffers /// destroy internal buffers
void destroy (); void destroy ();
//ALBERTO CONCEPT FORK //ALBERTO CONCEPT FORK
void compressCtuForks(CodingStructure *&tempCS, CodingStructure *&bestCS, Partitioner &partitioner); void compressCtuForks(CodingStructure *&tempCS, CodingStructure *&bestCS, Partitioner &partitioner);
void reduceVector();
void cleanCostModeVector();
//END ALBERTO CONCEPT FORK //END ALBERTO CONCEPT FORK
/// CTU analysis function /// CTU analysis function
...@@ -382,12 +381,7 @@ protected: ...@@ -382,12 +381,7 @@ protected:
xCheckBestMode ( CodingStructure *&tempCS, CodingStructure *&bestCS, Partitioner &pm, const EncTestMode& encTestmode ); xCheckBestMode ( CodingStructure *&tempCS, CodingStructure *&bestCS, Partitioner &pm, const EncTestMode& encTestmode );
//ALBERTO CONCEPT FORK //ALBERTO CONCEPT FORK
bool digits_below_or_equal(std::string a, std::string b);
int determinePosNodeInVectorRec(std::string posNode, std::string posSearch, int index, int counter);
int determinePosNodeInVector(std::string posNode);
int searchFirstChildEmpty(int posFather);
int searchFirstChild(int posFather); int searchFirstChild(int posFather);
void reduceVector();
// END ALBERTO CONCEPT FORK // END ALBERTO CONCEPT FORK
void xCheckModeSplit(CodingStructure *&tempCS, CodingStructure *&bestCS, Partitioner &pm, const EncTestMode &encTestMode, const ModeType modeTypeParent, bool &skipInterPass, double *splitRdCostBest); void xCheckModeSplit(CodingStructure *&tempCS, CodingStructure *&bestCS, Partitioner &pm, const EncTestMode &encTestMode, const ModeType modeTypeParent, bool &skipInterPass, double *splitRdCostBest);
......
...@@ -104,10 +104,25 @@ bool EncModeCtrl::nextMode( const CodingStructure &cs, Partitioner &partitioner ...@@ -104,10 +104,25 @@ bool EncModeCtrl::nextMode( const CodingStructure &cs, Partitioner &partitioner
} }
//ALBERTO CONCEPT FORK //ALBERTO CONCEPT FORK
bool EncModeCtrl::lastModeAvailable( const CodingStructure &cs, Partitioner &partitioner ) bool EncModeCtrl::lastModeAvailable() const
{ {
return !m_ComprCUCtxList.empty() && !m_ComprCUCtxList.back().testModes.empty() && m_ComprCUCtxList.back().testModes.size()==1; return !m_ComprCUCtxList.empty() && !m_ComprCUCtxList.back().testModes.empty() && m_ComprCUCtxList.back().testModes.size()==1;
} }
bool EncModeCtrl::vectorModeAvailable(int objetiveModeType) const
{
bool vectorModeAvailable = false;
const auto& lastElem = m_ComprCUCtxList.back();
const auto& testModes = lastElem.testModes;
for (const auto& actualMode : testModes)
{
if(actualMode.type == objetiveModeType)
{
vectorModeAvailable = true;
}
}
return vectorModeAvailable;
}
//END ALBERTO CONCEPT FORK //END ALBERTO CONCEPT FORK
EncTestMode EncModeCtrl::currTestMode() const EncTestMode EncModeCtrl::currTestMode() const
......
...@@ -327,7 +327,8 @@ public: ...@@ -327,7 +327,8 @@ public:
bool tryModeMaster ( const EncTestMode& encTestmode, const CodingStructure &cs, Partitioner& partitioner ); bool tryModeMaster ( const EncTestMode& encTestmode, const CodingStructure &cs, Partitioner& partitioner );
bool nextMode ( const CodingStructure &cs, Partitioner &partitioner ); bool nextMode ( const CodingStructure &cs, Partitioner &partitioner );
//ALBERTO CONCEPT FORK //ALBERTO CONCEPT FORK
bool lastModeAvailable(const CodingStructure &cs, Partitioner &partitioner); bool lastModeAvailable() const;
bool vectorModeAvailable(int modeType) const;
//END ALBERTO CONCEPT FORK //END ALBERTO CONCEPT FORK
EncTestMode currTestMode() const; EncTestMode currTestMode() const;
EncTestMode lastTestMode () const; EncTestMode lastTestMode () const;
......
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