History

add parseoly statistics

huili2 committed 9 years ago

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

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

Unified · Split

codec/decoder/core/src/decoder.cpp+21−9
@@ -1022,11 +1022,15 @@ void ResetDecStatNums (SDecoderStatistics* pDecStat) { · 1021 unmodified lines
10221022 uint32_t uiHeight = pDecStat->uiHeight;
10231023 int32_t iAvgLumaQp = pDecStat->iAvgLumaQp;
10241024 uint32_t iLogInterval = pDecStat->iStatisticsLogInterval;
1025+ uint32_t uiProfile = pDecStat->uiProfile;
1026+ uint32_t uiLevel = pDecStat->uiLevel;
10251027 memset (pDecStat, 0, sizeof (SDecoderStatistics));
10261028 pDecStat->uiWidth = uiWidth;
10271029 pDecStat->uiHeight = uiHeight;
10281030 pDecStat->iAvgLumaQp = iAvgLumaQp;
10291031 pDecStat->iStatisticsLogInterval = iLogInterval;
1032+ pDecStat->uiProfile = uiProfile;
1033+ pDecStat->uiLevel = uiLevel;
10301034 }
10311035
10321036 //update information when freezing occurs, including IDR/non-IDR number
@@ -1049,15 +1053,22 @@ void UpdateDecStatNoFreezingInfo (PWelsDecoderContext pCtx) { · 16 unmodified lines
10491053 //update QP info
10501054 int32_t iTotalQp = 0;
10511055 const int32_t kiMbNum = pCurDq->iMbWidth * pCurDq->iMbHeight;
1052− int32_t iCorrectMbNum = 0;
1053− for (int32_t iMb = 0; iMb < kiMbNum; ++iMb) {
1054− iCorrectMbNum += (int32_t) pCurDq->pMbCorrectlyDecodedFlag[iMb];
1055− iTotalQp += pCurDq->pLumaQp[iMb] * pCurDq->pMbCorrectlyDecodedFlag[iMb];
1056+ if (pCtx->pParam->eEcActiveIdc == ERROR_CON_DISABLE) { //all correct
1057+ for (int32_t iMb = 0; iMb < kiMbNum; ++iMb) {
1058+ iTotalQp += pCurDq->pLumaQp[iMb];
1059+ }
1060+ iTotalQp /= kiMbNum;
1061+ } else {
1062+ int32_t iCorrectMbNum = 0;
1063+ for (int32_t iMb = 0; iMb < kiMbNum; ++iMb) {
1064+ iCorrectMbNum += (int32_t) pCurDq->pMbCorrectlyDecodedFlag[iMb];
1065+ iTotalQp += pCurDq->pLumaQp[iMb] * pCurDq->pMbCorrectlyDecodedFlag[iMb];
1066+ }
1067+ if (iCorrectMbNum == 0) //non MB is correct, should remain QP statistic info
1068+ iTotalQp = pDecStat->iAvgLumaQp;
1069+ else
1070+ iTotalQp /= iCorrectMbNum;
10561071 }
1057− if (iCorrectMbNum == 0) //non MB is correct, should remain QP statistic info
1058− iTotalQp = pDecStat->iAvgLumaQp;
1059− else
1060− iTotalQp /= iCorrectMbNum;
10611072 if (pDecStat->uiDecodedFrameCount + 1 == 0) { //maximum uint32_t reached
10621073 ResetDecStatNums (pDecStat);
10631074 pDecStat->iAvgLumaQp = iTotalQp;
@@ -1068,7 +1079,8 @@ void UpdateDecStatNoFreezingInfo (PWelsDecoderContext pCtx) { · 4 unmodified lines
10681079 //update IDR number
10691080 if (pCurDq->sLayerInfo.sNalHeaderExt.bIdrFlag) {
10701081 pDecStat->uiIDRCorrectNum += (pPic->bIsComplete);
1071− pDecStat->uiEcIDRNum += (!pPic->bIsComplete);
1082+ if (pCtx->pParam->eEcActiveIdc != ERROR_CON_DISABLE)
1083+ pDecStat->uiEcIDRNum += (!pPic->bIsComplete);
10721084 }
10731085 }
10741086

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