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
This commit is contained in:
Michael Sevakis 2013-05-04 14:23:21 -04:00
parent 78a45b47de
commit 1a4acc9d1e

View file

@ -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);