shithub: openh264

Download patch

ref: 887b4f47fca8bb13eb7075803fa227fa65383459
parent: ef5f1c46b97b7cbe7d6d533467e900f5ae72e4fe
author: Martin Storsjö <martin@martin.st>
date: Fri Dec 19 19:33:42 EST 2014

Make sure the random test bitrate is high enough

This is the same fix as in 47df41 (for the ForceIntraFrame
test) applied to the ForceIntraFrameWithTemporal test.

--- a/test/encoder/EncUT_EncoderExt.cpp
+++ b/test/encoder/EncUT_EncoderExt.cpp
@@ -643,6 +643,8 @@
   sEncParamExt.iPicWidth = MB_SIZE + abs ((rand() * 2) % (MAX_WIDTH - MB_SIZE));
   sEncParamExt.iPicHeight = MB_SIZE + abs ((rand() * 2) % (MAX_HEIGHT - MB_SIZE));
   sEncParamExt.iTargetBitrate = rand() + 1; //!=0
+  // Force a bitrate of at least w*h/50, otherwise we will only get skipped frames
+  sEncParamExt.iTargetBitrate = WELS_CLIP3 (sEncParamExt.iTargetBitrate, sEncParamExt.iPicWidth * sEncParamExt.iPicHeight / 50, 100000000);
   int32_t iLevelMaxBitrate = WelsCommon::g_ksLevelLimits[LEVEL_5_0 - 1].uiMaxBR * CpbBrNalFactor;
   if (sEncParamExt.iTargetBitrate > iLevelMaxBitrate)
     sEncParamExt.iTargetBitrate = iLevelMaxBitrate;