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 | 257 | int32_t iThreadNum = 0; |
| 258 | 258 | int32_t iIdx = 0; |
| 259 | 259 | int32_t iReturn = ENC_RETURN_SUCCESS; |
| 260 | − bool bWillUseTaskManage = false; | |
| 261 | 260 | |
| 262 | 261 | if (NULL == ppCtx || NULL == pCodingParam || NULL == *ppCtx || iCountBsLen <= 0) |
| 263 | 262 | return 1; |
| @@ -281,15 +280,6 @@ int32_t RequestMtResource (sWelsEncCtx** ppCtx, SWelsSvcCodingParam* pCodingPara · 17 unmodified lines | ||
| 281 | 280 | WelsSnprintf (pSmt->eventNamespace, sizeof (pSmt->eventNamespace), "%p%x", (void*) *ppCtx, getpid()); |
| 282 | 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 | 283 | #ifdef MT_DEBUG |
| 294 | 284 | // file handle for MT debug |
| 295 | 285 | pSmt->pFSliceDiff = NULL; |
| @@ -353,10 +343,8 @@ int32_t RequestMtResource (sWelsEncCtx** ppCtx, SWelsSvcCodingParam* pCodingPara · 57 unmodified lines | ||
| 353 | 343 | iReturn = WelsMutexInit (&pSmt->mutexSliceNumUpdate); |
| 354 | 344 | WELS_VERIFY_RETURN_PROC_IF (1, (WELS_THREAD_ERROR_OK != iReturn), FreeMemorySvc (ppCtx)) |
| 355 | 345 | |
| 356 | − if (bWillUseTaskManage) { | |
| 357 | − (*ppCtx)->pTaskManage = IWelsTaskManage::CreateTaskManage (*ppCtx, iNumSpatialLayers, bDynamicSlice); | |
| 358 | − WELS_VERIFY_RETURN_PROC_IF (iReturn, (NULL == (*ppCtx)->pTaskManage), FreeMemorySvc (ppCtx)) | |
| 359 | − } | |
| 346 | + (*ppCtx)->pTaskManage = IWelsTaskManage::CreateTaskManage (*ppCtx, iNumSpatialLayers, bDynamicSlice); | |
| 347 | + WELS_VERIFY_RETURN_PROC_IF (iReturn, (NULL == (*ppCtx)->pTaskManage), FreeMemorySvc (ppCtx)) | |
| 360 | 348 | |
| 361 | 349 | memset (&pSmt->bThreadBsBufferUsage, 0, MAX_THREADS_NUM * sizeof (bool)); |
| 362 | 350 | iReturn = WelsMutexInit (&pSmt->mutexThreadBsBufferUsage); |