This fixes build warnings with MSVC.
Showing the changes to codec/encoder/core/src/ratectl.cpp (1 of 1 file). Show all
Unified · Split
| @@ -1285,12 +1285,12 @@ void WelsRcPictureInitGomTimeStamp (sWelsEncCtx* pEncCtx, long long uiTimeStamp · 1284 unmodified lines | ||
| 1285 | 1285 | if ((pDLayerParam->fFrameRate > EPSN) && (pDLayerParam->iVideoWidth && pDLayerParam->iVideoHeight)) |
| 1286 | 1286 | dBpp = (double) (pDLayerParam->iSpatialBitrate) / (double) (pDLayerParam->fFrameRate * pDLayerParam->iVideoWidth * |
| 1287 | 1287 | pDLayerParam->iVideoHeight); |
| 1288 | − pWelsSvcRc->iInitialQp = 50 - dBpp * 10 * 4; | |
| 1288 | + pWelsSvcRc->iInitialQp = (int32_t) (50 - dBpp * 10 * 4); | |
| 1289 | 1289 | pWelsSvcRc->iInitialQp = WELS_CLIP3 (pWelsSvcRc->iInitialQp, MIN_IDR_QP, MAX_IDR_QP); |
| 1290 | 1290 | |
| 1291 | 1291 | iLumaQp = pWelsSvcRc->iInitialQp; |
| 1292 | − pWelsSvcRc->iTargetBits = (double) (pDLayerParam->iSpatialBitrate) / (double) (pDLayerParam->fFrameRate) * | |
| 1293 | − IDR_BITRATE_RATIO; | |
| 1292 | + pWelsSvcRc->iTargetBits = (int32_t) ((double) (pDLayerParam->iSpatialBitrate) / (double) (pDLayerParam->fFrameRate) * | |
| 1293 | + IDR_BITRATE_RATIO); | |
| 1294 | 1294 | |
| 1295 | 1295 | WelsLog (& (pEncCtx->sLogCtx), WELS_LOG_DEBUG, |
| 1296 | 1296 | "[Rc] First IDR iSpatialBitrate = %d,iBufferFullnessSkip = %d,iTargetBits= %d,dBpp = %f,initQp = %d", |
| @@ -1301,8 +1301,8 @@ void WelsRcPictureInitGomTimeStamp (sWelsEncCtx* pEncCtx, long long uiTimeStamp · 4 unmodified lines | ||
| 1301 | 1301 | |
| 1302 | 1302 | int32_t iMaxTh = pWelsSvcRc->iBufferSizeSkip - pWelsSvcRc->iBufferFullnessSkip; |
| 1303 | 1303 | int32_t iMinTh = iMaxTh / 2; |
| 1304 | − pWelsSvcRc->iTargetBits = (double) (pDLayerParam->iSpatialBitrate) / (double) (pDLayerParam->fFrameRate) * | |
| 1305 | − IDR_BITRATE_RATIO; | |
| 1304 | + pWelsSvcRc->iTargetBits = (int32_t) ((double) (pDLayerParam->iSpatialBitrate) / (double) (pDLayerParam->fFrameRate) * | |
| 1305 | + IDR_BITRATE_RATIO); | |
| 1306 | 1306 | if (iMaxTh > 0) { |
| 1307 | 1307 | pWelsSvcRc->iTargetBits = WELS_CLIP3 (pWelsSvcRc->iTargetBits, iMinTh, iMaxTh); |
| 1308 | 1308 | |
| @@ -1331,7 +1331,7 @@ void WelsRcPictureInitGomTimeStamp (sWelsEncCtx* pEncCtx, long long uiTimeStamp · 22 unmodified lines | ||
| 1331 | 1331 | |
| 1332 | 1332 | SSpatialLayerInternal* pDLayerParamInternal = &pEncCtx->pSvcParam->sDependencyLayers[pEncCtx->uiDependencyId]; |
| 1333 | 1333 | const int32_t kiGopSize = (1 << pDLayerParamInternal->iDecompositionStages); |
| 1334 | − int32_t iAverageFrameSize = (double) (pDLayerParam->iSpatialBitrate) / (double) (pDLayerParam->fFrameRate); | |
| 1334 | + int32_t iAverageFrameSize = (int32_t) ((double) (pDLayerParam->iSpatialBitrate) / (double) (pDLayerParam->fFrameRate)); | |
| 1335 | 1335 | const int32_t kiGopBits = iAverageFrameSize * kiGopSize; |
| 1336 | 1336 | int64_t iCmplxRatio = WELS_DIV_ROUND64 (pEncCtx->pVaa->sComplexityAnalysisParam.iFrameComplexity * INT_MULTIPLY, |
| 1337 | 1337 | pTOverRc->iFrameCmplxMean); |