History

add flag to count EC Mbs due to ref error add UT

dong zhang committed 11 years ago

Commit 2c468b91 parent ecc8ae611 files · +69 −25Browse files

Showing the changes to codec/decoder/plus/src/welsDecoderExt.cpp (1 of 11 files). Show all

Unified · Split

codec/decoder/plus/src/welsDecoderExt.cpp+6−6
@@ -385,8 +385,6 @@ DECODING_STATE CWelsDecoder::DecodeFrame2 (const unsigned char* kpSrc, · 384 unmodified lines
385385 const int kiSrcLen,
386386 unsigned char** ppDst,
387387 SBufferInfo* pDstInfo) {
388− m_pDecContext->iMbEcedNum = 0;
389− m_pDecContext->iMbNum = 0;
390388 if (CheckBsBuffer (m_pDecContext, kiSrcLen)) {
391389 return dsOutOfMemory;
392390 }
@@ -480,10 +478,12 @@ DECODING_STATE CWelsDecoder::DecodeFrame2 (const unsigned char* kpSrc, · 87 unmodified lines
480478 ResetDecStatNums (&m_pDecContext->sDecoderStatistics);
481479 m_pDecContext->sDecoderStatistics.uiDecodedFrameCount++;
482480 }
483− m_pDecContext->sDecoderStatistics.uiAvgEcRatio = m_pDecContext->iMbEcedNum == 0 ? (m_pDecContext->sDecoderStatistics.uiAvgEcRatio * m_pDecContext->sDecoderStatistics.uiEcFrameNum) :((m_pDecContext->sDecoderStatistics.uiAvgEcRatio * m_pDecContext->sDecoderStatistics.uiEcFrameNum) + ((m_pDecContext->iMbEcedNum * 100) / m_pDecContext->iMbNum));
484− m_pDecContext->sDecoderStatistics.uiEcFrameNum++;
485− m_pDecContext->sDecoderStatistics.uiAvgEcRatio = m_pDecContext->sDecoderStatistics.uiAvgEcRatio /
486− m_pDecContext->sDecoderStatistics.uiEcFrameNum;
481+ int32_t iMbConcealedNum = m_pDecContext->iMbEcedNum + m_pDecContext->iMbEcedPropNum;
482+ m_pDecContext->sDecoderStatistics.uiAvgEcRatio = iMbConcealedNum == 0 ? (m_pDecContext->sDecoderStatistics.uiAvgEcRatio * m_pDecContext->sDecoderStatistics.uiEcFrameNum) :((m_pDecContext->sDecoderStatistics.uiAvgEcRatio * m_pDecContext->sDecoderStatistics.uiEcFrameNum) + ((iMbConcealedNum * 100) / m_pDecContext->iMbNum));
483+ m_pDecContext->sDecoderStatistics.uiAvgEcPropRatio = m_pDecContext->iMbEcedPropNum == 0 ? (m_pDecContext->sDecoderStatistics.uiAvgEcPropRatio * m_pDecContext->sDecoderStatistics.uiEcFrameNum) :((m_pDecContext->sDecoderStatistics.uiAvgEcPropRatio * m_pDecContext->sDecoderStatistics.uiEcFrameNum) + ((m_pDecContext->iMbEcedPropNum * 100) / m_pDecContext->iMbNum));
484+ m_pDecContext->sDecoderStatistics.uiEcFrameNum += (iMbConcealedNum == 0 ? 0 : 1);
485+ m_pDecContext->sDecoderStatistics.uiAvgEcRatio = m_pDecContext->sDecoderStatistics.uiEcFrameNum == 0? 0 : m_pDecContext->sDecoderStatistics.uiAvgEcRatio / m_pDecContext->sDecoderStatistics.uiEcFrameNum;
486+ m_pDecContext->sDecoderStatistics.uiAvgEcPropRatio = m_pDecContext->sDecoderStatistics.uiEcFrameNum == 0? 0 : m_pDecContext->sDecoderStatistics.uiAvgEcPropRatio / m_pDecContext->sDecoderStatistics.uiEcFrameNum;
487487 }
488488 iEnd = WelsTime();
489489 m_pDecContext->dDecTime += (iEnd - iStart) / 1e3;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t