History

Add tasks and thread pool call for SM_SIZELIMITED_SLICE mode

sijchen committed 10 years ago

Commit 76ca5641 parent 76b428a7 files · +165 −21Browse files

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

Unified · Split

codec/encoder/core/src/slice_multi_threading.cpp+10−2
@@ -319,7 +319,7 @@ int32_t RequestMtResource (sWelsEncCtx** ppCtx, SWelsSvcCodingParam* pCodingPara · 318 unmodified lines
319 iIdx = 0;319 iIdx = 0;
320 while (iIdx < iNumSpatialLayers) {320 while (iIdx < iNumSpatialLayers) {
321 SSliceArgument* pSliceArgument = &pPara->sSpatialLayers[iIdx].sSliceArgument;321 SSliceArgument* pSliceArgument = &pPara->sSpatialLayers[iIdx].sSliceArgument;
322 if (pSliceArgument->uiSliceMode == SM_FIXEDSLCNUM_SLICE || pSliceArgument->uiSliceMode == SM_RASTER_SLICE) {322 if (pSliceArgument->uiSliceMode == SM_FIXEDSLCNUM_SLICE || pSliceArgument->uiSliceMode == SM_RASTER_SLICE || pSliceArgument->uiSliceMode == SM_SIZELIMITED_SLICE) {
323 bWillUseTaskManage = true;323 bWillUseTaskManage = true;
324 }324 }
325 ++ iIdx;325 ++ iIdx;
@@ -763,12 +763,15 @@ WELS_THREAD_ROUTINE_TYPE CodingSliceThreadProc (void* arg) { · 437 unmodified lines
763 pCurDq->pLastMbIdxOfPartition[kiPartitionId] = kiEndMbInPartition - 1;763 pCurDq->pLastMbIdxOfPartition[kiPartitionId] = kiEndMbInPartition - 1;
764 764
765 pCurDq->pLastCodedMbIdxOfPartition[kiPartitionId] = 0;765 pCurDq->pLastCodedMbIdxOfPartition[kiPartitionId] = 0;
766
767 while (iAnyMbLeftInPartition > 0) {766 while (iAnyMbLeftInPartition > 0) {
768 if (iSliceIdx >= pSliceCtx->iMaxSliceNumConstraint) {767 if (iSliceIdx >= pSliceCtx->iMaxSliceNumConstraint) {
769 // TODO: need exception handler for not large enough of MAX_SLICES_NUM related memory usage768 // TODO: need exception handler for not large enough of MAX_SLICES_NUM related memory usage
770 // No idea about its solution due MAX_SLICES_NUM is fixed lenght in relevent pData structure769 // No idea about its solution due MAX_SLICES_NUM is fixed lenght in relevent pData structure
771 uiThrdRet = 1;770 uiThrdRet = 1;
771 WelsLog (&pEncPEncCtx->sLogCtx, WELS_LOG_WARNING,
772 "[MT] CodingSliceThreadProc Too many slices: coding_idx %d, iSliceIdx %d, pSliceCtx->iMaxSliceNumConstraint %d",
773 pEncPEncCtx->iCodingIndex,
774 iSliceIdx, pSliceCtx->iMaxSliceNumConstraint);
772 WELS_THREAD_SIGNAL_AND_BREAK (pEncPEncCtx->pSliceThreading->pSliceCodedEvent,775 WELS_THREAD_SIGNAL_AND_BREAK (pEncPEncCtx->pSliceThreading->pSliceCodedEvent,
773 pEncPEncCtx->pSliceThreading->pSliceCodedMasterEvent,776 pEncPEncCtx->pSliceThreading->pSliceCodedMasterEvent,
774 iEventIdx);777 iEventIdx);
@@ -810,6 +813,11 @@ WELS_THREAD_ROUTINE_TYPE CodingSliceThreadProc (void* arg) { · 35 unmodified lines
810 iReturn = WriteSliceBs (pEncPEncCtx, pSliceBs, iSliceIdx, iSliceSize);813 iReturn = WriteSliceBs (pEncPEncCtx, pSliceBs, iSliceIdx, iSliceSize);
811 if (ENC_RETURN_SUCCESS != iReturn) {814 if (ENC_RETURN_SUCCESS != iReturn) {
812 uiThrdRet = iReturn;815 uiThrdRet = iReturn;
816 WelsLog (&pEncPEncCtx->sLogCtx, WELS_LOG_WARNING,
817 "[MT] CodingSliceThreadProc, WriteSliceBs not successful: coding_idx %d, iSliceIdx %d, BufferSize %d, m_iSliceSize %d, iPayloadSize %d",
818 pEncPEncCtx->iCodingIndex,
819 iSliceIdx, pSliceBs->uiSize, iSliceSize, pSliceBs->sNalList[0].iPayloadSize);
820
813 WELS_THREAD_SIGNAL_AND_BREAK (pEncPEncCtx->pSliceThreading->pSliceCodedEvent,821 WELS_THREAD_SIGNAL_AND_BREAK (pEncPEncCtx->pSliceThreading->pSliceCodedEvent,
814 pEncPEncCtx->pSliceThreading->pSliceCodedMasterEvent,822 pEncPEncCtx->pSliceThreading->pSliceCodedMasterEvent,
815 iEventIdx);823 iEventIdx);

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