From 4d9be96a819206534594f79e856fbbd7880588d4 Mon Sep 17 00:00:00 2001 From: Thom Johansen Date: Sun, 6 Nov 2005 23:05:49 +0000 Subject: Changed output format of libmpcdec to non-interleaved stereo for a slight speed boost. Also stopped wasting 10kb of IRAM in the output sample buffer. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@7769 a1c6a512-1295-4272-9138-f99709370657 --- apps/codecs/libmusepack/synth_filter.c | 7 +++---- apps/codecs/mpc.c | 11 ++++++----- 2 files changed, 9 insertions(+), 9 deletions(-) (limited to 'apps/codecs') diff --git a/apps/codecs/libmusepack/synth_filter.c b/apps/codecs/libmusepack/synth_filter.c index bd3c3e8..e01da55 100644 --- a/apps/codecs/libmusepack/synth_filter.c +++ b/apps/codecs/libmusepack/synth_filter.c @@ -372,8 +372,7 @@ static void Synthese_Filter_float_internal(MPC_SAMPLE_FORMAT * OutData,MPC_SAMPL "mac.l %%d3, %%a5, %%acc0\n\t" "movclr.l %%acc0, %%d0\n\t" "asl.l #1, %%d0\n\t" - "move.l %%d0, (%[Data])\n\t" - "addq.l #8, %[Data]" + "move.l %%d0, (%[Data])+\n" : [Data] "+a" (Data) : [V] "a" (V), [D] "a" (D) : "d0", "d1", "d2", "d3", "a5"); @@ -389,7 +388,7 @@ static void Synthese_Filter_float_internal(MPC_SAMPLE_FORMAT * OutData,MPC_SAMPL #endif } V -= 32;//bleh - OutData+=64; + OutData+=32; } } } @@ -409,7 +408,7 @@ mpc_decoder_synthese_filter_float(mpc_decoder *d, MPC_SAMPLE_FORMAT* OutData) memmove(d->V_R + MPC_V_MEM, d->V_R, 960 * sizeof(MPC_SAMPLE_FORMAT) ); Synthese_Filter_float_internal( - OutData + 1, + OutData + MPC_FRAME_LENGTH, (MPC_SAMPLE_FORMAT *)(d->V_R + MPC_V_MEM), (MPC_SAMPLE_FORMAT *)(d->Y_R [0])); } diff --git a/apps/codecs/mpc.c b/apps/codecs/mpc.c index fb42447..0f113c7 100644 --- a/apps/codecs/mpc.c +++ b/apps/codecs/mpc.c @@ -62,7 +62,7 @@ bool canseek_impl(void *data) } /* temporary, we probably have better use for iram than this */ -MPC_SAMPLE_FORMAT sample_buffer[MPC_DECODER_BUFFER_LENGTH] IBSS_ATTR; +MPC_SAMPLE_FORMAT sample_buffer[MPC_FRAME_LENGTH*2] IBSS_ATTR; #ifdef USE_IRAM extern char iramcopy[]; @@ -122,7 +122,7 @@ next_track: /* NOTE: current musepack format only allows for stereo files but code is here to handle other configurations anyway */ if (info.channels == 2) - ci->configure(DSP_SET_STEREO_MODE, (long *)STEREO_INTERLEAVED); + ci->configure(DSP_SET_STEREO_MODE, (long *)STEREO_NONINTERLEAVED); else if (info.channels == 1) ci->configure(DSP_SET_STEREO_MODE, (long *)STEREO_MONO); else @@ -163,13 +163,14 @@ next_track: if (ci->stop_codec || ci->reload_codec) break; - status = mpc_decoder_decode(&decoder, sample_buffer, 0, 0); + status = mpc_decoder_decode(&decoder, sample_buffer, NULL, NULL); ci->yield(); if (status == (unsigned)(-1)) { /* decode error */ return CODEC_ERROR; } else { - while (!ci->pcmbuf_insert((char *)sample_buffer, - status*sizeof(MPC_SAMPLE_FORMAT)*2)) + while (!ci->pcmbuf_insert_split(sample_buffer, + sample_buffer + MPC_FRAME_LENGTH, + status*sizeof(MPC_SAMPLE_FORMAT))) ci->yield(); samplesdone += status; ci->set_elapsed(samplesdone/(frequency/1000)); -- cgit v1.1