Add more conditions for CPU detection in denoiser filter.
Add WEBRTC_HAS_NEON and __SSE2__, otherwise, CPU detection fails in some cases. Review URL: https://codereview.webrtc.org/1784323005 Cr-Commit-Position: refs/heads/master@{#12001}
This commit is contained in:
@ -28,12 +28,18 @@ std::unique_ptr<DenoiserFilter> DenoiserFilter::Create(
|
||||
if (runtime_cpu_detection) {
|
||||
// If we know the minimum architecture at compile time, avoid CPU detection.
|
||||
#if defined(WEBRTC_ARCH_X86_FAMILY)
|
||||
#if defined(__SSE2__)
|
||||
filter.reset(new DenoiserFilterSSE2());
|
||||
#else
|
||||
// x86 CPU detection required.
|
||||
if (WebRtc_GetCPUInfo(kSSE2)) {
|
||||
filter.reset(new DenoiserFilterSSE2());
|
||||
} else {
|
||||
filter.reset(new DenoiserFilterC());
|
||||
}
|
||||
#endif
|
||||
#elif defined(WEBRTC_HAS_NEON)
|
||||
filter.reset(new DenoiserFilterNEON());
|
||||
#elif defined(WEBRTC_DETECT_NEON)
|
||||
if (WebRtc_GetCPUFeaturesARM() & kCPUFeatureNEON) {
|
||||
filter.reset(new DenoiserFilterNEON());
|
||||
|
||||
Reference in New Issue
Block a user