B.1.12 N Point 3X3 2-D Fir Convolution; Table B-2 Variable Descriptions; Figure B-9 3X3 Coefficient Mask; Figure B-10 Image Stored As 514X514 Array - Motorola DSP56800 Manual

16-bit digital signal processor
Table of Contents

Advertisement

B.1.12
N Point 3x3 2-D FIR Convolution
The two-dimensional FIR uses a 3x3 coefficient mask as shown in Figure B-9.
The image is an array of 512 pixels x 512 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 (see
Figure B-10).
The image (with boundary) is stored in row-major storage. The first element of the array image is
image(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 d memory. For
example:
Image(1,1) maps to index 0.
Image(1,514) maps to index 513.
Image(2,1) maps to index 514.
See Table B-2 for the definitions of r0, r2, and r3.
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 two. Other possibilities include storing a 512x512
image but computing only a 511x511 result, computing a 512x512 result without boundary conditions but
throwing away the pixels on the border, and so on.
Variable
r0
r2
r3
c11
c21
c31
Figure B-9. 3x3 Coefficient Mask
0
0
0
Image
0
Area
0
0
Figure B-10. Image Stored as 514x514 Array
Table B-2. Variable Descriptions
image(n,m)
image(n,m+1)
image(n+514,m)
image(n+514,m+1)
image(n+2*514,m)
image(n+2*514,m+1)
output image
FIR coefficients
DSP Benchmarks
c12
c13
c22
c23
c32
c33
514
0
0
512
514
0
0
Description
image(n,m+2)
image(n+514,m+2)
image(n+2*514,m+2)
AA0087
AA0088
B-17

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents