summaryrefslogtreecommitdiffstats
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-1a4acc9.tar.gz
rockbox-1a4acc9.tar.bz2
rockbox-1a4acc9.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,
/* Tag input with codec-specified sample format */
src->format = dsp->io_data.format;
+ if (src->format.version != dsp->io_data.sample_buf.format.version)
+ dsp_sample_input_format_change(&dsp->io_data, &src->format);
+
while (1)
{
/* Out-of-place-processing stages take the current buf as input
* and switch the buffer to their own output buffer */
struct dsp_buffer *buf = src;
- if (UNLIKELY(buf->format.version != dsp->io_data.sample_buf.format.version))
- dsp_sample_input_format_change(&dsp->io_data, &buf->format);
-
/* Convert input samples to internal format */
dsp->io_data.input_samples(&dsp->io_data, &buf);