ref: 8dbdb418cac6500a4d145c8d7d6c41401365799d
parent: 030d320e43c7f2b5b65931ab52160ef1486fd52b
parent: 47df411b1a8c0bbc2007a3038f186f7d90f1c5df
author: sijchen <sijchen@cisco.com>
date: Wed Dec 17 10:50:13 EST 2014
Merge pull request #1641 from mstorsjo/test-min-bitrate Make sure the random test bitrate is high enough
--- 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;