aboutsummaryrefslogtreecommitdiff
path: root/libopna/opnassg.h
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.h
parenta86bb48b9f3acb081afa92e5efc50d0192c4f68c (diff)
add NEON optimization
Diffstat (limited to 'libopna/opnassg.h')
-rw-r--r--libopna/opnassg.h13
1 files changed, 12 insertions, 1 deletions
diff --git a/libopna/opnassg.h b/libopna/opnassg.h
index 0321163..231db4d 100644
--- a/libopna/opnassg.h
+++ b/libopna/opnassg.h
@@ -8,6 +8,9 @@
extern "C" {
#endif
+#define OPNA_SSG_SINCTABLEBIT 7
+#define OPNA_SSG_SINCTABLELEN (1<<OPNA_SSG_SINCTABLEBIT)
+
struct opna_ssg_ch {
uint16_t tone_counter;
bool out;
@@ -30,7 +33,7 @@ struct opna_ssg {
};
struct opna_ssg_resampler {
- int16_t buf[(1<<7)*3];
+ int16_t buf[OPNA_SSG_SINCTABLELEN*3 * 2];
unsigned index;
};
@@ -58,6 +61,14 @@ unsigned opna_ssg_readreg(const struct opna_ssg *ssg, unsigned reg);
int opna_ssg_channel_level(const struct opna_ssg *ssg, int ch);
unsigned opna_ssg_tone_period(const struct opna_ssg *ssg, int ch);
+typedef void (*opna_ssg_sinc_calc_func_type)(unsigned resampler_index,
+ const int16_t *inbuf, int32_t *outbuf);
+extern opna_ssg_sinc_calc_func_type opna_ssg_sinc_calc_func;
+void opna_ssg_sinc_calc_c(unsigned resampler_index,
+ const int16_t *inbuf, int32_t *outbuf);
+
+extern const int16_t opna_ssg_sinctable[OPNA_SSG_SINCTABLELEN*2];
+
#ifdef __cplusplus
}
#endif