PcmResampleFallback: use PcmBuffer instead of PcmResampler

Lighter API.
This commit is contained in:
Max Kellermann 2013-11-11 18:34:01 +01:00
parent a40d7ae4dd
commit 44ac84767e
3 changed files with 9 additions and 9 deletions

View File

@ -101,7 +101,7 @@ PcmResampler::ResampleFloat(unsigned channels, unsigned src_rate,
not do any math on the sample values, so this hack is
possible: */
return (const float *)
pcm_resample_fallback_32(this, channels,
pcm_resample_fallback_32(buffer, channels,
src_rate, (const int32_t *)src_buffer,
src_size,
dest_rate, dest_size_r);
@ -123,7 +123,7 @@ PcmResampler::Resample16(unsigned channels,
(void)error_r;
#endif
return pcm_resample_fallback_16(this, channels,
return pcm_resample_fallback_16(buffer, channels,
src_rate, src_buffer, src_size,
dest_rate, dest_size_r);
}
@ -144,7 +144,7 @@ PcmResampler::Resample32(unsigned channels, unsigned src_rate,
(void)error_r;
#endif
return pcm_resample_fallback_32(this, channels,
return pcm_resample_fallback_32(buffer, channels,
src_rate, src_buffer, src_size,
dest_rate, dest_size_r);
}

View File

@ -24,7 +24,7 @@
/* resampling code blatantly ripped from ESD */
const int16_t *
pcm_resample_fallback_16(PcmResampler *state,
pcm_resample_fallback_16(PcmBuffer &buffer,
unsigned channels,
unsigned src_rate,
const int16_t *src_buffer, size_t src_size,
@ -37,7 +37,7 @@ pcm_resample_fallback_16(PcmResampler *state,
(src_frames * dest_rate + src_rate - 1) / src_rate;
unsigned dest_samples = dest_frames * channels;
size_t dest_size = dest_samples * sizeof(*src_buffer);
int16_t *dest_buffer = (int16_t *)state->buffer.Get(dest_size);
int16_t *dest_buffer = (int16_t *)buffer.Get(dest_size);
assert((src_size % (sizeof(*src_buffer) * channels)) == 0);
@ -65,7 +65,7 @@ pcm_resample_fallback_16(PcmResampler *state,
}
const int32_t *
pcm_resample_fallback_32(PcmResampler *state,
pcm_resample_fallback_32(PcmBuffer &buffer,
unsigned channels,
unsigned src_rate,
const int32_t *src_buffer, size_t src_size,
@ -78,7 +78,7 @@ pcm_resample_fallback_32(PcmResampler *state,
(src_frames * dest_rate + src_rate - 1) / src_rate;
unsigned dest_samples = dest_frames * channels;
size_t dest_size = dest_samples * sizeof(*src_buffer);
int32_t *dest_buffer = (int32_t *)state->buffer.Get(dest_size);
int32_t *dest_buffer = (int32_t *)buffer.Get(dest_size);
assert((src_size % (sizeof(*src_buffer) * channels)) == 0);

View File

@ -72,7 +72,7 @@ pcm_resample_lsr_32(PcmResampler *state,
#endif
const int16_t *
pcm_resample_fallback_16(PcmResampler *state,
pcm_resample_fallback_16(PcmBuffer &buffer,
unsigned channels,
unsigned src_rate,
const int16_t *src_buffer, size_t src_size,
@ -80,7 +80,7 @@ pcm_resample_fallback_16(PcmResampler *state,
size_t *dest_size_r);
const int32_t *
pcm_resample_fallback_32(PcmResampler *state,
pcm_resample_fallback_32(PcmBuffer &buffer,
unsigned channels,
unsigned src_rate,
const int32_t *src_buffer,