aboutsummaryrefslogtreecommitdiff
path: root/libopna/opnassg-sinc-c.c
diff options
context:
space:
mode:
authorTakamichi Horikawa <takamichiho@gmail.com>2017-03-30 23:31:39 +0000
committerTakamichi Horikawa <takamichiho@gmail.com>2017-03-30 23:31:39 +0000
commitf47eba7d7d4c6a1d9501e027b63bbab04bb7d417 (patch)
treec6d8ebf4f84b76e9d32d4998d28a69d36fddd4a9 /libopna/opnassg-sinc-c.c
parenta86bb48b9f3acb081afa92e5efc50d0192c4f68c (diff)
add NEON optimization
Diffstat (limited to 'libopna/opnassg-sinc-c.c')
-rw-r--r--libopna/opnassg-sinc-c.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/libopna/opnassg-sinc-c.c b/libopna/opnassg-sinc-c.c
new file mode 100644
index 0000000..bf93039
--- /dev/null
+++ b/libopna/opnassg-sinc-c.c
@@ -0,0 +1,13 @@
+#include "libopna/opnassg.h"
+
+void opna_ssg_sinc_calc_c(unsigned resampler_index, const int16_t *inbuf, int32_t *outbuf) {
+ for (int c = 0; c < 3; c++) {
+ int32_t chsample = 0;
+ for (int j = 0; j < OPNA_SSG_SINCTABLELEN; j++) {
+ unsigned sincindex = j;
+ if (!(resampler_index&1)) sincindex += OPNA_SSG_SINCTABLELEN;
+ chsample += inbuf[(((resampler_index)>>1)+j)*3+c] * opna_ssg_sinctable[sincindex];
+ }
+ outbuf[c] = chsample;
+ }
+}