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
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
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>
18static __inline __m128 _mm_castsi128_ps(__m128i a) { return *(__m128*)&a; }
19static __inline __m128i _mm_castps_si128(__m128 a) { return *(__m128i*)&a; }
20#endif
21
22#ifdef _MSC_VER /* visual c++ */
23# define ALIGN16_BEG __declspec(align(16))
24# define ALIGN16_END
25#else /* gcc or icc */
26# define ALIGN16_BEG
27# define ALIGN16_END __attribute__((aligned(16)))
28#endif
29
30// constants shared by all paths (C, SSE2).
31extern float rdft_w[64];
32// constants used by the C path.
33extern float rdft_wk3ri_first[32];
34extern float rdft_wk3ri_second[32];
35// constants used by SSE2 but initialized in C path.
36extern float rdft_wk1r[32];
37extern float rdft_wk2r[32];
38extern float rdft_wk3r[32];
39extern float rdft_wk1i[32];
40extern float rdft_wk2i[32];
41extern float rdft_wk3i[32];
42extern float cftmdl_wk1r[4];
43
44// code path selection function pointers
45typedef void (*rft_sub_128_t)(float *a);
46extern rft_sub_128_t rftfsub_128;
47extern rft_sub_128_t rftbsub_128;
48extern rft_sub_128_t cft1st_128;
49extern rft_sub_128_t cftmdl_128;
50
51// entry points
52void aec_rdft_init(void);
53void aec_rdft_init_sse2(void);
54void aec_rdft_forward_128(float *a);
55void aec_rdft_inverse_128(float *a);
56
57#endif  // WEBRTC_MODULES_AUDIO_PROCESSING_AEC_MAIN_SOURCE_AEC_RDFT_H_
58