History

add option to set decoder statistics log interval add variables into decoder statistics and add statistics log

sijchen@cisco.com committed 9 years ago

Commit fb48e981 parent 47aedcf6 files · +83 −1Browse files

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

Unified · Split

codec/decoder/plus/src/welsDecoderExt.cpp+52−0
@@ -346,6 +346,8 @@ long CWelsDecoder::SetOption (DECODER_OPTION eOptID, void* pOption) { · 345 unmodified lines
346346 WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_WARNING,
347347 "CWelsDecoder::SetOption():DECODER_OPTION_GET_STATISTICS: this option is get-only!");
348348 return cmInitParaError;
349+ } else if (eOptID == DECODER_OPTION_STATISTICS_LOG_INTERVAL) {
350+ m_pDecContext->sDecoderStatistics.iStatisticsLogInterval = (* ((unsigned int*)pOption));
349351 } else if (eOptID == DECODER_OPTION_GET_SAR_INFO) {
350352 WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_WARNING,
351353 "CWelsDecoder::SetOption():DECODER_OPTION_GET_SAR_INFO: this option is get-only!");
@@ -415,6 +417,9 @@ long CWelsDecoder::GetOption (DECODER_OPTION eOptID, void* pOption) { · 63 unmodified lines
415417 m_pDecContext->sDecoderStatistics.uiFreezingNonIDRNum);
416418 }
417419 return cmResultSuccess;
420+ } else if (eOptID == DECODER_OPTION_STATISTICS_LOG_INTERVAL) {
421+ iVal = m_pDecContext->sDecoderStatistics.iStatisticsLogInterval;
422+ * ((unsigned int*)pOption) = iVal;
418423 } else if (DECODER_OPTION_GET_SAR_INFO == eOptID) { //get decoder SAR info in VUI
419424 PVuiSarInfo pVuiSarInfo = (static_cast<PVuiSarInfo> (pOption));
420425 memset (pVuiSarInfo, 0, sizeof (SVuiSarInfo));
@@ -625,9 +630,56 @@ DECODING_STATE CWelsDecoder::DecodeFrame2 (const unsigned char* kpSrc, · 204 unmodified lines
625630 }
626631 iEnd = WelsTime();
627632 m_pDecContext->dDecTime += (iEnd - iStart) / 1e3;
633+
634+ OutputStatisticsLog(m_pDecContext->sDecoderStatistics);
635+
628636 return dsErrorFree;
629637 }
630638
639+void CWelsDecoder::OutputStatisticsLog(SDecoderStatistics& sDecoderStatistics) {
640+ if ((sDecoderStatistics.uiDecodedFrameCount > 0) && (sDecoderStatistics.iStatisticsLogInterval > 0) && ((sDecoderStatistics.uiDecodedFrameCount % sDecoderStatistics.iStatisticsLogInterval) == 0)) {
641+ WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO,
642+ "uiWidth=%d, uiHeight=%d, fAverageFrameSpeedInMs=%.1f, fActualAverageFrameSpeedInMs=%.1f, \
643+ uiDecodedFrameCount=%d, uiResolutionChangeTimes=%d, uiIDRCorrectNum=%d, \
644+ uiAvgEcRatio=%d, uiAvgEcPropRatio=%d, uiEcIDRNum=%d, uiEcFrameNum=%d, \
645+ uiIDRLostNum=%d, uiFreezingIDRNum=%d, uiFreezingNonIDRNum=%d, iAvgLumaQp=%d, \
646+ iSpsReportErrorNum=%d, iSubSpsReportErrorNum=%d, iPpsReportErrorNum=%d, iSpsNoExistNalNum=%d, iSubSpsNoExistNalNum=%d, iPpsNoExistNalNum=%d, \
647+ uiProfile=%d, uiLevel=%d, \
648+ iCurrentActiveSpsId=%d, iCurrentActivePpsId=%d,",
649+ sDecoderStatistics.uiWidth,
650+ sDecoderStatistics.uiHeight,
651+ sDecoderStatistics.fAverageFrameSpeedInMs,
652+ sDecoderStatistics.fActualAverageFrameSpeedInMs,
653+
654+ sDecoderStatistics.uiDecodedFrameCount,
655+ sDecoderStatistics.uiResolutionChangeTimes,
656+ sDecoderStatistics.uiIDRCorrectNum,
657+
658+ sDecoderStatistics.uiAvgEcRatio,
659+ sDecoderStatistics.uiAvgEcPropRatio,
660+ sDecoderStatistics.uiEcIDRNum,
661+ sDecoderStatistics.uiEcFrameNum,
662+
663+ sDecoderStatistics.uiIDRLostNum,
664+ sDecoderStatistics.uiFreezingIDRNum,
665+ sDecoderStatistics.uiFreezingNonIDRNum,
666+ sDecoderStatistics.iAvgLumaQp,
667+
668+ sDecoderStatistics.iSpsReportErrorNum,
669+ sDecoderStatistics.iSubSpsReportErrorNum,
670+ sDecoderStatistics.iPpsReportErrorNum,
671+ sDecoderStatistics.iSpsNoExistNalNum,
672+ sDecoderStatistics.iSubSpsNoExistNalNum,
673+ sDecoderStatistics.iPpsNoExistNalNum,
674+
675+ sDecoderStatistics.uiProfile,
676+ sDecoderStatistics.uiLevel,
677+
678+ sDecoderStatistics.iCurrentActiveSpsId,
679+ sDecoderStatistics.iCurrentActivePpsId);
680+ }
681+}
682+
631683 DECODING_STATE CWelsDecoder::DecodeParser (const unsigned char* kpSrc,
632684 const int kiSrcLen,
633685 SParserBsInfo* pDstInfo) {

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