diff options
Diffstat (limited to 'apps/codecs/libgme/resampler.h')
-rw-r--r-- | apps/codecs/libgme/resampler.h | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/apps/codecs/libgme/resampler.h b/apps/codecs/libgme/resampler.h index 1d8f86670b..3f3710a54a 100644 --- a/apps/codecs/libgme/resampler.h +++ b/apps/codecs/libgme/resampler.h | |||
@@ -7,16 +7,15 @@ | |||
7 | #include "blargg_common.h" | 7 | #include "blargg_common.h" |
8 | #include "multi_buffer.h" | 8 | #include "multi_buffer.h" |
9 | 9 | ||
10 | typedef short sample_t; | 10 | typedef short dsample_t; |
11 | 11 | ||
12 | enum { stereo = 2 }; | ||
13 | enum { max_buf_size = 3960 }; | 12 | enum { max_buf_size = 3960 }; |
14 | enum { max_resampler_size = 5942 }; | 13 | enum { max_resampler_size = 5942 }; |
15 | enum { write_offset = 8 * stereo }; | 14 | enum { write_offset = 8 * stereo }; |
16 | enum { gain_bits = 14 }; | 15 | enum { gain_bits = 14 }; |
17 | 16 | ||
18 | struct Resampler { | 17 | struct Resampler { |
19 | int (*callback)( void*, blip_time_t, int, sample_t* ); | 18 | int (*callback)( void*, blip_time_t, int, dsample_t* ); |
20 | void* callback_data; | 19 | void* callback_data; |
21 | 20 | ||
22 | int sample_buffer_size; | 21 | int sample_buffer_size; |
@@ -34,8 +33,8 @@ struct Resampler { | |||
34 | 33 | ||
35 | int rate_; | 34 | int rate_; |
36 | 35 | ||
37 | sample_t sample_buf [max_buf_size]; | 36 | dsample_t sample_buf [max_buf_size]; |
38 | sample_t buf [max_resampler_size]; // Internal resampler | 37 | dsample_t buf [max_resampler_size]; // Internal resampler |
39 | }; | 38 | }; |
40 | 39 | ||
41 | static inline void Resampler_init( struct Resampler* this ) | 40 | static inline void Resampler_init( struct Resampler* this ) |
@@ -50,9 +49,9 @@ static inline void Resampler_init( struct Resampler* this ) | |||
50 | 49 | ||
51 | blargg_err_t Resampler_reset( struct Resampler* this, int max_pairs ); | 50 | blargg_err_t Resampler_reset( struct Resampler* this, int max_pairs ); |
52 | void Resampler_resize( struct Resampler* this, int pairs_per_frame ); | 51 | void Resampler_resize( struct Resampler* this, int pairs_per_frame ); |
53 | void Resampler_play( struct Resampler* this, int count, sample_t* out, struct Blip_Buffer* ); | 52 | void Resampler_play( struct Resampler* this, int count, dsample_t* out, struct Blip_Buffer* ); |
54 | 53 | ||
55 | static inline void Resampler_set_callback(struct Resampler* this, int (*func)( void*, blip_time_t, int, sample_t* ), void* user_data ) | 54 | static inline void Resampler_set_callback(struct Resampler* this, int (*func)( void*, blip_time_t, int, dsample_t* ), void* user_data ) |
56 | { | 55 | { |
57 | this->callback = func; | 56 | this->callback = func; |
58 | this->callback_data = user_data; | 57 | this->callback_data = user_data; |