forked from len0rd/rockbox
Fundamentally rewrite much of the audio DSP.
Creates a standard buffer passing, local data passing and messaging system for processing stages. Stages can be moved to their own source files to reduce clutter and ease assimilation of new ones. dsp.c becomes dsp_core.c which supports an engine and framework for effects. Formats and change notifications are passed along with the buffer so that they arrive at the correct time at each stage in the chain regardless of the internal delays of a particular one. Removes restrictions on the number of samples that can be processed at a time and it pays attention to destination buffer size restrictions without having to limit input count, which also allows pcmbuf to remain fuller and safely set its own buffer limits as it sees fit. There is no longer a need to query input/output counts given a certain number of input samples; just give it the sizes of the source and destination buffers. Works in harmony with stages that are not deterministic in terms of sample input/output ratio (like both resamplers but most notably the timestretch). As a result it fixes quirks with timestretch hanging up with certain settings and it now operates properly throughout its full settings range. Change-Id: Ib206ec78f6f6c79259c5af9009fe021d68be9734 Reviewed-on: http://gerrit.rockbox.org/200 Reviewed-by: Michael Sevakis <jethead71@rockbox.org> Tested-by: Michael Sevakis <jethead71@rockbox.org>
This commit is contained in:
parent
c9c1349773
commit
c9bcbe202d
56 changed files with 4823 additions and 2998 deletions
|
|
@ -20,19 +20,21 @@
|
|||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* void sample_output_mono(int count, struct dsp_data *data,
|
||||
* const int32_t *src[], int16_t *dst)
|
||||
* void sample_output_mono(struct sample_io_data *this,
|
||||
* struct dsp_buffer *src,
|
||||
* struct dsp_buffer *dst)
|
||||
*/
|
||||
.section .text, "ax", %progbits
|
||||
.align 2
|
||||
.section .text
|
||||
.global sample_output_mono
|
||||
.type sample_output_mono, %function
|
||||
sample_output_mono:
|
||||
@ input: r0 = count, r1 = data, r2 = src, r3 = dst
|
||||
@ input: r0 = this, r1 = src, r2 = dst
|
||||
stmfd sp!, { r4, lr } @
|
||||
@
|
||||
ldr r1, [r1] @ r1 = data->output_scale
|
||||
ldr r2, [r2] @ r2 = src[0]
|
||||
ldr r0, [r0] @ r0 = this->outcount
|
||||
ldr r3, [r2, #4] @ r3 = dst->p16out
|
||||
ldr r2, [r1, #4] @ r2 = src->p32[0]
|
||||
ldrb r1, [r1, #19] @ r1 = src->format.output_scale
|
||||
@
|
||||
mov r4, #1 @ r4 = 1 << (scale - 1)
|
||||
mov r4, r4, lsl r1 @
|
||||
|
|
@ -68,19 +70,21 @@ sample_output_mono:
|
|||
.size sample_output_mono, .-sample_output_mono
|
||||
|
||||
/****************************************************************************
|
||||
* void sample_output_stereo(int count, struct dsp_data *data,
|
||||
* const int32_t *src[], int16_t *dst)
|
||||
* void sample_output_stereo(struct sample_io_data *this,
|
||||
* struct dsp_buffer *src,
|
||||
* struct dsp_buffer *dst)
|
||||
*/
|
||||
.section .text, "ax", %progbits
|
||||
.align 2
|
||||
.section .text
|
||||
.global sample_output_stereo
|
||||
.type sample_output_stereo, %function
|
||||
sample_output_stereo:
|
||||
@ input: r0 = count, r1 = data, r2 = src, r3 = dst
|
||||
@ input: r0 = this, r1 = src, r2 = dst
|
||||
stmfd sp!, { r4-r7, lr } @
|
||||
@
|
||||
ldr r1, [r1] @ r1 = data->output_scale
|
||||
ldmia r2, { r2, r4 } @ r2 = src[0], r4 = src[1]
|
||||
ldr r0, [r0] @ r0 = this->outcount
|
||||
ldr r3, [r2, #4] @ r3 = dst->p16out
|
||||
ldmib r1, { r2, r4 } @ r2 = src->p32[0], r4 = src->p32[1]
|
||||
ldrb r1, [r1, #19] @ r1 = src->format.output_scale
|
||||
@
|
||||
mov r5, #1 @ r5 = 1 << (scale - 1)
|
||||
mov r5, r5, lsl r1 @
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue