Mercurial > hg > vamp-plugin-sdk
comparison src/vamp-hostsdk/PluginInputDomainAdapter.cpp @ 336:50df48a51c97
Thread-safe base-fft
author | Chris Cannam |
---|---|
date | Mon, 09 Jul 2012 22:36:06 +0100 |
parents | 7920b9519fd9 |
children | d5c5a52e6c9f |
comparison
equal
deleted
inserted
replaced
335:7d4aeb0d0d6c | 336:50df48a51c97 |
---|---|
624 bits = i; | 624 bits = i; |
625 break; | 625 break; |
626 } | 626 } |
627 } | 627 } |
628 | 628 |
629 static unsigned int tableSize = 0; | 629 int table[n]; |
630 static int *table = 0; | 630 |
631 | 631 for (i = 0; i < n; ++i) { |
632 if (tableSize != n) { | 632 m = i; |
633 | 633 for (j = k = 0; j < bits; ++j) { |
634 delete[] table; | 634 k = (k << 1) | (m & 1); |
635 | 635 m >>= 1; |
636 table = new int[n]; | 636 } |
637 | 637 table[i] = k; |
638 for (i = 0; i < n; ++i) { | |
639 | |
640 m = i; | |
641 | |
642 for (j = k = 0; j < bits; ++j) { | |
643 k = (k << 1) | (m & 1); | |
644 m >>= 1; | |
645 } | |
646 | |
647 table[i] = k; | |
648 } | |
649 | |
650 tableSize = n; | |
651 } | 638 } |
652 | 639 |
653 if (ii) { | 640 if (ii) { |
654 for (i = 0; i < n; ++i) { | 641 for (i = 0; i < n; ++i) { |
655 ro[table[i]] = ri[i]; | 642 ro[table[i]] = ri[i]; |