From 350cafd69a3c2d79946a5ed86ee8c871c7714465 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Storsj=C3=B6?= Date: Wed, 20 Jul 2016 12:10:34 +0300 Subject: [PATCH] Silence warnings about conversions in MSVC The kind of cast (static_cast vs C style cast) is different to match the closely surrounding code. --- codec/encoder/core/src/ratectl.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/codec/encoder/core/src/ratectl.cpp b/codec/encoder/core/src/ratectl.cpp index e93ccde2..e2684981 100644 --- a/codec/encoder/core/src/ratectl.cpp +++ b/codec/encoder/core/src/ratectl.cpp @@ -570,7 +570,7 @@ void RcDecideTargetBitsTimestamp (sWelsEncCtx* pEncCtx) { pWelsSvcRc->iTargetBits = pTOverRc->iMinBitsTl; } else { int32_t iMaxTh = iBufferTh * 3 / 4; - int32_t iMinTh = iBufferTh * 2 / pDLayerParam->fFrameRate; + int32_t iMinTh = static_cast (iBufferTh * 2 / pDLayerParam->fFrameRate); pWelsSvcRc->iTargetBits = static_cast (((double) (pDLayerParam->iSpatialBitrate) / (double) ( pDLayerParam->fFrameRate) * IDR_BITRATE_RATIO)); WelsLog (& (pEncCtx->sLogCtx), WELS_LOG_DEBUG, @@ -597,7 +597,7 @@ void RcDecideTargetBitsTimestamp (sWelsEncCtx* pEncCtx) { pWelsSvcRc->iTargetBits = WELS_DIV_ROUND (pTOverRc->iTlayerWeight * kiGopBits, INT_MULTIPLY * 10 * 2); int32_t iMaxTh = iBufferTh / 2; - int32_t iMinTh = iBufferTh * 2 / pDLayerParam->fFrameRate; + int32_t iMinTh = (int32_t) (iBufferTh * 2 / pDLayerParam->fFrameRate); WelsLog (& (pEncCtx->sLogCtx), WELS_LOG_DEBUG, "iMaxTh = %d,iMinTh = %d,pWelsSvcRc->iTargetBits = %d,pWelsSvcRc->iBufferSizeSkip = %d, pWelsSvcRc->iBufferFullnessSkip= % " PRId64, @@ -1081,7 +1081,7 @@ void RcUpdateFrameComplexity (sWelsEncCtx* pEncCtx) { iAlpha = SMOOTH_FACTOR_MIN_VALUE; if (0 == pTOverRc->iPFrameNum) { pTOverRc->iLinearCmplx = ((int64_t)pWelsSvcRc->iFrameDqBits) * iQStep; - pTOverRc->iFrameCmplxMean = pEncCtx->pVaa->sComplexityAnalysisParam.iFrameComplexity; + pTOverRc->iFrameCmplxMean = (int32_t)pEncCtx->pVaa->sComplexityAnalysisParam.iFrameComplexity; } else { pTOverRc->iLinearCmplx = WELS_DIV_ROUND64 (((LINEAR_MODEL_DECAY_FACTOR) * (int64_t)pTOverRc->iLinearCmplx + (INT_MULTIPLY - LINEAR_MODEL_DECAY_FACTOR) * ((int64_t)pWelsSvcRc->iFrameDqBits * iQStep)),