History

Merge pull request #2206 from sijchen/thp42

[Encoder] adjust encoder tasks, add ut and enable new thread pool under some cases

sijchen committed 11 years ago

Commit b0c6ea92 parents cda6a1f 3350cf715 files · +392 −44Browse files

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

Unified · Split

codec/encoder/core/src/encoder_ext.cpp+18−1
@@ -2930,6 +2930,10 @@ void WelsInitCurrentLayer (sWelsEncCtx* pCtx, · 2929 unmodified lines
29302930 } else {
29312931 pCurDq->bBaseLayerAvailableFlag = false;
29322932 }
2933+
2934+ if (pCtx->pTaskManage) {
2935+ pCtx->pTaskManage->InitFrame(kiCurDid);
2936+ }
29332937 }
29342938
29352939 static inline void SetFastCodingFunc (SWelsFuncPtrList* pFuncList) {
@@ -4016,7 +4020,7 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, SFrameBSInfo* pFbi, const SSour · 1080 unmodified lines
40164020 iSliceCount);
40174021 return ENC_RETURN_UNEXPECTED;
40184022 }
4019−
4023+ if (SM_AUTO_SLICE == pParam->sSliceCfg.uiSliceMode) {
40204024 if (pSvcParam->iCountThreadsNum >= iSliceCount) { //THREAD_FULLY_FIRE_MODE
40214025 #if defined(MT_DEBUG)
40224026 int64_t t_bs_append = 0;
@@ -4105,6 +4109,19 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, SFrameBSInfo* pFbi, const SSour · 82 unmodified lines
41054109 // append exclusive slice 0 bs to pFrameBs
41064110 iLayerSize = AppendSliceToFrameBs (pCtx, pLayerBsInfo, iSliceCount);
41074111 }
4112+
4113+ } else {
4114+ pLayerBsInfo->pBsBuf = pCtx->pFrameBs + pCtx->iPosBsBuffer;
4115+ pLayerBsInfo->uiLayerType = VIDEO_CODING_LAYER;
4116+ pLayerBsInfo->uiSpatialId = pCtx->uiDependencyId;
4117+ pLayerBsInfo->uiTemporalId = pCtx->uiTemporalId;
4118+ pLayerBsInfo->uiQualityId = 0;
4119+ pLayerBsInfo->iNalCount = 0;
4120+ pCtx->pSliceBs[0].pBs = pLayerBsInfo->pBsBuf;
4121+
4122+ pCtx->pTaskManage->ExecuteTasks();
4123+ iLayerSize = AppendSliceToFrameBs (pCtx, pLayerBsInfo, iSliceCount);
4124+ }
41084125 }
41094126 // THREAD_FULLY_FIRE_MODE && SM_DYN_SLICE
41104127 else if ((SM_DYN_SLICE == pParam->sSliceCfg.uiSliceMode) && (pSvcParam->iMultipleThreadIdc > 1)) {

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