OLD | NEW |
---|---|
(Empty) | |
1 /* | |
2 * Copyright (c) 2017 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 WEBRTC_MODULES_AUDIO_PROCESSING_ECHO_DETECTOR_MOVING_MAX_H_ | |
12 #define WEBRTC_MODULES_AUDIO_PROCESSING_ECHO_DETECTOR_MOVING_MAX_H_ | |
13 | |
14 #include <deque> | |
15 #include <vector> | |
16 | |
17 namespace webrtc { | |
18 | |
19 class MovingMax { | |
20 public: | |
21 explicit MovingMax(size_t window_size); | |
22 ~MovingMax(); | |
23 | |
24 // Add a new likelihood to the buffer. This will automatically remove the | |
the sun
2017/01/13 14:51:23
Comments need updating. Since it's a generic class
ivoc
2017/01/13 15:08:42
I removed the comments for Update() and max(), sin
| |
25 // oldest likelihood value from the buffer. | |
26 void Update(float value); | |
27 // Return the maximum likelihood value in the buffer. | |
28 float max() const; | |
29 // Fill the buffer with zeros. | |
30 void Clear(); | |
31 | |
32 private: | |
33 float max_value_ = 0.f; | |
34 size_t counter_ = 0; | |
35 size_t window_size_; | |
the sun
2017/01/13 14:51:23
It's a good idea to always init everything, regard
ivoc
2017/01/13 15:08:41
Since zero is an illegal value, I set it to one by
| |
36 }; | |
37 | |
38 } // namespace webrtc | |
39 | |
40 #endif // WEBRTC_MODULES_AUDIO_PROCESSING_ECHO_DETECTOR_MOVING_MAX_H_ | |
OLD | NEW |