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 | //condition 1: whole pBuffer fullness | 694 | //condition 1: whole pBuffer fullness |
| 695 | pWelsSvcRc->iBufferFullnessSkip += (pWelsSvcRc->iFrameDqBits - kiOutputBits); | 695 | pWelsSvcRc->iBufferFullnessSkip += (pWelsSvcRc->iFrameDqBits - kiOutputBits); |
| 696 | //condition 2: VGOP bits constraint | 696 | //condition 2: VGOP bits constraint |
| 697 | const int32_t kiVGopBits = WELS_DIV_ROUND (pWelsSvcRc->iBitsPerFrame * VGOP_SIZE, INT_MULTIPLY); | ||
| 698 | int32_t iVGopBitsPred = 0; | 697 | int32_t iVGopBitsPred = 0; |
| 699 | for (int32_t i = pWelsSvcRc->iFrameCodedInVGop + 1; i < VGOP_SIZE; i++) | 698 | for (int32_t i = pWelsSvcRc->iFrameCodedInVGop + 1; i < VGOP_SIZE; i++) |
| 700 | iVGopBitsPred += pTOverRc[pWelsSvcRc->iTlOfFrames[i]].iMinBitsTl; | 699 | iVGopBitsPred += pTOverRc[pWelsSvcRc->iTlOfFrames[i]].iMinBitsTl; |
| 701 | iVGopBitsPred -= pWelsSvcRc->iRemainingBits; | 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 | if ((pWelsSvcRc->iBufferFullnessSkip > pWelsSvcRc->iBufferSizeSkip | 703 | if ((pWelsSvcRc->iBufferFullnessSkip > pWelsSvcRc->iBufferSizeSkip |
| 705 | && pWelsSvcRc->iAverageFrameQp > pWelsSvcRc->iSkipQpValue) | 704 | && pWelsSvcRc->iAverageFrameQp > pWelsSvcRc->iSkipQpValue) |