summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Sevakis <jethead71@rockbox.org>2013-05-04 14:23:21 -0400
committerMichael Sevakis <jethead71@rockbox.org>2013-05-04 14:23:21 -0400
commit1a4acc9d1eebd8e3dba9045a5047a4229567453e (patch)
tree71bf6545d063571599a959f859ef9b4a218a71a8
parent78a45b47dede5ddf35dfc53e965b486a79177b18 (diff)
downloadrockbox-1a4acc9d1eebd8e3dba9045a5047a4229567453e.tar.gz
rockbox-1a4acc9d1eebd8e3dba9045a5047a4229567453e.zip
Fix missed optimization opportunity in dsp_process.
Input type can only change once per call because the DSP parameters are only copied at the start and input is always taken from the src buffer which means sample input format switching can be once per call instead of once per loop. Change-Id: Ifa3521753428fb0e6997e4934f24a3b915628cc7
-rw-r--r--lib/rbcodec/dsp/dsp_core.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/rbcodec/dsp/dsp_core.c b/lib/rbcodec/dsp/dsp_core.c
index c54bda17a9..5e365eb08d 100644
--- a/lib/rbcodec/dsp/dsp_core.c
+++ b/lib/rbcodec/dsp/dsp_core.c
@@ -414,15 +414,15 @@ void dsp_process(struct dsp_config *dsp, struct dsp_buffer *src,
414 /* Tag input with codec-specified sample format */ 414 /* Tag input with codec-specified sample format */
415 src->format = dsp->io_data.format; 415 src->format = dsp->io_data.format;
416 416
417 if (src->format.version != dsp->io_data.sample_buf.format.version)
418 dsp_sample_input_format_change(&dsp->io_data, &src->format);
419
417 while (1) 420 while (1)
418 { 421 {
419 /* Out-of-place-processing stages take the current buf as input 422 /* Out-of-place-processing stages take the current buf as input
420 * and switch the buffer to their own output buffer */ 423 * and switch the buffer to their own output buffer */
421 struct dsp_buffer *buf = src; 424 struct dsp_buffer *buf = src;
422 425
423 if (UNLIKELY(buf->format.version != dsp->io_data.sample_buf.format.version))
424 dsp_sample_input_format_change(&dsp->io_data, &buf->format);
425
426 /* Convert input samples to internal format */ 426 /* Convert input samples to internal format */
427 dsp->io_data.input_samples(&dsp->io_data, &buf); 427 dsp->io_data.input_samples(&dsp->io_data, &buf);
428 428