blob: 3b339a05c413f404c6f2ac28b67663489ac49ae0 [file] [log] [blame]
niklase@google.com470e71d2011-07-07 08:21:25 +00001/*
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.comce7c2a22011-08-04 01:50:00 +000011#ifndef WEBRTC_MODULES_AUDIO_PROCESSING_AEC_MAIN_SOURCE_AEC_RDFT_H_
12#define WEBRTC_MODULES_AUDIO_PROCESSING_AEC_MAIN_SOURCE_AEC_RDFT_H_
13
bjornv@webrtc.org555fc782014-07-10 08:03:11 +000014#include "webrtc/modules/audio_processing/aec/aec_common.h"
15
andrew@webrtc.org86b85db2011-09-19 18:48:25 +000016// 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>
20static __inline __m128 _mm_castsi128_ps(__m128i a) { return *(__m128*)&a; }
21static __inline __m128i _mm_castps_si128(__m128 a) { return *(__m128i*)&a; }
22#endif
23
niklase@google.com470e71d2011-07-07 08:21:25 +000024// constants shared by all paths (C, SSE2).
25extern float rdft_w[64];
cduvivier@google.com0e07d822011-07-25 23:54:20 +000026// constants used by the C path.
27extern float rdft_wk3ri_first[32];
28extern float rdft_wk3ri_second[32];
29// constants used by SSE2 but initialized in C path.
andrew@webrtc.org754de522014-01-23 20:55:14 +000030extern ALIGN16_BEG float ALIGN16_END rdft_wk1r[32];
31extern ALIGN16_BEG float ALIGN16_END rdft_wk2r[32];
32extern ALIGN16_BEG float ALIGN16_END rdft_wk3r[32];
33extern ALIGN16_BEG float ALIGN16_END rdft_wk1i[32];
34extern ALIGN16_BEG float ALIGN16_END rdft_wk2i[32];
35extern ALIGN16_BEG float ALIGN16_END rdft_wk3i[32];
36extern ALIGN16_BEG float ALIGN16_END cftmdl_wk1r[4];
niklase@google.com470e71d2011-07-07 08:21:25 +000037
38// code path selection function pointers
andrew@webrtc.org13b2d462013-10-08 23:41:42 +000039typedef void (*rft_sub_128_t)(float* a);
niklase@google.com470e71d2011-07-07 08:21:25 +000040extern rft_sub_128_t rftfsub_128;
41extern rft_sub_128_t rftbsub_128;
cduvivier@google.com0e07d822011-07-25 23:54:20 +000042extern rft_sub_128_t cft1st_128;
cduvivier@google.com288c8692011-08-22 21:55:33 +000043extern rft_sub_128_t cftmdl_128;
andrew@webrtc.orgc0907ef2014-02-21 00:13:31 +000044extern rft_sub_128_t cftfsub_128;
45extern rft_sub_128_t cftbsub_128;
46extern rft_sub_128_t bitrv2_128;
niklase@google.com470e71d2011-07-07 08:21:25 +000047
48// entry points
49void aec_rdft_init(void);
50void aec_rdft_init_sse2(void);
andrew@webrtc.org13b2d462013-10-08 23:41:42 +000051void aec_rdft_forward_128(float* a);
52void aec_rdft_inverse_128(float* a);
ajm@google.comce7c2a22011-08-04 01:50:00 +000053
andrew@webrtc.orgc0907ef2014-02-21 00:13:31 +000054#if defined(MIPS_FPU_LE)
55void aec_rdft_init_mips(void);
56#endif
bjornv@webrtc.orgcd9b90a2014-06-30 12:05:18 +000057#if defined(WEBRTC_DETECT_ARM_NEON) || defined(WEBRTC_ARCH_ARM_NEON)
58void aec_rdft_init_neon(void);
59#endif
andrew@webrtc.orgc0907ef2014-02-21 00:13:31 +000060
ajm@google.comce7c2a22011-08-04 01:50:00 +000061#endif // WEBRTC_MODULES_AUDIO_PROCESSING_AEC_MAIN_SOURCE_AEC_RDFT_H_