mirror of
https://github.com/mollyim/webrtc.git
synced 2025-05-19 08:37:54 +01:00
SSE2 and NEON kill switches for AGC2
Bug: webrtc:7494 Change-Id: I221b717b5cf3c41b7b637e9234d1e339a0e6c7e5 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/199967 Reviewed-by: Sam Zackrisson <saza@webrtc.org> Commit-Queue: Alessio Bazzica <alessiob@webrtc.org> Cr-Commit-Position: refs/heads/master@{#32918}
This commit is contained in:
parent
b8f32c4a86
commit
524f682184
2 changed files with 13 additions and 4 deletions
|
@ -33,12 +33,19 @@ constexpr int kGainApplierAdjacentSpeechFramesThreshold = 1;
|
||||||
constexpr float kMaxGainChangePerSecondDb = 3.f;
|
constexpr float kMaxGainChangePerSecondDb = 3.f;
|
||||||
constexpr float kMaxOutputNoiseLevelDbfs = -50.f;
|
constexpr float kMaxOutputNoiseLevelDbfs = -50.f;
|
||||||
|
|
||||||
// Detects the available CPU features and applies a kill-switch to AVX2.
|
// Detects the available CPU features and applies any kill-switches.
|
||||||
AvailableCpuFeatures GetAllowedCpuFeatures(bool avx2_allowed) {
|
AvailableCpuFeatures GetAllowedCpuFeatures(
|
||||||
|
const AudioProcessing::Config::GainController2::AdaptiveDigital& config) {
|
||||||
AvailableCpuFeatures features = GetAvailableCpuFeatures();
|
AvailableCpuFeatures features = GetAvailableCpuFeatures();
|
||||||
if (!avx2_allowed) {
|
if (!config.sse2_allowed) {
|
||||||
|
features.sse2 = false;
|
||||||
|
}
|
||||||
|
if (!config.avx2_allowed) {
|
||||||
features.avx2 = false;
|
features.avx2 = false;
|
||||||
}
|
}
|
||||||
|
if (!config.neon_allowed) {
|
||||||
|
features.neon = false;
|
||||||
|
}
|
||||||
return features;
|
return features;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -65,7 +72,7 @@ AdaptiveAgc::AdaptiveAgc(ApmDataDumper* apm_data_dumper,
|
||||||
config.adaptive_digital.initial_saturation_margin_db,
|
config.adaptive_digital.initial_saturation_margin_db,
|
||||||
config.adaptive_digital.extra_saturation_margin_db),
|
config.adaptive_digital.extra_saturation_margin_db),
|
||||||
vad_(config.adaptive_digital.vad_probability_attack,
|
vad_(config.adaptive_digital.vad_probability_attack,
|
||||||
GetAllowedCpuFeatures(config.adaptive_digital.avx2_allowed)),
|
GetAllowedCpuFeatures(config.adaptive_digital)),
|
||||||
gain_applier_(
|
gain_applier_(
|
||||||
apm_data_dumper,
|
apm_data_dumper,
|
||||||
config.adaptive_digital.gain_applier_adjacent_speech_frames_threshold,
|
config.adaptive_digital.gain_applier_adjacent_speech_frames_threshold,
|
||||||
|
|
|
@ -365,7 +365,9 @@ class RTC_EXPORT AudioProcessing : public rtc::RefCountInterface {
|
||||||
int gain_applier_adjacent_speech_frames_threshold = 1;
|
int gain_applier_adjacent_speech_frames_threshold = 1;
|
||||||
float max_gain_change_db_per_second = 3.f;
|
float max_gain_change_db_per_second = 3.f;
|
||||||
float max_output_noise_level_dbfs = -50.f;
|
float max_output_noise_level_dbfs = -50.f;
|
||||||
|
bool sse2_allowed = true;
|
||||||
bool avx2_allowed = true;
|
bool avx2_allowed = true;
|
||||||
|
bool neon_allowed = true;
|
||||||
} adaptive_digital;
|
} adaptive_digital;
|
||||||
} gain_controller2;
|
} gain_controller2;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue