Add IntelligibilityEnhancer support to audioproc_float

R=peah@webrtc.org

Review URL: https://codereview.webrtc.org/1800413002 .

Cr-Commit-Position: refs/heads/master@{#12147}
This commit is contained in:
Alejandro Luebs
2016-03-29 12:43:32 -07:00
parent f537768497
commit 98c69a0ee7
7 changed files with 99 additions and 38 deletions

View File

@ -177,17 +177,15 @@ std::vector<float> NoiseSuppressionImpl::NoiseEstimate() {
rtc::CritScope cs(crit_);
std::vector<float> noise_estimate;
#if defined(WEBRTC_NS_FLOAT)
const float kNormalizationFactor = 1.f / (1 << 15);
noise_estimate.assign(WebRtcNs_num_freq(), 0.f);
for (auto& suppressor : suppressors_) {
const float* noise = WebRtcNs_noise_estimate(suppressor->state());
for (size_t i = 0; i < noise_estimate.size(); ++i) {
noise_estimate[i] +=
kNormalizationFactor * noise[i] / suppressors_.size();
noise_estimate[i] += noise[i] / suppressors_.size();
}
}
#elif defined(WEBRTC_NS_FIXED)
const float kNormalizationFactor = 1.f / (1 << 23);
const float kNormalizationFactor = 1.f / (1 << 9);
noise_estimate.assign(WebRtcNsx_num_freq(), 0.f);
for (auto& suppressor : suppressors_) {
const uint32_t* noise = WebRtcNsx_noise_estimate(suppressor->state());