summaryrefslogtreecommitdiff
path: root/apps/codecs/libgme/resampler.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/codecs/libgme/resampler.c')
-rw-r--r--apps/codecs/libgme/resampler.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/apps/codecs/libgme/resampler.c b/apps/codecs/libgme/resampler.c
index 837f01ed13..91677cbb8a 100644
--- a/apps/codecs/libgme/resampler.c
+++ b/apps/codecs/libgme/resampler.c
@@ -64,7 +64,7 @@ void Resampler_resize( struct Resampler* this, int pairs )
64 } 64 }
65} 65}
66 66
67void mix_samples( struct Resampler* this, struct Blip_Buffer* blip_buf, sample_t out_ [] ) 67void mix_samples( struct Resampler* this, struct Blip_Buffer* blip_buf, dsample_t out_ [] )
68{ 68{
69 int const bass = BLIP_READER_BASS( *blip_buf ); 69 int const bass = BLIP_READER_BASS( *blip_buf );
70 BLIP_READER_BEGIN( sn, *blip_buf ); 70 BLIP_READER_BEGIN( sn, *blip_buf );
@@ -72,7 +72,7 @@ void mix_samples( struct Resampler* this, struct Blip_Buffer* blip_buf, sample_t
72 int count = this->sample_buf_size >> 1; 72 int count = this->sample_buf_size >> 1;
73 BLIP_READER_ADJ_( sn, count ); 73 BLIP_READER_ADJ_( sn, count );
74 74
75 typedef sample_t stereo_dsample_t [2]; 75 typedef dsample_t stereo_dsample_t [2];
76 stereo_dsample_t* BLARGG_RESTRICT out = (stereo_dsample_t*) out_ + count; 76 stereo_dsample_t* BLARGG_RESTRICT out = (stereo_dsample_t*) out_ + count;
77 stereo_dsample_t const* BLARGG_RESTRICT in = 77 stereo_dsample_t const* BLARGG_RESTRICT in =
78 (stereo_dsample_t const*) this->sample_buf + count; 78 (stereo_dsample_t const*) this->sample_buf + count;
@@ -97,14 +97,14 @@ void mix_samples( struct Resampler* this, struct Blip_Buffer* blip_buf, sample_t
97 BLIP_READER_END( sn, *blip_buf ); 97 BLIP_READER_END( sn, *blip_buf );
98} 98}
99 99
100sample_t const* resample_( struct Resampler* this, sample_t** out_, 100dsample_t const* resample_( struct Resampler* this, dsample_t** out_,
101 sample_t const* out_end, sample_t const in [], int in_size ) 101 dsample_t const* out_end, dsample_t const in [], int in_size )
102{ 102{
103 in_size -= write_offset; 103 in_size -= write_offset;
104 if ( in_size > 0 ) 104 if ( in_size > 0 )
105 { 105 {
106 sample_t* BLARGG_RESTRICT out = *out_; 106 dsample_t* BLARGG_RESTRICT out = *out_;
107 sample_t const* const in_end = in + in_size; 107 dsample_t const* const in_end = in + in_size;
108 108
109 int const step = this->step; 109 int const step = this->step;
110 int pos = this->pos; 110 int pos = this->pos;
@@ -135,12 +135,12 @@ sample_t const* resample_( struct Resampler* this, sample_t** out_,
135 return in; 135 return in;
136} 136}
137 137
138static inline int resample_wrapper( struct Resampler* this, sample_t out [], int* out_size, 138static inline int resample_wrapper( struct Resampler* this, dsample_t out [], int* out_size,
139 sample_t const in [], int in_size ) 139 dsample_t const in [], int in_size )
140{ 140{
141 assert( Resampler_rate( this ) ); 141 assert( Resampler_rate( this ) );
142 142
143 sample_t* out_ = out; 143 dsample_t* out_ = out;
144 int result = resample_( this, &out_, out + *out_size, in, in_size ) - in; 144 int result = resample_( this, &out_, out + *out_size, in, in_size ) - in;
145 assert( out_ <= out + *out_size ); 145 assert( out_ <= out + *out_size );
146 assert( result <= in_size ); 146 assert( result <= in_size );
@@ -161,7 +161,7 @@ int skip_input( struct Resampler* this, int count )
161 return count; 161 return count;
162} 162}
163 163
164void play_frame_( struct Resampler* this, struct Blip_Buffer* blip_buf, sample_t* out ) 164void play_frame_( struct Resampler* this, struct Blip_Buffer* blip_buf, dsample_t* out )
165{ 165{
166 int pair_count = this->sample_buf_size >> 1; 166 int pair_count = this->sample_buf_size >> 1;
167 blip_time_t blip_time = Blip_count_clocks( blip_buf, pair_count ); 167 blip_time_t blip_time = Blip_count_clocks( blip_buf, pair_count );
@@ -185,7 +185,7 @@ void play_frame_( struct Resampler* this, struct Blip_Buffer* blip_buf, sample_t
185 Blip_remove_samples( blip_buf, pair_count ); 185 Blip_remove_samples( blip_buf, pair_count );
186} 186}
187 187
188void Resampler_play( struct Resampler* this, int count, sample_t* out, struct Blip_Buffer* blip_buf ) 188void Resampler_play( struct Resampler* this, int count, dsample_t* out, struct Blip_Buffer* blip_buf )
189{ 189{
190 // empty extra buffer 190 // empty extra buffer
191 int remain = this->sample_buf_size - this->buf_pos; 191 int remain = this->sample_buf_size - this->buf_pos;