Showing the changes to codec/encoder/core/src/ratectl.cpp (1 of 1 file). Show all
Unified · Split
| @@ -694,12 +694,11 @@ void RcVBufferCalculationSkip (sWelsEncCtx* pEncCtx) { · 693 unmodified lines | ||
| 694 | 694 | //condition 1: whole pBuffer fullness |
| 695 | 695 | pWelsSvcRc->iBufferFullnessSkip += (pWelsSvcRc->iFrameDqBits - kiOutputBits); |
| 696 | 696 | //condition 2: VGOP bits constraint |
| 697 | − const int32_t kiVGopBits = WELS_DIV_ROUND (pWelsSvcRc->iBitsPerFrame * VGOP_SIZE, INT_MULTIPLY); | |
| 698 | 697 | int32_t iVGopBitsPred = 0; |
| 699 | 698 | for (int32_t i = pWelsSvcRc->iFrameCodedInVGop + 1; i < VGOP_SIZE; i++) |
| 700 | 699 | iVGopBitsPred += pTOverRc[pWelsSvcRc->iTlOfFrames[i]].iMinBitsTl; |
| 701 | 700 | iVGopBitsPred -= pWelsSvcRc->iRemainingBits; |
| 702 | − double dIncPercent = iVGopBitsPred * 100.0 / kiVGopBits - (double)VGOP_BITS_PERCENTAGE_DIFF; | |
| 701 | + double dIncPercent = iVGopBitsPred * 100.0 * INT_MULTIPLY / (pWelsSvcRc->iBitsPerFrame * VGOP_SIZE) - (double)VGOP_BITS_PERCENTAGE_DIFF; | |
| 703 | 702 | |
| 704 | 703 | if ((pWelsSvcRc->iBufferFullnessSkip > pWelsSvcRc->iBufferSizeSkip |
| 705 | 704 | && pWelsSvcRc->iAverageFrameQp > pWelsSvcRc->iSkipQpValue) |