History

fix bug when some parameters change dynamically

ruil2 committed 11 years ago

Commit ce14a0e1 parent 3244f112 files · +25 −5Browse files

Showing the changes to test/encoder/EncUT_EncoderExt.cpp (1 of 2 files). Show all

Unified · Split

test/encoder/EncUT_EncoderExt.cpp+19−2
@@ -324,6 +324,21 @@ TEST_F (EncoderInterfaceTest, TemporalLayerSettingTest) { · 323 unmodified lines
324324 EXPECT_EQ (iResult, static_cast<int> (cmResultSuccess));
325325 EXPECT_EQ (sFbi.eFrameType, static_cast<int> (videoFrameTypeP));
326326
327+ //change backgrouddetection and qp
328+ pOption ->bEnableBackgroundDetection = !pOption ->bEnableBackgroundDetection;
329+ iResult = pPtrEnc->SetOption (eOptionId, pOption);
330+ EXPECT_EQ (iResult, static_cast<int> (cmResultSuccess));
331+ pSrcPic->uiTimeStamp = 150;
332+ iResult = pPtrEnc->EncodeFrame (pSrcPic, &sFbi);
333+ EXPECT_EQ (iResult, static_cast<int> (cmResultSuccess));
334+
335+ pOption ->bEnableAdaptiveQuant = !pOption ->bEnableAdaptiveQuant;
336+ iResult = pPtrEnc->SetOption (eOptionId, pOption);
337+ EXPECT_EQ (iResult, static_cast<int> (cmResultSuccess));
338+ pSrcPic->uiTimeStamp = 180;
339+ iResult = pPtrEnc->EncodeFrame (pSrcPic, &sFbi);
340+ EXPECT_EQ (iResult, static_cast<int> (cmResultSuccess));
341+
327342 iResult = pPtrEnc->Uninitialize();
328343 EXPECT_EQ (iResult, static_cast<int> (cmResultSuccess));
329344 }
@@ -456,7 +471,8 @@ void GetValidEncParamBase (SEncParamBase* pEncParamBase) { · 126 unmodified lines
456471 pEncParamBase->iPicHeight = VALID_SIZE (pEncParamBase->iPicHeight);
457472 pEncParamBase->iTargetBitrate = rand() + 1; //!=0
458473 // Force a bitrate of at least w*h/50, otherwise we will only get skipped frames
459− pEncParamBase->iTargetBitrate = WELS_CLIP3 (pEncParamBase->iTargetBitrate, pEncParamBase->iPicWidth * pEncParamBase->iPicHeight / 50, 100000000);
474+ pEncParamBase->iTargetBitrate = WELS_CLIP3 (pEncParamBase->iTargetBitrate,
475+ pEncParamBase->iPicWidth * pEncParamBase->iPicHeight / 50, 100000000);
460476 int32_t iLevelMaxBitrate = WelsCommon::g_ksLevelLimits[LEVEL_5_0 - 1].uiMaxBR * CpbBrNalFactor;
461477 if (pEncParamBase->iTargetBitrate > iLevelMaxBitrate)
462478 pEncParamBase->iTargetBitrate = iLevelMaxBitrate;
@@ -644,7 +660,8 @@ TEST_F (EncoderInterfaceTest, ForceIntraFrameWithTemporal) { · 181 unmodified lines
644660 sEncParamExt.iPicHeight = MB_SIZE + abs ((rand() * 2) % (MAX_HEIGHT - MB_SIZE));
645661 sEncParamExt.iTargetBitrate = rand() + 1; //!=0
646662 // Force a bitrate of at least w*h/50, otherwise we will only get skipped frames
647− sEncParamExt.iTargetBitrate = WELS_CLIP3 (sEncParamExt.iTargetBitrate, sEncParamExt.iPicWidth * sEncParamExt.iPicHeight / 50, 100000000);
663+ sEncParamExt.iTargetBitrate = WELS_CLIP3 (sEncParamExt.iTargetBitrate,
664+ sEncParamExt.iPicWidth * sEncParamExt.iPicHeight / 50, 100000000);
648665 int32_t iLevelMaxBitrate = WelsCommon::g_ksLevelLimits[LEVEL_5_0 - 1].uiMaxBR * CpbBrNalFactor;
649666 if (sEncParamExt.iTargetBitrate > iLevelMaxBitrate)
650667 sEncParamExt.iTargetBitrate = iLevelMaxBitrate;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t