Showing the changes to codec/encoder/plus/src/welsEncoderExt.cpp (1 of 1 file). Show all
Unified · Split
| @@ -594,14 +594,20 @@ void CWelsH264SVCEncoder::UpdateStatistics (const int64_t kiCurrentFrameTs, EVid · 593 unmodified lines | |||
| 594 | kiTimeDiff); | 594 | kiTimeDiff); |
| 595 | pStatistics->uiBitRate = static_cast<unsigned int> ((m_pEncContext->iTotalEncodedBytes - | 595 | pStatistics->uiBitRate = static_cast<unsigned int> ((m_pEncContext->iTotalEncodedBytes - |
| 596 | m_pEncContext->iLastStatisticsBytes) * 8 * 1000 / kiTimeDiff); | 596 | m_pEncContext->iLastStatisticsBytes) * 8 * 1000 / kiTimeDiff); |
| 597 | } | ||
| 598 | 597 | ||
| 599 | if (m_pEncContext->pSvcParam->iRCMode == RC_QUALITY_MODE || m_pEncContext->pSvcParam->iRCMode == RC_BITRATE_MODE) { | 598 | if (WELS_ABS (pStatistics->fLatestFrameRate - m_pEncContext->pSvcParam->fMaxFrameRate) > 30) { |
| 600 | if ((pStatistics->fLatestFrameRate > 0) | ||
| 601 | && WELS_ABS (m_pEncContext->pSvcParam->fMaxFrameRate - pStatistics->fLatestFrameRate) > 5) { | ||
| 602 | WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_WARNING, | 599 | WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_WARNING, |
| 603 | "Actual Input Framerate %f is different from framerate in setting %f, suggest to use other rate control modes", | 600 | "Actual input fLatestFrameRate = %f is quite different from framerate in setting %f, please check setting or timestamp unit (ms), cur_Ts = %" PRId64 " start_Ts = %" PRId64, |
| 604 | pStatistics->fLatestFrameRate, m_pEncContext->pSvcParam->fMaxFrameRate); | 601 | pStatistics->fLatestFrameRate, m_pEncContext->pSvcParam->fMaxFrameRate, kiCurrentFrameTs, static_cast<int64_t> (pStatistics->iStatisticsTs) ); |
| 602 | } | ||
| 603 | |||
| 604 | if (m_pEncContext->pSvcParam->iRCMode == RC_QUALITY_MODE || m_pEncContext->pSvcParam->iRCMode == RC_BITRATE_MODE) { | ||
| 605 | if ((pStatistics->fLatestFrameRate > 0) | ||
| 606 | && WELS_ABS (m_pEncContext->pSvcParam->fMaxFrameRate - pStatistics->fLatestFrameRate) > 5) { | ||
| 607 | WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_WARNING, | ||
| 608 | "Actual input framerate %f is different from framerate in setting %f, suggest to use other rate control modes", | ||
| 609 | pStatistics->fLatestFrameRate, m_pEncContext->pSvcParam->fMaxFrameRate); | ||
| 610 | } | ||
| 605 | } | 611 | } |
| 606 | } | 612 | } |
| 607 | 613 | ||
| @@ -616,18 +622,17 @@ void CWelsH264SVCEncoder::UpdateStatistics (const int64_t kiCurrentFrameTs, EVid · 8 unmodified lines | |||
| 616 | if (m_pEncContext->iStatisticsLogInterval > 0) { | 622 | if (m_pEncContext->iStatisticsLogInterval > 0) { |
| 617 | const int64_t kiTimeDiff = kiCurrentFrameTs - m_pEncContext->iLastStatisticsLogTs; | 623 | const int64_t kiTimeDiff = kiCurrentFrameTs - m_pEncContext->iLastStatisticsLogTs; |
| 618 | if ((kiTimeDiff > m_pEncContext->iStatisticsLogInterval) || (0 == pStatistics->uiInputFrameCount % 300)) { | 624 | if ((kiTimeDiff > m_pEncContext->iStatisticsLogInterval) || (0 == pStatistics->uiInputFrameCount % 300)) { |
| 619 | |||
| 620 | if (WELS_ABS (pStatistics->fAverageFrameRate - m_pEncContext->pSvcParam->fMaxFrameRate) > 30) { | 625 | if (WELS_ABS (pStatistics->fAverageFrameRate - m_pEncContext->pSvcParam->fMaxFrameRate) > 30) { |
| 621 | WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_WARNING, | 626 | WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_WARNING, |
| 622 | "Actual Input Framerate %f is quite different from framerate in setting %f, please check setting or timestamp unit (ms)", | 627 | "Actual input framerate fAverageFrameRate = %f is quite different from framerate in setting %f, please check setting or timestamp unit (ms), start_Ts = %" PRId64, |
| 623 | pStatistics->fAverageFrameRate, m_pEncContext->pSvcParam->fMaxFrameRate); | 628 | pStatistics->fAverageFrameRate, m_pEncContext->pSvcParam->fMaxFrameRate, m_pEncContext->uiStartTimestamp); |
| 624 | } | 629 | } |
| 625 | 630 | ||
| 626 | WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO, | 631 | WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO, |
| 627 | "EncoderStatistics: %dx%d, SpeedInMs: %f, fAverageFrameRate=%f, " | 632 | "EncoderStatistics: %dx%d, SpeedInMs: %f, fAverageFrameRate=%f, " |
| 628 | "LastFrameRate=%f, LatestBitRate=%d, LastFrameQP=%d, uiInputFrameCount=%d, uiSkippedFrameCount=%d, " | 633 | "LastFrameRate=%f, LatestBitRate=%d, LastFrameQP=%d, uiInputFrameCount=%d, uiSkippedFrameCount=%d, " |
| 629 | "uiResolutionChangeTimes=%d, uIDRReqNum=%d, uIDRSentNum=%d, uLTRSentNum=NA, iTotalEncodedBytes=%" PRId64 | 634 | "uiResolutionChangeTimes=%d, uIDRReqNum=%d, uIDRSentNum=%d, uLTRSentNum=NA, iTotalEncodedBytes=%" PRId64 |
| 630 | "at Ts = %" PRId64, | 635 | " at Ts = %" PRId64, |
| 631 | pStatistics->uiWidth, pStatistics->uiHeight, | 636 | pStatistics->uiWidth, pStatistics->uiHeight, |
| 632 | pStatistics->fAverageFrameSpeedInMs, pStatistics->fAverageFrameRate, | 637 | pStatistics->fAverageFrameSpeedInMs, pStatistics->fAverageFrameRate, |
| 633 | pStatistics->fLatestFrameRate, pStatistics->uiBitRate, pStatistics->uiAverageFrameQP, | 638 | pStatistics->fLatestFrameRate, pStatistics->uiBitRate, pStatistics->uiAverageFrameQP, |