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/aecm/aecm_core.h" | 11 #include "webrtc/modules/audio_processing/aecm/aecm_core.h" |
12 | 12 |
13 #include <assert.h> | 13 #include <assert.h> |
14 #include <stddef.h> | 14 #include <stddef.h> |
15 #include <stdlib.h> | 15 #include <stdlib.h> |
16 | 16 |
| 17 extern "C" { |
17 #include "webrtc/common_audio/ring_buffer.h" | 18 #include "webrtc/common_audio/ring_buffer.h" |
18 #include "webrtc/common_audio/signal_processing/include/real_fft.h" | 19 #include "webrtc/common_audio/signal_processing/include/real_fft.h" |
| 20 } |
19 #include "webrtc/modules/audio_processing/aecm/echo_control_mobile.h" | 21 #include "webrtc/modules/audio_processing/aecm/echo_control_mobile.h" |
| 22 extern "C" { |
20 #include "webrtc/modules/audio_processing/utility/delay_estimator_wrapper.h" | 23 #include "webrtc/modules/audio_processing/utility/delay_estimator_wrapper.h" |
21 #include "webrtc/system_wrappers/include/compile_assert_c.h" | |
22 #include "webrtc/system_wrappers/include/cpu_features_wrapper.h" | 24 #include "webrtc/system_wrappers/include/cpu_features_wrapper.h" |
| 25 } |
23 #include "webrtc/typedefs.h" | 26 #include "webrtc/typedefs.h" |
24 | 27 |
25 // Square root of Hanning window in Q14. | 28 // Square root of Hanning window in Q14. |
26 #if defined(WEBRTC_DETECT_NEON) || defined(WEBRTC_HAS_NEON) | |
27 // Table is defined in an ARM assembly file. | |
28 extern const ALIGN8_BEG int16_t WebRtcAecm_kSqrtHanning[] ALIGN8_END; | |
29 #else | |
30 static const ALIGN8_BEG int16_t WebRtcAecm_kSqrtHanning[] ALIGN8_END = { | 29 static const ALIGN8_BEG int16_t WebRtcAecm_kSqrtHanning[] ALIGN8_END = { |
31 0, 399, 798, 1196, 1594, 1990, 2386, 2780, 3172, | 30 0, 399, 798, 1196, 1594, 1990, 2386, 2780, 3172, |
32 3562, 3951, 4337, 4720, 5101, 5478, 5853, 6224, | 31 3562, 3951, 4337, 4720, 5101, 5478, 5853, 6224, |
33 6591, 6954, 7313, 7668, 8019, 8364, 8705, 9040, | 32 6591, 6954, 7313, 7668, 8019, 8364, 8705, 9040, |
34 9370, 9695, 10013, 10326, 10633, 10933, 11227, 11514, | 33 9370, 9695, 10013, 10326, 10633, 10933, 11227, 11514, |
35 11795, 12068, 12335, 12594, 12845, 13089, 13325, 13553, | 34 11795, 12068, 12335, 12594, 12845, 13089, 13325, 13553, |
36 13773, 13985, 14189, 14384, 14571, 14749, 14918, 15079, | 35 13773, 13985, 14189, 14384, 14571, 14749, 14918, 15079, |
37 15231, 15373, 15506, 15631, 15746, 15851, 15947, 16034, | 36 15231, 15373, 15506, 15631, 15746, 15851, 15947, 16034, |
38 16111, 16179, 16237, 16286, 16325, 16354, 16373, 16384 | 37 16111, 16179, 16237, 16286, 16325, 16354, 16373, 16384 |
39 }; | 38 }; |
40 #endif | |
41 | 39 |
42 #ifdef AECM_WITH_ABS_APPROX | 40 #ifdef AECM_WITH_ABS_APPROX |
43 //Q15 alpha = 0.99439986968132 const Factor for magnitude approximation | 41 //Q15 alpha = 0.99439986968132 const Factor for magnitude approximation |
44 static const uint16_t kAlpha1 = 32584; | 42 static const uint16_t kAlpha1 = 32584; |
45 //Q15 beta = 0.12967166976970 const Factor for magnitude approximation | 43 //Q15 beta = 0.12967166976970 const Factor for magnitude approximation |
46 static const uint16_t kBeta1 = 4249; | 44 static const uint16_t kBeta1 = 4249; |
47 //Q15 alpha = 0.94234827210087 const Factor for magnitude approximation | 45 //Q15 alpha = 0.94234827210087 const Factor for magnitude approximation |
48 static const uint16_t kAlpha2 = 30879; | 46 static const uint16_t kAlpha2 = 30879; |
49 //Q15 beta = 0.33787806009150 const Factor for magnitude approximation | 47 //Q15 beta = 0.33787806009150 const Factor for magnitude approximation |
50 static const uint16_t kBeta2 = 11072; | 48 static const uint16_t kBeta2 = 11072; |
(...skipping 710 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
761 13); | 759 13); |
762 } | 760 } |
763 uImag[PART_LEN] = 0; | 761 uImag[PART_LEN] = 0; |
764 | 762 |
765 for (i = 0; i < PART_LEN1; i++) | 763 for (i = 0; i < PART_LEN1; i++) |
766 { | 764 { |
767 out[i].real = WebRtcSpl_AddSatW16(out[i].real, uReal[i]); | 765 out[i].real = WebRtcSpl_AddSatW16(out[i].real, uReal[i]); |
768 out[i].imag = WebRtcSpl_AddSatW16(out[i].imag, uImag[i]); | 766 out[i].imag = WebRtcSpl_AddSatW16(out[i].imag, uImag[i]); |
769 } | 767 } |
770 } | 768 } |
771 | |
OLD | NEW |