IMAGE PROCESSING METHOD AND CIRCUIT

Abstract: An image processing circuit for processing a set of transform domain coefficients sequentially in order to produce an image includes a first multiplier stage (205) coupled to receive the set of coefficients, for sequentially multiplying each one of the set by a weighting factor to produce a set of weighted coefficients. A second multiplier stage is coupled to receive the set of weighted coefficients for sequentially multiplying each one by a number of transform weighting factors to produce a number of transform weighted coefficients for each one of the set. An accumulator array of elements is coupled to the multiplier. A selection arrangement adds each of the transform weighted coefficients to selected elements of the array according to a selection scheme, such that when the processing of the set is completed, the elements of the array define the image.

Description: IMAGE PROCESSING METHOD AND CIRCUIT Field of the Invention This invention relates to image processing and particularly but not exclusively to processing of discrete cosine transform coefficients to reproduce an image. Background ofthe Invention Image compression and decompression techniques, which compress images in order to facilitate efficient transmission are well known. A number of standards exist which define particular compression and decompression methods. For example, the JPEG standard for still images, and the MPEG1 and MPEG2 standards for moving images. Typically, Discrete Cosine Transform (DCT) functions are used to compress an image into a number of DCT coefficients. The image is typically sub¬ divided into a number of nominal blocks containing picture elements, and the functions are performed on the picture elements of each block. Corresponding inverse DCT (I-DCT) functions are used for subsequent decompression of the DCT coefficients to reconstruct the picture elements of the blocks and hence the image. Methods for performing the decompression process typically include the use of a block matrix having a specified sequential order, used to compute an inverse quantisation ofthe coefficients in a two dimensional array to provide intermediate results before perforating saturation and mismatch control functions, and the I-DCT function. For example, the MPEG2 standard specifies that the inverse DCT is performed by a dedicated processor which handles the coefficients using butterfly computations or a row-column method to reconstruct the picture elements. These methods require a number of cascaded computations, each of which has specific combinations of operands, which are then multiplied by cosine functions. The first computation processes the coefficients together in first specific combinations to provide intermediate results. These are then subject to a second computation, according to a second specific combination, in order to provide further intermediate results, and so on. The intermediate results must be stored in memory after each computation, and reloaded into the processor as required by subsequent steps. The intermediate results must be re-ordered in order to achieve the different specific combinations required by each computation, giving rise to processing delay. The multiple exchanges between processor and memory give rise to further delay. A further problem with the above method is that the inverse quantisation operation as applied to the two-dimensional array is cumbersome and inefficient, since the array must be accessed element by element. Furthermore, the saturation and mismatch control functions must also be performed on the two-dimensional array and as a result these functions are also slow and inefficient. This invention seeks to provide an image processing method which mitigates the above mentioned disadvantages. Summary ofthe Invention According to a first aspect ofthe present invention there is provided a method for processing a sequential set of transform function coefficients to produce an image, comprising the steps of: performing a weighting step on each one of the set of coefficients, to produce a weighted set of coefficients; multiplying each one ofthe weighted set of coefficients by a plurality of transform weighting factors to produce a plurality of transform weighted coefficients for each one of he weighted set; and, selectively adding each of the transform weighted coefficients to elements of an accumulator array according to a selection scheme, such that when the processing ofthe set is completed, the elements ofthe array define the image. Preferably the weighting step is an inverse quantisation step, and the weighted set of coefficients are inverse quantised. The plurality of transform weighting factors are preferably inverse-discrete cosine transform values. Preferably the selection scheme is calculated according to the sequential order of the transform function coefficients. The method preferably further comprises the steps of saturation and mismatch control applied to the weighted set of coefficients. According to a second aspect of the present invention there is provided an image processing circuit for processing a sequential set of transform domain coefficients to produce an image, comprising: a first multiplier stage coupled to receive the set of coefficients, for sequentially multiplying each one of the set by a weighting factor to produce a set of weighted coefficients; a second multiplier circuit coupled to receive the set of weighted coefficients for sequentially multiplying each one ofthe set of weighted coefficients by a plurality of transform weighting factors to produce a plurality of transform weighted coefficients for each one of the set; an accumulator array of elements coupled to the second multiplier circuit; and a selection circuit for adding each of the transform weighted coefficients to selected elements of the array according to a selection scheme, such that when the processing of the set is completed, the elements of the array define the image. Preferably the weighting factor is an inverse quantisation factor, and the weighted set of coefficients are inverse quantised. The plurality of transform weighting factors are preferably inverse discrete cosine transform weighting factors. Preferably the selection circuit calculates an adding sequence for the elements ofthe array according to the sequential order of the transform function coefficients. The circuit preferably further comprises saturation and mismatch control circuits for performing saturation and mismatch control functions on the weighted set of coefficients. In this way the transform function is performed in a manner such that the transform coefficients may be processed in any order and the inverse scan function is removed. This reduces the required memory size and the exchanges between the image processing circuit and memory as neither the data at the output ofthe variable length decoder, nor the re-ordered data need to be stored for the purpose of re-ordering the data. Brief Description ofthe Drawings An exemplary embodiment ofthe invention will now be described with reference to the drawings in which:- FIG.l shows a flow diagram of a prior art image processing method. FIG.2 shows a flow diagram of an preferred image processing method in accordance with the invention. FIGs.3 and 4 show a pair of scan matrices which define scanning patterns in accordance with the MPEG2 standard. FIG.5 shows a preferred embodiment of an image processing circuit in accordance with the present invention. Detailed Description of a Preferred Embodiment The 2-dimensional inverse DCT is defined in the MPGE2 standard specification as:- f <j, ) = r∑∑C(u) C(V) F(u,v) cos (2j ^ )uπ cos (2k ^ )v;r Equation 1 • ' ■ ' u=0 v=0 where f(j,k) is a reconstructed picture element for each j and k, N is the size ofthe block on which the I-DCT is performed, u and v are the transform domain coordinates ofthe DCT coefficients, j and k are the spatial coordinates of he picture elements, F(u,v) is a DCT coefficient for each u and v, and C(u) and C(v) are constants, being: As this is a double summing of the weighted DCT coefficients, where they depend on the same pair of u and v values as their respective factors, the DCT coefficients may be handled one after the other, in any order, to compute each of the f(j,k) picture elements. Instead of processing a two- dimensional array of coefficients indexed with the u and v values, the I-DCT block may process a one-dimensional array of coefficient parametrised with a unique n index. This assumes that the information on the relationship of the pair of indices (u,v) versus n is passed to the I-DCT processor. Referring to FIGs.3 and 4, the MPEG2 standard specification defines a relationship between block coordinates u,v and index n. FIG.3 shows a first scan pattern called scan [0][v][u] in which the scan tracks in a zig-zag manner starting at (0,0) and tracking diagonally in opposite directions with successive diagonals from top-left to bottom-right. FIG.4 shows a second, more complex scan pattern called scan [l][v][u]. Referring to FIG.l, there is shown a prior art image processing method 10. Coded data 15 is decoded by a variable length decoding block 20 to produce a quantised one-dimensional data stream QFS[n] 25, which is scan coded (i.e. is ordered according to one ofthe scan patterns of FIGs. 3 or 4). The QFS[n] 25 is then input to an inverse scan block 30, where they are inverse scanned (in dependence upon the scan pattern used) to produce a quantised two- dimensional array QF[v][u] 35. The quantised coefficients, QF[v][u] 35, need to be multiplied by a scale factor and by a weighting matrix. As the scale factor has a single value within a whole block of image, it does not depend either on u and v, or n. The weighting matrix is a two-dimensional array depending on u and v. The array QF[v][u] 35 is input to an inverse quantisation block 40 which performs an inverse quantisation function incorporating a weighting function, to produce a sequence of weighted DCT coefficients organised as a two-dimensional array F"[v][u] 41. A saturation control function is performed on the two-dimensional array F"[v][u] 41 by block 42, to produce DCT coefficients F[v,u] 43. A mismatch control function is then performed on the two-dimensional array F'[v][u] 43 by block 45, to produce DCT coefficients F[v,u] 46. The I-DCT function is performed on DCT coefficients F[v,u] 46 at I-DCT block 50, producing f[y][x] 55, which are spatial domain image values. The f[y][x] 55 are then input to a motion compensation block 60 where they are motion compensated to produce output image pixels d[y][x] 65. A frame store memory block 80 is coupled to the output image pixels d[y][x] 65, for storing a feedback image for use by the motion compensation block 60. In the above prior art method, the 2-dimensional I-DCT is performed as a sequence of two 1-dimensional I-DCT's on the rows first (or the columns first) then the columns. This requires the availability of at least a complete row (or column) of coefficients before processing the 1-dimensional I-DCT function. Because of the zig-zag scan this storage amounts to having to store at least half the coefficients matrix in order to preserve the coefficients ofthe following rows for later processing. It is to be noted that the zero coefficients also have to be stored in the right order for the I-DCT. The MPEG-2 standard also defines run coefficients, wherein if a number of successive coefficients are identical, they are compressed by sending the value of the coefficient followed by the number of times that value is repeated. These are termed run coefficients and the number of repetitions is termed the run value. Thus the coded data 15 as defined according to the MPEG2 standard comprises a first value which is the value ofthe coefficient, and a second value, the run value, which indicates the number of repetitions. This requires on-chip memory, since any off-chip memory will reduce the processing speeds, due to limited access time of external memory. Also the processing time is proportional to the number of stored DCT coefficients, and requires some pipelining in order to store the coefficients produced by the variable length decoder from consecutive blocks, to compensate for the processing latency ofthe I-DCT block. Referring to FIG.2, there is shown an image processing method 100 in accordance with a preferred embodiment ofthe invention. Coded data 15 is decoded by the variable length decoding block 20 as above to produce the quantised one-dimensional data stream QFS[n] 25. The QFS[n] 25 is then inverse quantised at block 110, according to a quantisation scale factor from block 130 and the W[w][n] matrix from block 120 to produce FS"[n] 115. The saturation control function is then performed on the one dimensional FS"[n] 115 by block 140, to produce FS'[n] 145. The saturation ofthe coefficients do not depend on their order. The saturation control function may handle one-dimensional incoming arrays without any other considerations. The mismatch control function is so arranged that only one F[v][u] coefficient, F[7][7] depends on all of the F[v][u] coefficients. This function is defined by: v<8 u<8 sum = X X F' [v][u] Equation 2 v=0 u=o for all u,v except u=v=7 F'[7][7] if sum is odd F[7][7] = F' [7][7] - 1 if F' [7][7] is odd and if sum is even F'[7][7] + 1 if F'[7][7] is even and if sum is even Here it has to be noted that, referring to FIGS. 3 and 4, the case [v][u] = [7][7] always corresponds to [n] = 63 whichever scan is used. Thus the mismatch control function as performed in block 150 may be re-written as: tKM sum = T FS' [n] Equation 3 n=0 FS[n]=FS'[n] for all n except n=63 fFS'[63] if sum is odd FS[63] = FS' [63] - 1 if FS' [63] is odd and if sum is even Equation 4 FS' [63] + 1 if FS' [63] is even and if sum is even where the scan pattern has clearly no influence. The mismatch control function is therefore performed in this way on the one- dimensional FS'[n] 145 by block 150, to produce FS[n] 155. The one-dimensional array FS[n] is then processed by the I-DCT block 50, according to a selection scheme to produce the spatial domain image values f[y][x] 55. The function of the I-DCT block 50 and the selection scheme are further described below, with reference to the circuit of FIG.5. The spatial domain image values f[y][x] 55 are then input to the motion compensation block 60 to produce the output image pixels d[y][x] 65, which are also fed- back via the frame store memory 80 as in the prior art method above. o Assuming that the relationship between n, u and v as shown in the scan patterns of FIGS. 3 and 4 is known, the weighting matrix may be handled as a one-dimensional array in the inverse quantisation arithmetic section. In the case of a pre-defined matrix W, it may be stored according to u and v indices. Thus, for an incoming QFS[n] coefficient, the appropriate W[w][n] element has to be accessed according to the [n] versus [v][u] relationship. The w index indicates which matrix has to be used. It is also possible to store a W matrix according to the n index corresponding to one given scan pattern. If this is the pattern used in the bit stream, the weighting matrix elements may be output in order that they are stored. If the second scan pattern is used in the bit stream, the matrix elements need to be accessed in an order depending on the scan [0] versus scan [1] relation which can be deduced from tables of FIGS. 3 and 4. In the case of a download matrix it may even be simpler. Here a weighting matrix is downloaded through the bit stream in the same scan order as the DCT coefficients. This means that the matrix elements may just be stored and read in this order without any care to the [n] versus [v][u] relation. Referring now also to FIG.5, there is shown an image processing circuit 50. An input 200 of the image processing circuit 50 receives a variable length decoded signal according to the MPEG2 standard (or any other system where a serial stream of coefficients is provided given an ordering that is not regular). According to the MPEG2 standard, each block of coefficients is preceded by a binary codeword which identifies the next word as being n=0 (i.e. the beginning of a new block of 64 coefficients). An n index counter circuit 260 is coupled to receive the variable length decoded signal from the input 200, for providing an incrementing n count. The counter circuit 260 incorporates a 64 step counter. Detection ofthe binary codeword causes the counter circuit 260 to reset the counter to n=0, and then to increment the counter by the run value of each new coefficient word received at the input 200, up to n=63. A quantisation circuit 280 provides the W[w][n] matrix values sequentially to a first multiplier 285, where they are multiplied with a quantisation scale factor from a quantisation scale circuit 275 to produce a set of quantisation weighting factors. The input coefficients received at input 200 are inverse quantised at a second multiplier 205 by the set of quantisation weighting factors. The quantisation circuit 280 is arranged to provide appropriate quantisation coefficients depending upon the input coefficients received at input 200. The quantisation circuit 280 comprises a first MUX block 290 which multiplexes outputs from first and second recirculating shift registers 300 and 310 respectively, and from a fixed inverse quantization coefficient block 305 (=16). The first recirculating shift register 300 is coupled to receive the n index value from the index counter circuit 260, for holding a pre-defined set of inverse quantisation coefficients, appropriate for one particular arrangement of input coefficients to be received at input 200, and for providing these coefficients to the first MUX block 290 in dependence upon the n index value received. The second recirculating shift register 310 is coupled to a second MUX block 320, and to the index counter circuit 260, for storing a set of downloaded quantisation coefficients and for providing these coefficients to the first MUX block 290 in dependence upon the n index value received. The second MUX block 320 has a downloadable IQ coefficient input, a fed-back input from the second recirculating shift register 310 and a download IQ control input. In this way a particular set of IQ coefficients, appropriate for one particular arrangement of input coefficients to be received at input 200, are downloaded into the second recirculating shift register 310 via the second MUX block 320. The fixed inverse quantization coefficient block 305, provides a fixed quantisation coefficient (=16) to the first MUX block 290. The activity of the first MUX block 290 is controlled by an inverse quantisation select function, which selects one ofthe three coefficient inputs to the first MUX block 290 in dependence upon the arrangement of input coefficients to be received at the input 200. The first recirculating shift register 300 is coupled to the index counter circuit 260, for providing a weighted coefficient depending on the order of the input coefficients, the weighted coefficient being an inverse quantisation value for each input coefficient. The second recirculating shift register 310 is coupled to the index counter circuit 260, and is also coupled to receive an output from a second MUX block 320, which combines inverse quantisation coefficients which are downloaded from an external source, with a download inverse quantisation control signal. Saturation and mismatch control circuits 210 and 220 respectively are coupled to receive the inverse quantised signals from the second multiplier 205, for performing the saturation and mismatch control functions as described above. Since the saturation control function does not depend on coefficient order, the saturation circuit 210 does not require any external input other than the coefficients themselves. However, the mismatch control function, as stated above in equation 4, is given by:- fFS * [63] if sum is odd FS[63] FS' [63] - 1 if FS' [63] is odd and if sum is even Equation 4 FS' [63] + 1 if FS' [63] is even and if sum is even Therefore, the mismatch control circuit 220 is coupled to receive the index counter value from the index counter circuit 260, in order to perform the saturation function on the one-dimensional data stream. The I-DCT function is performed in block 235, by an I-DCT weighting circuit 230 and an 8*8 block accumulator 240. The I-DCT weighting circuit 230 is arranged for multiplying the arriving coefficients from the mismatch control circuit 220 by the I-DCT cosine weighting values. Zero coefficients need not be processed at all since the accumulators need not be updated. Only the index [n] corresponding to [v][u] need be incremented to indicate that the I-DCT weighting coefficients were multiplied by zero. In the case of a run of zero values, the time that would have been spent processing these zero values is saved. In case of non-zero coefficients, with a run value not equal to zero, the multiplication is only performed once and the accumulation ofthe same result is done directly into the 8*8 accumulator block 240 in the right positions. A sorting circuit 270 is coupled to receive the linear index [n] from the index counter circuit 260, and a zig-zag index [v][u] 265. The zig-zag choice input 265 identifies which of the scan patterns of FIGs. 3 and 4 is applicable to the coefficients being accumulated in the accumulator block 240. Together with the n index count from the counter circuit 260, the sorting circuit 270 provides pixel indices which identify a particular pixel of an 8*8 image block. In this way the sorting circuit 270 provides a loading or addressing scheme for the incoming coefficients to the 8*8 block accumulator 240. The 8*8 block accumulator 240 receives the values resulting from the multiplication operation, as well as the pixel indices from the sorting circuit 270, to accumulate these results in the right pixel value. At the end of 64 equivalent accumulations (as zero values are not really counted, this can be less than 64 cycles) the contents of the 8*8 accumulator block 240 are the f[y][x] 55 which together represent a motion-uncompensated pixel-block image. The f[y][x] 55 are then motion compensated by an external circuit (not shown in FIG.5), as described above and shown in block 60 of FIG.2, to produce output pixels d[y][x] 65, which are also fed-back via a frame store memory, as described above. The way the compression algorithm of MPEG2 works allows for a large compression ratio. This is specifically represented by a large number of zero DCT coefficients coming in the bitstream. Most of these coefficients are in the spatial high frequency portion ofthe 8*8 matrix of blocks and are located towards the lower half ofthe matrix below the off-diagonal marked by (bottom to top) h0-gl-f2-e3-d4-c5-b6-a7 aO al a2 a3 a4 a5 a6 a7 bO bl b2 b3 b4 b5 b6 b7 cO cl c2 c3 c4 c5 c6 c7 dO dl d2 d3 d4 d5 d6 d7 eO el e2 e3 e4 e5 e6 e7 fO fl f2 f3 f4 f5 f6 f7 hO hi h2 h3 h4 h5 h6 h7 This is therefore an advantage in the way this embodiment performs the I- DCT, in that the zero coefficients processing time is skipped, which clearly allows for higher throughput, and low latency, which will eliminate the need for large pipelining stages ahead of the I-DCT, therefore reducing hardware. The efficiency of such a system is valuable in high throughput system requirements in cases such as HDTV where several I-DCT blocks would have to be used in case classical architectures are used. The I-DCT block is always one ofthe limiting factors in MPEG2 Encoders/Decoders. It will be appreciated by a person skilled in the art that alternative embodiments to the one described above are possible. For example, the first and second recirculating shift registers 300 and 310 respectively could be replaced by a ROM for the fixed values, and RAM for the downloaded values.

