History

Avoid implicit conversions from double to int32_t

This fixes warnings when building with MSVC.

Martin Storsjö committed 8 years ago

Commit 2e1241a1 parent 75f9b7e1 file · +2 −4Browse files

Showing the changes to codec/encoder/core/src/ratectl.cpp (1 of 1 file). Show all

Unified · Split

codec/encoder/core/src/ratectl.cpp+2−4
@@ -580,8 +580,7 @@ void RcDecideTargetBitsTimestamp (sWelsEncCtx* pEncCtx) { · 579 unmodified lines
580580 pWelsSvcRc->iTargetBits = pTOverRc->iMinBitsTl;
581581 } else {
582582 int32_t iMaxTh = iBufferTh * 3 / 4;
583− int32_t iMinTh = (pDLayerParam->fFrameRate < 8) ? iBufferTh * 1.0 / 4 : static_cast<int32_t>
584− (iBufferTh * 2 / pDLayerParam->fFrameRate);
583+ int32_t iMinTh = static_cast<int32_t>((pDLayerParam->fFrameRate < 8) ? iBufferTh * 1.0 / 4 : iBufferTh * 2 / pDLayerParam->fFrameRate);
585584 if (pDLayerParam->fFrameRate < (IDR_BITRATE_RATIO + 1))
586585 pWelsSvcRc->iTargetBits = static_cast<int32_t> (((double) (pDLayerParam->iSpatialBitrate) / (double) (
587586 pDLayerParam->fFrameRate)));
@@ -612,8 +611,7 @@ void RcDecideTargetBitsTimestamp (sWelsEncCtx* pEncCtx) { · 24 unmodified lines
612611 pWelsSvcRc->iTargetBits = WELS_DIV_ROUND (pTOverRc->iTlayerWeight * kiGopBits, INT_MULTIPLY * 10 * 2);
613612
614613 int32_t iMaxTh = iBufferTh / 2;
615− int32_t iMinTh = (pDLayerParam->fFrameRate < 8) ? iBufferTh * 1.0 / 4 : static_cast<int32_t>
616− (iBufferTh * 2 / pDLayerParam->fFrameRate);
614+ int32_t iMinTh = static_cast<int32_t>((pDLayerParam->fFrameRate < 8) ? iBufferTh * 1.0 / 4 : iBufferTh * 2 / pDLayerParam->fFrameRate);
617615 WelsLog (& (pEncCtx->sLogCtx), WELS_LOG_DEBUG,
618616 "iMaxTh = %d,iMinTh = %d,pWelsSvcRc->iTargetBits = %d,pWelsSvcRc->iBufferSizeSkip = %d, pWelsSvcRc->iBufferFullnessSkip= % "
619617 PRId64,

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t