beautypg.com

Motorola DSP96002 User Manual

Page 560

background image

MOTOROLA

DSP96002 USER’S MANUAL

B-41

B.1.23

N Point 3x3 2-D FIR Convolution

The two dimensional FIR uses a 3x3 coefficient mask:

c(1,1) c(1,2) c(1,3)

c(2,1) c(2,2) c(2,3)

c(3,1) c(3,2) c(3,3)

Stored in Y memory in the order:

c(1,1), c(1,2), c(1,3), c(2,1), c(2,2), c(2,3), c(3,1), c(3,2), c(3,3)

The image is an array of 512x512 pixels. To provide boundary conditions for the FIR filtering, the image is

surrounded by a set of zeros such that the image is actually stored as a 514x514 array. i.e.

514

... 0 ...

.

. 512 .

. . 514

0 0

. Image Area 512 .

. .

... 0 ...

The image (with boundary) is stored in row major storage. The first element of the array image(,) is im-

age(1,1) followed by image(1,2). The last element of the first row is image(1,514) followed by the beginning

of the next column image(2,1). These are stored sequentially in the array "im" in X memory.

Image(1,1) maps to index 0, image(1,514) maps to index 513, Image(2,1) maps to index 514 (row major

storage).

Although many other implementations are possible, this is a realistic type of image environment where the

actual size of the image may not be an exact power of 2. Other possibilities include storing a 512x512 im-

age but computing only a 511x511 result, computing a 512x512 result without boundary conditions but

throwing away the pixels on the border, etc.