Claims: Claims 1. An image processing method for processing a sequential set of transform function coefficients (25) to produce an image (65), comprising the steps of: performing a weighting step (110) on each one ofthe set of coefficients, to produce a weighted set of coefficients (115); multiplying each one ofthe weighted set of coefficients by a plurahty of transform weighting factors (50) to produce a plurality of transform weighted coefficients (55) for each one ofthe weighted set; and, selectively adding each ofthe transform weighted coefficients to elements of an accumulator array according to a selection scheme, such that when the processing of the set is completed, the elements ofthe array define the image (65). 2. The image processing method according to claim 1 wherein the weighting step is an inverse quantisation step, and the weighted set of coefficients are inverse quantised. 3. The image processing method according to claim 1 or claim 2 wherein the plurality of transform weighting factors are inverse-discrete cosine transform values. 4. The image processing method according to any preceding claim wherein the selection scheme is calculated according to the sequential order of the transform function coefficients. 5. The image processing method according to any preceding claim further comprising the steps of saturation and mismatch control applied to the weighted set of coefficients. 6. An image processing circuit for processing a sequential set of transform domain coefficients (200) to produce an image (250), comprising: a first multiplier stage (205) coupled to receive the set of coefficients (200), for sequentially multiplying each one ofthe set by a weighting factor to produce a set of weighted coefficients; a second multiplier circuit (230) coupled to receive the set of weighted coefficients for sequentially multiplying each one of the set of weighted coefficients by a plurality of transform weighting factors to produce a plurality of transform weighted coefficients for each one of the set; an accumulator array (240) of elements coupled to the second multiplier circuit (230); and, a selection circuit (270) for adding each of the transform weighted coefficients to selected elements ofthe array according to a selection scheme, such that when the processing ofthe set is completed, the elements ofthe array define the image (250). 7. The image processing circuit according to claim 6 wherein the weighting factor is an inverse quantisation factor, and the weighted set of coefficients are inverse quantised. 8. The image processing circuit according to claim 6 or claim 7 wherein the plurality of transform weighting factors are inverse discrete cosine transform weighting factors. 9. The image processing circuit according to any preceding claim wherein the selection circuit calculates an adding sequence for the elements ofthe array according to the sequential order of the transform function coefficients. 10. The image processing circuit according to any preceding claim further comprising saturation and mismatch control circuits for performing saturation and mismatch control functions on the weighted set of coefficients.

Inventors: CLEMENT PATRICK, YASSA FATHY, CLEMENT, PATRICK, YASSA, FATHY
Applicants: CLEMENT PATRICK, MOTOROLA INC, YASSA FATHY, CLEMENT, PATRICK, MOTOROLA INC., YASSA, FATHY
Application year: 1996
Main classification: H04N7
IPC codes: G06F17, G06T9, H04N7