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

Unified Diff: webrtc/modules/audio_processing/audio_processing_impl.cc

Issue 1701843004: Simplified the function for detecting whether capture data is modified. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 10 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/modules/audio_processing/audio_processing_impl.cc
diff --git a/webrtc/modules/audio_processing/audio_processing_impl.cc b/webrtc/modules/audio_processing/audio_processing_impl.cc
index f3856128bb6bbd83544c1901e25a5790d2633e95..9b75b78825ec8e335789c49d8390737454866439 100644
--- a/webrtc/modules/audio_processing/audio_processing_impl.cc
+++ b/webrtc/modules/audio_processing/audio_processing_impl.cc
@@ -1132,46 +1132,23 @@ VoiceDetection* AudioProcessingImpl::voice_detection() const {
}
bool AudioProcessingImpl::is_data_processed() const {
hlundin-webrtc 2016/02/18 15:15:56 Wow, that was a really convoluted function. Nice c
- if (capture_nonlocked_.beamformer_enabled) {
+ // The beamformer, noise suppressor and highpass filter
+ // modify the data.
+ if (capture_nonlocked_.beamformer_enabled ||
+ public_submodules_->high_pass_filter->is_enabled() ||
+ public_submodules_->noise_suppression->is_enabled()) {
return true;
}
- int enabled_count = 0;
+ // All of the private submodules modify the data.
for (auto item : private_submodules_->component_list) {
if (item->is_component_enabled()) {
- enabled_count++;
+ return true;
}
}
- if (public_submodules_->high_pass_filter->is_enabled()) {
- enabled_count++;
- }
- if (public_submodules_->noise_suppression->is_enabled()) {
- enabled_count++;
- }
- if (public_submodules_->level_estimator->is_enabled()) {
- enabled_count++;
- }
- if (public_submodules_->voice_detection->is_enabled()) {
- enabled_count++;
- }
- // Data is unchanged if no components are enabled, or if only
- // public_submodules_->level_estimator
- // or public_submodules_->voice_detection is enabled.
- if (enabled_count == 0) {
- return false;
- } else if (enabled_count == 1) {
- if (public_submodules_->level_estimator->is_enabled() ||
- public_submodules_->voice_detection->is_enabled()) {
- return false;
- }
- } else if (enabled_count == 2) {
- if (public_submodules_->level_estimator->is_enabled() &&
- public_submodules_->voice_detection->is_enabled()) {
- return false;
- }
- }
- return true;
+ // The capture data is otherwise unchanged.
+ return false;
}
bool AudioProcessingImpl::output_copy_needed(bool is_data_processed) const {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698