diff options
| author | Thom Johansen <thomj@rockbox.org> | 2005-11-06 23:05:49 +0000 |
|---|---|---|
| committer | Thom Johansen <thomj@rockbox.org> | 2005-11-06 23:05:49 +0000 |
| commit | 4d9be96a819206534594f79e856fbbd7880588d4 (patch) | |
| tree | eb1c3af104d7957061c03a08d8f23156597f84ee /apps/codecs/mpc.c | |
| parent | c8193b8da503859eeeb4d551fdbe523759421394 (diff) | |
| download | rockbox-4d9be96a819206534594f79e856fbbd7880588d4.zip rockbox-4d9be96a819206534594f79e856fbbd7880588d4.tar.gz rockbox-4d9be96a819206534594f79e856fbbd7880588d4.tar.bz2 rockbox-4d9be96a819206534594f79e856fbbd7880588d4.tar.xz | |
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
Diffstat (limited to 'apps/codecs/mpc.c')
| -rw-r--r-- | apps/codecs/mpc.c | 11 |
1 files changed, 6 insertions, 5 deletions
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)); |