ref: d2896038b8986a04434cde72801d425f97831fe3
parent: d0d6842f73dbbd3a7f2a6284a2efa3257dac8251
parent: 4ee434691ab430f2365d736bbf419ef68eedd83f
author: ruil2 <[email protected]>
date: Tue Jul 29 05:33:06 EDT 2014
Merge pull request #1230 from lyao2/ut_fixbug 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