History

remove one always-on macro to save code complexity, and use core-1 for multi-threading in real-time

Sijia Chen committed 11 years ago

Commit daee3dc1 parent 9ecc6712 files · +5 −12Browse files

Unified · Split

2 files
  1. codec/encoder/core/inc/mt_defs.h +0 −3
  2. codec/encoder/core/src/encoder_ext.cpp +5 −9
codec/encoder/core/inc/mt_defs.h+0−3
@@ -51,9 +51,6 @@ · 50 unmodified lines
51//#define MT_DEBUG51//#define MT_DEBUG
52//#define ENABLE_TRACE_MT52//#define ENABLE_TRACE_MT
53 53
54
55#define DYNAMIC_DETECT_CPU_CORES
56
57#define THRESHOLD_RMSE_CORE8 0.0320f // v1.1: 0.0320f; v1.0: 0.02f54#define THRESHOLD_RMSE_CORE8 0.0320f // v1.1: 0.0320f; v1.0: 0.02f
58#define THRESHOLD_RMSE_CORE4 0.0215f // v1.1: 0.0215f; v1.0: 0.03f55#define THRESHOLD_RMSE_CORE4 0.0215f // v1.1: 0.0215f; v1.0: 0.03f
59#define THRESHOLD_RMSE_CORE2 0.0200f // v1.1: 0.0200f; v1.0: 0.04f56#define THRESHOLD_RMSE_CORE2 0.0200f // v1.1: 0.0200f; v1.0: 0.04f
codec/encoder/core/src/encoder_ext.cpp+5−9
@@ -2395,22 +2395,18 @@ int32_t GetMultipleThreadIdc (SLogContext* pLogCtx, SWelsSvcCodingParam* pCoding · 2394 unmodified lines
2395 iCacheLineSize = 16; // 16 bytes aligned in default2395 iCacheLineSize = 16; // 16 bytes aligned in default
2396#endif//X86_ASM2396#endif//X86_ASM
2397 2397
2398#if defined(DYNAMIC_DETECT_CPU_CORES)
2399 if (pCodingParam->iMultipleThreadIdc > 0)2398 if (pCodingParam->iMultipleThreadIdc > 0)
2400 uiCpuCores = pCodingParam->iMultipleThreadIdc;2399 uiCpuCores = pCodingParam->iMultipleThreadIdc;
2401 else {2400 else {
2402 if (uiCpuCores ==2401 if (uiCpuCores ==
2403 0) // cpuid not supported or doesn't expose the number of cores, use high level system API as followed to detect number of pysical/logic processor2402 0) { // cpuid not supported or doesn't expose the number of cores, use high level system API as followed to detect number of pysical/logic processor
2404 uiCpuCores = DynamicDetectCpuCores();2403 uiCpuCores = DynamicDetectCpuCores();
2405 // So far so many cpu cores up to MAX_THREADS_NUM mean for server platforms,2404 }// So far so many cpu cores up to MAX_THREADS_NUM mean for server platforms,
2406 // for client application here it is constrained by maximal to MAX_THREADS_NUM2405 // for client application here it is constrained by maximal to MAX_THREADS_NUM
2407 if (uiCpuCores > MAX_THREADS_NUM) // MAX_THREADS_NUM2406 if ((pCodingParam->iUsageType == CAMERA_VIDEO_REAL_TIME) || (pCodingParam->iUsageType == SCREEN_CONTENT_REAL_TIME)) {
2408 uiCpuCores = MAX_THREADS_NUM; // MAX_THREADS_NUM2407 uiCpuCores -= 1; // minus 1 for REAL_TIME video, for the processing needed by other threads
2409 else if (uiCpuCores < 1) // just for safe2408 }
2410 uiCpuCores = 1;
2411 }2409 }
2412#endif//DYNAMIC_DETECT_CPU_CORES
2413
2414 uiCpuCores = WELS_CLIP3 (uiCpuCores, 1, MAX_THREADS_NUM);2410 uiCpuCores = WELS_CLIP3 (uiCpuCores, 1, MAX_THREADS_NUM);
2415 2411
2416 if (InitSliceSettings (pLogCtx, pCodingParam, uiCpuCores, &iSliceNum)) {2412 if (InitSliceSettings (pLogCtx, pCodingParam, uiCpuCores, &iSliceNum)) {

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