summaryrefslogtreecommitdiffstats
path: root/src/ffts.c
diff options
context:
space:
mode:
authorAnthony Blake <anthonix@me.com>2014-01-05 14:32:16 -0800
committerAnthony Blake <anthonix@me.com>2014-01-05 14:32:16 -0800
commitfa1780c68593762b1e4bdbc46d83912db3eba27a (patch)
tree2af703b1878f647161a852eea15409b8707b4c56 /src/ffts.c
parentbedc7ea023b2a4cef8ca0a79c50941ed36e786d4 (diff)
parentd70b38d65f5afec50ae43c20edf3927d11dfa734 (diff)
downloadffts-fa1780c68593762b1e4bdbc46d83912db3eba27a.zip
ffts-fa1780c68593762b1e4bdbc46d83912db3eba27a.tar.gz
Merge pull request #20 from dennisss/android-neon-fixes
Android neon fixes
Diffstat (limited to 'src/ffts.c')
-rw-r--r--src/ffts.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/ffts.c b/src/ffts.c
index 5a42122..7c46bfc 100644
--- a/src/ffts.c
+++ b/src/ffts.c
@@ -53,6 +53,18 @@
#endif
void ffts_execute(ffts_plan_t *p, const void * in, void * out) {
+
+//TODO: Define NEEDS_ALIGNED properly instead
+#if defined(HAVE_SSE) || defined(HAVE_NEON)
+ if(((int)in % 16) != 0) {
+ LOG("ffts_execute: input buffer needs to be aligned to a 128bit boundary\n");
+ }
+
+ if(((int)out % 16) != 0) {
+ LOG("ffts_execute: output buffer needs to be aligned to a 128bit boundary\n");
+ }
+#endif
+
p->transform(p, (const float *)in, (float *)out);
}
@@ -85,6 +97,11 @@ void ffts_free_1d(ffts_plan_t *p) {
}
ffts_plan_t *ffts_init_1d(size_t N, int sign) {
+ if(N == 0 || (N & (N - 1)) != 0){
+ LOG("FFT size must be a power of two\n");
+ return NULL;
+ }
+
ffts_plan_t *p = malloc(sizeof(ffts_plan_t));
size_t leafN = 8;
size_t i;
OpenPOWER on IntegriCloud