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_AEC3_DOWN_SAMPLER_4KHZ_H_ | |
12 #define WEBRTC_MODULES_AUDIO_PROCESSING_AEC3_DOWN_SAMPLER_4KHZ_H_ | |
13 | |
14 #include "webrtc/base/array_view.h" | |
15 #include "webrtc/base/constructormagic.h" | |
16 #include "webrtc/modules/audio_processing/aec3/cascaded_biquad_filter.h" | |
17 | |
18 namespace webrtc { | |
19 | |
20 // Provides downsampling functionality to a 4 kHz rate. | |
21 class DownSampler4kHz { | |
22 public: | |
23 explicit DownSampler4kHz(int sample_rate_hz_); | |
aleloi
2017/01/27 15:37:47
I suggest adding a comment that sample_rate_hz_ is
peah-webrtc
2017/02/02 14:04:47
Done.
| |
24 | |
25 // Downsamples the signal. | |
aleloi
2017/01/27 15:37:47
I think assumptions about frame size should be doc
peah-webrtc
2017/02/02 14:04:46
I agree. This is a big drawback with ArrayView and
aleloi
2017/02/03 15:46:48
SGTM! Great that fixed-size array could be used!
peah-webrtc
2017/02/06 11:25:38
:-)
| |
26 void DownSample(rtc::ArrayView<const float> in, rtc::ArrayView<float> out); | |
27 | |
28 // Returns the downsampling factor applied in the downsampler. | |
29 int GetDownSamplingFactor() const { return down_sampling_factor_; } | |
30 | |
31 private: | |
32 const int down_sampling_factor_; | |
33 CascadedBiQuadFilter low_pass_filter_; | |
34 | |
35 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(DownSampler4kHz); | |
36 }; | |
37 } // namespace webrtc | |
38 | |
39 #endif // WEBRTC_MODULES_AUDIO_PROCESSING_AEC3_DOWN_SAMPLER_4KHZ_H_ | |
OLD | NEW |