History

fix uncorrect statistics info issue

ruil2 committed 8 years ago

Commit 52d49f31 parent 68ab6681 file · +8 −8Browse files

Showing the changes to codec/encoder/plus/src/welsEncoderExt.cpp (1 of 1 file). Show all

Unified · Split

codec/encoder/plus/src/welsEncoderExt.cpp+8−8
@@ -638,7 +638,7 @@ void CWelsH264SVCEncoder::UpdateStatistics (SFrameBSInfo* pBsInfo, · 637 unmodified lines
638638 const int32_t kiDeltaFrames = static_cast<int32_t> (pStatistics->uiInputFrameCount -
639639 pStatistics->iLastStatisticsFrameCount);
640640 if (kiDeltaFrames > (m_pEncContext->pSvcParam->fMaxFrameRate * 2)) {
641− if (kiTimeDiff > m_pEncContext->iStatisticsLogInterval) {
641+ if (kiTimeDiff >= m_pEncContext->iStatisticsLogInterval) {
642642 pStatistics->fLatestFrameRate = static_cast<float> ((pStatistics->uiInputFrameCount -
643643 pStatistics->iLastStatisticsFrameCount) * 1000 /
644644 kiTimeDiff);
@@ -661,17 +661,17 @@ void CWelsH264SVCEncoder::UpdateStatistics (SFrameBSInfo* pBsInfo, · 16 unmodified lines
661661 pStatistics->fLatestFrameRate, m_pEncContext->pSvcParam->fMaxFrameRate);
662662 }
663663 }
664− }
664+ // update variables
665+ pStatistics->iLastStatisticsBytes = pStatistics->iTotalEncodedBytes;
666+ pStatistics->iLastStatisticsFrameCount = pStatistics->uiInputFrameCount;
665667
666− // update variables
667− pStatistics->iLastStatisticsBytes = pStatistics->iTotalEncodedBytes;
668− pStatistics->iLastStatisticsFrameCount = pStatistics->uiInputFrameCount;
668+ //TODO: the following statistics will be calculated and added later
669+ //pStatistics->uiLTRSentNum
669670
670− //TODO: the following statistics will be calculated and added later
671− //pStatistics->uiLTRSentNum
671+ }
672672 }
673673 }
674− if (((m_pEncContext->iStatisticsLogInterval > 0) && (kiTimeDiff > m_pEncContext->iStatisticsLogInterval))
674+ if (((m_pEncContext->iStatisticsLogInterval > 0) && (kiTimeDiff >= m_pEncContext->iStatisticsLogInterval))
675675 || (0 == iMaxInputFrame % 300)) {
676676
677677 if ((iMaxFrameRate > 0) && WELS_ABS (iMaxFrameRate - m_pEncContext->pSvcParam->fMaxFrameRate) > 30) {

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