History

fix the missing loadbalancing part

sijchen committed 11 years ago

Commit e508c861 parent beacba78 files · +159 −20Browse files

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

Unified · Split

codec/encoder/core/src/slice_multi_threading.cpp+4−3
@@ -65,7 +65,7 @@ · 64 unmodified lines
6565 #include "wels_task_management.h"
6666
6767 #if defined(ENABLE_TRACE_MT)
68−#define MT_TRACE_LOG(x, ...) WelsLog(x, __VA_ARGS__)
68+#define MT_TRACE_LOG(pLog, x, ...) WelsLog(pLog, x, __VA_ARGS__)
6969 #else
7070 #define MT_TRACE_LOG(x, ...)
7171 #endif
@@ -812,7 +812,7 @@ WELS_THREAD_ROUTINE_TYPE CodingSliceThreadProc (void* arg) { · 740 unmodified lines
812812 if (bDsaFlag) {
813813 pEncPEncCtx->pSliceThreading->pSliceConsumeTime[pEncPEncCtx->uiDependencyId][iSliceIdx] = (uint32_t) (
814814 WelsTime() - iSliceStart);
815− MT_TRACE_LOG (pEncPEncCtx, WELS_LOG_INFO,
815+ MT_TRACE_LOG (&(pEncPEncCtx->sLogCtx), WELS_LOG_INFO,
816816 "[MT] CodingSliceThreadProc(), coding_idx %d, uiSliceIdx %d, pSliceConsumeTime %d, iSliceSize %d, pFirstMbInSlice %d, count_num_mb_in_slice %d",
817817 pEncPEncCtx->iCodingIndex, iSliceIdx,
818818 pEncPEncCtx->pSliceThreading->pSliceConsumeTime[pEncPEncCtx->uiDependencyId][iSliceIdx], iSliceSize,
@@ -1060,7 +1060,7 @@ int32_t AdjustBaseLayer (sWelsEncCtx* pCtx) { · 241 unmodified lines
10601060 #endif//MT_DEBUG
10611061
10621062 pCtx->pCurDqLayer = pCurDq;
1063−
1063+ memcpy((pCtx->pSliceThreading->pSliceConsumeTime[0]), (pCurDq->pSliceEncCtx->pSliceConsumeTime), pCurDq->pSliceEncCtx->iSliceNumInFrame*sizeof(uint32_t));
10641064 // do not need adjust due to not different at both slices of consumed time
10651065 iNeedAdj = NeedDynamicAdjust (pCtx->pSliceThreading->pSliceConsumeTime[0], pCurDq->pSliceEncCtx->iSliceNumInFrame);
10661066 if (iNeedAdj)
@@ -1092,6 +1092,7 @@ int32_t AdjustEnhanceLayer (sWelsEncCtx* pCtx, int32_t iCurDid) { · 25 unmodified lines
10921092 && (pCtx->pSvcParam->sSpatialLayers[iCurDid - 1].sSliceArgument.uiSliceMode == SM_FIXEDSLCNUM_SLICE
10931093 && pCtx->pSvcParam->iMultipleThreadIdc >= pCtx->pSvcParam->sSpatialLayers[iCurDid -
10941094 1].sSliceArgument.uiSliceNum);
1095+ memcpy((pCtx->pSliceThreading->pSliceConsumeTime[iCurDid]), (pCtx->pCurDqLayer->pSliceEncCtx->pSliceConsumeTime), pCtx->pCurDqLayer->pSliceEncCtx->iSliceNumInFrame*sizeof(uint32_t));
10951096
10961097 if (kbModelingFromSpatial) { // using spatial base layer for complexity estimation
10971098 // do not need adjust due to not different at both slices of consumed time

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