Showing the changes to codec/encoder/plus/src/welsEncoderExt.cpp (1 of 3 files). Show all
Unified · Split
| @@ -642,10 +642,11 @@ void CWelsH264SVCEncoder::UpdateStatistics (const int64_t kiCurrentFrameTs, EVid · 641 unmodified lines | ||
| 642 | 642 | int64_t iTimeDiff = kiCurrentFrameTs - m_pEncContext->iLastStatisticsLogTs; |
| 643 | 643 | if ((iTimeDiff > m_pEncContext->iStatisticsLogInterval) || (0 == pStatistics->uiInputFrameCount % 300)) { |
| 644 | 644 | if (iTimeDiff) { |
| 645 | − pStatistics->fLatestFrameRate = static_cast<float> ((pStatistics->uiInputFrameCount - m_pEncContext->iLastStatisticsFrameCount) * 1000 / | |
| 646 | − iTimeDiff); | |
| 645 | + pStatistics->fLatestFrameRate = static_cast<float> ((pStatistics->uiInputFrameCount - | |
| 646 | + m_pEncContext->iLastStatisticsFrameCount) * 1000 / | |
| 647 | + iTimeDiff); | |
| 647 | 648 | pStatistics->uiBitRate = static_cast<unsigned int> ((m_pEncContext->iTotalEncodedBits - |
| 648 | − m_pEncContext->iLastStatisticsBits) * 1000 / iTimeDiff); | |
| 649 | + m_pEncContext->iLastStatisticsBits) * 1000 / iTimeDiff); | |
| 649 | 650 | } |
| 650 | 651 | |
| 651 | 652 | // update variables |
| @@ -1072,6 +1073,14 @@ int CWelsH264SVCEncoder::SetOption (ENCODER_OPTION eOptionId, void* pOption) { · 420 unmodified lines | ||
| 1072 | 1073 | "CWelsH264SVCEncoder::SetOption():ENCODER_OPTION_IS_LOSSLESS_LINK,bIsLosslessLink = %d", bValue); |
| 1073 | 1074 | } |
| 1074 | 1075 | break; |
| 1076 | + case ENCODER_OPTION_BITS_VARY_PERCENTAGE: { | |
| 1077 | + bool bValue = * (static_cast<bool*> (pOption)); | |
| 1078 | + m_pEncContext->pSvcParam->iBitsVaryPercentage = bValue; | |
| 1079 | + WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO, | |
| 1080 | + "CWelsH264SVCEncoder::SetOption():ENCODER_OPTION_BITS_VARY_PERCENTAGE,iBitsVaryPercentage = %d", bValue); | |
| 1081 | + } | |
| 1082 | + break; | |
| 1083 | + | |
| 1075 | 1084 | default: |
| 1076 | 1085 | return cmInitParaError; |
| 1077 | 1086 | } |