OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2013 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 #include "webrtc/modules/audio_processing/transient/transient_suppressor.h" | 11 #include "webrtc/modules/audio_processing/transient/transient_suppressor.h" |
12 | 12 |
13 #include <math.h> | 13 #include <math.h> |
14 #include <string.h> | 14 #include <string.h> |
15 #include <cmath> | 15 #include <cmath> |
16 #include <complex> | 16 #include <complex> |
17 #include <deque> | 17 #include <deque> |
18 #include <set> | 18 #include <set> |
19 | 19 |
20 #include "webrtc/base/checks.h" | 20 #include "webrtc/base/checks.h" |
| 21 #include "webrtc/base/logging.h" |
21 #include "webrtc/common_audio/fft4g.h" | 22 #include "webrtc/common_audio/fft4g.h" |
22 #include "webrtc/common_audio/include/audio_util.h" | 23 #include "webrtc/common_audio/include/audio_util.h" |
23 #include "webrtc/common_audio/signal_processing/include/signal_processing_librar
y.h" | 24 #include "webrtc/common_audio/signal_processing/include/signal_processing_librar
y.h" |
24 #include "webrtc/modules/audio_processing/transient/common.h" | 25 #include "webrtc/modules/audio_processing/transient/common.h" |
25 #include "webrtc/modules/audio_processing/transient/transient_detector.h" | 26 #include "webrtc/modules/audio_processing/transient/transient_detector.h" |
26 #include "webrtc/modules/audio_processing/ns/windows_private.h" | 27 #include "webrtc/modules/audio_processing/ns/windows_private.h" |
27 #include "webrtc/system_wrappers/include/logging.h" | |
28 #include "webrtc/typedefs.h" | 28 #include "webrtc/typedefs.h" |
29 | 29 |
30 namespace webrtc { | 30 namespace webrtc { |
31 | 31 |
32 static const float kMeanIIRCoefficient = 0.5f; | 32 static const float kMeanIIRCoefficient = 0.5f; |
33 static const float kVoiceThreshold = 0.02f; | 33 static const float kVoiceThreshold = 0.02f; |
34 | 34 |
35 // TODO(aluebs): Check if these values work also for 48kHz. | 35 // TODO(aluebs): Check if these values work also for 48kHz. |
36 static const size_t kMinVoiceBin = 3; | 36 static const size_t kMinVoiceBin = 3; |
37 static const size_t kMaxVoiceBin = 60; | 37 static const size_t kMaxVoiceBin = 60; |
(...skipping 377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
415 const float magnitude_ratio = new_magnitude / magnitudes_[i]; | 415 const float magnitude_ratio = new_magnitude / magnitudes_[i]; |
416 | 416 |
417 fft_buffer_[i * 2] *= magnitude_ratio; | 417 fft_buffer_[i * 2] *= magnitude_ratio; |
418 fft_buffer_[i * 2 + 1] *= magnitude_ratio; | 418 fft_buffer_[i * 2 + 1] *= magnitude_ratio; |
419 magnitudes_[i] = new_magnitude; | 419 magnitudes_[i] = new_magnitude; |
420 } | 420 } |
421 } | 421 } |
422 } | 422 } |
423 | 423 |
424 } // namespace webrtc | 424 } // namespace webrtc |
OLD | NEW |