Showing the changes to codec/decoder/core/src/decoder.cpp (1 of 4 files). Show all
Unified · Split
| @@ -1022,11 +1022,15 @@ void ResetDecStatNums (SDecoderStatistics* pDecStat) { · 1021 unmodified lines | ||
| 1022 | 1022 | uint32_t uiHeight = pDecStat->uiHeight; |
| 1023 | 1023 | int32_t iAvgLumaQp = pDecStat->iAvgLumaQp; |
| 1024 | 1024 | uint32_t iLogInterval = pDecStat->iStatisticsLogInterval; |
| 1025 | + uint32_t uiProfile = pDecStat->uiProfile; | |
| 1026 | + uint32_t uiLevel = pDecStat->uiLevel; | |
| 1025 | 1027 | memset (pDecStat, 0, sizeof (SDecoderStatistics)); |
| 1026 | 1028 | pDecStat->uiWidth = uiWidth; |
| 1027 | 1029 | pDecStat->uiHeight = uiHeight; |
| 1028 | 1030 | pDecStat->iAvgLumaQp = iAvgLumaQp; |
| 1029 | 1031 | pDecStat->iStatisticsLogInterval = iLogInterval; |
| 1032 | + pDecStat->uiProfile = uiProfile; | |
| 1033 | + pDecStat->uiLevel = uiLevel; | |
| 1030 | 1034 | } |
| 1031 | 1035 | |
| 1032 | 1036 | //update information when freezing occurs, including IDR/non-IDR number |
| @@ -1049,15 +1053,22 @@ void UpdateDecStatNoFreezingInfo (PWelsDecoderContext pCtx) { · 16 unmodified lines | ||
| 1049 | 1053 | //update QP info |
| 1050 | 1054 | int32_t iTotalQp = 0; |
| 1051 | 1055 | 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; | |
| 1056 | 1071 | } |
| 1057 | − if (iCorrectMbNum == 0) //non MB is correct, should remain QP statistic info | |
| 1058 | − iTotalQp = pDecStat->iAvgLumaQp; | |
| 1059 | − else | |
| 1060 | − iTotalQp /= iCorrectMbNum; | |
| 1061 | 1072 | if (pDecStat->uiDecodedFrameCount + 1 == 0) { //maximum uint32_t reached |
| 1062 | 1073 | ResetDecStatNums (pDecStat); |
| 1063 | 1074 | pDecStat->iAvgLumaQp = iTotalQp; |
| @@ -1068,7 +1079,8 @@ void UpdateDecStatNoFreezingInfo (PWelsDecoderContext pCtx) { · 4 unmodified lines | ||
| 1068 | 1079 | //update IDR number |
| 1069 | 1080 | if (pCurDq->sLayerInfo.sNalHeaderExt.bIdrFlag) { |
| 1070 | 1081 | pDecStat->uiIDRCorrectNum += (pPic->bIsComplete); |
| 1071 | − pDecStat->uiEcIDRNum += (!pPic->bIsComplete); | |
| 1082 | + if (pCtx->pParam->eEcActiveIdc != ERROR_CON_DISABLE) | |
| 1083 | + pDecStat->uiEcIDRNum += (!pPic->bIsComplete); | |
| 1072 | 1084 | } |
| 1073 | 1085 | } |
| 1074 | 1086 | |