ref: 47df411b1a8c0bbc2007a3038f186f7d90f1c5df
parent: a4370b8ca8d66eda8209c4e0f8c4cb2c126c8e2e
author: Martin Storsjö <[email protected]>
date: Tue Dec 16 06:56:48 EST 2014
Make sure the random test bitrate is high enough 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.
--- a/test/encoder/EncUT_EncoderExt.cpp
+++ b/test/encoder/EncUT_EncoderExt.cpp
@@ -455,6 +455,8 @@
pEncParamBase->iPicWidth = VALID_SIZE (pEncParamBase->iPicWidth);
pEncParamBase->iPicHeight = VALID_SIZE (pEncParamBase->iPicHeight);
pEncParamBase->iTargetBitrate = rand() + 1; //!=0
+ // Force a bitrate of at least w*h/50, otherwise we will only get skipped frames
+ pEncParamBase->iTargetBitrate = WELS_CLIP3 (pEncParamBase->iTargetBitrate, pEncParamBase->iPicWidth * pEncParamBase->iPicHeight / 50, 100000000);
int32_t iLevelMaxBitrate = WelsCommon::g_ksLevelLimits[LEVEL_5_0 - 1].uiMaxBR * CpbBrNalFactor;
if (pEncParamBase->iTargetBitrate > iLevelMaxBitrate)
pEncParamBase->iTargetBitrate = iLevelMaxBitrate;