History

add parseoly statistics

huili2 committed 9 years ago

Commit 5cd3c5d1 parent 7f172774 files · +164 −63Browse files

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

Unified · Split

codec/decoder/plus/src/welsDecoderExt.cpp+46−49
@@ -585,14 +585,6 @@ DECODING_STATE CWelsDecoder::DecodeFrame2 (const unsigned char* kpSrc, · 584 unmodified lines
585585 //TODO after dec status updated
586586 m_pDecContext->iErrorCode |= dsDataErrorConcealed;
587587
588− //
589− if ((m_pDecContext->sDecoderStatistics.uiWidth != (unsigned int) pDstInfo->UsrData.sSystemBuffer.iWidth)
590− || (m_pDecContext->sDecoderStatistics.uiHeight != (unsigned int) pDstInfo->UsrData.sSystemBuffer.iHeight)) {
591− m_pDecContext->sDecoderStatistics.uiResolutionChangeTimes++;
592− m_pDecContext->sDecoderStatistics.uiWidth = pDstInfo->UsrData.sSystemBuffer.iWidth;
593− m_pDecContext->sDecoderStatistics.uiHeight = pDstInfo->UsrData.sSystemBuffer.iHeight;
594−
595− }
596588 m_pDecContext->sDecoderStatistics.uiDecodedFrameCount++;
597589 if (m_pDecContext->sDecoderStatistics.uiDecodedFrameCount == 0) { //exceed max value of uint32_t
598590 ResetDecStatNums (&m_pDecContext->sDecoderStatistics);
@@ -626,24 +618,18 @@ DECODING_STATE CWelsDecoder::DecodeFrame2 (const unsigned char* kpSrc, · 27 unmodified lines
626618 ResetDecStatNums (&m_pDecContext->sDecoderStatistics);
627619 m_pDecContext->sDecoderStatistics.uiDecodedFrameCount++;
628620 }
629−
630− if ((m_pDecContext->sDecoderStatistics.uiWidth != (unsigned int) pDstInfo->UsrData.sSystemBuffer.iWidth)
631− || (m_pDecContext->sDecoderStatistics.uiHeight != (unsigned int) pDstInfo->UsrData.sSystemBuffer.iHeight)) {
632− m_pDecContext->sDecoderStatistics.uiResolutionChangeTimes++;
633− m_pDecContext->sDecoderStatistics.uiWidth = pDstInfo->UsrData.sSystemBuffer.iWidth;
634− m_pDecContext->sDecoderStatistics.uiHeight = pDstInfo->UsrData.sSystemBuffer.iHeight;
635− }
636621 }
637622 iEnd = WelsTime();
638623 m_pDecContext->dDecTime += (iEnd - iStart) / 1e3;
639624
640− OutputStatisticsLog(m_pDecContext->sDecoderStatistics);
625+ OutputStatisticsLog (m_pDecContext->sDecoderStatistics);
641626
642627 return dsErrorFree;
643628 }
644629
645−void CWelsDecoder::OutputStatisticsLog(SDecoderStatistics& sDecoderStatistics) {
646− if ((sDecoderStatistics.uiDecodedFrameCount > 0) && (sDecoderStatistics.iStatisticsLogInterval > 0) && ((sDecoderStatistics.uiDecodedFrameCount % sDecoderStatistics.iStatisticsLogInterval) == 0)) {
630+void CWelsDecoder::OutputStatisticsLog (SDecoderStatistics& sDecoderStatistics) {
631+ if ((sDecoderStatistics.uiDecodedFrameCount > 0) && (sDecoderStatistics.iStatisticsLogInterval > 0)
632+ && ((sDecoderStatistics.uiDecodedFrameCount % sDecoderStatistics.iStatisticsLogInterval) == 0)) {
647633 WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO,
648634 "uiWidth=%d, uiHeight=%d, fAverageFrameSpeedInMs=%.1f, fActualAverageFrameSpeedInMs=%.1f, \
649635 uiDecodedFrameCount=%d, uiResolutionChangeTimes=%d, uiIDRCorrectNum=%d, \
@@ -652,37 +638,37 @@ void CWelsDecoder::OutputStatisticsLog(SDecoderStatistics& sDecoderStatistics) { · 2 unmodified lines
652638 iSpsReportErrorNum=%d, iSubSpsReportErrorNum=%d, iPpsReportErrorNum=%d, iSpsNoExistNalNum=%d, iSubSpsNoExistNalNum=%d, iPpsNoExistNalNum=%d, \
653639 uiProfile=%d, uiLevel=%d, \
654640 iCurrentActiveSpsId=%d, iCurrentActivePpsId=%d,",
655− sDecoderStatistics.uiWidth,
656− sDecoderStatistics.uiHeight,
657− sDecoderStatistics.fAverageFrameSpeedInMs,
658− sDecoderStatistics.fActualAverageFrameSpeedInMs,
659−
660− sDecoderStatistics.uiDecodedFrameCount,
661− sDecoderStatistics.uiResolutionChangeTimes,
662− sDecoderStatistics.uiIDRCorrectNum,
663−
664− sDecoderStatistics.uiAvgEcRatio,
665− sDecoderStatistics.uiAvgEcPropRatio,
666− sDecoderStatistics.uiEcIDRNum,
667− sDecoderStatistics.uiEcFrameNum,
668−
669− sDecoderStatistics.uiIDRLostNum,
670− sDecoderStatistics.uiFreezingIDRNum,
671− sDecoderStatistics.uiFreezingNonIDRNum,
672− sDecoderStatistics.iAvgLumaQp,
673−
674− sDecoderStatistics.iSpsReportErrorNum,
675− sDecoderStatistics.iSubSpsReportErrorNum,
676− sDecoderStatistics.iPpsReportErrorNum,
677− sDecoderStatistics.iSpsNoExistNalNum,
678− sDecoderStatistics.iSubSpsNoExistNalNum,
679− sDecoderStatistics.iPpsNoExistNalNum,
680−
681− sDecoderStatistics.uiProfile,
682− sDecoderStatistics.uiLevel,
683−
684− sDecoderStatistics.iCurrentActiveSpsId,
685− sDecoderStatistics.iCurrentActivePpsId);
641+ sDecoderStatistics.uiWidth,
642+ sDecoderStatistics.uiHeight,
643+ sDecoderStatistics.fAverageFrameSpeedInMs,
644+ sDecoderStatistics.fActualAverageFrameSpeedInMs,
645+
646+ sDecoderStatistics.uiDecodedFrameCount,
647+ sDecoderStatistics.uiResolutionChangeTimes,
648+ sDecoderStatistics.uiIDRCorrectNum,
649+
650+ sDecoderStatistics.uiAvgEcRatio,
651+ sDecoderStatistics.uiAvgEcPropRatio,
652+ sDecoderStatistics.uiEcIDRNum,
653+ sDecoderStatistics.uiEcFrameNum,
654+
655+ sDecoderStatistics.uiIDRLostNum,
656+ sDecoderStatistics.uiFreezingIDRNum,
657+ sDecoderStatistics.uiFreezingNonIDRNum,
658+ sDecoderStatistics.iAvgLumaQp,
659+
660+ sDecoderStatistics.iSpsReportErrorNum,
661+ sDecoderStatistics.iSubSpsReportErrorNum,
662+ sDecoderStatistics.iPpsReportErrorNum,
663+ sDecoderStatistics.iSpsNoExistNalNum,
664+ sDecoderStatistics.iSubSpsNoExistNalNum,
665+ sDecoderStatistics.iPpsNoExistNalNum,
666+
667+ sDecoderStatistics.uiProfile,
668+ sDecoderStatistics.uiLevel,
669+
670+ sDecoderStatistics.iCurrentActiveSpsId,
671+ sDecoderStatistics.iCurrentActivePpsId);
686672 }
687673 }
688674
@@ -701,6 +687,7 @@ DECODING_STATE CWelsDecoder::DecodeParser (const unsigned char* kpSrc, · 12 unmodified lines
701687 m_pDecContext->iErrorCode |= dsInvalidArgument;
702688 return dsInvalidArgument;
703689 }
690+ int64_t iEnd, iStart = WelsTime();
704691 if (CheckBsBuffer (m_pDecContext, kiSrcLen)) {
705692 if (ResetDecoder())
706693 return dsOutOfMemory;
@@ -745,6 +732,14 @@ DECODING_STATE CWelsDecoder::DecodeParser (const unsigned char* kpSrc, · 38 unmodified lines
745732
746733 if (!m_pDecContext->bFramePending && m_pDecContext->pParserBsInfo->iNalNum) {
747734 memcpy (pDstInfo, m_pDecContext->pParserBsInfo, sizeof (SParserBsInfo));
735+
736+ if (m_pDecContext->iErrorCode == ERR_NONE) { //update statistics: decoding frame count
737+ m_pDecContext->sDecoderStatistics.uiDecodedFrameCount++;
738+ if (m_pDecContext->sDecoderStatistics.uiDecodedFrameCount == 0) { //exceed max value of uint32_t
739+ ResetDecStatNums (&m_pDecContext->sDecoderStatistics);
740+ m_pDecContext->sDecoderStatistics.uiDecodedFrameCount++;
741+ }
742+ }
748743 }
749744
750745 m_pDecContext->bInstantDecFlag = false; //reset no-delay flag
@@ -753,6 +748,8 @@ DECODING_STATE CWelsDecoder::DecodeParser (const unsigned char* kpSrc, · 2 unmodified lines
753748 WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO, "decode failed, failure type:%d \n", m_pDecContext->iErrorCode);
754749 m_pDecContext->bPrintFrameErrorTraceFlag = false;
755750 }
751+ iEnd = WelsTime();
752+ m_pDecContext->dDecTime += (iEnd - iStart) / 1e3;
756753
757754 return (DECODING_STATE) m_pDecContext->iErrorCode;
758755 }

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