summaryrefslogtreecommitdiff
path: root/apps/eq_cf.S
diff options
context:
space:
mode:
Diffstat (limited to 'apps/eq_cf.S')
-rw-r--r--apps/eq_cf.S17
1 files changed, 10 insertions, 7 deletions
diff --git a/apps/eq_cf.S b/apps/eq_cf.S
index 3876ca72d6..0a34d7707e 100644
--- a/apps/eq_cf.S
+++ b/apps/eq_cf.S
@@ -26,21 +26,24 @@ eq_filter:
26 movem.l (11*4+16, %sp), %d6-%d7 | load num. channels and shift count 26 movem.l (11*4+16, %sp), %d6-%d7 | load num. channels and shift count
27 movem.l (%a5), %a0-%a4 | load coefs 27 movem.l (%a5), %a0-%a4 | load coefs
28 lea.l (5*4, %a5), %a5 | point to filter history 28 lea.l (5*4, %a5), %a5 | point to filter history
29 moveq.l #2, %d6 | number of channels (hardcode to stereo)
30 29
31.filterloop: 30.filterloop:
32 move.l (11*4+4, %sp), %a6 | load input channel pointer 31 move.l (11*4+4, %sp), %a6 | load input channel pointer
32 addq.l #4, (11*4+4, %sp) | point x to next channel
33 move.l (%a6), %a6 33 move.l (%a6), %a6
34 move.l (11*4+12, %sp), %d5 | number of samples 34 move.l (11*4+12, %sp), %d5 | number of samples
35 addq.l #4, (11*4+4, %sp) | point x to next channel
36 movem.l (%a5), %d0-%d3 | load filter history 35 movem.l (%a5), %d0-%d3 | load filter history
37.loop: 36.loop:
38 move.l (%a6), %d4 37 /* Direct form 1 filtering code. We assume DSP has put EMAC in frac mode.
39 mac.l %a0, %d4, %acc0 | acc = b0*x[i] 38 y[n] = b0*x[i] + b1*x[i - 1] + b2*x[i - 2] + a1*y[i - 1] + a2*y[i - 2],
40 mac.l %a1, %d0, %acc0 | acc += b1*x[i - 1] 39 where y[] is output and x[] is input. This is performed out of order
40 to do parallel load of input value.
41 */
42 mac.l %a1, %d0, (%a6), %d4, %acc0 | acc = b1*x[i - 1], x[i] -> d4
41 mac.l %a2, %d1, %acc0 | acc += b2*x[i - 2] 43 mac.l %a2, %d1, %acc0 | acc += b2*x[i - 2]
42 msac.l %a3, %d2, %acc0 | acc -= a1*y[i - 1] 44 mac.l %a0, %d4, %acc0 | acc += b0*x[i]
43 msac.l %a4, %d3, %acc0 | acc -= a2*y[i - 2] 45 mac.l %a3, %d2, %acc0 | acc += a1*y[i - 1]
46 mac.l %a4, %d3, %acc0 | acc += a2*y[i - 2]
44 move.l %d0, %d1 | fix history 47 move.l %d0, %d1 | fix history
45 move.l %d4, %d0 48 move.l %d4, %d0
46 move.l %d2, %d3 49 move.l %d2, %d3