OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2014 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 |
11 #ifndef WEBRTC_MODULES_AUDIO_PROCESSING_BEAMFORMER_NONLINEAR_BEAMFORMER_H_ | 11 #ifndef WEBRTC_MODULES_AUDIO_PROCESSING_BEAMFORMER_NONLINEAR_BEAMFORMER_H_ |
12 #define WEBRTC_MODULES_AUDIO_PROCESSING_BEAMFORMER_NONLINEAR_BEAMFORMER_H_ | 12 #define WEBRTC_MODULES_AUDIO_PROCESSING_BEAMFORMER_NONLINEAR_BEAMFORMER_H_ |
13 | 13 |
14 // MSVC++ requires this to be set before any other includes to get M_PI. | 14 // MSVC++ requires this to be set before any other includes to get M_PI. |
15 #define _USE_MATH_DEFINES | 15 #define _USE_MATH_DEFINES |
16 | 16 |
17 #include <math.h> | 17 #include <math.h> |
| 18 |
| 19 #include <memory> |
18 #include <vector> | 20 #include <vector> |
19 | 21 |
20 #include "webrtc/common_audio/lapped_transform.h" | 22 #include "webrtc/common_audio/lapped_transform.h" |
21 #include "webrtc/common_audio/channel_buffer.h" | 23 #include "webrtc/common_audio/channel_buffer.h" |
22 #include "webrtc/modules/audio_processing/beamformer/beamformer.h" | 24 #include "webrtc/modules/audio_processing/beamformer/beamformer.h" |
23 #include "webrtc/modules/audio_processing/beamformer/complex_matrix.h" | 25 #include "webrtc/modules/audio_processing/beamformer/complex_matrix.h" |
24 #include "webrtc/system_wrappers/include/scoped_vector.h" | 26 #include "webrtc/system_wrappers/include/scoped_vector.h" |
25 | 27 |
26 namespace webrtc { | 28 namespace webrtc { |
27 | 29 |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 // Applies both sets of masks to |input| and store in |output|. | 120 // Applies both sets of masks to |input| and store in |output|. |
119 void ApplyMasks(const complex_f* const* input, complex_f* const* output); | 121 void ApplyMasks(const complex_f* const* input, complex_f* const* output); |
120 | 122 |
121 void EstimateTargetPresence(); | 123 void EstimateTargetPresence(); |
122 | 124 |
123 static const size_t kFftSize = 256; | 125 static const size_t kFftSize = 256; |
124 static const size_t kNumFreqBins = kFftSize / 2 + 1; | 126 static const size_t kNumFreqBins = kFftSize / 2 + 1; |
125 | 127 |
126 // Deals with the fft transform and blocking. | 128 // Deals with the fft transform and blocking. |
127 size_t chunk_length_; | 129 size_t chunk_length_; |
128 rtc::scoped_ptr<LappedTransform> lapped_transform_; | 130 std::unique_ptr<LappedTransform> lapped_transform_; |
129 float window_[kFftSize]; | 131 float window_[kFftSize]; |
130 | 132 |
131 // Parameters exposed to the user. | 133 // Parameters exposed to the user. |
132 const size_t num_input_channels_; | 134 const size_t num_input_channels_; |
133 int sample_rate_hz_; | 135 int sample_rate_hz_; |
134 | 136 |
135 const std::vector<Point> array_geometry_; | 137 const std::vector<Point> array_geometry_; |
136 // The normal direction of the array if it has one and it is in the xy-plane. | 138 // The normal direction of the array if it has one and it is in the xy-plane. |
137 const rtc::Optional<Point> array_normal_; | 139 const rtc::Optional<Point> array_normal_; |
138 | 140 |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
191 // Number of blocks after which the data is considered interference if the | 193 // Number of blocks after which the data is considered interference if the |
192 // mask does not pass |kMaskSignalThreshold|. | 194 // mask does not pass |kMaskSignalThreshold|. |
193 size_t hold_target_blocks_; | 195 size_t hold_target_blocks_; |
194 // Number of blocks since the last mask that passed |kMaskSignalThreshold|. | 196 // Number of blocks since the last mask that passed |kMaskSignalThreshold|. |
195 size_t interference_blocks_count_; | 197 size_t interference_blocks_count_; |
196 }; | 198 }; |
197 | 199 |
198 } // namespace webrtc | 200 } // namespace webrtc |
199 | 201 |
200 #endif // WEBRTC_MODULES_AUDIO_PROCESSING_BEAMFORMER_NONLINEAR_BEAMFORMER_H_ | 202 #endif // WEBRTC_MODULES_AUDIO_PROCESSING_BEAMFORMER_NONLINEAR_BEAMFORMER_H_ |
OLD | NEW |