Commit a17e902b authored by Miroslav Goncharenko's avatar Miroslav Goncharenko Committed by Oleg Nabiullin

[sample_hevc_fei_abr] Minor improvements

Use scoped lock for mutex
Added missed initialization
parent 8259c643
......@@ -405,7 +405,7 @@ public:
virtual void SubmitNewStat(FrameStatData& stat) override
{
queue_mutex.lock();
std::lock_guard<std::mutex> lock(queue_mutex);
// Fill some additional information
stat.Propagation = 1.0 - std::pow(stat.ShareIntra, BRC3_PROPAGATION_EXPONENT);
......@@ -413,8 +413,6 @@ public:
stat.ComplexityOriginal = stat.QstepOriginal*stat.FrameSize;
m_frameStatQueue.Add(stat);
queue_mutex.unlock();
}
private:
......
......@@ -103,7 +103,7 @@ struct HevcTaskDSO
std::vector<mfxI32> m_refListActive[2];
MVPPool::Type m_mvp;
mfxU32 m_nMvPredictors[2];
mfxU32 m_nMvPredictors[2] = {0, 0};
CTUCtrlPool::Type m_ctuCtrl;
bool m_isGPBFrame = false;
......
......@@ -218,7 +218,7 @@ void LA_BRC::UpdateStatData()
void LA_BRC::PreEnc(FrameStatData& /*statData*/)
{
queue_mutex.lock();
std::lock_guard<std::mutex> lock(queue_mutex);
// Shift index of current frame
m_frameStatQueue.StartNewFrameProcessing();
......@@ -307,8 +307,6 @@ void LA_BRC::PreEnc(FrameStatData& /*statData*/)
statData.QstepCalculated = Qp2QStep(m_curQp);
statData.QP = m_curQp;
}
queue_mutex.unlock();
}
void LA_BRC::Report(mfxU32 dataLength)
......
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