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
62#include "cpu.h"62#include "cpu.h"
63 63
64#include "measure_time.h"64#include "measure_time.h"
65#include "wels_task_management.h"
65 66
66#if defined(ENABLE_TRACE_MT)67#if defined(ENABLE_TRACE_MT)
67#define MT_TRACE_LOG(x, ...) WelsLog(x, __VA_ARGS__)68#define MT_TRACE_LOG(x, ...) WelsLog(x, __VA_ARGS__)
@@ -443,6 +444,10 @@ int32_t RequestMtResource (sWelsEncCtx** ppCtx, SWelsSvcCodingParam* pCodingPara · 375 unmodified lines
443 iReturn = WelsMutexInit (&pSmt->mutexSliceNumUpdate);444 iReturn = WelsMutexInit (&pSmt->mutexSliceNumUpdate);
444 WELS_VERIFY_RETURN_PROC_IF (1, (WELS_THREAD_ERROR_OK != iReturn), FreeMemorySvc (ppCtx))445 WELS_VERIFY_RETURN_PROC_IF (1, (WELS_THREAD_ERROR_OK != iReturn), FreeMemorySvc (ppCtx))
445 446
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
446 iReturn = WelsMutexInit (& (*ppCtx)->mutexEncoderError);451 iReturn = WelsMutexInit (& (*ppCtx)->mutexEncoderError);
447 WELS_VERIFY_RETURN_PROC_IF (1, (WELS_THREAD_ERROR_OK != iReturn), FreeMemorySvc (ppCtx))452 WELS_VERIFY_RETURN_PROC_IF (1, (WELS_THREAD_ERROR_OK != iReturn), FreeMemorySvc (ppCtx))
448 453
@@ -496,6 +501,7 @@ void ReleaseMtResource (sWelsEncCtx** ppCtx) { · 47 unmodified lines
496 WelsEventClose (&pSmt->pSliceCodedMasterEvent, ename);501 WelsEventClose (&pSmt->pSliceCodedMasterEvent, ename);
497 502
498 WelsMutexDestroy (&pSmt->mutexSliceNumUpdate);503 WelsMutexDestroy (&pSmt->mutexSliceNumUpdate);
504 WelsMutexDestroy (&pSmt->mutexThreadBsBufferUsage);
499 WelsMutexDestroy (& ((*ppCtx)->mutexEncoderError));505 WelsMutexDestroy (& ((*ppCtx)->mutexEncoderError));
500 506
501 if (pSmt->pThreadPEncCtx != NULL) {507 if (pSmt->pThreadPEncCtx != NULL) {
@@ -509,6 +515,7 @@ void ReleaseMtResource (sWelsEncCtx** ppCtx) { · 7 unmodified lines
509 pSmt->pThreadBsBuffer[i] = NULL;515 pSmt->pThreadBsBuffer[i] = NULL;
510 }516 }
511 }517 }
518 memset(&pSmt->bThreadBsBufferUsage, 0, MAX_THREADS_NUM * sizeof(bool));
512 519
513 pSliceB = (*ppCtx)->pSliceBs;520 pSliceB = (*ppCtx)->pSliceBs;
514 iIdx = 0;521 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