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
5151 //#define MT_DEBUG
5252 //#define ENABLE_TRACE_MT
5353
54−
55−#define DYNAMIC_DETECT_CPU_CORES
56−
5754 #define THRESHOLD_RMSE_CORE8 0.0320f // v1.1: 0.0320f; v1.0: 0.02f
5855 #define THRESHOLD_RMSE_CORE4 0.0215f // v1.1: 0.0215f; v1.0: 0.03f
5956 #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
23952395 iCacheLineSize = 16; // 16 bytes aligned in default
23962396 #endif//X86_ASM
23972397
2398−#if defined(DYNAMIC_DETECT_CPU_CORES)
23992398 if (pCodingParam->iMultipleThreadIdc > 0)
24002399 uiCpuCores = pCodingParam->iMultipleThreadIdc;
24012400 else {
24022401 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 processor
2402+ 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
24042403 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,
24062405 // for client application here it is constrained by maximal to MAX_THREADS_NUM
2407− if (uiCpuCores > MAX_THREADS_NUM) // MAX_THREADS_NUM
2408− uiCpuCores = MAX_THREADS_NUM; // MAX_THREADS_NUM
2409− else if (uiCpuCores < 1) // just for safe
2410− uiCpuCores = 1;
2406+ if ((pCodingParam->iUsageType == CAMERA_VIDEO_REAL_TIME) || (pCodingParam->iUsageType == SCREEN_CONTENT_REAL_TIME)) {
2407+ uiCpuCores -= 1; // minus 1 for REAL_TIME video, for the processing needed by other threads
2408+ }
24112409 }
2412−#endif//DYNAMIC_DETECT_CPU_CORES
2413−
24142410 uiCpuCores = WELS_CLIP3 (uiCpuCores, 1, MAX_THREADS_NUM);
24152411
24162412 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