History

remove iCountThreadsNum and unitfy with iMultipleThreadIdc

huade committed 10 years ago

Commit e8536c61 parent ee01b3a4 files · +16 −21Browse files

Showing the changes to codec/encoder/core/src/encoder_ext.cpp (1 of 4 files). Show all

Unified · Split

codec/encoder/core/src/encoder_ext.cpp+10−11
@@ -1186,7 +1186,7 @@ static inline int32_t InitDqLayers (sWelsEncCtx** ppCtx, SExistingParasetList* p · 1185 unmodified lines
11861186
11871187 // for dynamic slicing mode
11881188 if (SM_SIZELIMITED_SLICE == pDlayer->sSliceArgument.uiSliceMode) {
1189− const int32_t iSize = pParam->iCountThreadsNum * sizeof (int32_t);
1189+ const int32_t iSize = pParam->iMultipleThreadIdc * sizeof (int32_t);
11901190
11911191 pDqLayer->pNumSliceCodedOfPartition = (int32_t*)pMa->WelsMallocz (iSize, "pNumSliceCodedOfPartition");
11921192 pDqLayer->pLastCodedMbIdxOfPartition = (int32_t*)pMa->WelsMallocz (iSize, "pLastCodedMbIdxOfPartition");
@@ -2291,8 +2291,7 @@ int32_t InitSliceSettings (SLogContext* pLogCtx, SWelsSvcCodingParam* pCodingPar · 1098 unmodified lines
22912291 ++ iSpatialIdx;
22922292 } while (iSpatialIdx < iSpatialNum);
22932293
2294− pCodingParam->iCountThreadsNum = WELS_MIN (kiCpuCores, iMaxSliceCount);
2295− pCodingParam->iMultipleThreadIdc = pCodingParam->iCountThreadsNum;
2294+ pCodingParam->iMultipleThreadIdc = WELS_MIN (kiCpuCores, iMaxSliceCount);
22962295 if (pCodingParam->iLoopFilterDisableIdc == 0
22972296 && pCodingParam->iMultipleThreadIdc != 1) // Loop filter requested to be enabled, with threading enabled
22982297 pCodingParam->iLoopFilterDisableIdc =
@@ -2454,7 +2453,7 @@ int32_t WelsInitEncoderExt (sWelsEncCtx** ppCtx, SWelsSvcCodingParam* pCodingPar · 155 unmodified lines
24542453 }
24552454 InitFunctionPointers (pCtx, pCtx->pSvcParam, uiCpuFeatureFlags);
24562455
2457− pCtx->iActiveThreadsNum = pCodingParam->iCountThreadsNum;
2456+ pCtx->iActiveThreadsNum = pCodingParam->iMultipleThreadIdc;
24582457 pCtx->iMaxSliceCount = iSliceNum;
24592458 iRet = RequestMemorySvc (&pCtx, pExistingParasetList);
24602459 if (iRet != 0) {
@@ -2593,15 +2592,15 @@ void WelsUninitEncoderExt (sWelsEncCtx** ppCtx) { · 132 unmodified lines
25932592 return;
25942593
25952594 WelsLog (& (*ppCtx)->sLogCtx, WELS_LOG_INFO,
2596− "WelsUninitEncoderExt(), pCtx= %p, iThreadCount= %d, iMultipleThreadIdc= %d.",
2597− (void*) (*ppCtx), (*ppCtx)->pSvcParam->iCountThreadsNum, (*ppCtx)->pSvcParam->iMultipleThreadIdc);
2595+ "WelsUninitEncoderExt(), pCtx= %p, iMultipleThreadIdc= %d.",
2596+ (void*) (*ppCtx), (*ppCtx)->pSvcParam->iMultipleThreadIdc);
25982597
25992598 #if defined(STAT_OUTPUT)
26002599 StatOverallEncodingExt (*ppCtx);
26012600 #endif
26022601
26032602 if ((*ppCtx)->pSvcParam->iMultipleThreadIdc > 1 && (*ppCtx)->pSliceThreading != NULL) {
2604− const int32_t iThreadCount = (*ppCtx)->pSvcParam->iCountThreadsNum;
2603+ const int32_t iThreadCount = (*ppCtx)->pSvcParam->iMultipleThreadIdc;
26052604 int32_t iThreadIdx = 0;
26062605
26072606 while (iThreadIdx < iThreadCount) {
@@ -2656,7 +2655,7 @@ void DynslcUpdateMbNeighbourInfoListForAllSlices (SDqLayer* pCurDq, SMB* pMbList · 48 unmodified lines
26562655 int32_t PicPartitionNumDecision (sWelsEncCtx* pCtx) {
26572656 int32_t iPartitionNum = 1;
26582657 if (pCtx->pSvcParam->iMultipleThreadIdc > 1) {
2659− iPartitionNum = pCtx->pSvcParam->iCountThreadsNum;
2658+ iPartitionNum = pCtx->pSvcParam->iMultipleThreadIdc;
26602659 }
26612660 return iPartitionNum;
26622661 }
@@ -3964,7 +3963,7 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, SFrameBSInfo* pFbi, const SSour · 1301 unmodified lines
39643963 }
39653964 // THREAD_FULLY_FIRE_MODE && SM_SIZELIMITED_SLICE
39663965 else if ((SM_SIZELIMITED_SLICE == pParam->sSliceArgument.uiSliceMode) && (pSvcParam->iMultipleThreadIdc > 1)) {
3967− const int32_t kiPartitionCnt = pCtx->iActiveThreadsNum; //pSvcParam->iCountThreadsNum;
3966+ const int32_t kiPartitionCnt = pCtx->iActiveThreadsNum;
39683967
39693968 #if 0 //TODO: temporarily use this to keep old codes for a while, will remove old codes later
39703969 int32_t iRet = 0;
@@ -3975,8 +3974,8 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, SFrameBSInfo* pFbi, const SSour · 4 unmodified lines
39753974 pFbi, kiPartitionCnt, &pCtx->pCurDqLayer->sSliceEncCtx, true);
39763975 if (iRet) {
39773976 WelsLog (pLogCtx, WELS_LOG_ERROR,
3978− "[MT] WelsEncoderEncodeExt(), FiredSliceThreads return(%d) failed and exit encoding frame, iCountThreadsNum= %d, iSliceCount= %d, uiSliceMode= %d, iMultipleThreadIdc= %d!!",
3979− iRet, pSvcParam->iCountThreadsNum, iSliceCount, pParam->sSliceArgument.uiSliceMode, pSvcParam->iMultipleThreadIdc);
3977+ "[MT] WelsEncoderEncodeExt(), FiredSliceThreads return(%d) failed and exit encoding frame, iSliceCount= %d, uiSliceMode= %d, iMultipleThreadIdc= %d!!",
3978+ iRet, iSliceCount, pParam->sSliceArgument.uiSliceMode, pSvcParam->iMultipleThreadIdc);
39803979 return ENC_RETURN_UNEXPECTED;
39813980 }
39823981

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