shithub: openh264

Download patch

ref: 96a73c29cdbf7f2e261691485dfa4d0016a279f4
parent: 75f9b7ee3f5dba224c6c73e9808e2517e6429c7b
parent: 2e1241aa79732f740651d09271ac4bfdccbbbdd5
author: sijchen <sijchen@cisco.com>
date: Wed Jan 3 08:03:32 EST 2018

Merge pull request #2895 from mstorsjo/fix-msvc-warn

Avoid implicit conversions from double to int32_t

--- a/codec/encoder/core/src/ratectl.cpp
+++ b/codec/encoder/core/src/ratectl.cpp
@@ -580,8 +580,7 @@
       pWelsSvcRc->iTargetBits = pTOverRc->iMinBitsTl;
     } else {
       int32_t iMaxTh = iBufferTh * 3 / 4;
-      int32_t iMinTh = (pDLayerParam->fFrameRate < 8) ? iBufferTh * 1.0 / 4 : static_cast<int32_t>
-                       (iBufferTh * 2 / pDLayerParam->fFrameRate);
+      int32_t iMinTh = static_cast<int32_t>((pDLayerParam->fFrameRate < 8) ? iBufferTh * 1.0 / 4 : iBufferTh * 2 / pDLayerParam->fFrameRate);
       if (pDLayerParam->fFrameRate < (IDR_BITRATE_RATIO + 1))
         pWelsSvcRc->iTargetBits = static_cast<int32_t> (((double) (pDLayerParam->iSpatialBitrate) / (double) (
                                     pDLayerParam->fFrameRate)));
@@ -612,8 +611,7 @@
       pWelsSvcRc->iTargetBits = WELS_DIV_ROUND (pTOverRc->iTlayerWeight * kiGopBits, INT_MULTIPLY * 10 * 2);
 
       int32_t iMaxTh = iBufferTh / 2;
-      int32_t iMinTh = (pDLayerParam->fFrameRate < 8) ? iBufferTh * 1.0 / 4 : static_cast<int32_t>
-                       (iBufferTh * 2 / pDLayerParam->fFrameRate);
+      int32_t iMinTh = static_cast<int32_t>((pDLayerParam->fFrameRate < 8) ? iBufferTh * 1.0 / 4 : iBufferTh * 2 / pDLayerParam->fFrameRate);
       WelsLog (& (pEncCtx->sLogCtx), WELS_LOG_DEBUG,
                "iMaxTh = %d,iMinTh = %d,pWelsSvcRc->iTargetBits = %d,pWelsSvcRc->iBufferSizeSkip = %d, pWelsSvcRc->iBufferFullnessSkip= % "
                PRId64,