History

[Encoder] add encoder tasks and task-management class https://rbcommons.com/s/OpenH264/r/1334/

Sijia Chen committed 11 years ago

Commit 819f6f51 parent 490098919 files · +904 −7Browse files

Showing the changes to codec/encoder/core/src/slice_multi_threading.cpp (1 of 19 files). Show all

Unified · Split

codec/encoder/core/src/slice_multi_threading.cpp+7−0
@@ -62,6 +62,7 @@ · 61 unmodified lines
6262 #include "cpu.h"
6363
6464 #include "measure_time.h"
65+#include "wels_task_management.h"
6566
6667 #if defined(ENABLE_TRACE_MT)
6768 #define MT_TRACE_LOG(x, ...) WelsLog(x, __VA_ARGS__)
@@ -443,6 +444,10 @@ int32_t RequestMtResource (sWelsEncCtx** ppCtx, SWelsSvcCodingParam* pCodingPara · 375 unmodified lines
443444 iReturn = WelsMutexInit (&pSmt->mutexSliceNumUpdate);
444445 WELS_VERIFY_RETURN_PROC_IF (1, (WELS_THREAD_ERROR_OK != iReturn), FreeMemorySvc (ppCtx))
445446
447+ memset(&pSmt->bThreadBsBufferUsage, 0, MAX_THREADS_NUM * sizeof(bool));
448+ iReturn = WelsMutexInit (&pSmt->mutexThreadBsBufferUsage);
449+ WELS_VERIFY_RETURN_PROC_IF (1, (WELS_THREAD_ERROR_OK != iReturn), FreeMemorySvc (ppCtx))
450+
446451 iReturn = WelsMutexInit (& (*ppCtx)->mutexEncoderError);
447452 WELS_VERIFY_RETURN_PROC_IF (1, (WELS_THREAD_ERROR_OK != iReturn), FreeMemorySvc (ppCtx))
448453
@@ -496,6 +501,7 @@ void ReleaseMtResource (sWelsEncCtx** ppCtx) { · 47 unmodified lines
496501 WelsEventClose (&pSmt->pSliceCodedMasterEvent, ename);
497502
498503 WelsMutexDestroy (&pSmt->mutexSliceNumUpdate);
504+ WelsMutexDestroy (&pSmt->mutexThreadBsBufferUsage);
499505 WelsMutexDestroy (& ((*ppCtx)->mutexEncoderError));
500506
501507 if (pSmt->pThreadPEncCtx != NULL) {
@@ -509,6 +515,7 @@ void ReleaseMtResource (sWelsEncCtx** ppCtx) { · 7 unmodified lines
509515 pSmt->pThreadBsBuffer[i] = NULL;
510516 }
511517 }
518+ memset(&pSmt->bThreadBsBufferUsage, 0, MAX_THREADS_NUM * sizeof(bool));
512519
513520 pSliceB = (*ppCtx)->pSliceBs;
514521 iIdx = 0;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t