1 /*
2  *  Copyright (c) 2016 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 MODULES_AUDIO_PROCESSING_AEC_AEC_CORE_OPTIMIZED_METHODS_H_
12 #define MODULES_AUDIO_PROCESSING_AEC_AEC_CORE_OPTIMIZED_METHODS_H_
13 
14 #include <memory>
15 
16 #include "modules/audio_processing/aec/aec_core.h"
17 #include "typedefs.h"  // NOLINT(build/include)
18 
19 namespace webrtc {
20 
21 typedef void (*WebRtcAecFilterFar)(
22     int num_partitions,
23     int x_fft_buf_block_pos,
24     float x_fft_buf[2][kExtendedNumPartitions * PART_LEN1],
25     float h_fft_buf[2][kExtendedNumPartitions * PART_LEN1],
26     float y_fft[2][PART_LEN1]);
27 extern WebRtcAecFilterFar WebRtcAec_FilterFar;
28 typedef void (*WebRtcAecScaleErrorSignal)(float mu,
29                                           float error_threshold,
30                                           float x_pow[PART_LEN1],
31                                           float ef[2][PART_LEN1]);
32 extern WebRtcAecScaleErrorSignal WebRtcAec_ScaleErrorSignal;
33 typedef void (*WebRtcAecFilterAdaptation)(
34     const OouraFft& ooura_fft,
35     int num_partitions,
36     int x_fft_buf_block_pos,
37     float x_fft_buf[2][kExtendedNumPartitions * PART_LEN1],
38     float e_fft[2][PART_LEN1],
39     float h_fft_buf[2][kExtendedNumPartitions * PART_LEN1]);
40 extern WebRtcAecFilterAdaptation WebRtcAec_FilterAdaptation;
41 
42 typedef void (*WebRtcAecOverdrive)(float overdrive_scaling,
43                                    const float hNlFb,
44                                    float hNl[PART_LEN1]);
45 extern WebRtcAecOverdrive WebRtcAec_Overdrive;
46 
47 typedef void (*WebRtcAecSuppress)(const float hNl[PART_LEN1],
48                                   float efw[2][PART_LEN1]);
49 extern WebRtcAecSuppress WebRtcAec_Suppress;
50 
51 typedef void (*WebRtcAecComputeCoherence)(const CoherenceState* coherence_state,
52                                           float* cohde,
53                                           float* cohxd);
54 extern WebRtcAecComputeCoherence WebRtcAec_ComputeCoherence;
55 
56 typedef void (*WebRtcAecUpdateCoherenceSpectra)(int mult,
57                                                 bool extended_filter_enabled,
58                                                 float efw[2][PART_LEN1],
59                                                 float dfw[2][PART_LEN1],
60                                                 float xfw[2][PART_LEN1],
61                                                 CoherenceState* coherence_state,
62                                                 short* filter_divergence_state,
63                                                 int* extreme_filter_divergence);
64 extern WebRtcAecUpdateCoherenceSpectra WebRtcAec_UpdateCoherenceSpectra;
65 
66 typedef int (*WebRtcAecPartitionDelay)(
67     int num_partitions,
68     float h_fft_buf[2][kExtendedNumPartitions * PART_LEN1]);
69 extern WebRtcAecPartitionDelay WebRtcAec_PartitionDelay;
70 
71 typedef void (*WebRtcAecStoreAsComplex)(const float* data,
72                                         float data_complex[2][PART_LEN1]);
73 extern WebRtcAecStoreAsComplex WebRtcAec_StoreAsComplex;
74 
75 typedef void (*WebRtcAecWindowData)(float* x_windowed, const float* x);
76 extern WebRtcAecWindowData WebRtcAec_WindowData;
77 
78 }  // namespace webrtc
79 
80 #endif  // MODULES_AUDIO_PROCESSING_AEC_AEC_CORE_OPTIMIZED_METHODS_H_
81