ref: 3dff262fe7c9b260d9cb3fd20e10cb9ab32625ca
parent: 5a8f5e8cf12d7cf46d3c28a31299b646e7bf3282
author: Karina <[email protected]>
date: Mon Jul 18 12:11:12 EDT 2016
set complexity mode
--- a/codec/console/enc/src/welsenc.cpp
+++ b/codec/console/enc/src/welsenc.cpp
@@ -667,7 +667,7 @@
sParam.uiIntraPeriod = 320; // period of Intra frame
sParam.eSpsPpsIdStrategy = INCREASING_ID;
sParam.bPrefixNalAddingCtrl = 0;
- sParam.iComplexityMode = MEDIUM_COMPLEXITY;
+ sParam.iComplexityMode = LOW_COMPLEXITY;
sParam.bSimulcastAVC = false;
int iIndexLayer = 0;
sParam.sSpatialLayers[iIndexLayer].uiProfileIdc = PRO_BASELINE;
--- a/codec/encoder/core/inc/param_svc.h
+++ b/codec/encoder/core/inc/param_svc.h
@@ -136,7 +136,7 @@
param.fMaxFrameRate = MAX_FRAME_RATE; // maximal frame rate [Hz / fps]
- param.iComplexityMode = MEDIUM_COMPLEXITY;
+ param.iComplexityMode = LOW_COMPLEXITY;
param.iTargetBitrate = UNSPECIFIED_BIT_RATE; // overall target bitrate introduced in RC module
param.iMaxBitrate = UNSPECIFIED_BIT_RATE;
param.iMultipleThreadIdc = 1;
--- a/codec/encoder/core/src/encoder_ext.cpp
+++ b/codec/encoder/core/src/encoder_ext.cpp
@@ -2759,12 +2759,13 @@
//const bool kbBaseAvail = pCurLayer->bBaseLayerAvailableFlag;
const bool kbHighestSpatialLayer =
(pCtx->pSvcParam->iSpatialLayerNum == (pCurLayer->sLayerInfo.sNalHeaderExt.uiDependencyId + 1));
+ bool bFastMode = kbHighestSpatialLayer && (pCtx->pSvcParam->iComplexityMode == LOW_COMPLEXITY);
SWelsFuncPtrList* pFuncList = pCtx->pFuncList;
SLogContext* pLogCtx = & (pCtx->sLogCtx);
/* function pointers conditional assignment under sWelsEncCtx, layer_mb_enc_rec (in stack) is exclusive */
- if ((pCtx->pSvcParam->iUsageType == CAMERA_VIDEO_REAL_TIME && kbHighestSpatialLayer) ||
+ if ((pCtx->pSvcParam->iUsageType == CAMERA_VIDEO_REAL_TIME && bFastMode) ||
(pCtx->pSvcParam->iUsageType == SCREEN_CONTENT_REAL_TIME && P_SLICE == pCtx->eSliceType
- && kbHighestSpatialLayer) //TODO: here is for sync with the origin code, consider the design again with more tests
+ && bFastMode) //TODO: here is for sync with the origin code, consider the design again with more tests
) {
SetFastCodingFunc (pFuncList);
} else {
@@ -2786,7 +2787,7 @@
pFuncList->sSampleDealingFuncs.pfMeCost = pCtx->pFuncList->sSampleDealingFuncs.pfSampleSatd;
pFuncList->pfSetScrollingMv = SetScrollingMvToMdNull;
- if (kbHighestSpatialLayer) {
+ if (bFastMode) {
pFuncList->pfCalculateSatd = NotCalculateSatdCost;
pFuncList->pfInterFineMd = WelsMdInterFinePartitionVaa;
} else {