The ForceIntraFrame test will fail (giving up after 100 skipped frames) if the bitrate is not set high enough. Set the minimum bitrate to w*h/50, which is a very low value, but which still should allow getting a non-skipped frame within a few attempts.
Showing the changes to test/encoder/EncUT_EncoderExt.cpp (1 of 1 file). Show all
Unified · Split
| @@ -455,6 +455,8 @@ void GetValidEncParamBase (SEncParamBase* pEncParamBase) { · 454 unmodified lines | |||
| 455 | pEncParamBase->iPicWidth = VALID_SIZE (pEncParamBase->iPicWidth); | 455 | pEncParamBase->iPicWidth = VALID_SIZE (pEncParamBase->iPicWidth); |
| 456 | pEncParamBase->iPicHeight = VALID_SIZE (pEncParamBase->iPicHeight); | 456 | pEncParamBase->iPicHeight = VALID_SIZE (pEncParamBase->iPicHeight); |
| 457 | pEncParamBase->iTargetBitrate = rand() + 1; //!=0 | 457 | pEncParamBase->iTargetBitrate = rand() + 1; //!=0 |
| 458 | // Force a bitrate of at least w*h/50, otherwise we will only get skipped frames | ||
| 459 | pEncParamBase->iTargetBitrate = WELS_CLIP3 (pEncParamBase->iTargetBitrate, pEncParamBase->iPicWidth * pEncParamBase->iPicHeight / 50, 100000000); | ||
| 458 | int32_t iLevelMaxBitrate = WelsCommon::g_ksLevelLimits[LEVEL_5_0 - 1].uiMaxBR * CpbBrNalFactor; | 460 | int32_t iLevelMaxBitrate = WelsCommon::g_ksLevelLimits[LEVEL_5_0 - 1].uiMaxBR * CpbBrNalFactor; |
| 459 | if (pEncParamBase->iTargetBitrate > iLevelMaxBitrate) | 461 | if (pEncParamBase->iTargetBitrate > iLevelMaxBitrate) |
| 460 | pEncParamBase->iTargetBitrate = iLevelMaxBitrate; | 462 | pEncParamBase->iTargetBitrate = iLevelMaxBitrate; |