diff options
| author | Thom Johansen <thomj@rockbox.org> | 2006-01-29 15:37:03 +0000 |
|---|---|---|
| committer | Thom Johansen <thomj@rockbox.org> | 2006-01-29 15:37:03 +0000 |
| commit | 55ff456c4615b4cedc1d936d510abe4d92403b61 (patch) | |
| tree | 076149a8754f5461c830bedfaddf700acc44030d /apps/eq_cf.S | |
| parent | 7d1117fe4f594c9ef8c7faef3dea701db0526255 (diff) | |
| download | rockbox-55ff456c4615b4cedc1d936d510abe4d92403b61.zip rockbox-55ff456c4615b4cedc1d936d510abe4d92403b61.tar.gz rockbox-55ff456c4615b4cedc1d936d510abe4d92403b61.tar.bz2 rockbox-55ff456c4615b4cedc1d936d510abe4d92403b61.tar.xz | |
Recommit reverted changes and add the missing file...
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8484 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/eq_cf.S')
| -rw-r--r-- | apps/eq_cf.S | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/apps/eq_cf.S b/apps/eq_cf.S new file mode 100644 index 0000000..3876ca7 --- /dev/null +++ b/apps/eq_cf.S @@ -0,0 +1,61 @@ +/*************************************************************************** + * __________ __ ___. + * Open \______ \ ____ ____ | | _\_ |__ _______ ___ + * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / + * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < + * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ + * \/ \/ \/ \/ \/ + * $Id$ + * + * Copyright (C) 2006 Thom Johansen + * + * All files in this archive are subject to the GNU General Public License. + * See the file COPYING in the source tree root for full license agreement. + * + * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY + * KIND, either express or implied. + * + ****************************************************************************/ + + .text + .global eq_filter +eq_filter: + lea.l (-11*4, %sp), %sp + movem.l %d2-%d7/%a2-%a6, (%sp) | save clobbered regs + move.l (11*4+8, %sp), %a5 | fetch filter structure address + movem.l (11*4+16, %sp), %d6-%d7 | load num. channels and shift count + movem.l (%a5), %a0-%a4 | load coefs + lea.l (5*4, %a5), %a5 | point to filter history + moveq.l #2, %d6 | number of channels (hardcode to stereo) + +.filterloop: + move.l (11*4+4, %sp), %a6 | load input channel pointer + move.l (%a6), %a6 + move.l (11*4+12, %sp), %d5 | number of samples + addq.l #4, (11*4+4, %sp) | point x to next channel + movem.l (%a5), %d0-%d3 | load filter history +.loop: + move.l (%a6), %d4 + mac.l %a0, %d4, %acc0 | acc = b0*x[i] + mac.l %a1, %d0, %acc0 | acc += b1*x[i - 1] + mac.l %a2, %d1, %acc0 | acc += b2*x[i - 2] + msac.l %a3, %d2, %acc0 | acc -= a1*y[i - 1] + msac.l %a4, %d3, %acc0 | acc -= a2*y[i - 2] + move.l %d0, %d1 | fix history + move.l %d4, %d0 + move.l %d2, %d3 + movclr.l %acc0, %d2 | fetch and write result + asl.l %d7, %d2 | restore fixed point format + move.l %d2, (%a6)+ | save result + subq.l #1, %d5 | are we done with this channel? + jne .loop + + movem.l %d0-%d3, (%a5) | save history back to struct + lea.l (4*4, %a5), %a5 | point to next channel's history + subq.l #1, %d6 | have we processed both channels? + jne .filterloop + + movem.l (%sp), %d2-%d7/%a2-%a6 + lea.l (11*4, %sp), %sp + rts + |