Showing the changes to codec/encoder/core/src/slice_multi_threading.cpp (1 of 1 file). Show all
Unified · Split
| @@ -257,7 +257,6 @@ int32_t RequestMtResource (sWelsEncCtx** ppCtx, SWelsSvcCodingParam* pCodingPara · 256 unmodified lines | |||
| 257 | int32_t iThreadNum = 0; | 257 | int32_t iThreadNum = 0; |
| 258 | int32_t iIdx = 0; | 258 | int32_t iIdx = 0; |
| 259 | int32_t iReturn = ENC_RETURN_SUCCESS; | 259 | int32_t iReturn = ENC_RETURN_SUCCESS; |
| 260 | bool bWillUseTaskManage = false; | ||
| 261 | 260 | ||
| 262 | if (NULL == ppCtx || NULL == pCodingParam || NULL == *ppCtx || iCountBsLen <= 0) | 261 | if (NULL == ppCtx || NULL == pCodingParam || NULL == *ppCtx || iCountBsLen <= 0) |
| 263 | return 1; | 262 | return 1; |
| @@ -281,15 +280,6 @@ int32_t RequestMtResource (sWelsEncCtx** ppCtx, SWelsSvcCodingParam* pCodingPara · 17 unmodified lines | |||
| 281 | WelsSnprintf (pSmt->eventNamespace, sizeof (pSmt->eventNamespace), "%p%x", (void*) *ppCtx, getpid()); | 280 | WelsSnprintf (pSmt->eventNamespace, sizeof (pSmt->eventNamespace), "%p%x", (void*) *ppCtx, getpid()); |
| 282 | #endif//!_WIN32 | 281 | #endif//!_WIN32 |
| 283 | 282 | ||
| 284 | iIdx = 0; | ||
| 285 | while (iIdx < iNumSpatialLayers) { | ||
| 286 | SSliceArgument* pSliceArgument = &pPara->sSpatialLayers[iIdx].sSliceArgument; | ||
| 287 | if (pSliceArgument->uiSliceMode == SM_FIXEDSLCNUM_SLICE || pSliceArgument->uiSliceMode == SM_RASTER_SLICE || pSliceArgument->uiSliceMode == SM_SIZELIMITED_SLICE) { | ||
| 288 | bWillUseTaskManage = true; | ||
| 289 | } | ||
| 290 | ++ iIdx; | ||
| 291 | } | ||
| 292 | |||
| 293 | #ifdef MT_DEBUG | 283 | #ifdef MT_DEBUG |
| 294 | // file handle for MT debug | 284 | // file handle for MT debug |
| 295 | pSmt->pFSliceDiff = NULL; | 285 | pSmt->pFSliceDiff = NULL; |
| @@ -353,10 +343,8 @@ int32_t RequestMtResource (sWelsEncCtx** ppCtx, SWelsSvcCodingParam* pCodingPara · 57 unmodified lines | |||
| 353 | iReturn = WelsMutexInit (&pSmt->mutexSliceNumUpdate); | 343 | iReturn = WelsMutexInit (&pSmt->mutexSliceNumUpdate); |
| 354 | WELS_VERIFY_RETURN_PROC_IF (1, (WELS_THREAD_ERROR_OK != iReturn), FreeMemorySvc (ppCtx)) | 344 | WELS_VERIFY_RETURN_PROC_IF (1, (WELS_THREAD_ERROR_OK != iReturn), FreeMemorySvc (ppCtx)) |
| 355 | 345 | ||
| 356 | if (bWillUseTaskManage) { | 346 | (*ppCtx)->pTaskManage = IWelsTaskManage::CreateTaskManage (*ppCtx, iNumSpatialLayers, bDynamicSlice); |
| 357 | (*ppCtx)->pTaskManage = IWelsTaskManage::CreateTaskManage (*ppCtx, iNumSpatialLayers, bDynamicSlice); | 347 | WELS_VERIFY_RETURN_PROC_IF (iReturn, (NULL == (*ppCtx)->pTaskManage), FreeMemorySvc (ppCtx)) |
| 358 | WELS_VERIFY_RETURN_PROC_IF (iReturn, (NULL == (*ppCtx)->pTaskManage), FreeMemorySvc (ppCtx)) | ||
| 359 | } | ||
| 360 | 348 | ||
| 361 | memset (&pSmt->bThreadBsBufferUsage, 0, MAX_THREADS_NUM * sizeof (bool)); | 349 | memset (&pSmt->bThreadBsBufferUsage, 0, MAX_THREADS_NUM * sizeof (bool)); |
| 362 | iReturn = WelsMutexInit (&pSmt->mutexThreadBsBufferUsage); | 350 | iReturn = WelsMutexInit (&pSmt->mutexThreadBsBufferUsage); |