niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2011 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 | |
ajm@google.com | ce7c2a2 | 2011-08-04 01:50:00 +0000 | [diff] [blame] | 11 | #ifndef WEBRTC_MODULES_AUDIO_PROCESSING_AEC_MAIN_SOURCE_AEC_RDFT_H_ |
| 12 | #define WEBRTC_MODULES_AUDIO_PROCESSING_AEC_MAIN_SOURCE_AEC_RDFT_H_ |
| 13 | |
andrew@webrtc.org | 86b85db | 2011-09-19 18:48:25 +0000 | [diff] [blame] | 14 | // These intrinsics were unavailable before VS 2008. |
| 15 | // TODO(andrew): move to a common file. |
| 16 | #if defined(_MSC_VER) && _MSC_VER < 1500 |
| 17 | #include <emmintrin.h> |
| 18 | static __inline __m128 _mm_castsi128_ps(__m128i a) { return *(__m128*)&a; } |
| 19 | static __inline __m128i _mm_castps_si128(__m128 a) { return *(__m128i*)&a; } |
| 20 | #endif |
| 21 | |
cduvivier@google.com | 0e07d82 | 2011-07-25 23:54:20 +0000 | [diff] [blame] | 22 | #ifdef _MSC_VER /* visual c++ */ |
andrew@webrtc.org | 13b2d46 | 2013-10-08 23:41:42 +0000 | [diff] [blame] | 23 | #define ALIGN16_BEG __declspec(align(16)) |
| 24 | #define ALIGN16_END |
cduvivier@google.com | 0e07d82 | 2011-07-25 23:54:20 +0000 | [diff] [blame] | 25 | #else /* gcc or icc */ |
andrew@webrtc.org | 13b2d46 | 2013-10-08 23:41:42 +0000 | [diff] [blame] | 26 | #define ALIGN16_BEG |
| 27 | #define ALIGN16_END __attribute__((aligned(16))) |
cduvivier@google.com | 0e07d82 | 2011-07-25 23:54:20 +0000 | [diff] [blame] | 28 | #endif |
| 29 | |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 30 | // constants shared by all paths (C, SSE2). |
| 31 | extern float rdft_w[64]; |
cduvivier@google.com | 0e07d82 | 2011-07-25 23:54:20 +0000 | [diff] [blame] | 32 | // constants used by the C path. |
| 33 | extern float rdft_wk3ri_first[32]; |
| 34 | extern float rdft_wk3ri_second[32]; |
| 35 | // constants used by SSE2 but initialized in C path. |
andrew@webrtc.org | 754de52 | 2014-01-23 20:55:14 +0000 | [diff] [blame] | 36 | extern ALIGN16_BEG float ALIGN16_END rdft_wk1r[32]; |
| 37 | extern ALIGN16_BEG float ALIGN16_END rdft_wk2r[32]; |
| 38 | extern ALIGN16_BEG float ALIGN16_END rdft_wk3r[32]; |
| 39 | extern ALIGN16_BEG float ALIGN16_END rdft_wk1i[32]; |
| 40 | extern ALIGN16_BEG float ALIGN16_END rdft_wk2i[32]; |
| 41 | extern ALIGN16_BEG float ALIGN16_END rdft_wk3i[32]; |
| 42 | extern ALIGN16_BEG float ALIGN16_END cftmdl_wk1r[4]; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 43 | |
| 44 | // code path selection function pointers |
andrew@webrtc.org | 13b2d46 | 2013-10-08 23:41:42 +0000 | [diff] [blame] | 45 | typedef void (*rft_sub_128_t)(float* a); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 46 | extern rft_sub_128_t rftfsub_128; |
| 47 | extern rft_sub_128_t rftbsub_128; |
cduvivier@google.com | 0e07d82 | 2011-07-25 23:54:20 +0000 | [diff] [blame] | 48 | extern rft_sub_128_t cft1st_128; |
cduvivier@google.com | 288c869 | 2011-08-22 21:55:33 +0000 | [diff] [blame] | 49 | extern rft_sub_128_t cftmdl_128; |
andrew@webrtc.org | c0907ef | 2014-02-21 00:13:31 +0000 | [diff] [blame] | 50 | extern rft_sub_128_t cftfsub_128; |
| 51 | extern rft_sub_128_t cftbsub_128; |
| 52 | extern rft_sub_128_t bitrv2_128; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 53 | |
| 54 | // entry points |
| 55 | void aec_rdft_init(void); |
| 56 | void aec_rdft_init_sse2(void); |
andrew@webrtc.org | 13b2d46 | 2013-10-08 23:41:42 +0000 | [diff] [blame] | 57 | void aec_rdft_forward_128(float* a); |
| 58 | void aec_rdft_inverse_128(float* a); |
ajm@google.com | ce7c2a2 | 2011-08-04 01:50:00 +0000 | [diff] [blame] | 59 | |
andrew@webrtc.org | c0907ef | 2014-02-21 00:13:31 +0000 | [diff] [blame] | 60 | #if defined(MIPS_FPU_LE) |
| 61 | void aec_rdft_init_mips(void); |
| 62 | #endif |
bjornv@webrtc.org | cd9b90a | 2014-06-30 12:05:18 +0000 | [diff] [blame^] | 63 | #if defined(WEBRTC_DETECT_ARM_NEON) || defined(WEBRTC_ARCH_ARM_NEON) |
| 64 | void aec_rdft_init_neon(void); |
| 65 | #endif |
andrew@webrtc.org | c0907ef | 2014-02-21 00:13:31 +0000 | [diff] [blame] | 66 | |
ajm@google.com | ce7c2a2 | 2011-08-04 01:50:00 +0000 | [diff] [blame] | 67 | #endif // WEBRTC_MODULES_AUDIO_PROCESSING_AEC_MAIN_SOURCE_AEC_RDFT_H_ |