remove iCountThreadsNum and unitfy with iMultipleThreadIdc
Showing the changes to codec/encoder/core/src/slice_multi_threading.cpp (1 of 4 files). Show all
Unified · Split
| @@ -299,7 +299,7 @@ int32_t RequestMtResource (sWelsEncCtx** ppCtx, SWelsSvcCodingParam* pCodingPara · 298 unmodified lines | |||
| 299 | pMa = (*ppCtx)->pMemAlign; | 299 | pMa = (*ppCtx)->pMemAlign; |
| 300 | pPara = pCodingParam; | 300 | pPara = pCodingParam; |
| 301 | iNumSpatialLayers = pPara->iSpatialLayerNum; | 301 | iNumSpatialLayers = pPara->iSpatialLayerNum; |
| 302 | iThreadNum = pPara->iCountThreadsNum; | 302 | iThreadNum = pPara->iMultipleThreadIdc; |
| 303 | iMaxSliceNum = (*ppCtx)->iMaxSliceCount; | 303 | iMaxSliceNum = (*ppCtx)->iMaxSliceCount; |
| 304 | 304 | ||
| 305 | pSmt = (SSliceThreading*)pMa->WelsMalloc (sizeof (SSliceThreading), "SSliceThreading"); | 305 | pSmt = (SSliceThreading*)pMa->WelsMalloc (sizeof (SSliceThreading), "SSliceThreading"); |
| @@ -406,8 +406,8 @@ int32_t RequestMtResource (sWelsEncCtx** ppCtx, SWelsSvcCodingParam* pCodingPara · 100 unmodified lines | |||
| 406 | iReturn = WelsMutexInit (& (*ppCtx)->mutexEncoderError); | 406 | iReturn = WelsMutexInit (& (*ppCtx)->mutexEncoderError); |
| 407 | WELS_VERIFY_RETURN_PROC_IF (1, (WELS_THREAD_ERROR_OK != iReturn), FreeMemorySvc (ppCtx)) | 407 | WELS_VERIFY_RETURN_PROC_IF (1, (WELS_THREAD_ERROR_OK != iReturn), FreeMemorySvc (ppCtx)) |
| 408 | 408 | ||
| 409 | MT_TRACE_LOG (*ppCtx, WELS_LOG_INFO, "RequestMtResource(), iThreadNum=%d, iCountSliceNum= %d", | 409 | MT_TRACE_LOG (*ppCtx, WELS_LOG_INFO, "RequestMtResource(), iThreadNum=%d, iMultipleThreadIdc= %d", |
| 410 | pPara->iCountThreadsNum, | 410 | pPara->iMultipleThreadIdc, |
| 411 | iMaxSliceNum); | 411 | iMaxSliceNum); |
| 412 | 412 | ||
| 413 | return 0; | 413 | return 0; |
| @@ -426,7 +426,7 @@ void ReleaseMtResource (sWelsEncCtx** ppCtx) { · 12 unmodified lines | |||
| 426 | 426 | ||
| 427 | pMa = (*ppCtx)->pMemAlign; | 427 | pMa = (*ppCtx)->pMemAlign; |
| 428 | uiSliceNum = (*ppCtx)->iMaxSliceCount; | 428 | uiSliceNum = (*ppCtx)->iMaxSliceCount; |
| 429 | iThreadNum = (*ppCtx)->pSvcParam->iCountThreadsNum; | 429 | iThreadNum = (*ppCtx)->pSvcParam->iMultipleThreadIdc; |
| 430 | pSmt = (*ppCtx)->pSliceThreading; | 430 | pSmt = (*ppCtx)->pSliceThreading; |
| 431 | 431 | ||
| 432 | if (NULL == pSmt) | 432 | if (NULL == pSmt) |
| @@ -880,7 +880,7 @@ WELS_THREAD_ROUTINE_TYPE CodingSliceThreadProc (void* arg) { · 447 unmodified lines | |||
| 880 | } | 880 | } |
| 881 | 881 | ||
| 882 | int32_t CreateSliceThreads (sWelsEncCtx* pCtx) { | 882 | int32_t CreateSliceThreads (sWelsEncCtx* pCtx) { |
| 883 | const int32_t kiThreadCount = pCtx->pSvcParam->iCountThreadsNum; | 883 | const int32_t kiThreadCount = pCtx->pSvcParam->iMultipleThreadIdc; |
| 884 | int32_t iIdx = 0; | 884 | int32_t iIdx = 0; |
| 885 | 885 | ||
| 886 | while (iIdx < kiThreadCount) { | 886 | while (iIdx < kiThreadCount) { |