Digital resampling integrated circuit for fast image resizing applications

Abstract: A resampling application specific integrated circuit (RSA) supports image interpolation or decimation by any arbitrary factor in order to provide flexibility, and utilizes a neighborhood of up to 9 x 9 pixels to produce image data of high quality. The RSA contains a separate vertical and horizontal filter units for vertical resizing and horizontal resizing operations, vertical and horizontal position accumulator units, a configuration register unit for loading the vertical and horizontal position accumulator units, and a memory management unit to interface the RSA to external memory banks. The vertical and horizontal filter units contain nine multipliers and nine corresponding coefficient memories, with each memory preferably containing storage space for thirty-two coefficients. The coefficients are addressed on a pixel by pixel basis in response to the outputs of the vertical and horizontal position accumulator units. The RSA is designed to handle an input data stream that contains multiple color components and simultaneously resizes all of the color components.

Description: Field of the Invention The invention relates generally to digital image processing systems and, more specifically, to digital image processing systems that perform image resizing or resampling. Background Image resizing or resampling is an important operation in many digital imaging systems, including film or print scanners, image processing accelerators, and digital hard-copy printers, and is used to enlarge (interpolation) or reduce (decimation) the size of a digital image. Each pixel of a resized image is computed as a weighted average of an N x N neighborhood of pixels of an original image as a result of a resizing operation. Thus, a resizing operation is similar to image filtering or convolution operations. In image filtering, however, the output pixel sampling grids are identical and the same weights or filter coefficients are used to compute each output pixel; while in image resizing, the output pixel locations are different than the input locations, the weights used to compute each output pixel depend on the distance between the output pixels and the input sampling grid, and the weights can be different for each output pixel. Several different types of calculations must be performed to resize an entire image including: the calculation of the positions of the output image pixels relative to the input sampling grid for a given factor of decimation or interpolation; the calculation of addresses of filter kernel coefficients from the position values; and the calculation of each output pixel value using the filter coefficients and the pixels in the N x N neighborhood. Performing an image resizing operation on a personal computer or workstation using software routines is therefore impractical, due to the large number of multiplication and addition operations that must be performed. Thus, image resizing operations have generally been performed in digital image processing systems using specialized hardware such as customized integrated circuit devices. Current hardware solutions for performing image resizing are limited by a number of factors, including the requirement for a number of separate integrated circuit chips (ICs) to: 1) perform pixel position and address calculation; 2) store interpolation filter coefficients; and 3) multiply/add input pixels and coefficients to compute output pixel values (i.e. a convolver IC). The use of multiple ICs increases the expense of the system and consumes a comparatively large amount of circuit board space. In addition, currently available convolver ICs that also allow the filter coefficient to be changed on a pixel by pixel basis (for example the TMC2246 device manufactured by TRW, Inc. or the L64260 device manufactured by LSI Logic, Inc.) have only four multipliers, which limits the size of the neighborhood that can be used to compute the output pixels to a 4 x 4 neighborhood. The limitation of the size of the neighborhood is a significant disadvantage, as the use of large neighborhoods reduces aliasing artifacts in an output image and produces a more visually appealing result. Currently available convolver ICs that support neighborhoods or kernels of up to 9 x 9 pixels (for example the TMC2250 device manufactured by TRW, Inc. or the L64243 device manufactured by LSI Logic, Inc.) do not allow the filter coefficients to be selected on a pixel by pixel basis. Finally, current convolver ICs are not suited for use with input image data sources that contain more than one color component of an image that might be produced, for example, by a color film scanner. The EP-A-0 093 429 describes an apparatus for enlarging and reducing two-dimensional images. In this apparatus there is provided a two-dimensional interpolation calculator in the form of a ROM. A problem with this architecture is that if multiple types of filtering or resampling are to be done, the ROM would necessarily be quite large in order to support the multiple functions. In the US-A-4,328,426 a filter for image pixels is described which features separate horizontal and vertical filter units with a plurality of tap elements. The filter coefficients are read from a data bus connected to an external CPU and the different coefficients have to be provided to the bus in real time during operation of the filter units which is very time-consuming. No means are provided in this circuit for image enlarging or reducing. Summary of the Invention The invention provides a resampling application specific integrated circuit (RSA) that can be utilized to perform multiple functions including image filtering, image resampling, and image compression/decompression. The RSA supports image interpolation or decimation by any arbitrary factor in order to provide flexibility, and utilizes a neighborhood of up to 9 x 9 pixels to produce images of high quality. The RSA contains a separate vertical and horizontal filter units for vertical resizing and horizontal resizing operations, vertical and horizontal position accumulator units, a configuration register unit for loading the vertical and horizontal position accumulator units, and a memory management unit to interface the RSA to a plurality of external memory banks. The vertical and horizontal filter units preferably contain nine multipliers and nine corresponding coefficient memories, with each memory preferably containing storage space for thirty-two coefficients. The coefficients are addressed on a pixel by pixel basis in response to the outputs of the vertical and horizontal position accumulator units. The RSA is designed to handle an input data stream that contains multiple color components and simultaneously resizes all of the color components. Brief Description of the Drawings Reference should now be made to the following detailed description of the best mode of carrying out the invention and the accompanying drawings, wherein: Fig. 1 is a schematic block diagram of an RSA in accordance with the present invention; Fig. 2 is a schematic diagram of a filter tap used in the horizontal and vertical filter units illustrated in Fig. 1; Fig. 3 illustrates the division of the input pixel interval into bins; Fig. 4 illustrates the output pixel positions for a 1.6X example interpolation; Fig. 5 is a timing diagram illustrating the operation of the RSA shown in Fig. 1 in a nine tap/four memory bank mode of operation; Fig. 6 is a timing diagram illustrating the operation of the RSA shown in Fig. 1 in a four tap/five memory bank mode of operation; Fig. 7 is a timing diagram illustrating the operation of the RSA shown in Fig. 1 in a photo CD compression/decompression mode while vertical filter filtering; Fig. 8 is a timing diagram illustrating the operation of the RSA shown in Fig. 1 in a photo CD compression/decompression mode while vertical filter interpolating; Fig. 9 illustrates an example of an input image; Fig. 10 illustrates the input image of Fig. 9 after horizontal filtering/resampling; Fig. 11 illustrates the image shown in Fig. 108 after vertical filtering/rescaling; and Fig. 12 is an example of a compression algorithm. Best Mode of Carrying Out the Invention An RSA in accordance with the invention is shown in Fig. 1. The RSA includes a horizontal filter unit 10 coupled to an input port 11, a vertical filter unit 12 coupled to an output port 13, a memory manager unit 14 coupled to a memory port 15, a configuration register unit 16 coupled to a configuration port 17, and horizontal and vertical position accumulators 18, 20 respectively coupled to the horizontal and vertical filter units 10, 12 and the configuration register unit 16. The outputs of the horizontal filter unit 10 and the vertical filter unit 12 are also coupled to a multiplexer (MUX) 22, thereby permitting the output from the vertical filter unit 12 to be selectively recirculated back to the input of memory manager unit 14. Each of the components of the RSA are integrated in a single IC. The input port 11, output port 13 and memory port 15 are used to transfer data and control signals between the RSA and external devices. The input port 11 includes a sixteen bit input data bus (ID), an input data strobe line (ISTRB), which the RSA asserts to request input pixel data, an input line start line (ILS), which an external device asserts when a complete line of input image data is available to the RSA to read, and an input ready line (IRDY), which the RSA asserts when it is ready to accept the next line of input image data. Similarly, the output port 13 includes a sixteen bit output data bus (OD), an output data strobe (OSTRB), which the RSA asserts when valid output image data is present on the output data bus, and output line valid line (OLV) which the RSA asserts while producing all pixels for a given line of output image data and deasserts between consecutive lines of output image data, an output image done line (ODONE), which the RSA asserts after all lines of an output image have been output, and finally an output photo CD interpolation line (OPCDI), which the RSA asserts to indicate that interpolated data is being output on the output data bus OD. In the illustrated embodiment, the memory port 15 preferably includes a sixteen bit memory address bus (MA), five separate eight bit bidirectional memory bank data buses (MD0-MD4), five memory write enable lines (MWE), and five memory output enable lines (OE), all of which are respectively coupled to external memory banks M0-M4. The configuration port 17 includes a ten bit configuration data bus (CD), which is used to load configuration data and coefficient data into the RSA, a configuration data strobe line (CSTRB), the rising edge of which is preferably used to load the configuration register and coefficient memories (which will be described in greater detail below), and a configuration/coefficient select line (CNFB), which is set high to load the configuration registers and set low to load the coefficient memories. Other connections to the RSA include a master clock line (MCLK), a voltage supply line (VDD) and a logic ground (GND). The MCLK is used to supply a 33 MHz external master clock signal to the RSA, which in turn uses the signal to generate internal timing and external control signals. The horizontal filter unit 10 and the vertical filter unit 12 each consist of nine tap elements, numbered 0 to 8, and a nine input adder. Each tap element, as shown in Fig. 2, preferably includes an 8-bit by 8-bit multiplier 30, a 32-word by 8-bit coefficient RAM memory 32 for coefficient storage, input and output registers 34, 36, and a multiplexer 38 for selecting the multiplier input data. The coefficient memories for all of the tap elements are loaded through the configuration register unit 16. For each pixel, one of 32 coefficients is selected by the horizontal and vertical position accumulator units 18, 20 via the COEFF-SEL input. For the horizontal filter unit 10, the DATA-IN port of tap 0 is connected to the input port of the RSA. The DATA-OUT port of each horizontal filter tap element feeds the DATA-IN port of the next tap element, with the DATA-OUT port of tap 8 unconnected. For the vertical filter unit 12, all nine DATA-IN ports are connected in parallel to the memory manager unit 14. In each filter unit 10, 12, the nine PRODUCT ports are connected to a 9-input adder (not shown) that computes the sum of the nine products. The output of the adder is then scaled and rounded to eight bits, and sent to the memory port 15 of the RSA in the case of the horizontal filter unit 10, or to the output port 13 of the RSA for the vertical filter unit 12. The horizontal and vertical filter units 10, 12 are respectively controlled by the horizontal and vertical position accumulators 18, 20. The position accumulators calculate the position of each output pixel or line, which in turn determines which set of filter coefficients and which image data are to be used for each calculation. The RSA divides the interval between input pixels (lines) into 32 sub-intervals, or bins, as shown in Fig. 3. Bin n' is centered at position i + n'/32 , and extends +/-1/64 input pixel from its center, where i is the integer part of an output pixel position and n' is a bin or sub-pixel index, as will be described in greater detail below. Each bin corresponds to a set of filter coefficients, and a location in the coefficient memory for each filter tap element. In operation, the output pixel and line spacing values for a desired amount of image resizing are loaded into horizontal and vertical position accumulator units. These values are defined as the number of input pixels divided by the number of output pixels (lines). Thus, the output pixel or line spacing will be less than one for an interpolation operation, and will be greater than one for a decimation operation. The output pixel and line spacing values are represented with a 3-bit integer part and a 16-bit fractional part. Thus, the maximum distance between output pixels (lines) is 7.99998 input pixels (lines). Starting at position 0.0, the horizontal and vertical position accumulator units increment by the pixel (line) spacing for each pixel, and maintain the position of the current output pixel (line). The current output pixel and line positions are represented with a 13-bit integer part (to span input images up to 8192 x 8192) and a 16-bit fractional part. For a given output pixel, the integer part of its position corresponds to i in the image resampling equation. It determines which input data are used to compute the current output pixel. The fractional part of the output position represents how close the output location is to the input sampling grid. This fractional position specifies which bin, n', the output pixel falls in, and is used to select which set of filter coefficients to apply to the surrounding input pixels. The fractional part of each output position is rounded to the nearest 1/32nd and multiplied by 32 to produce the bin number, from 0 to 31. For example, consider an input line of five pixels and an output line of eight pixels, or interpolation by a factor of 1.6. The output pixel spacing is thus 5/8 = 0.625 input pixels. Fig. 4 illustrates the positions of the output pixels, where for clarity, only 8 bins are shown. Assuming that a 4-tap interpolation mode of operation is employed, output pixel o2 is computed from input pixels i0, i1, i2, and i3, and the coefficient set of bin 5 (of 8). Output pixel o3 is also computed from input pixels i0, i1, i2 and i3, but uses the coefficient set for bin 7 (of 8). The function of the memory management unit 14 is to interface the RSA to the external memory banks (M0-M4) for storage of intermediate data, and to control the inputs to the vertical filter unit 12. When the vertical filter unit is configured for a 4-tap mode of operation, all five memory banks are active. Only four banks are used when the vertical filter unit 12 is configured in a 9-tap mode of operation. All five memory banks are also used when a compression/decompression mode of operation (utilizing, for example, a hierarchical or pyramid compression algorithm of the type discussed in U.S. Patent 4,969,204) is employed. The memory management unit 14 interleaves writes to the external memory banks M0-M4 from the horizontal filter unit 10 with reads from the memory banks M0-M4 by the vertical filter unit 12, so that both filter units can run simultaneously. Multiplexers within the memory management unit 14 direct data from each memory bank to the appropriate filter tap based on the selected mode of operation of the RSA. In either an image filtering or image resample mode, the RSA can accept three-color line interleaved input image data. If this three-color mode is chosen, each external SRAM must be large enough to store three lines of each of three color components, or nine horizontally resampled/filtered lines total. When the vertical filter unit 12 is configured for a 9-tap mode of operation, four memory banks are utilized. Each SRAM memory bank stores three lines of horizontally resampled/filtered data, and thus the four banks together implement a 12-line circular buffer. Image data is stored in groups, such that three consecutive memory locations contain the same number pixel for three adjacent lines. In this manner, each column of nine horizontally resample/filtered pixels is read by performing three read cycles to consecutive addresses, with each read cycle accessing three memory banks in parallel. The memory management unit 14 always reads the nine oldest lines from the circular buffer and routes these nine lines to the appropriate taps of the vertical filter unit 12. In between sets of three memory reads, the memory management unit 14 writes one horizontally filtered pixel to one of the four memory banks. Fig. 5 shows the timing for this mode of operation, and the concurrent operation of both filter units. For two or three color images pixels from the different color components are stored at memory locations separated by two or three times the line length. In other words, if the input image is line-interleaved RGB data, all R pixels from three lines of the image are stored together followed by all G pixels from the same three lines, followed by all the B pixels from the same lines. When the vertical filter unit 12 is configured for 4-tap operation, all five memory banks are used to store a single line of horizontally resampled/filtered data. Thus, the five banks implement a five line circular buffer. Four adjacent lines are read in parallel from four of the five banks and input to the vertical filter, while the current output of the horizontal filter is written to one of the five banks. Fig. 6 shows the timing for this mode of operation. Depending on the amount of image resizing, and the position of the output line being computed, both filter units may not be active. For example, consider the case of 2X interpolation in a 4-tap mode of operation. For 2X interpolation, the vertical filter unit 12 must produce twice the number of lines as the horizontal filter unit 10. Fig. 6 demonstrates the case where both horizontal and vertical filter units 10, 12 are active. When the horizontal filter unit is not active, as in 2X interpolation, the vertical filter unit 12 reads a column of four pixels on every master clock cycle. All five memory banks are used when the RSA operates in the compression/decompression mode. Three banks are used to store nine lines of the horizontally resample/filtered data in a manner similar to the 9-tap mode of operation. The other two banks are used to store two lines of both horizontally and vertically filtered data, one line per bank. The vertical filter unit 12 alternates between producing filtered data and bilinearly interpolated data as will be described in greater detail below. When filtering, the memory manager unit 14 reads data from nine lines of the horizontally filtered image from banks M0, M1 and M2 in three read cycles, and routes the data to the appropriate filter tap. The output of the vertical filter unit 14 is written by the memory manager unit 14 alternately to banks M3 and M4. The timing is similar to a 9-tap/4-bank mode of operation where four clock cycles are required for reading (3) and writing (1). The horizontal filter unit 10 cannot be active when the vertical filter unit 12 is operating in this mode, because the memory manager unit 14 is configured to write data from the vertical filter unit 12. When the vertical filter unit 12 is generating interpolated data, the memory manager unit 14 reads data from banks M3 and M4 in parallel and directs data from bank M3 to filter tap 0, and data from bank 4 to filter tap 2. Successive reads cause the data value from tap 0 to be shifted into tap 1 and the data value from tap 2 to be shifted into tap 3. The horizontal filter unit 10 can be active when the vertical filter unit 12 is performing interpolation. The results from the horizontal filter unit 10 are written into one of banks M0, M1 or M2, replacing the data from the oldest line stored in memory. The timing is similar to that of a 4-tap/5-bank mode of operation. Figs. 7 and 8 illustrate the timing for the compression/decompression mode of operation. The following tables further illustrate how pixel data is mapped into memory for various modes of operation. The tables illustrate the mappings for the initial set of lines in an image. Each line has four pixels and two color components. The entry "p2 l4 c1" represents pixel zero (the first pixel), line four, color component 1. The data enters the memory management unit 14 in line interleaved color, where pixels 0, 4 of color component 0 are followed by pixels 0, 4 of color component 1 for a given line. The mapping strategy would work equally well with pixel interleaved color, where the data would enter p0 c0, p0 c1, p1 c0 ...p3 c0, p3 c1. Table 1 shows the mapping for the first four lines of data in a 4-tap/5-bank mode of operation, wherein a single line of pixel data is stored in each memory bank. If a third color component were used, its data would occupy locations 8-12. To use data from lines 0-3, data is read from all five banks in parallel from addresses 0-7. The data from banks M0-M3 is directed to the appropriate filter tap and data from bank M4 is ignored. When writing, data from the oldest line in memory is replaced with the next incoming line; data from input line 5 would replace the data from line 0 bank M0, data from line 6 would replace the data from line 1, etc. Address MEMORY BANK 0 1 2 3 4 0 p0 l0 c0 p0 l1 c0 p0 l2 c0 p0 l3 c0 p0 l4 c0 1 p1 l0 c0 p1 l1 c0 p1 l2 c0 p1 l3 c0 p1 l4 c0 2 p2 l0 c0 p2 l1 c0 p2 l2 c0 p2 l3 c0 p2 l4 c0 3 p3 l0 c0 p3 l1 c0 p3 l3 c0 p3 l3 c0 p3 l4 c0 4 p0 l0 c1 p0 l1 c1 p0 l2 c1 p0 l3 c1 p0 l4 c1 5 p1 l0 c1 p1 l1 c1 p1 l2 c1 p1 l3 c1 p1 l4 c1 6 p2 l0 c1 p2 l1 c1 p2 l2 c1 p2 l3 c1 p2 l4 c1 7 p3 l0 c1 p3 l1 c1 p3 l2 c1 p3 l3 c1 p3 l4 c1 Table 2 illustrates the mapping for the first twelve lines of pixel data with the vertical filter unit 12 operating in a 9-tap/4-bank mode of operation. Again, two color components are shown. A third color component would occupy locations 24-35. Lines are stored in groups of three so that reading three successive locations will produce data from twelve lines (all four banks being read in parallel). The data from the nine newest lines are directed to the appropriate filter tap for processing. When writing, data from the oldest line is replaced. When reading lines 3-11, data from banks M1, M2 and M3 are routed to tap 0 to 8 of the vertical filter unit 12, with read cycles necessary to retrieve nine bits of data. Data is directed from the memory banks to the filter taps as follows: data from banks M1, M2 and M3 are directed to taps 0, 3 and 6 on the first read cycle; data is directed to taps 1, 4 and 7 on the second cycle; and the data is directed to taps 2, 5 and 8 on the third cycle. Data from line 0 in bank M0 is replaced with data from line 12. When line 13 is being written, data from lines 4 to 12 is being processed. Therefore, on the first of the three read cycles, data from banks M0, M2 and M3 are directed to taps 8, 2 and 5, data from banks 1, 2 and 3 is directed to taps 0, 3 and 6 on the second cycle, and from banks 1, 2 and 3 is directed to taps 1, 4 and 7 on the third cycle data. MEMORY BANK Address 0 1 2 3 4 0 p0 l0 c0 p0 l3 c0 p0 l6 c0 p0 l9 c0 unused 1 p0 l1 c0 p0 l4 c0 p0 l7 c0 p0 l10 c0 · 2 p0 l2 c0 p0 l5 c0 p0 l8 c0 p0 l11 c0 · 3 p1 l0 c0 p1 l3 c0 p1 l6 c0 p1 l9 c0 · 4 p1 l1 c0 p1 l4 c0 p1 l7 c0 p1 l10 c0 · 5 p1 l2 c0 p1 l5 c0 p1 l8 c0 p1 l11 c0 · 6 p2 l0 c0 p2 l3 c0 p2 l6 c0 p2 l9 c0 · 7 p2 l1 c0 p2 l4 c0 p2 l7 c0 p2 l10 c0 · 8 p2 l2 c0 p2 l5 c0 p2 l8 c0 p2 l11 c0 · 9 p3 l0 c0 p3 l3 c0 p3 l6 c0 p3 l9 c0 · 10 p3 l1 c0 p3 l4 c0 p3 l7 c0 p3 l10 c0 · 11 p3 l2 c0 p3 l5 c0 p3 l8 c0 p3 l11 c0 · 12 p0 l0 c1 p0 l3 c1 p0 l6 c1 p0 l9 c1 · 13 p0 l1 c1 p0 l4 c1 p0 l7 c1 p0 l10 c1 · 14 p0 l2 c1 p0 l5 c1 p0 l8 c1 p0 l11 c1 · 15 p1 l0 c1 p1 l3 c1 p1 l6 c1 p1 l9 c1 · 16 p1 l1 c1 p1 l4 c1 p1 l7 c1 p1 l10 c1 · 17 p1 l2 c1 p1 l5 c1 p1 l8 c1 p1 l11 c1 · 18 p2 l0 c1 p2 l3 c1 p2 l6 c1 p2 l9 c1 · 19 p2 l1 c1 p2 l4 c1 p2 l7 c1 p2 l10 c1 · 20 p2 l2 c1 p2 l5 c1 p2 l8 c1 p2 l11 c1 · 21 p3 l0 c1 p3 l3 c1 p3 l6 c1 p3 l9 c1 · 22 p3 l1 c1 p3 l4 c1 p3 l7 c1 p3 l10 c1 · 23 p3 l2 c1 p3 l5 c1 p3 l8 c1 p3 l11 c1 unused Table 3 illustrates a memory map after the first nine input lines and the first two decimated output lines that have been processed in the compression/decompression mode of operation. Three memory banks are used to store pixel data from nine lines of the horizontally filtered image, using the same mapping strategy as in the nine-tap mode of operation. The difference is that only nine lines are stored in three banks. The new input lines from the horizontal filter unit 10 cannot be written when the vertical filter unit 12 is processing the data in banks M0, M1 and M2. Instead, the output of the vertical filter unit 12 is written to one of banks 3 and 4. Even numbered lines are written to bank 3 and odd numbered lines are written to bank 4. This data is then read back into the vertical filter unit 12 to compute an 2x or 4x interpolated image using bilinear interpolation. Both banks M3 and M4 are read in parallel. Data from bank M3 is directed to tap 0. Data from bank M4 is directed to tap 2. During the time the vertical filter unit 12 is processing data from banks M3 and M4, new data from the horizontal filter unit 10 is written to one of banks M0, M1 or M2 replacing the data from the oldest line currently in memory. MEMORY BANK Address 0 1 2 3 4 0 p0 l0 c0 p0 l3 c0 p0 l6 c0 op0 l0 c0 op0 l1 c0 1 p0 l1 c0 p0 l4 c0 p0 l7 c0 op1 l0 c0 op1 l1 c0 2 p0 l2 c0 p0 l5 c0 p0 l8 c0 op2 l0 c0 op2 l1 c0 3 p1 l0 c0 p1 l3 c0 p1 l6 c0 op3 l0 c0 op3 l1 c0 4 p1 l1 c0 p1 l4 c0 p1 l7 c0 op0 l0 c1 op0 l1 c1 5 p1 l2 c0 p1 l5 c0 p1 l8 c0 op1 l0 c1 op1 l1 c1 6 p2 l0 c0 p2 l3 c0 p2 l6 c0 op2 l0 c1 op2 l1 c1 7 p2 l1 c0 p2 l4 c0 p2 l7 c0 op3 l0 c1 op3 l1 c1 8 p2 l2 c0 p2 l5 c0 p2 l8 c0 9 p2 l0 c0 p3 l3 c0 p3 l6 c0 10 p3 l1 c0 p3 l4 c0 p3 l7 c0 11 p3 l2 c0 p3 l5 c0 p3 l8 c0 12 p0 l0 c1 p0 l3 c1 p0 l6 c1 13 p0 l1 c1 p0 l4 c1 p0 l7 c1 14 p0 l2 c1 p0 l5 c1 p0 l8 c1 15 p1 l0 c1 p1 l3 c1 p1 l6 c1 16 p1 l1 c1 p1 l4 c1 p1 l7 c1 18 p2 l0 c1 p2 l3 c1 p2 l6 c1 19 p2 l1 c1 p2 l4 c1 p2 l7 c1 20 p2 l2 c1 p2 l5 c1 p2 l8 c1 21 p3 l0 c1 p3 l3 c1 p3 l6 c1 22 p3 l1 c1 p3 l4 c1 p3 l7 c1 23 p3 l2 c1 p3 l5 c1 p3 l8 c1 As described above, the RSA can selectively operate in at least three different modes including an: image filtering mode, an image resampling mode, and compression/decompression. Each of these operating modes will now be discussed in greater detail. In the image filter mode, the RSA performs a standard FIR filtering, or convolution operation on an input image and produces an output image of the same size as the input image. The two filter units 10, 12 each implement a standard one-dimensional convolution equation: y(n) = k=0 8 h(k) x(n-k+4) In this equation, y(n) represents output pixel n, x(m) represents input pixel m, and h(k) represents the filter coefficient at tap k. For this configurations, the same filter coefficients are used to compute every output pixel, and therefore only one of the 32 coefficient locations per tap are utilized. The RSA first performs the horizontal filtering on incoming lines of the input image and writes the horizontally filtered lines to the external memories. Groups of nine horizontally filtered lines are then read by the vertical filter unit 12 to produce a line of the output image. The output pixels are output from the output port as they are computed. In actual operation, the horizontal and vertical filter units 10, 12 run simultaneously, throttled by the input and output port control signals. In the image resampling mode of operation, The RSA produces an output image of a different size than the input image. Each 9-tap filter in the RSA implements a modified version of the FIR filter equation illustrated above. The expression for resampling with a 9-tap kernel is: y(n) = k=0 8 h(k,n')x(i-k+4) Where as before y(n) is output pixel n, x(m) is the input pixel m. This equation differs from a the standard convolution equation in the indexing of the input pixels and the coefficients h(k,n'). In the image resampling mode, the position of each output pixel is computed. The integer part of the output pixel position, i, is used to decide which nine input pixels to use. The fractional part of the output position is used to compute index n'', the bin or sub-pixel index, which selects 1 of the 32 sets of coefficients to apply to the input pixels. As before, k selects one of the nine filter taps. As in the filtering mode, the lines of the input image are first horizontally resampled and written to one of the external memories. Multiple horizontally filtered lines are then read from the external memories by the memory manager unit 14 into the vertical filter unit 12 to create one line of the output, resampled, image. When in resampling mode, all nine taps of both horizontal and vertical filter units may be used. However, when producing an output image with more pixels and lines than the input image, or interpolating, the RSA can be configured to run faster by using only four taps of the vertical filter unit 12 and all of the external memories. This special mode provides increased performance when using the common linear (2-tap) or cubic (4-tap) interpolation kernels. Figs. 9-11 shows an example of an input image which is interpolated by a factor of 2 in each direction. Each input line of Fig. 9 is interpolated horizontally, producing the intermediate data shown in Fig. 10. The four highlighted lines in Fig. 10 are read into the vertical filter unit 10 twice, to produce the two highlighted lines of Fig. 11. For each output line, a new n' is computed and used to select the vertical filter coefficients for computing all pixels of that line. In the compression/decompression mode of operation, the RSA is used to efficiently perform part of a image compression or decompression algorithm. Fig. 12, for example, illustrates a compression algorithm that consists of a number of stages including image decimation, bilinear interpolation, residual image calculation, and Huffman encoding. The RSA can be used to perform the image decimation and bilinear interpolation parts of the compression algorithm, while circuitry external to the RSA performs the remainder of the compression algorithm. In the illustrated example, images are decimated and then interpolated by either a factor of 2.0 or 4.0 in each dimension. Similarly, the RSA can be used to perform 2D bilinear interpolation in exactly the same manner in a decompression operation. In this mode of operation, lines of the original image are input to the RSA where they are horizontally reduced in size and written to the external memory banks. The vertical filter unit 12 then read the horizontally filtered lines from the memory banks to produce one line of the decimated image. While the decimated lines is output from the RSA it is also written back to the external memories. In between computation of the decimated lines, the vertical filter unit 12 is configured for 2D bilinear interpolation. The vertical filter reads two previously decimated lines from the memory banks and computes 2 (or 4) lines of the interpolated image, each line being 2 (or 4) times the size of the decimated line. Thus, the vertical filter unit 12 alternately computes lines of the decimated image and lines of the interpolated image. This mode of operation, together with external circuitry, reads the original image a single time while producing the decimated and residual images. Because the special case of reducing the size of an image by an integer factor only requires one set of filter coefficients, the remaining locations in the coefficient memories are used to store bilinear interpolation coefficients. It should be noted that the input image data is preferably 8-bit unsigned integer data, with values ranging from 0 to 255, for the illustrated embodiment. The coefficient format can be configured to be either 8-bit unsigned integer, or an 8-bit modified 2's complement. In unsigned format, coefficients would range from 0-255. The modified 2's complement format is identical to standard 2's complement representation, except for the value of 10000000, which is used to represent a positive 128. The value 10000000 combined with scaling the filter output 128, allows a tap element to multiply a pixel by exactly 1.0, a value commonly used for interpolation kernals. The tap element multipliers compute a 16-bit product which is input into the adder discussed above. The adder preferably generates a full-precision 20-bit adder sum which is then scaled by either 64 or 128, and clipped to range from 0 to 255. The scale factor together with the coefficient format determines the effective filter coefficient range. Table 4 is illustrates four possibilities of effective range of the filter coefficients. Coefficient Format Coefficient Range Scale Factor Effective Range unsigned 0 --→ 255 64 0.0 --→ 3.984 unsigned 0 --→ 255 128 0.0 --→ 1.992 modified 2's complement -127 --→ 128 64 -1.984 --→ 2.0 modified 2's complement -127 --→ 128 128 -0.992 --→ 1.0 In the preferred embodiment, the configuration register unit 16 includes a mode register, an output pixels/line register, an input pixels/line register, an output lines register, and input lines register, and output line spacing register, and an output pixel spacing register. The mode register includes: a vertical filter length bit that is set (1) to use four taps and all five memory banks and reset (0) to use all nine taps with four memory banks; a two's complement coefficients bit that is set to use 8-bit modified 2's complement representation of the filter coefficients; a filter scale factor bit that is set to scale both filter outputs by a factor of 64 or six binary digits and reset to scale the filter outputs by a factor of 128 or seven binary digits; a compression/decompression mode bit that is set to perform simultaneous decimation and bilinear interpolation for the compression/decompression mode and reset to perform image filtering and image resampling; a compression/decompression interpolation factor bit which is set to perform interpolation by 4X in each dimension and reset to use 2X interpolation; two bits to define the number of color components; and input strobe polarity bit which is set to indicated active-high input data strobe and reset to indicate an active-low strobe; and an output strobe polarity bit that is set to indicate an active-high output data strobe and reset to indicate an active-low strobe. The output pixels/line register contains a 13-bit number representing the number of pixels/lines in the output image less one. The input pixels/line register contains a 13-bit number representing the number of pixels/line in the input image less one. The output lines register is a register containing a 14-bit number representing the number of lines in the output image less one. The input lines register contains a 14-bit number representing the number of lines in the input image less one. The output line spacing register contains the spacing between output lines relative to the input line spacing. The output pixel spacing register contains the spacing between output pixels relative to the input pixel spacing. There are a total of 576 8-bit filter coefficients to be loaded (2 filters x 9 tape/filter x 32 coefficients/tap) in the preferred embodiment. The coefficients are preferably loaded into the horizontal filter unit 10 first and then into the vertical filter unit 12, and from tap 0 to tap 8 in each of the filter units. For each tap, the 32 coefficients are loaded from bin 0 to bin 31. The coefficient memory addresses are generated by an internal address counter which is not shown. Industrial Utility The invention provides an RSA that can be utilized in a number of electronic image processing systems or devices, including film or print scanners, image processing accelerators or digital hard copy printers, to increase or decrease the size of an original image. The invention is particularly useful in implementing an electronic zoom feature in such systems or devices. PARTS LIST 10 Horizontal Filter Unit 11 Input Port 12 Vertical Filter Unit 13 Output Port 13 14 Memory Manager Unit 15 Memory port 16 Configuration Register Unit 17 Configuration Port 17 18 Horizontal Position Accumulator 20 Vertical Position Accumulator 22 Multiplexer 30 8-bit Multiplier 30 32 Coefficient RAM Memory 34 Input Register 36 Output Register 38 Multiplexer

