Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(317)

Unified Diff: webrtc/modules/audio_processing/beamformer/nonlinear_beamformer.cc

Issue 1235643003: Miscellaneous changes split from https://codereview.webrtc.org/1230503003 . (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: Resync Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: webrtc/modules/audio_processing/beamformer/nonlinear_beamformer.cc
diff --git a/webrtc/modules/audio_processing/beamformer/nonlinear_beamformer.cc b/webrtc/modules/audio_processing/beamformer/nonlinear_beamformer.cc
index 66ad6259a3690c31f96668c6d9c206ed1ae9cca7..6925b617624579bcc70804b25ef1456af88757cf 100644
--- a/webrtc/modules/audio_processing/beamformer/nonlinear_beamformer.cc
+++ b/webrtc/modules/audio_processing/beamformer/nonlinear_beamformer.cc
@@ -120,7 +120,7 @@ complex<float> ConjugateDotProduct(const ComplexMatrix<float>& lhs,
// Works for positive numbers only.
int Round(float x) {
- return std::floor(x + 0.5f);
+ return static_cast<int>(std::floor(x + 0.5f));
}
// Calculates the sum of absolute values of a complex matrix.
@@ -464,9 +464,9 @@ void NonlinearBeamformer::ApplyMaskFrequencySmoothing() {
final_mask_[i] = kMaskFrequencySmoothAlpha * final_mask_[i] +
(1 - kMaskFrequencySmoothAlpha) * final_mask_[i - 1];
}
- for (int i = high_mean_end_bin_; i >= 0; --i) {
- final_mask_[i] = kMaskFrequencySmoothAlpha * final_mask_[i] +
- (1 - kMaskFrequencySmoothAlpha) * final_mask_[i + 1];
+ for (int i = high_mean_end_bin_ + 1; i > 0; --i) {
+ final_mask_[i - 1] = kMaskFrequencySmoothAlpha * final_mask_[i - 1] +
+ (1 - kMaskFrequencySmoothAlpha) * final_mask_[i];
}
}

Powered by Google App Engine
This is Rietveld 408576698