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
324 EXPECT_EQ (iResult, static_cast<int> (cmResultSuccess));324 EXPECT_EQ (iResult, static_cast<int> (cmResultSuccess));
325 EXPECT_EQ (sFbi.eFrameType, static_cast<int> (videoFrameTypeP));325 EXPECT_EQ (sFbi.eFrameType, static_cast<int> (videoFrameTypeP));
326 326
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
327 iResult = pPtrEnc->Uninitialize();342 iResult = pPtrEnc->Uninitialize();
328 EXPECT_EQ (iResult, static_cast<int> (cmResultSuccess));343 EXPECT_EQ (iResult, static_cast<int> (cmResultSuccess));
329 }344 }
@@ -456,7 +471,8 @@ void GetValidEncParamBase (SEncParamBase* pEncParamBase) { · 126 unmodified lines
456 pEncParamBase->iPicHeight = VALID_SIZE (pEncParamBase->iPicHeight);471 pEncParamBase->iPicHeight = VALID_SIZE (pEncParamBase->iPicHeight);
457 pEncParamBase->iTargetBitrate = rand() + 1; //!=0472 pEncParamBase->iTargetBitrate = rand() + 1; //!=0
458 // Force a bitrate of at least w*h/50, otherwise we will only get skipped frames473 // 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);
460 int32_t iLevelMaxBitrate = WelsCommon::g_ksLevelLimits[LEVEL_5_0 - 1].uiMaxBR * CpbBrNalFactor;476 int32_t iLevelMaxBitrate = WelsCommon::g_ksLevelLimits[LEVEL_5_0 - 1].uiMaxBR * CpbBrNalFactor;
461 if (pEncParamBase->iTargetBitrate > iLevelMaxBitrate)477 if (pEncParamBase->iTargetBitrate > iLevelMaxBitrate)
462 pEncParamBase->iTargetBitrate = iLevelMaxBitrate;478 pEncParamBase->iTargetBitrate = iLevelMaxBitrate;
@@ -644,7 +660,8 @@ TEST_F (EncoderInterfaceTest, ForceIntraFrameWithTemporal) { · 181 unmodified lines
644 sEncParamExt.iPicHeight = MB_SIZE + abs ((rand() * 2) % (MAX_HEIGHT - MB_SIZE));660 sEncParamExt.iPicHeight = MB_SIZE + abs ((rand() * 2) % (MAX_HEIGHT - MB_SIZE));
645 sEncParamExt.iTargetBitrate = rand() + 1; //!=0661 sEncParamExt.iTargetBitrate = rand() + 1; //!=0
646 // Force a bitrate of at least w*h/50, otherwise we will only get skipped frames662 // 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);
648 int32_t iLevelMaxBitrate = WelsCommon::g_ksLevelLimits[LEVEL_5_0 - 1].uiMaxBR * CpbBrNalFactor;665 int32_t iLevelMaxBitrate = WelsCommon::g_ksLevelLimits[LEVEL_5_0 - 1].uiMaxBR * CpbBrNalFactor;
649 if (sEncParamExt.iTargetBitrate > iLevelMaxBitrate)666 if (sEncParamExt.iTargetBitrate > iLevelMaxBitrate)
650 sEncParamExt.iTargetBitrate = iLevelMaxBitrate;667 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