From dfb3f4f10cc66a72027ae5869318cc10baf30a2e Mon Sep 17 00:00:00 2001 From: Takamichi Horikawa Date: Wed, 23 Aug 2017 21:13:48 +0900 Subject: PPZ8: add sinc interpolation --- fmdriver/ppz8.h | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'fmdriver/ppz8.h') diff --git a/fmdriver/ppz8.h b/fmdriver/ppz8.h index 35c67dc..f2134ce 100644 --- a/fmdriver/ppz8.h +++ b/fmdriver/ppz8.h @@ -10,6 +10,12 @@ extern "C" { #endif +enum ppz8_interp { + PPZ8_INTERP_NONE, + PPZ8_INTERP_LINEAR, + PPZ8_INTERP_SINC, +}; + struct ppz8_pcmvoice { uint32_t start; uint32_t len; @@ -32,11 +38,11 @@ struct ppz8_channel { uint32_t freq; uint32_t loopstartoff; uint32_t loopendoff; - int16_t prevout[2]; uint8_t vol; uint8_t pan; uint8_t voice; bool playing; + bool looped; struct leveldata leveldata; }; @@ -47,6 +53,7 @@ struct ppz8 { uint8_t totalvol; uint16_t mix_volume; unsigned mask; + enum ppz8_interp interp; }; void ppz8_init(struct ppz8 *ppz8, uint16_t srate, uint16_t mix_volume); @@ -70,6 +77,10 @@ static inline uint32_t ppz8_pzi_decodebuf_samples(uint32_t pzidatalen) { unsigned ppz8_get_mask(const struct ppz8 *ppz8); void ppz8_set_mask(struct ppz8 *ppz8, unsigned mask); +static inline void ppz8_set_interpolation(struct ppz8 *ppz8, enum ppz8_interp interp) { + ppz8->interp = interp; +} + struct ppz8_functbl { void (*channel_play)(struct ppz8 *ppz8, uint8_t channel, uint8_t voice); void (*channel_stop)(struct ppz8 *ppz8, uint8_t channel); -- cgit v1.2.3