Showing the changes to test/encoder/EncUT_EncoderExt.cpp (1 of 2 files). Show all
Unified · Split
| @@ -324,6 +324,21 @@ TEST_F (EncoderInterfaceTest, TemporalLayerSettingTest) { · 323 unmodified lines | ||
| 324 | 324 | EXPECT_EQ (iResult, static_cast<int> (cmResultSuccess)); |
| 325 | 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 | 342 | iResult = pPtrEnc->Uninitialize(); |
| 328 | 343 | EXPECT_EQ (iResult, static_cast<int> (cmResultSuccess)); |
| 329 | 344 | } |
| @@ -456,7 +471,8 @@ void GetValidEncParamBase (SEncParamBase* pEncParamBase) { · 126 unmodified lines | ||
| 456 | 471 | pEncParamBase->iPicHeight = VALID_SIZE (pEncParamBase->iPicHeight); |
| 457 | 472 | pEncParamBase->iTargetBitrate = rand() + 1; //!=0 |
| 458 | 473 | // 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 | 476 | int32_t iLevelMaxBitrate = WelsCommon::g_ksLevelLimits[LEVEL_5_0 - 1].uiMaxBR * CpbBrNalFactor; |
| 461 | 477 | if (pEncParamBase->iTargetBitrate > iLevelMaxBitrate) |
| 462 | 478 | pEncParamBase->iTargetBitrate = iLevelMaxBitrate; |
| @@ -644,7 +660,8 @@ TEST_F (EncoderInterfaceTest, ForceIntraFrameWithTemporal) { · 181 unmodified lines | ||
| 644 | 660 | sEncParamExt.iPicHeight = MB_SIZE + abs ((rand() * 2) % (MAX_HEIGHT - MB_SIZE)); |
| 645 | 661 | sEncParamExt.iTargetBitrate = rand() + 1; //!=0 |
| 646 | 662 | // 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 | 665 | int32_t iLevelMaxBitrate = WelsCommon::g_ksLevelLimits[LEVEL_5_0 - 1].uiMaxBR * CpbBrNalFactor; |
| 649 | 666 | if (sEncParamExt.iTargetBitrate > iLevelMaxBitrate) |
| 650 | 667 | sEncParamExt.iTargetBitrate = iLevelMaxBitrate; |