Showing the changes to codec/encoder/core/src/ratectl.cpp (1 of 4 files). Show all
Unified · Split
| @@ -1004,7 +1004,7 @@ void RcVBufferCalculationPadding (sWelsEncCtx* pEncCtx) { · 1003 unmodified lines | ||
| 1004 | 1004 | } |
| 1005 | 1005 | |
| 1006 | 1006 | |
| 1007 | −void RcTraceFrameBits (sWelsEncCtx* pEncCtx, long long uiTimeStamp) { | |
| 1007 | +void RcTraceFrameBits (sWelsEncCtx* pEncCtx, long long uiTimeStamp, int32_t iFrameSize) { | |
| 1008 | 1008 | SWelsSvcRc* pWelsSvcRc = &pEncCtx->pWelsSvcRc[pEncCtx->uiDependencyId]; |
| 1009 | 1009 | SSpatialLayerInternal* pParamInternal = &pEncCtx->pSvcParam->sDependencyLayers[pEncCtx->uiDependencyId]; |
| 1010 | 1010 | if (pWelsSvcRc->iPredFrameBit != 0) |
| @@ -1019,7 +1019,8 @@ void RcTraceFrameBits (sWelsEncCtx* pEncCtx, long long uiTimeStamp) { · 8 unmodified lines | ||
| 1019 | 1019 | pEncCtx->uiDependencyId, uiTimeStamp, pEncCtx->eSliceType, pEncCtx->iGlobalQp, pWelsSvcRc->iAverageFrameQp, |
| 1020 | 1020 | pWelsSvcRc->iMaxFrameQp, |
| 1021 | 1021 | pWelsSvcRc->iMinFrameQp, |
| 1022 | − pParamInternal->iFrameIndex, pEncCtx->uiTemporalId, pWelsSvcRc->iFrameDqBits, pWelsSvcRc->iBitsPerFrame, | |
| 1022 | + pParamInternal->iFrameIndex, pEncCtx->uiTemporalId, pWelsSvcRc->iFrameDqBits, | |
| 1023 | + ( pWelsSvcRc->iBitsPerFrame>0 ) ? pWelsSvcRc->iBitsPerFrame : (iFrameSize<<3), | |
| 1023 | 1024 | pWelsSvcRc->iTargetBits, pWelsSvcRc->iRemainingBits, pWelsSvcRc->iBufferSizeSkip); |
| 1024 | 1025 | |
| 1025 | 1026 | } |
| @@ -1298,7 +1299,7 @@ void WelRcPictureInitBufferBasedQp (sWelsEncCtx* pEncCtx, long long uiTimeStamp) · 272 unmodified lines | ||
| 1298 | 1299 | else |
| 1299 | 1300 | pEncCtx->iGlobalQp += 2; |
| 1300 | 1301 | pEncCtx->iGlobalQp = WELS_CLIP3 (pEncCtx->iGlobalQp, iMinQp, pWelsSvcRc->iMaxQp); |
| 1301 | − pWelsSvcRc->iAverageFrameQp = pEncCtx->iGlobalQp; | |
| 1302 | + pWelsSvcRc->iAverageFrameQp = pWelsSvcRc->iMaxFrameQp = pWelsSvcRc->iMinFrameQp = pEncCtx->iGlobalQp; | |
| 1302 | 1303 | } |
| 1303 | 1304 | void WelRcPictureInitScc (sWelsEncCtx* pEncCtx, long long uiTimeStamp) { |
| 1304 | 1305 | SWelsSvcRc* pWelsSvcRc = &pEncCtx->pWelsSvcRc[pEncCtx->uiDependencyId]; |