enhance a UT to cover more case
This commit is contained in:
parent
bf35b6fee7
commit
5cad0f9bba
@ -2500,14 +2500,6 @@ int32_t WelsInitEncoderExt (sWelsEncCtx** ppCtx, SWelsSvcCodingParam* pCodingPar
|
||||
return iRet;
|
||||
}
|
||||
|
||||
if (pCodingParam->iMultipleThreadIdc > 1) {
|
||||
iRet = CreateSliceThreads (pCtx);
|
||||
if (iRet != 0) {
|
||||
WelsLog (pLogCtx, WELS_LOG_ERROR, "WelsInitEncoderExt(), CreateSliceThreads failed return %d.", iRet);
|
||||
FreeMemorySvc (&pCtx);
|
||||
return iRet;
|
||||
}
|
||||
}
|
||||
if (pCodingParam->iEntropyCodingModeFlag)
|
||||
WelsCabacInit (pCtx);
|
||||
WelsRcInitModule (pCtx, pCtx->pSvcParam->iRCMode);
|
||||
|
@ -334,11 +334,9 @@ int32_t RequestMtResource (sWelsEncCtx** ppCtx, SWelsSvcCodingParam* pCodingPara
|
||||
pSmt->pThreadBsBuffer[iIdx] = NULL;
|
||||
}
|
||||
|
||||
//previous conflict
|
||||
WelsSnprintf (name, SEM_NAME_MAX, "scm%s", pSmt->eventNamespace);
|
||||
err = WelsEventOpen (&pSmt->pSliceCodedMasterEvent, name);
|
||||
MT_TRACE_LOG (*ppCtx, WELS_LOG_INFO, "[MT] Open pSliceCodedMasterEvent named(%s) ret%d err%d", name, err, errno);
|
||||
//previous conflict ends
|
||||
|
||||
iReturn = WelsMutexInit (&pSmt->mutexSliceNumUpdate);
|
||||
WELS_VERIFY_RETURN_PROC_IF (1, (WELS_THREAD_ERROR_OK != iReturn), FreeMemorySvc (ppCtx))
|
||||
|
@ -1447,15 +1447,19 @@ TEST_F (EncodeDecodeTestAPI, DiffSlicingInDlayerMixed) {
|
||||
sParam.bSimulcastAVC = 1;
|
||||
sParam.sSpatialLayers[0].iVideoWidth = (iWidth >> 2);
|
||||
sParam.sSpatialLayers[0].iVideoHeight = (iHeight >> 2);
|
||||
sParam.sSpatialLayers[0].sSliceArgument.uiSliceMode = SM_SIZELIMITED_SLICE;
|
||||
sParam.sSpatialLayers[0].sSliceArgument.uiSliceMode = (rand() % 2) ? SM_SIZELIMITED_SLICE : SM_FIXEDSLCNUM_SLICE;
|
||||
sParam.sSpatialLayers[0].sSliceArgument.uiSliceSizeConstraint = 1500;
|
||||
|
||||
sParam.sSpatialLayers[1].iVideoWidth = iWidth;
|
||||
sParam.sSpatialLayers[1].iVideoHeight = iHeight;
|
||||
sParam.sSpatialLayers[1].sSliceArgument.uiSliceMode = SM_FIXEDSLCNUM_SLICE;
|
||||
sParam.sSpatialLayers[1].sSliceArgument.uiSliceMode = (rand() % 2) ? SM_SIZELIMITED_SLICE : SM_FIXEDSLCNUM_SLICE;
|
||||
sParam.sSpatialLayers[1].sSliceArgument.uiSliceNum = 1;
|
||||
sParam.sSpatialLayers[1].sSliceArgument.uiSliceSizeConstraint = 1500;
|
||||
|
||||
int rv = encoder_->InitializeExt (&sParam);
|
||||
int iTraceLevel = WELS_LOG_QUIET;
|
||||
int rv = encoder_->SetOption (ENCODER_OPTION_TRACE_LEVEL, &iTraceLevel);
|
||||
|
||||
rv = encoder_->InitializeExt (&sParam);
|
||||
ASSERT_TRUE (rv == cmResultSuccess) << "Init Failed sParam: rv = " << rv;;
|
||||
|
||||
unsigned char* pBsBuf[MAX_SPATIAL_LAYER_NUM];
|
||||
@ -1568,14 +1572,18 @@ TEST_F (EncodeDecodeTestAPI, TriggerLoadBalancing) {
|
||||
SEncParamExt sParam;
|
||||
encoder_->GetDefaultParams (&sParam);
|
||||
prepareParamDefault (iSpatialLayerNum, 1, iWidth, iHeight, fFrameRate, &sParam);
|
||||
sParam.iMultipleThreadIdc = (rand() % 8) + 1;
|
||||
sParam.iMultipleThreadIdc = 4;
|
||||
sParam.bSimulcastAVC = 1;
|
||||
sParam.sSpatialLayers[0].iVideoWidth = iWidth;
|
||||
sParam.sSpatialLayers[0].iVideoHeight = iHeight;
|
||||
sParam.sSpatialLayers[0].sSliceArgument.uiSliceMode = SM_FIXEDSLCNUM_SLICE;
|
||||
//TODO: use this after the buffer problem is fixed. sParam.sSpatialLayers[0].sSliceArgument.uiSliceMode = (rand()%2) ? SM_FIXEDSLCNUM_SLICE : SM_SIZELIMITED_SLICE;
|
||||
sParam.sSpatialLayers[0].sSliceArgument.uiSliceNum = sParam.iMultipleThreadIdc;
|
||||
sParam.sSpatialLayers[0].sSliceArgument.uiSliceSizeConstraint = 1000;
|
||||
|
||||
int rv = encoder_->InitializeExt (&sParam);
|
||||
int iTraceLevel = WELS_LOG_QUIET;
|
||||
int rv = encoder_->SetOption (ENCODER_OPTION_TRACE_LEVEL, &iTraceLevel);
|
||||
rv = encoder_->InitializeExt (&sParam);
|
||||
ASSERT_TRUE (rv == cmResultSuccess) << "Init Failed sParam: rv = " << rv;;
|
||||
|
||||
unsigned char* pBsBuf[MAX_SPATIAL_LAYER_NUM];
|
||||
|
Loading…
x
Reference in New Issue
Block a user