Chromium Code Reviews| 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 |