2-D FIR Implementation #3 on C6x (cont.)
fir3 LDHU .D1 *A5++,A6 ; load a(m1,m2) a(m1+1,m2+1)
|| LDHU .D2 *B6[B2],B6 ; load two pixels of image x|| CMPLT.L2 B2,B7,B1 ; need to go to next row?|| ADD .S2 B2,1,B2 ; incr offset into image
AND .L1 A6,A8,A6 ; extract a(m1,m2)
|| AND .L2 B6,A8,B6 ; extract x(n1-m1,n2-m2) || EXTU .S1 A6,0,8,A9 ; extract a(m1+1,m2+1)|| EXTU .S2 B6,0,8,B9 ; extract x(n1-m1+1,n2-m2+1) MPYHU .M1X A6,B6,A3 ; A3=a(m1,m2) x(n1-m1,n2-m2)
|| MPYHU .M2X A9,B9,B3 ; B3=a*x offset by 1 index|| ADD .L1 A3,A4,A4 ; y(n1,n2) += A3|| ADD .L2 B3,B4,B4 ; y(n1+1,n2+1) += B3
||[!B1]ADD .D2 B2,B9,B2 ; move offset to next row||[A2] SUB .S1 A2,1,A2 ; decrement loop counter||[A2] B .S2 fir3 ; if A2 != 0, then branch; A4=y(n1,n2) and B4=y(n1+1,n2+1)