1
0
Fork 0
forked from len0rd/rockbox

QMF filter memory doesn't need to be 32 bits, so convert it to 16 bits. Alter assembler code to reflect this. Also do a small optimization in the reverse block copy of the qmf_synth() Coldfire assembler.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15315 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Thom Johansen 2007-10-26 11:34:08 +00:00
parent 530abe84fd
commit 8431c08b7d
4 changed files with 21 additions and 23 deletions

View file

@ -478,7 +478,7 @@ void qmf_decomp(const spx_word16_t *xx, const spx_word16_t *aa, spx_word16_t *y1
#ifndef OVERRIDE_QMF_SYNTH
/* Re-synthesised a signal from the QMF low-band and high-band signals */
void qmf_synth(const spx_word16_t *x1, const spx_word16_t *x2, const spx_word16_t *a, spx_word16_t *y, int N, int M, spx_word32_t *mem1, spx_word32_t *mem2, char *stack)
void qmf_synth(const spx_word16_t *x1, const spx_word16_t *x2, const spx_word16_t *a, spx_word16_t *y, int N, int M, spx_word16_t *mem1, spx_word16_t *mem2, char *stack)
/* assumptions:
all odd x[i] are zero -- well, actually they are left out of the array now
N and M are multiples of 4 */

View file

@ -59,7 +59,7 @@ void highpass(const spx_word16_t *x, spx_word16_t *y, int len, int filtID, spx_m
void qmf_decomp(const spx_word16_t *xx, const spx_word16_t *aa, spx_word16_t *, spx_word16_t *y2, int N, int M, spx_word16_t *mem, char *stack);
void qmf_synth(const spx_word16_t *x1, const spx_word16_t *x2, const spx_word16_t *a, spx_word16_t *y, int N, int M, spx_word32_t *mem1, spx_word32_t *mem2, char *stack);
void qmf_synth(const spx_word16_t *x1, const spx_word16_t *x2, const spx_word16_t *a, spx_word16_t *y, int N, int M, spx_word16_t *mem1, spx_word16_t *mem2, char *stack);
void filter_mem16(const spx_word16_t *x, const spx_coef_t *num, const spx_coef_t *den, spx_word16_t *y, int N, int ord, spx_mem_t *mem, char *stack);
void iir_mem16(const spx_word16_t *x, const spx_coef_t *den, spx_word16_t *y, int N, int ord, spx_mem_t *mem, char *stack);

View file

@ -194,30 +194,32 @@ qmf_synth:
move.l %a6, %sp | Update sp
move.l %d3, -(%sp) | Stack old %sp
| Backwards copy x1 and x2 arrays to xx1 and xx2
| Backwards copy x1 and x2 arrays to xx1 and xx2, assume N2 is power of two
| TODO: these copying loops probably have more potential for optimization
lea.l (%a0, %d0.l*2), %a0 | x1 += N2
lea.l (%a1, %d0.l*2), %a1 | x2 += N2
move.l %d0, %d2 | Loop counter is N2
0:
move.w -(%a0), (%a2)+
move.w -(%a1), (%a6)+
subq.l #1, %d2
move.l -(%a0), %d3
swap.w %d3
move.l %d3, (%a2)+
move.l -(%a1), %d3
swap.w %d3
move.l %d3, (%a6)+
subq.l #2, %d2
jne 0b
| Copy alternate members of mem1 and mem2 to last part of xx1 and xx2
move.l %d1, %d2 | Loop counter is M2
addq.l #4, %a4 | a4 = &mem1[1]
addq.l #4, %a5 | a5 = &mem2[1]
addq.l #2, %a4 | a4 = &mem1[1]
addq.l #2, %a5 | a5 = &mem2[1]
move.l %a4, %d3 | Backup mem1 and mem2
move.l %a5, %d4
0:
move.l (%a4), %d5
move.w %d5, (%a2)+
move.l (%a5), %d5
move.w %d5, (%a6)+
addq.l #8, %a4
addq.l #8, %a5
move.w (%a4), (%a2)+
move.w (%a5), (%a6)+
addq.l #4, %a4
addq.l #4, %a5
subq.l #1, %d2
jne 0b
move.l %d3, %a4 | a4 = &mem1[1]
@ -295,14 +297,10 @@ qmf_synth:
addq.l #4, %a0 | a0 = &xx1[0]
addq.l #4, %a1 | a1 = &xx2[0]
0:
move.w (%a0)+, %d2
move.w (%a1)+, %d3
ext.l %d2
ext.l %d3
move.l %d2, (%a4)
move.l %d3, (%a5)
addq.l #8, %a4
addq.l #8, %a5
move.w (%a0)+, (%a4)
move.w (%a1)+, (%a5)
addq.l #4, %a4
addq.l #4, %a5
subq.l #1, %d1
jne 0b

View file

@ -109,7 +109,7 @@ typedef struct SBDecState {
int lpc_enh_enabled;
char *stack;
spx_word32_t g0_mem[64], g1_mem[64];
spx_word16_t g0_mem[64], g1_mem[64];
spx_word16_t excBuf[80];
spx_lsp_t old_qlsp[10];