Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(111)

Side by Side Diff: webrtc/modules/audio_processing/aec/aec_core.h

Issue 2348213002: Move the aec_rdft* files to a more proper place beneath APM and make them thread-safe. (Closed)
Patch Set: Rebase Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2012 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 /* 11 /*
12 * Specifies the interface for the AEC core. 12 * Specifies the interface for the AEC core.
13 */ 13 */
14 14
15 #ifndef WEBRTC_MODULES_AUDIO_PROCESSING_AEC_AEC_CORE_H_ 15 #ifndef WEBRTC_MODULES_AUDIO_PROCESSING_AEC_AEC_CORE_H_
16 #define WEBRTC_MODULES_AUDIO_PROCESSING_AEC_AEC_CORE_H_ 16 #define WEBRTC_MODULES_AUDIO_PROCESSING_AEC_AEC_CORE_H_
17 17
18 #include <stddef.h> 18 #include <stddef.h>
19 19
20 #include <memory> 20 #include <memory>
21 21
22 extern "C" { 22 extern "C" {
23 #include "webrtc/common_audio/ring_buffer.h" 23 #include "webrtc/common_audio/ring_buffer.h"
24 } 24 }
25 #include "webrtc/base/constructormagic.h" 25 #include "webrtc/base/constructormagic.h"
26 #include "webrtc/common_audio/wav_file.h" 26 #include "webrtc/common_audio/wav_file.h"
27 #include "webrtc/modules/audio_processing/aec/aec_common.h" 27 #include "webrtc/modules/audio_processing/aec/aec_common.h"
28 #include "webrtc/modules/audio_processing/utility/block_mean_calculator.h" 28 #include "webrtc/modules/audio_processing/utility/block_mean_calculator.h"
29 #include "webrtc/modules/audio_processing/utility/ooura_fft.h"
29 #include "webrtc/typedefs.h" 30 #include "webrtc/typedefs.h"
30 31
31 namespace webrtc { 32 namespace webrtc {
32 33
33 #define FRAME_LEN 80 34 #define FRAME_LEN 80
34 #define PART_LEN 64 // Length of partition 35 #define PART_LEN 64 // Length of partition
35 #define PART_LEN1 (PART_LEN + 1) // Unique fft coefficients 36 #define PART_LEN1 (PART_LEN + 1) // Unique fft coefficients
36 #define PART_LEN2 (PART_LEN * 2) // Length of partition * 2 37 #define PART_LEN2 (PART_LEN * 2) // Length of partition * 2
37 #define NUM_HIGH_BANDS_MAX 2 // Max number of high bands 38 #define NUM_HIGH_BANDS_MAX 2 // Max number of high bands
38 39
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 complex_t sde[PART_LEN1]; // cross-psd of nearend and error 128 complex_t sde[PART_LEN1]; // cross-psd of nearend and error
128 complex_t sxd[PART_LEN1]; // cross-psd of farend and nearend 129 complex_t sxd[PART_LEN1]; // cross-psd of farend and nearend
129 float sx[PART_LEN1], sd[PART_LEN1], se[PART_LEN1]; // far, near, error psd 130 float sx[PART_LEN1], sd[PART_LEN1], se[PART_LEN1]; // far, near, error psd
130 } CoherenceState; 131 } CoherenceState;
131 132
132 struct AecCore { 133 struct AecCore {
133 explicit AecCore(int instance_index); 134 explicit AecCore(int instance_index);
134 ~AecCore(); 135 ~AecCore();
135 136
136 std::unique_ptr<ApmDataDumper> data_dumper; 137 std::unique_ptr<ApmDataDumper> data_dumper;
138 const OouraFft ooura_fft;
137 139
138 CoherenceState coherence_state; 140 CoherenceState coherence_state;
139 141
140 int farBufWritePos, farBufReadPos; 142 int farBufWritePos, farBufReadPos;
141 143
142 int knownDelay; 144 int knownDelay;
143 int inSamples, outSamples; 145 int inSamples, outSamples;
144 int delayEstCtr; 146 int delayEstCtr;
145 147
146 // Nearend buffer used for changing from FRAME_LEN to PART_LEN sample block 148 // Nearend buffer used for changing from FRAME_LEN to PART_LEN sample block
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
331 int WebRtcAec_system_delay(AecCore* self); 333 int WebRtcAec_system_delay(AecCore* self);
332 334
333 // Sets the |system_delay| to |value|. Note that if the value is changed 335 // Sets the |system_delay| to |value|. Note that if the value is changed
334 // improperly, there can be a performance regression. So it should be used with 336 // improperly, there can be a performance regression. So it should be used with
335 // care. 337 // care.
336 void WebRtcAec_SetSystemDelay(AecCore* self, int delay); 338 void WebRtcAec_SetSystemDelay(AecCore* self, int delay);
337 339
338 } // namespace webrtc 340 } // namespace webrtc
339 341
340 #endif // WEBRTC_MODULES_AUDIO_PROCESSING_AEC_AEC_CORE_H_ 342 #endif // WEBRTC_MODULES_AUDIO_PROCESSING_AEC_AEC_CORE_H_
OLDNEW
« no previous file with comments | « webrtc/modules/audio_processing/BUILD.gn ('k') | webrtc/modules/audio_processing/aec/aec_core.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698