2 * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
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.
11 #ifndef WEBRTC_MODULES_AUDIO_PROCESSING_AEC_MAIN_SOURCE_AEC_RDFT_H_
12 #define WEBRTC_MODULES_AUDIO_PROCESSING_AEC_MAIN_SOURCE_AEC_RDFT_H_
14 #include "webrtc/modules/audio_processing/aec/aec_common.h"
16 // These intrinsics were unavailable before VS 2008.
17 // TODO(andrew): move to a common file.
18 #if defined(_MSC_VER) && _MSC_VER < 1500
19 #include <emmintrin.h>
20 static __inline __m128 _mm_castsi128_ps(__m128i a) { return *(__m128*)&a; }
21 static __inline __m128i _mm_castps_si128(__m128 a) { return *(__m128i*)&a; }
24 // Constants shared by all paths (C, SSE2, NEON).
25 extern const float rdft_w[64];
26 // Constants used by the C path.
27 extern const float rdft_wk3ri_first[16];
28 extern const float rdft_wk3ri_second[16];
29 // Constants used by SSE2 and NEON but initialized in the C path.
30 extern ALIGN16_BEG const float ALIGN16_END rdft_wk1r[32];
31 extern ALIGN16_BEG const float ALIGN16_END rdft_wk2r[32];
32 extern ALIGN16_BEG const float ALIGN16_END rdft_wk3r[32];
33 extern ALIGN16_BEG const float ALIGN16_END rdft_wk1i[32];
34 extern ALIGN16_BEG const float ALIGN16_END rdft_wk2i[32];
35 extern ALIGN16_BEG const float ALIGN16_END rdft_wk3i[32];
36 extern ALIGN16_BEG const float ALIGN16_END cftmdl_wk1r[4];
38 // code path selection function pointers
39 typedef void (*rft_sub_128_t)(float* a);
40 extern rft_sub_128_t rftfsub_128;
41 extern rft_sub_128_t rftbsub_128;
42 extern rft_sub_128_t cft1st_128;
43 extern rft_sub_128_t cftmdl_128;
44 extern rft_sub_128_t cftfsub_128;
45 extern rft_sub_128_t cftbsub_128;
46 extern rft_sub_128_t bitrv2_128;
49 void aec_rdft_init(void);
50 void aec_rdft_init_sse2(void);
51 void aec_rdft_forward_128(float* a);
52 void aec_rdft_inverse_128(float* a);
54 #if defined(MIPS_FPU_LE)
55 void aec_rdft_init_mips(void);
57 #if defined(WEBRTC_DETECT_ARM_NEON) || defined(WEBRTC_ARCH_ARM_NEON)
58 void aec_rdft_init_neon(void);
61 #endif // WEBRTC_MODULES_AUDIO_PROCESSING_AEC_MAIN_SOURCE_AEC_RDFT_H_