| @@ -2395,22 +2395,18 @@ int32_t GetMultipleThreadIdc (SLogContext* pLogCtx, SWelsSvcCodingParam* pCoding · 2394 unmodified lines |
| 2395 | iCacheLineSize = 16; // 16 bytes aligned in default | 2395 | iCacheLineSize = 16; // 16 bytes aligned in default |
| 2396 | #endif//X86_ASM | 2396 | #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 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 |
| 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_NUM | 2405 | // for client application here it is constrained by maximal to MAX_THREADS_NUM |
| 2407 | if (uiCpuCores > MAX_THREADS_NUM) // MAX_THREADS_NUM | 2406 | if ((pCodingParam->iUsageType == CAMERA_VIDEO_REAL_TIME) || (pCodingParam->iUsageType == SCREEN_CONTENT_REAL_TIME)) { |
| 2408 | uiCpuCores = MAX_THREADS_NUM; // MAX_THREADS_NUM | 2407 | uiCpuCores -= 1; // minus 1 for REAL_TIME video, for the processing needed by other threads |
| 2409 | else if (uiCpuCores < 1) // just for safe | 2408 | } |
| 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)) { |