OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 1081 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1092 // from the returned pointer. | 1092 // from the returned pointer. |
1093 return public_submodules_->noise_suppression.get(); | 1093 return public_submodules_->noise_suppression.get(); |
1094 } | 1094 } |
1095 | 1095 |
1096 VoiceDetection* AudioProcessingImpl::voice_detection() const { | 1096 VoiceDetection* AudioProcessingImpl::voice_detection() const { |
1097 // Adding a lock here has no effect as it allows any access to the submodule | 1097 // Adding a lock here has no effect as it allows any access to the submodule |
1098 // from the returned pointer. | 1098 // from the returned pointer. |
1099 return public_submodules_->voice_detection.get(); | 1099 return public_submodules_->voice_detection.get(); |
1100 } | 1100 } |
1101 | 1101 |
1102 bool AudioProcessingImpl::is_data_processed() const { | 1102 bool AudioProcessingImpl::is_fwd_processed() const { |
1103 // The beamformer, noise suppressor and highpass filter | 1103 // The beamformer, noise suppressor and highpass filter |
1104 // modify the data. | 1104 // modify the data. |
1105 if (capture_nonlocked_.beamformer_enabled || | 1105 if (capture_nonlocked_.beamformer_enabled || |
1106 public_submodules_->high_pass_filter->is_enabled() || | 1106 public_submodules_->high_pass_filter->is_enabled() || |
1107 public_submodules_->noise_suppression->is_enabled() || | 1107 public_submodules_->noise_suppression->is_enabled() || |
1108 public_submodules_->echo_cancellation->is_enabled() || | 1108 public_submodules_->echo_cancellation->is_enabled() || |
1109 public_submodules_->echo_control_mobile->is_enabled() || | 1109 public_submodules_->echo_control_mobile->is_enabled() || |
1110 public_submodules_->gain_control->is_enabled()) { | 1110 public_submodules_->gain_control->is_enabled()) { |
1111 return true; | 1111 return true; |
1112 } | 1112 } |
1113 | 1113 |
1114 // The capture data is otherwise unchanged. | 1114 // The capture data is otherwise unchanged. |
1115 return false; | 1115 return false; |
1116 } | 1116 } |
1117 | 1117 |
1118 bool AudioProcessingImpl::output_copy_needed() const { | 1118 bool AudioProcessingImpl::output_copy_needed() const { |
1119 // Check if we've upmixed or downmixed the audio. | 1119 // Check if we've upmixed or downmixed the audio. |
1120 return ((formats_.api_format.output_stream().num_channels() != | 1120 return ((formats_.api_format.output_stream().num_channels() != |
1121 formats_.api_format.input_stream().num_channels()) || | 1121 formats_.api_format.input_stream().num_channels()) || |
1122 is_data_processed() || capture_.transient_suppressor_enabled); | 1122 is_fwd_processed() || capture_.transient_suppressor_enabled); |
1123 } | 1123 } |
1124 | 1124 |
1125 bool AudioProcessingImpl::fwd_synthesis_needed() const { | 1125 bool AudioProcessingImpl::fwd_synthesis_needed() const { |
1126 return (is_data_processed() && | 1126 return (is_fwd_processed() && |
1127 is_multi_band(capture_nonlocked_.fwd_proc_format.sample_rate_hz())); | 1127 is_multi_band(capture_nonlocked_.fwd_proc_format.sample_rate_hz())); |
1128 } | 1128 } |
1129 | 1129 |
1130 bool AudioProcessingImpl::fwd_analysis_needed() const { | 1130 bool AudioProcessingImpl::fwd_analysis_needed() const { |
1131 if (!is_data_processed() && | 1131 if (!is_fwd_processed() && |
1132 !public_submodules_->voice_detection->is_enabled() && | 1132 !public_submodules_->voice_detection->is_enabled() && |
1133 !capture_.transient_suppressor_enabled) { | 1133 !capture_.transient_suppressor_enabled) { |
1134 // Only public_submodules_->level_estimator is enabled. | 1134 // Only public_submodules_->level_estimator is enabled. |
1135 return false; | 1135 return false; |
1136 } else if (is_multi_band( | 1136 } else if (is_multi_band( |
1137 capture_nonlocked_.fwd_proc_format.sample_rate_hz())) { | 1137 capture_nonlocked_.fwd_proc_format.sample_rate_hz())) { |
1138 // Something besides public_submodules_->level_estimator is enabled, and we | 1138 // Something besides public_submodules_->level_estimator is enabled, and we |
1139 // have super-wb. | 1139 // have super-wb. |
1140 return true; | 1140 return true; |
1141 } | 1141 } |
1142 return false; | 1142 return false; |
1143 } | 1143 } |
1144 | 1144 |
1145 bool AudioProcessingImpl::is_rev_processed() const { | 1145 bool AudioProcessingImpl::is_rev_processed() const { |
1146 return constants_.intelligibility_enabled; | 1146 return constants_.intelligibility_enabled; |
1147 } | 1147 } |
1148 | 1148 |
1149 bool AudioProcessingImpl::rev_synthesis_needed() const { | 1149 bool AudioProcessingImpl::rev_synthesis_needed() const { |
1150 return (is_rev_processed() && | 1150 return (is_rev_processed() && |
1151 is_multi_band(formats_.rev_proc_format.sample_rate_hz())); | 1151 is_multi_band(formats_.rev_proc_format.sample_rate_hz())); |
1152 } | 1152 } |
1153 | 1153 |
1154 bool AudioProcessingImpl::rev_analysis_needed() const { | 1154 bool AudioProcessingImpl::rev_analysis_needed() const { |
1155 return is_multi_band(formats_.rev_proc_format.sample_rate_hz()); | 1155 return is_multi_band(formats_.rev_proc_format.sample_rate_hz()) && |
| 1156 (is_rev_processed() || |
| 1157 public_submodules_->echo_cancellation->is_enabled() || |
| 1158 public_submodules_->echo_control_mobile->is_enabled() || |
| 1159 public_submodules_->gain_control->is_enabled()); |
1156 } | 1160 } |
1157 | 1161 |
1158 bool AudioProcessingImpl::render_check_rev_conversion_needed() const { | 1162 bool AudioProcessingImpl::render_check_rev_conversion_needed() const { |
1159 return rev_conversion_needed(); | 1163 return rev_conversion_needed(); |
1160 } | 1164 } |
1161 | 1165 |
1162 bool AudioProcessingImpl::rev_conversion_needed() const { | 1166 bool AudioProcessingImpl::rev_conversion_needed() const { |
1163 return (formats_.api_format.reverse_input_stream() != | 1167 return (formats_.api_format.reverse_input_stream() != |
1164 formats_.api_format.reverse_output_stream()); | 1168 formats_.api_format.reverse_output_stream()); |
1165 } | 1169 } |
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1440 debug_dump_.capture.event_msg->mutable_config()->CopyFrom(config); | 1444 debug_dump_.capture.event_msg->mutable_config()->CopyFrom(config); |
1441 | 1445 |
1442 RETURN_ON_ERR(WriteMessageToDebugFile(debug_dump_.debug_file.get(), | 1446 RETURN_ON_ERR(WriteMessageToDebugFile(debug_dump_.debug_file.get(), |
1443 &debug_dump_.num_bytes_left_for_log_, | 1447 &debug_dump_.num_bytes_left_for_log_, |
1444 &crit_debug_, &debug_dump_.capture)); | 1448 &crit_debug_, &debug_dump_.capture)); |
1445 return kNoError; | 1449 return kNoError; |
1446 } | 1450 } |
1447 #endif // WEBRTC_AUDIOPROC_DEBUG_DUMP | 1451 #endif // WEBRTC_AUDIOPROC_DEBUG_DUMP |
1448 | 1452 |
1449 } // namespace webrtc | 1453 } // namespace webrtc |
OLD | NEW |