From 05b115a519d225e7470efb8c547deb6ba20ff9d7 Mon Sep 17 00:00:00 2001 From: waker Date: Sun, 20 Mar 2011 22:49:07 +0100 Subject: added 24 to 32 bit converter --- premix.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/premix.c b/premix.c index 679199b1..da93576e 100644 --- a/premix.c +++ b/premix.c @@ -180,6 +180,21 @@ pcm_write_samples_24_to_24 (const ddb_waveformat_t * restrict inputfmt, const ch } } +static inline void +pcm_write_samples_24_to_32 (const ddb_waveformat_t * restrict inputfmt, const char * restrict input, const ddb_waveformat_t * restrict outputfmt, char * restrict output, int nsamples, int * restrict channelmap, int outputsamplesize) { + for (int s = 0; s < nsamples; s++) { + for (int c = 0; c < inputfmt->channels; c++) { + char *out = output + 4 * channelmap[c]; + out[0] = 0; + out[1] = input[0]; + out[2] = input[1]; + out[3] = input[2]; + input += 3; + } + output += outputsamplesize; + } +} + static inline void pcm_write_samples_24_to_16 (const ddb_waveformat_t * restrict inputfmt, const char * restrict input, const ddb_waveformat_t * restrict outputfmt, char * restrict output, int nsamples, int * restrict channelmap, int outputsamplesize) { for (int s = 0; s < nsamples; s++) { @@ -317,7 +332,7 @@ remap_fn_t remappers[8][8] = { pcm_write_samples_24_to_8, pcm_write_samples_24_to_16, pcm_write_samples_24_to_24, - NULL, // FIXME: add 24_to_32 + pcm_write_samples_24_to_32, NULL, NULL, NULL, -- cgit v1.2.3