Showing the changes to codec/encoder/core/src/slice_multi_threading.cpp (1 of 7 files). Show all
Unified · Split
| @@ -237,8 +237,8 @@ void DynamicAdjustSlicing (sWelsEncCtx* pCtx, · 236 unmodified lines | ||
| 237 | 237 | return; |
| 238 | 238 | } |
| 239 | 239 | iRunLen[iSliceIdx] = iNumMbAssigning; |
| 240 | − MT_TRACE_LOG (& (pCtx->sLogCtx), WELS_LOG_DEBUG, | |
| 241 | − "[MT] DynamicAdjustSlicing(), uiSliceIdx= %d, iSliceComplexRatio= %.2f, slice_run_org= %d, slice_run_adj= %d", | |
| 240 | + MT_TRACE_LOG (&(pCtx->sLogCtx), WELS_LOG_DEBUG, | |
| 241 | + "[MT] DynamicAdjustSlicing(), iSliceIdx= %d, iSliceComplexRatio= %.2f, slice_run_org= %d, slice_run_adj= %d", | |
| 242 | 242 | iSliceIdx, ppSliceInLayer[iSliceIdx]->iSliceComplexRatio * 1.0f / INT_MULTIPLY, |
| 243 | 243 | ppSliceInLayer[iSliceIdx]->iCountMbNumInSlice, |
| 244 | 244 | iNumMbAssigning); |
| @@ -262,7 +262,6 @@ int32_t RequestMtResource (sWelsEncCtx** ppCtx, SWelsSvcCodingParam* pCodingPara · 17 unmodified lines | ||
| 262 | 262 | int32_t iThreadNum = 0; |
| 263 | 263 | int32_t iIdx = 0; |
| 264 | 264 | int32_t iReturn = ENC_RETURN_SUCCESS; |
| 265 | − int32_t iMaxSliceNumInThread = 0; | |
| 266 | 265 | |
| 267 | 266 | if (NULL == ppCtx || NULL == pCodingParam || NULL == *ppCtx || iCountBsLen <= 0) |
| 268 | 267 | return 1; |
| @@ -275,8 +274,6 @@ int32_t RequestMtResource (sWelsEncCtx** ppCtx, SWelsSvcCodingParam* pCodingPara · 6 unmodified lines | ||
| 275 | 274 | iThreadNum = pPara->iMultipleThreadIdc; |
| 276 | 275 | |
| 277 | 276 | assert (iThreadNum > 0); |
| 278 | − iMaxSliceNumInThread = ((*ppCtx)->iMaxSliceCount / iThreadNum + 1) * 2; | |
| 279 | − iMaxSliceNumInThread = WELS_MIN ((*ppCtx)->iMaxSliceCount, (int) iMaxSliceNumInThread); | |
| 280 | 277 | |
| 281 | 278 | pSmt = (SSliceThreading*)pMa->WelsMalloc (sizeof (SSliceThreading), "SSliceThreading"); |
| 282 | 279 | WELS_VERIFY_RETURN_IF (1, (NULL == pSmt)) |
| @@ -636,7 +633,7 @@ WELS_THREAD_ROUTINE_TYPE CodingSliceThreadProc (void* arg) { · 353 unmodified lines | ||
| 636 | 633 | |
| 637 | 634 | WelsLoadNalForSlice (pSliceBs, eNalType, eNalRefIdc); |
| 638 | 635 | pCurSlice = pEncPEncCtx->pCurDqLayer->ppSliceInLayer[iSliceIdx]; |
| 639 | − assert (iSliceIdx == (int) pCurSlice->uiSliceIdx); | |
| 636 | + assert (iSliceIdx == (int) pCurSlice->iSliceIdx); | |
| 640 | 637 | iReturn = SetSliceBoundaryInfo(pEncPEncCtx->pCurDqLayer, pCurSlice, iSliceIdx); |
| 641 | 638 | if (ENC_RETURN_SUCCESS != iReturn) { |
| 642 | 639 | uiThrdRet = iReturn; |
| @@ -653,7 +650,7 @@ WELS_THREAD_ROUTINE_TYPE CodingSliceThreadProc (void* arg) { · 10 unmodified lines | ||
| 653 | 650 | iEventIdx); |
| 654 | 651 | } |
| 655 | 652 | |
| 656 | − assert (iSliceIdx == (int) pSlice->uiSliceIdx); | |
| 653 | + assert (iSliceIdx == pSlice->iSliceIdx); | |
| 657 | 654 | iReturn = WelsCodeOneSlice (pEncPEncCtx, pSlice, eNalType); |
| 658 | 655 | if (ENC_RETURN_SUCCESS != iReturn) { |
| 659 | 656 | uiThrdRet = iReturn; |
| @@ -677,7 +674,7 @@ WELS_THREAD_ROUTINE_TYPE CodingSliceThreadProc (void* arg) { · 17 unmodified lines | ||
| 677 | 674 | if (bDsaFlag) { |
| 678 | 675 | pSlice->uiSliceConsumeTime = (uint32_t) (WelsTime() - iSliceStart); |
| 679 | 676 | MT_TRACE_LOG (& (pEncPEncCtx->sLogCtx), WELS_LOG_INFO, |
| 680 | − "[MT] CodingSliceThreadProc(), coding_idx %d, uiSliceIdx %d, uiSliceConsumeTime %d, iSliceSize %d, iFirstMbInSlice %d, count_num_mb_in_slice %d", | |
| 677 | + "[MT] CodingSliceThreadProc(), coding_idx %d, iSliceIdx %d, uiSliceConsumeTime %d, iSliceSize %d, iFirstMbInSlice %d, count_num_mb_in_slice %d", | |
| 681 | 678 | pEncPEncCtx->iCodingIndex, iSliceIdx, |
| 682 | 679 | pSlice->uiSliceConsumeTime, iSliceSize, |
| 683 | 680 | pSlice->sSliceHeaderExt.sSliceHeader.iFirstMbInSlice, |
| @@ -750,7 +747,7 @@ WELS_THREAD_ROUTINE_TYPE CodingSliceThreadProc (void* arg) { · 66 unmodified lines | ||
| 750 | 747 | |
| 751 | 748 | WelsLoadNalForSlice (pSliceBs, eNalType, eNalRefIdc); |
| 752 | 749 | |
| 753 | − assert (iSliceIdx == (int) pSlice->uiSliceIdx); | |
| 750 | + assert (iSliceIdx == pSlice->iSliceIdx); | |
| 754 | 751 | iReturn = WelsCodeOneSlice (pEncPEncCtx, pSlice, eNalType); |
| 755 | 752 | if (ENC_RETURN_SUCCESS != iReturn) { |
| 756 | 753 | uiThrdRet = iReturn; |
| @@ -786,8 +783,8 @@ WELS_THREAD_ROUTINE_TYPE CodingSliceThreadProc (void* arg) { · 29 unmodified lines | ||
| 786 | 783 | ); |
| 787 | 784 | #endif//SLICE_INFO_OUTPUT |
| 788 | 785 | |
| 789 | − MT_TRACE_LOG (& (pEncPEncCtx->sLogCtx), WELS_LOG_INFO, | |
| 790 | − "[MT] CodingSliceThreadProc(), coding_idx %d, iPartitionId %d, uiSliceIdx %d, iSliceSize %d, count_mb_slice %d, iEndMbInPartition %d, pCurDq->pLastCodedMbIdxOfPartition[%d] %d\n", | |
| 786 | + MT_TRACE_LOG (&(pEncPEncCtx->sLogCtx), WELS_LOG_INFO, | |
| 787 | + "[MT] CodingSliceThreadProc(), coding_idx %d, iPartitionId %d, iSliceIdx %d, iSliceSize %d, count_mb_slice %d, iEndMbInPartition %d, pCurDq->pLastCodedMbIdxOfPartition[%d] %d\n", | |
| 791 | 788 | pEncPEncCtx->iCodingIndex, kiPartitionId, iSliceIdx, iSliceSize, |
| 792 | 789 | pSlice->iCountMbNumInSlice, |
| 793 | 790 | kiEndMbIdxInPartition, kiPartitionId, pCurDq->pLastCodedMbIdxOfPartition[kiPartitionId]); |