beautypg.com

Motorola DSP96002 User Manual

Page 561

background image

B-42

DSP96002 USER’S MANUAL

MOTOROLA

r0

image(n,m) image(n,m+1) image(n,m+2)

r1

image(n+514,m) image(n+514,m+1) image(n+514,m+2)

r2

image(n+2*514,m) image(n+2*514,m+1) image(n+2*514,m+2)

r4

FIR coefficients

r5

output image

DSP56000 IMPLEMENTATION


Program

ICycles

Words

move #mask,r4 ;point to coefficients 1 1

move #8,m4 ;mod 9 1 1

move #image,r0 ;top boundary 1 1

move #image+514,r1 ;left of first pixel 1 1

move #image+2*514,r2 ;left of first pixel 2nd row 1 1

move #2,n1 ;adjustment for end of row 1 1

move n1,n2 1 1

move #imageout,r5 ;output image 1 1

move x:(r0)+,x0 y:(r4)+,y0 ;first element, c(1,1) 1 1

do #512,_rows 2 3

do #512,_cols 2 3

mpy x0,y0,a x:(r0)+,x0 y:(r4)+,y0 ;c(1,2) 1 1

mac x0,y0,a x:(r0)-,x0 y:(r4)+,y0 ;c(1,3) 1 1

mac x0,y0,a x:(r1)+,x0 y:(r4)+,y0 ;c(2,1) 1 1

mac x0,y0,a x:(r1)+,x0 y:(r4)+,y0 ;c(2,2) 1 1

mac x0,y0,a x:(r1)-,x0 y:(r4)+,y0 ;c(2,3) 1 1

mac x0,y0,a x:(r2)+,x0 y:(r4)+,y0 ;c(3,1) 1 1

mac x0,y0,a x:(r2)+,x0 y:(r4)+,y0 ;c(3,2) 1 1

mac x0,y0,a x:(r2)-,x0 y:(r4)+,y0 ;c(3,3) 1 1

macr x0,y0,a x:(r0)+,x0 y:(r4)+,y0 ;preload, get c(1,1) 1 1

move a,y:(r5)+ ;output image sample 1 1

_rows

; adjust pointers for frame boundary

move x:(r0)+,x0 y:(r5)+,y1 ;adj r0,r5 w/dummy loads 1 1

move x:(r1)+n1,x0 y:(r5)+,y1 ;adj r1,r5 w/dummy loads 1 1

move (r2)+n2 ;adj r2 1 1

move x:(r0)+,x0 ;preload for next pass 1 1

_cols

--- ---

28

(Kernel=10N), 10N

2

+7N+12