Showing the changes to codec/encoder/core/src/ratectl.cpp (1 of 3 files). Show all
Unified · Split
| @@ -230,7 +230,7 @@ void RcUpdateBitrateFps (sWelsEncCtx* pEncCtx) { · 229 unmodified lines | ||
| 230 | 230 | SSpatialLayerInternal* pDLayerParamInternal = &pEncCtx->pSvcParam->sDependencyLayers[pEncCtx->uiDependencyId]; |
| 231 | 231 | const int32_t kiGopSize = (1 << pDLayerParamInternal->iDecompositionStages); |
| 232 | 232 | const int32_t kiHighestTid = pDLayerParamInternal->iHighestTemporalId; |
| 233 | − int32_t input_iBitsPerFrame = WELS_ROUND (pDLayerParam->iSpatialBitrate * INT_MULTIPLY / | |
| 233 | + int64_t input_iBitsPerFrame = WELS_ROUND64 (((int64_t)pDLayerParam->iSpatialBitrate) * INT_MULTIPLY / | |
| 234 | 234 | pDLayerParamInternal->fInputFrameRate); |
| 235 | 235 | const int32_t kiGopBits = WELS_DIV_ROUND (input_iBitsPerFrame * kiGopSize, INT_MULTIPLY); |
| 236 | 236 | int32_t i; |
| @@ -255,7 +255,7 @@ void RcUpdateBitrateFps (sWelsEncCtx* pEncCtx) { · 18 unmodified lines | ||
| 255 | 255 | |
| 256 | 256 | //change remaining bits |
| 257 | 257 | if (pWelsSvcRc->iBitsPerFrame > REMAIN_BITS_TH) |
| 258 | − pWelsSvcRc->iRemainingBits = pWelsSvcRc->iRemainingBits * input_iBitsPerFrame / pWelsSvcRc->iBitsPerFrame; | |
| 258 | + pWelsSvcRc->iRemainingBits = (int32_t) (pWelsSvcRc->iRemainingBits * input_iBitsPerFrame / pWelsSvcRc->iBitsPerFrame); | |
| 259 | 259 | pWelsSvcRc->iBitsPerFrame = input_iBitsPerFrame; |
| 260 | 260 | } |
| 261 | 261 | |