1 /*
2  *  Copyright (c) 2018 The WebRTC project authors. All Rights Reserved.
3  *
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
6  *  tree. An additional intellectual property rights grant can be found
7  *  in the file PATENTS.  All contributing project authors may
8  *  be found in the AUTHORS file in the root of the source tree.
9  */
10 
11 #ifndef MODULES_AUDIO_PROCESSING_AEC3_SUBTRACTOR_OUTPUT_ANALYZER_H_
12 #define MODULES_AUDIO_PROCESSING_AEC3_SUBTRACTOR_OUTPUT_ANALYZER_H_
13 
14 #include <vector>
15 
16 #include "modules/audio_processing/aec3/subtractor_output.h"
17 
18 namespace webrtc {
19 
20 // Class for analyzing the properties subtractor output.
21 class SubtractorOutputAnalyzer {
22  public:
23   explicit SubtractorOutputAnalyzer(size_t num_capture_channels);
24   ~SubtractorOutputAnalyzer() = default;
25 
26   // Analyses the subtractor output.
27   void Update(rtc::ArrayView<const SubtractorOutput> subtractor_output,
28               bool* any_filter_converged,
29               bool* all_filters_diverged);
30 
ConvergedFilters()31   const std::vector<bool>& ConvergedFilters() const {
32     return filters_converged_;
33   }
34 
35   // Handle echo path change.
36   void HandleEchoPathChange();
37 
38  private:
39   std::vector<bool> filters_converged_;
40 };
41 
42 }  // namespace webrtc
43 
44 #endif  // MODULES_AUDIO_PROCESSING_AEC3_SUBTRACTOR_OUTPUT_ANALYZER_H_
45