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

Unified Diff: webrtc/modules/audio_processing/intelligibility/intelligibility_utils.cc

Issue 1234463003: Integrate Intelligibility with APM (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Updated interface, how VAD is used, other issues 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/intelligibility/intelligibility_utils.cc
diff --git a/webrtc/modules/audio_processing/intelligibility/intelligibility_utils.cc b/webrtc/modules/audio_processing/intelligibility/intelligibility_utils.cc
index d67d200689f1613391c18c138b55f504a18ffde4..2d7309ee12aafbd9048909a1ed789e3496789b79 100644
--- a/webrtc/modules/audio_processing/intelligibility/intelligibility_utils.cc
+++ b/webrtc/modules/audio_processing/intelligibility/intelligibility_utils.cc
@@ -329,6 +329,22 @@ void GainApplier::Apply(const complex<float>* in_block,
}
}
+void GainApplier::Clear() {
+ for (int i = 0; i < freqs_; i++) {
aluebs-webrtc 2015/07/20 19:33:43 ++i Also, maybe use num_freqs_? It is clearer.
ekm 2015/07/21 01:02:44 Done.
+ target_[i] = 1.0f;
aluebs-webrtc 2015/07/20 19:33:43 1.f
ekm 2015/07/21 01:02:44 Done.
+ }
+}
+
+// TODO(ekmeyerson): Can reduce from O(|freqs_|) to O(1) if necessary.
+bool GainApplier::IsIdentity() {
+ for (int i = 0; i < freqs_; i++) {
aluebs-webrtc 2015/07/20 19:33:43 ++i
ekm 2015/07/21 01:02:44 Done.
+ if (current_[i] != 1.0f || target_[i] != 1.0f) {
aluebs-webrtc 2015/07/20 19:33:43 1.f both times.
ekm 2015/07/21 01:02:44 Done.
+ return false;
+ }
+ }
+ return true;
+}
+
} // namespace intelligibility
} // namespace webrtc

Powered by Google App Engine
This is Rietveld 408576698