shithub: openh264

Download patch

ref: 4ee434691ab430f2365d736bbf419ef68eedd83f
parent: d0d6842f73dbbd3a7f2a6284a2efa3257dac8251
author: lyao2 <[email protected]>
date: Mon Jul 28 13:43:56 EDT 2014

fix param initialization bug in UT

--- a/test/encoder/EncUT_EncoderExt.cpp
+++ b/test/encoder/EncUT_EncoderExt.cpp
@@ -316,8 +316,8 @@
 
 void GetValidEncParamBase (SEncParamBase* pEncParamBase) {
   pEncParamBase->iUsageType = CAMERA_VIDEO_REAL_TIME;
-  pEncParamBase->iPicWidth = 2 + ((rand() * 2) % (MAX_WIDTH - 2));
-  pEncParamBase->iPicHeight = 2 + ((rand() * 2) % (MAX_HEIGHT - 2));
+  pEncParamBase->iPicWidth = 2 + ((rand() % ((MAX_WIDTH >> 1) - 1)) << 1);
+  pEncParamBase->iPicHeight = 2 + ((rand() % ((MAX_HEIGHT >> 1) - 1)) << 1);
   pEncParamBase->iPicWidth = VALID_SIZE(pEncParamBase->iPicWidth);
   pEncParamBase->iPicHeight = VALID_SIZE(pEncParamBase->iPicHeight);
   pEncParamBase->iTargetBitrate = rand() + 1; //!=0