Claims: An integrated circuit device for use in digital image processing comprising: a horizontal filter unit (10) and a vertical filter unit (12) that is separate from the horizontal filter unit, the filter units being operable so that an output of a first one of the filter units is subsequently processed by the second other one of the filter units; memory management means (14) for interleaving writes to a memory (M0-M4) of an output of said first one of the filter units with reads from the memory to said second other one of the fiter units; means (14, 22) for connecting an output of said second other one of the filter units to be selectively recirculated to the memory and back to said second other one of the filter units; a horizontal position accumulator (18) coupled to the horizontal filter unit and a vertical position accumulator (20) coupled to the vertical filter unit; and data entry means for loading coefficient data into the horizontal and vertical filter units and configuration data into the horizontal and vertical position accumulators. An integrated circuit device as claimed in claim 1, wherein the horizontal and vertical filter units include a plurality of tap elements. An integrated circuit device as claimed in claims 1 or 2, wherein the horizontal and vertical filter units include a plurality of tap elements and wherein each respective tap element includes a multiplier (30) and a coefficient memory (32) that stores plural selectable coefficients for exclusive use of the respective tap element. An integrated circuit device as claimed in claims 2 or 3 wherein each tap element includes a DATA-IN port and a DATA-OUT port, the DATA-IN port of the first tap element of the horizontal filter unit is connected to an input port of the integrated circuit device, the DATA-OUT port of each tap element in the horizontal filter unit feeds the DATA-IN port of the next tap element, and the DATA-IN port of the tap elements of the vertical filter unit are connected in parallel to the memory management unit. A digital image processing method comprising: loading respective coefficient data into a horizontal filter unit (10) and into a vertical filter unit (12) that is separate from the horizontal filter unit, the horizontal and vertical filter units being formed into an integrated circuit chip; loading respective configuration data into a horizontal position accumulator (18) and into a vertical position accumulator (20); inputting image data into the horizontal filter unit (10); inputting image data into the vertical filter unit (12); in response to the respective coefficient data and configuration data associated with the horizontal filter unit resampling the image data input into the horizontal filter unit and providing an output from the horizontal filter unit as a first set of resampled image data; in response to the respective coefficient data and configuration data associated with the vertical filter unit, resampling the first set of resampled image data and providing an output from the vertical filter unit as a second set of resampled image data; and alternately interleaving reads into a memory of outputs from the horizontal filter unit with writes from the memory of resampled data into the vertical filter unit. An image processing method as claimed in claim 5, further including the steps of: providing a plurality of tap elements in the horizontal and vertical filter units of the integrated circuit device, each tap element comprising a multiplier (30) and a coefficient memory (32); and loading plural selectable coefficients into the coefficient memory (32) for exclusive use by the multiplier (30) of the respective tap element. The image processing method of claims 5 or 6 wherein the vertical filter unit alternately computes lines of a decimated image and lines of an interpolated image. The image processing method of claims 5 or 6 wherein the vertical filter unit alternately has input thereto recirculated sampled data previously output from the vertical filter unit and sampled data output from the horizontal filter unit.

Inventors: BERARDUCCI THOMAS NEAL, COOK WILLIAM A, D LUNA LIONEL J, WARD JOSEPH, BERARDUCCI, THOMAS NEAL, COOK, WILLIAM A., D'LUNA, LIONEL J., WARD, JOSEPH
Applicants: EASTMAN KODAK CO, EASTMAN KODAK COMPANY
Application year: 1994
Main classification: H04N1
IPC codes: G06T3, H04N7, H04N1, G09G5