; Version: @(#)fir2d1.asm 1.2 07/06/99 ; ; Compute y(n1,n2) = h(n1,n2) ** x(n1,n2) at one index n1, n2. ; The filter h(n1,n2) is an M1 x M2 filter having M = M1 M2 ; coefficients. The image x(n1,n2) is N1 x N2. ; ; Registers: A5=&a(0,0) B5=&x(n1,n2) B7=M A9=M2 B8=N2 fir2d1 MV .D1 A9,A2 ; inner product length || SUB .D2 B8,B7,B10 ; offset to next row || CMPLT.L1 B7,A9,A1 ; A1=no more rows to do || ZERO .S1 A4 ; initialize accumulator || SUB .S2 B7,A9,B7 ; number of taps left fir1 LDBU .D1 *A5++,A6 ; load a(m1,m2), zero fill || LDBU .D2 *B5++,B6 ; load x(n1-m1,n2-m2) || MPY .M1X A6,B6,A3 ; A3=a(m1,m2) x(n1-m1,n2-m2) || ADD .L1 A3,A4,A4 ; y(n1,n2) += A3 ||[A2] SUB .S1 A2,1,A2 ; decrement loop counter ||[A2] B .S2 fir1 ; if A2 != 0, then branch MV .D1 A9,A2 ; inner product length || CMPLT.L1 B7,A9,A1 ; A1=no more rows to do || ADD .L2 B5,B10,B5 ; advance to next image row ||[!A1] B .S1 fir1 ; outer loop || SUB .S2 B7,A9,B7 ; count number of taps left ; return y(n1,n2)