| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2016 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 19 matching lines...) Expand all Loading... |
| 30 | 30 |
| 31 // This function should be called while holding the render lock. | 31 // This function should be called while holding the render lock. |
| 32 void AnalyzeRenderAudio(rtc::ArrayView<const float> render_audio); | 32 void AnalyzeRenderAudio(rtc::ArrayView<const float> render_audio); |
| 33 | 33 |
| 34 // This function should be called while holding the capture lock. | 34 // This function should be called while holding the capture lock. |
| 35 void AnalyzeCaptureAudio(rtc::ArrayView<const float> capture_audio); | 35 void AnalyzeCaptureAudio(rtc::ArrayView<const float> capture_audio); |
| 36 | 36 |
| 37 // This function should be called while holding the capture lock. | 37 // This function should be called while holding the capture lock. |
| 38 void Initialize(); | 38 void Initialize(); |
| 39 | 39 |
| 40 // This function is for testing purposes only. |
| 41 void SetReliabilityForTest(float value) { reliability_ = value; } |
| 42 |
| 40 static void PackRenderAudioBuffer(AudioBuffer* audio, | 43 static void PackRenderAudioBuffer(AudioBuffer* audio, |
| 41 std::vector<float>* packed_buffer); | 44 std::vector<float>* packed_buffer); |
| 42 | 45 |
| 43 // This function should be called while holding the capture lock. | 46 // This function should be called while holding the capture lock. |
| 44 float echo_likelihood() const { return echo_likelihood_; } | 47 float echo_likelihood() const { return echo_likelihood_; } |
| 45 | 48 |
| 46 private: | 49 private: |
| 47 // Keep track if the |Process| function has been previously called. | 50 // Keep track if the |Process| function has been previously called. |
| 48 bool first_process_call_ = true; | 51 bool first_process_call_ = true; |
| 49 // Buffer for storing the power of incoming farend buffers. This is needed for | 52 // Buffer for storing the power of incoming farend buffers. This is needed for |
| (...skipping 14 matching lines...) Expand all Loading... |
| 64 // Covariance estimates for different delay values. | 67 // Covariance estimates for different delay values. |
| 65 std::vector<NormalizedCovarianceEstimator> covariances_; | 68 std::vector<NormalizedCovarianceEstimator> covariances_; |
| 66 // Index where next element should be inserted in all of the above circular | 69 // Index where next element should be inserted in all of the above circular |
| 67 // buffers. | 70 // buffers. |
| 68 size_t next_insertion_index_ = 0; | 71 size_t next_insertion_index_ = 0; |
| 69 | 72 |
| 70 MeanVarianceEstimator render_statistics_; | 73 MeanVarianceEstimator render_statistics_; |
| 71 MeanVarianceEstimator capture_statistics_; | 74 MeanVarianceEstimator capture_statistics_; |
| 72 // Current echo likelihood. | 75 // Current echo likelihood. |
| 73 float echo_likelihood_ = 0.f; | 76 float echo_likelihood_ = 0.f; |
| 77 // Reliability of the current likelihood. |
| 78 float reliability_ = 0.f; |
| 74 }; | 79 }; |
| 75 | 80 |
| 76 } // namespace webrtc | 81 } // namespace webrtc |
| 77 | 82 |
| 78 #endif // WEBRTC_MODULES_AUDIO_PROCESSING_RESIDUAL_ECHO_DETECTOR_H_ | 83 #endif // WEBRTC_MODULES_AUDIO_PROCESSING_RESIDUAL_ECHO_DETECTOR_H_ |
| OLD | NEW |