Showing the changes to codec/encoder/core/src/slice_multi_threading.cpp (1 of 2 files). Show all
Unified · Split
| @@ -332,22 +332,19 @@ int32_t RequestMtResource (sWelsEncCtx** ppCtx, SWelsSvcCodingParam* pCodingPara · 331 unmodified lines | ||
| 332 | 332 | WELS_VERIFY_RETURN_PROC_IF (1, (NULL == pSmt->pReadySliceCodingEvent), FreeMemorySvc (ppCtx)) |
| 333 | 333 | pSmt->pFinSliceCodingEvent = (WELS_EVENT*)pMa->WelsMalloc (sizeof (WELS_EVENT) * iThreadNum, "pFinSliceCodingEvent"); |
| 334 | 334 | WELS_VERIFY_RETURN_PROC_IF (1, (NULL == pSmt->pFinSliceCodingEvent), FreeMemorySvc (ppCtx)) |
| 335 | −#else | |
| 336 | − pSmt->pUpdateMbListThrdHandles = (WELS_THREAD_HANDLE*)pMa->WelsMalloc (sizeof (WELS_THREAD_HANDLE) * iThreadNum, | |
| 337 | − "pUpdateMbListThrdHandles"); | |
| 338 | − WELS_VERIFY_RETURN_PROC_IF (1, (NULL == pSmt->pUpdateMbListThrdHandles), FreeMemorySvc (ppCtx)) | |
| 339 | −#endif//!_WIN32 | |
| 340 | −#ifdef _WIN32 | |
| 335 | + | |
| 341 | 336 | pSmt->pUpdateMbListEvent = (WELS_EVENT*)pMa->WelsMalloc (sizeof (WELS_EVENT) * iThreadNum, "pUpdateMbListEvent"); |
| 342 | 337 | WELS_VERIFY_RETURN_PROC_IF (1, (NULL == pSmt->pUpdateMbListEvent), FreeMemorySvc (ppCtx)) |
| 343 | 338 | pSmt->pFinUpdateMbListEvent = (WELS_EVENT*)pMa->WelsMalloc (sizeof (WELS_EVENT) * iThreadNum, "pFinUpdateMbListEvent"); |
| 344 | 339 | WELS_VERIFY_RETURN_PROC_IF (1, (NULL == pSmt->pFinUpdateMbListEvent), FreeMemorySvc (ppCtx)) |
| 345 | −#endif//_WIN32 | |
| 346 | 340 | |
| 347 | −#ifdef _WIN32 | |
| 348 | 341 | pSmt->pExitEncodeEvent = (WELS_EVENT*)pMa->WelsMalloc (sizeof (WELS_EVENT) * iThreadNum, "pExitEncodeEvent"); |
| 349 | 342 | WELS_VERIFY_RETURN_PROC_IF (1, (NULL == pSmt->pExitEncodeEvent), FreeMemorySvc (ppCtx)) |
| 350 | −#endif//_WIN32 | |
| 343 | +#else | |
| 344 | + pSmt->pUpdateMbListThrdHandles = (WELS_THREAD_HANDLE*)pMa->WelsMalloc (sizeof (WELS_THREAD_HANDLE) * iThreadNum, | |
| 345 | + "pUpdateMbListThrdHandles"); | |
| 346 | + WELS_VERIFY_RETURN_PROC_IF (1, (NULL == pSmt->pUpdateMbListThrdHandles), FreeMemorySvc (ppCtx)) | |
| 347 | +#endif//!_WIN32 | |
| 351 | 348 | |
| 352 | 349 | iIdx = 0; |
| 353 | 350 | while (iIdx < iNumSpatialLayers) { |
| @@ -396,6 +393,10 @@ int32_t RequestMtResource (sWelsEncCtx** ppCtx, SWelsSvcCodingParam* pCodingPara · 42 unmodified lines | ||
| 396 | 393 | #ifdef _WIN32 |
| 397 | 394 | WelsEventInit (&pSmt->pUpdateMbListEvent[iIdx]); |
| 398 | 395 | WelsEventInit (&pSmt->pFinUpdateMbListEvent[iIdx]); |
| 396 | + WelsEventInit (&pSmt->pSliceCodedEvent[iIdx]); | |
| 397 | + WelsEventInit (&pSmt->pReadySliceCodingEvent[iIdx]); | |
| 398 | + WelsEventInit (&pSmt->pFinSliceCodingEvent[iIdx]); | |
| 399 | + WelsEventInit (&pSmt->pExitEncodeEvent[iIdx]); | |
| 399 | 400 | #else |
| 400 | 401 | // length of semaphore name should be system constrained at least on mac 10.7 |
| 401 | 402 | WelsSnprintf (name, SEM_NAME_MAX, "ud%d%p", iIdx, (void*) (*ppCtx)); |
| @@ -408,14 +409,6 @@ int32_t RequestMtResource (sWelsEncCtx** ppCtx, SWelsSvcCodingParam* pCodingPara · 6 unmodified lines | ||
| 408 | 409 | #if defined(ENABLE_TRACE_MT) |
| 409 | 410 | WelsLog ((*ppCtx), WELS_LOG_INFO, "[MT] Open pFinUpdateMbListEvent%d named(%s) ret%d err%d\n", iIdx, name, err, errno); |
| 410 | 411 | #endif |
| 411 | −#endif//_WIN32 | |
| 412 | − | |
| 413 | −#ifdef _WIN32 | |
| 414 | − WelsEventInit (&pSmt->pSliceCodedEvent[iIdx]); | |
| 415 | − WelsEventInit (&pSmt->pReadySliceCodingEvent[iIdx]); | |
| 416 | − WelsEventInit (&pSmt->pFinSliceCodingEvent[iIdx]); | |
| 417 | − WelsEventInit (&pSmt->pExitEncodeEvent[iIdx]); | |
| 418 | −#else | |
| 419 | 412 | WelsSnprintf (name, SEM_NAME_MAX, "sc%d%p", iIdx, (void*) (*ppCtx)); |
| 420 | 413 | err = WelsEventOpen (&pSmt->pSliceCodedEvent[iIdx], name); |
| 421 | 414 | #if defined(ENABLE_TRACE_MT) |