MCPcopy Create free account
hub / github.com/cisco/openh264 / GetValidEncParamBase

Function GetValidEncParamBase

test/encoder/EncUT_EncoderExt.cpp:475–490  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

473}
474
475void GetValidEncParamBase (SEncParamBase* pEncParamBase) {
476 pEncParamBase->iUsageType = CAMERA_VIDEO_REAL_TIME;
477 pEncParamBase->iPicWidth = 2 + ((rand() % ((MAX_WIDTH >> 1) - 1)) << 1);
478 pEncParamBase->iPicHeight = 2 + ((rand() % ((MAX_HEIGHT >> 1) - 1)) << 1);
479 pEncParamBase->iPicWidth = VALID_SIZE (pEncParamBase->iPicWidth);
480 pEncParamBase->iPicHeight = VALID_SIZE (pEncParamBase->iPicHeight);
481 pEncParamBase->iTargetBitrate = rand() + 1; //!=0
482 // Force a bitrate of at least w*h/50, otherwise we will only get skipped frames
483 pEncParamBase->iTargetBitrate = WELS_CLIP3 (pEncParamBase->iTargetBitrate,
484 pEncParamBase->iPicWidth * pEncParamBase->iPicHeight / 50, 60000000);
485 int32_t iLevelMaxBitrate = WelsCommon::g_ksLevelLimits[LEVEL_NUMBER - 1].uiMaxBR * CpbBrNalFactor;
486 if (pEncParamBase->iTargetBitrate > iLevelMaxBitrate)
487 pEncParamBase->iTargetBitrate = iLevelMaxBitrate;
488 pEncParamBase->iRCMode = RC_BITRATE_MODE; //-1, 0, 1, 2
489 pEncParamBase->fMaxFrameRate = rand() + 0.5f; //!=0
490}
491
492TEST_F (EncoderInterfaceTest, BasicInitializeTest) {
493 SEncParamBase sEncParamBase;

Callers 1

TEST_FFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected