History

adjust encoder tasks, add ut and enable new thread pool under some slice modes

Sijia Chen committed 11 years ago

Commit 054a2971 parent 1a7a3e215 files · +330 −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) {
@@ -4013,7 +4017,7 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, SFrameBSInfo* pFbi, const SSour · 1077 unmodified lines
40134017 iSliceCount);
40144018 return ENC_RETURN_UNEXPECTED;
40154019 }
4016−
4020+ if (SM_AUTO_SLICE == pParam->sSliceCfg.uiSliceMode) {
40174021 if (pSvcParam->iCountThreadsNum >= iSliceCount) { //THREAD_FULLY_FIRE_MODE
40184022 #if defined(MT_DEBUG)
40194023 int64_t t_bs_append = 0;
@@ -4102,6 +4106,19 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, SFrameBSInfo* pFbi, const SSour · 82 unmodified lines
41024106 // append exclusive slice 0 bs to pFrameBs
41034107 iLayerSize = AppendSliceToFrameBs (pCtx, pLayerBsInfo, iSliceCount);
41044108 }
4109+
4110+ } else {
4111+ pLayerBsInfo->pBsBuf = pCtx->pFrameBs + pCtx->iPosBsBuffer;
4112+ pLayerBsInfo->uiLayerType = VIDEO_CODING_LAYER;
4113+ pLayerBsInfo->uiSpatialId = pCtx->uiDependencyId;
4114+ pLayerBsInfo->uiTemporalId = pCtx->uiTemporalId;
4115+ pLayerBsInfo->uiQualityId = 0;
4116+ pLayerBsInfo->iNalCount = 0;
4117+ pCtx->pSliceBs[0].pBs = pLayerBsInfo->pBsBuf;
4118+
4119+ pCtx->pTaskManage->ExecuteTasks();
4120+ iLayerSize = AppendSliceToFrameBs (pCtx, pLayerBsInfo, iSliceCount);
4121+ }
41054122 }
41064123 // THREAD_FULLY_FIRE_MODE && SM_DYN_SLICE
41074124 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