The caller of the function should not need to know exactly which implementation of it is being used. For the variants that don't support detecting the number of cores, the pNumberOfLogicProcessors parameter can be left untouched and the caller will use a higher level API for finding it out. This simplifies all the calling code, and simplifies adding more implementations of cpu feature detection.
Showing the changes to codec/processing/src/common/WelsFrameWork.cpp (1 of 5 files). Show all
Unified · Split
| @@ -87,11 +87,7 @@ EResult DestroySpecificVpInterface (IWelsVP* pCtx) { · 86 unmodified lines | ||
| 87 | 87 | |
| 88 | 88 | CVpFrameWork::CVpFrameWork (uint32_t uiThreadsNum, EResult& eReturn) { |
| 89 | 89 | int32_t iCoreNum = 1; |
| 90 | −#ifndef X86_ASM | |
| 91 | − uint32_t uiCPUFlag = 0; | |
| 92 | −#else | |
| 93 | 90 | uint32_t uiCPUFlag = WelsCPUFeatureDetect (&iCoreNum); |
| 94 | −#endif | |
| 95 | 91 | |
| 96 | 92 | for (int32_t i = 0; i < MAX_STRATEGY_NUM; i++) { |
| 97 | 93 | IStrategy* pStrategy = m_pStgChain[i]; |