Showing the changes to codec/encoder/plus/src/welsEncoderExt.cpp (1 of 4 files). Show all
Unified · Split
| @@ -554,14 +554,13 @@ void CWelsH264SVCEncoder::LogStatistics (const int64_t kiCurrentFrameTs, int32_t · 553 unmodified lines | ||
| 554 | 554 | WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO, |
| 555 | 555 | "EncoderStatistics: SpatialId = %d,%dx%d, SpeedInMs: %f, fAverageFrameRate=%f, " |
| 556 | 556 | "LastFrameRate=%f, LatestBitRate=%d, LastFrameQP=%d, uiInputFrameCount=%d, uiSkippedFrameCount=%d, " |
| 557 | − "uiResolutionChangeTimes=%d, uIDRReqNum=%d, uIDRSentNum=%d, uLTRSentNum=NA, iTotalEncodedBytes=%" PRId64 | |
| 558 | − " at Ts = %" PRId64, | |
| 557 | + "uiResolutionChangeTimes=%d, uIDRReqNum=%d, uIDRSentNum=%d, uLTRSentNum=NA, iTotalEncodedBytes=%lu at Ts = %" PRId64, | |
| 559 | 558 | iDid, pStatistics->uiWidth, pStatistics->uiHeight, |
| 560 | 559 | pStatistics->fAverageFrameSpeedInMs, pStatistics->fAverageFrameRate, |
| 561 | 560 | pStatistics->fLatestFrameRate, pStatistics->uiBitRate, pStatistics->uiAverageFrameQP, |
| 562 | 561 | pStatistics->uiInputFrameCount, pStatistics->uiSkippedFrameCount, |
| 563 | 562 | pStatistics->uiResolutionChangeTimes, pStatistics->uiIDRReqNum, pStatistics->uiIDRSentNum, |
| 564 | − m_pEncContext->iTotalEncodedBytes[iDid], kiCurrentFrameTs); | |
| 563 | + pStatistics->iTotalEncodedBytes, kiCurrentFrameTs); | |
| 565 | 564 | } |
| 566 | 565 | } |
| 567 | 566 | |
| @@ -622,18 +621,18 @@ void CWelsH264SVCEncoder::UpdateStatistics (SFrameBSInfo* pBsInfo, · 54 unmodified lines | ||
| 622 | 621 | pStatistics->uiLTRSentNum ++; |
| 623 | 622 | } |
| 624 | 623 | |
| 625 | − m_pEncContext->iTotalEncodedBytes[iDid] += kiCurrentFrameSize; | |
| 624 | + pStatistics->iTotalEncodedBytes += kiCurrentFrameSize; | |
| 626 | 625 | |
| 627 | 626 | const int32_t kiDeltaFrames = static_cast<int32_t> (pStatistics->uiInputFrameCount - |
| 628 | − m_pEncContext->iLastStatisticsFrameCount[iDid]); | |
| 627 | + pStatistics->iLastStatisticsFrameCount); | |
| 629 | 628 | if (kiDeltaFrames > (m_pEncContext->pSvcParam->fMaxFrameRate * 2)) { |
| 630 | 629 | const int64_t kiTimeDiff = kiCurrentFrameTs - pStatistics->iStatisticsTs; |
| 631 | 630 | if (kiTimeDiff) { |
| 632 | 631 | pStatistics->fLatestFrameRate = static_cast<float> ((pStatistics->uiInputFrameCount - |
| 633 | − m_pEncContext->iLastStatisticsFrameCount[iDid]) * 1000 / | |
| 632 | + pStatistics->iLastStatisticsFrameCount) * 1000 / | |
| 634 | 633 | kiTimeDiff); |
| 635 | − pStatistics->uiBitRate = static_cast<unsigned int> ((m_pEncContext->iTotalEncodedBytes[iDid] - | |
| 636 | − m_pEncContext->iLastStatisticsBytes[iDid]) * 8 * 1000 / kiTimeDiff); | |
| 634 | + pStatistics->uiBitRate = static_cast<unsigned int> ((pStatistics->iTotalEncodedBytes - | |
| 635 | + pStatistics->iLastStatisticsBytes) * 8 * 1000 / kiTimeDiff); | |
| 637 | 636 | |
| 638 | 637 | if (WELS_ABS (pStatistics->fLatestFrameRate - m_pEncContext->pSvcParam->fMaxFrameRate) > 30) { |
| 639 | 638 | WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_WARNING, |
| @@ -655,8 +654,8 @@ void CWelsH264SVCEncoder::UpdateStatistics (SFrameBSInfo* pBsInfo, · 15 unmodified lines | ||
| 655 | 654 | |
| 656 | 655 | // update variables |
| 657 | 656 | pStatistics->iStatisticsTs = kiCurrentFrameTs; |
| 658 | − m_pEncContext->iLastStatisticsBytes[iDid] = m_pEncContext->iTotalEncodedBytes[iDid]; | |
| 659 | − m_pEncContext->iLastStatisticsFrameCount[iDid] = pStatistics->uiInputFrameCount; | |
| 657 | + pStatistics->iLastStatisticsBytes = pStatistics->iTotalEncodedBytes; | |
| 658 | + pStatistics->iLastStatisticsFrameCount = pStatistics->uiInputFrameCount; | |
| 660 | 659 | |
| 661 | 660 | //TODO: the following statistics will be calculated and added later |
| 662 | 661 | //pStatistics->uiLTRSentNum |