Abstract:
An Inverse Discrete Cosine Transform processor employs symmetry and reusable elements to use a fewer number of gates while maintaining processing speed at an acceptable level. Even and odd sums are generated simultaneously by even and odd sum generators. A butterfly operation is then performed on the on the even and odd sums to produce pairs of transformed elements simultaneously. For an 8×8 block, the even and odd sum generators can be designed to a generate four pairs of even and odd sums sequentially. This design allows a single row or column of eight elements to be processed in 4 clock cycles. A horizontal transformation on all eight rows of the block can be performed in 32 cycles. A vertical transformation can then be performed by storing the transformed rows in a second memory, reading out columns from the second memory, and using the same hardware to generate the sums and perform the butterfly operation on the columns. An entire two-dimensional transformation can be performed in only 64 clock cycles.

Description:
BACKGROUND OF THE INVENTION 
     The invention relates to transform coding. More specifically, the invention relates to Discrete Cosine Transforms and Inverse Discrete Cosine Transforms. 
     Popularity of digital video is on the rise. High quality, full-motion digital video images are now being transmitted over the airwaves from satellites to homes equipped with small satellite dishes and integrated decoders/receivers. The dishes and integrated decoders/receivers have become so popular, in fact, that they have become the fastest selling consumer electronics product ever to enter the market. Lower quality digital video images suitable for teleconferencing are being transmitted over the telephone lines by digital ISDN systems. More and more companies are realizing that they can save time and money by holding meetings via teleconferencing instead of meeting in-person. Digital video images can now be viewed on personal computers. The video images are available on CD ROMs, and they are now being made available over the ever-popular Internet. 
     Future success of digital video will depend upon the ability to increase the compression of the digital video images, and to do so at affordable prices. Compression reduces the amount of information describing the digital video images, yet retains the quality of the video images. It is accomplished partly by eliminating redundant information in the video images. Digital video images contain a massive number of bits of information. The number of bits is proportional to the quality of the image. As more bits are used, the images become sharper, clearer and more life-like. A single high quality digital video image is made up of millions of bits of information. The amount of information is further increased because the video images in full-motion video must be updated many times per second to reduce flickering. Flicker-free video requires the images to be updated thirty times per second. This would normally be too much information to transmit within a fixed bandwidth and displayed in real time. However, compression allows all of this to happen. 
     The Discrete Cosine Transform (DCT) and Inverse Discrete Cosine Transform (IDCT) are the basic functions used in many current compression/decompression algorithms for digital video. The DCT transforms a two-dimensional image from the spatial domain into the frequency domain. This transformation allows for redundancy in the video images to be reduced and the video image to be described and transmitted using fewer bits. The IDCT is used to transform the image back to the spatial domain. The complexity of the transformations grow exponentially with the size of the image, so the transforms are typically performed on small 8×8 blocks. 
     Even for an 8×8 block, the IDCT is still quite complex, requiring 1024 multiplies and 896 adds. A 720×480 image requires an IDCT to be performed on 8100 such blocks, all within 33 milliseconds. This works out to over 466,500,000 operations per second. Even for an IDCT processor designed to run at 27 MHZ, this comes out to an average of 18 operations every clock cycle, 10 of which would be multiplies. Designing an IDCT processor with a straight-forward implementation would undoubtedly be very large. Using 60% of available computational bandwidth, which is fairly typical, the design would require 16 multipliers and adders, or about 46,000 gates. 
     Real-world designs are desired to be quite a bit smaller. Architectures of IDCT processors have been known to merge multiple multiplications and additions into single MAC operations. Still, the real world architectures simply use too many gates and take up too much area. Larger architectures cost more to fabricate than smaller architectures. Depending on where the profit margins are, the supplier can either pass the fabrication cost off to the consumer or take less profit. 
     Much research and effort has been devoted to finding esoteric IDCT algorithms that reduce the number of operations performed by IDCT processors. There are a myriad of papers describing new-fangled ways to compute IDCTs using fewer operations, particularly fewer multiplications. The general consensus seems to be that an IDCT algorithm with a fewer number of multiplications is better. 
     SUMMARY OF THE INVENTION 
     It is an objective of the present invention to provide a processor that has more symmetry and more reusable elements. This objective translates into a processor having a fewer number of gates, not necessarily a fewer number of operations. 
     It is a further objective to provide a processor that performs more parallel operations, not serial operations. 
     A processor according to the present invention comprises first memory for storing blocks of data and reading out the data in a first direction (the data being read out in vectors having 2n elements); an even sum generator that generates even sums from even elements of the vectors read out of the first memory; an odd sum generator that generates odd sums from odd elements of the vectors read out of the first memory; a first adder that adds together the even and odd sums; and a subtracter that subtracts the odd sums from the even sums. The operations of the first adder and subtracter are performed simultaneously. 
     A transformation in a second direction can be performed by storing the results of the first adder and subtracter in additional memory, reading out vectors from the additional memory in a direction other than the first direction; and processing the vectors with the even sum generator, odd sum generator, adder and subtracter. 
     The blocks of data can be scaled prior to storage in the first memory or results of the even and odd sum generators can be scaled. When scaling is performed prior to storage in the first memory, the processor performs an IDCT on the blocks of data. When scaling is performed on the results of the adder and subtracter, the processor performs a DCT on the blocks of data. 
    
    
     BRIEF DESCRIPTION OF THE DRAWINGS 
     FIG. 1 is a flowchart of a method of exploiting an IDCT matrix for use by an IDCT processor in accordance with the present invention; 
     FIG. 2 is a block diagram of the IDCT processor; and 
     FIG. 3 is a block diagram of a video decoder that uses the IDCT processor shown in FIG. 2. 
    
    
     DETAILED DESCRIPTION OF THE INVENTION 
     FIG. 1 shows the steps performed to design an IDCT processor according to the present invention. The processor is based on an IDCT matrix having redundancies and regularities in its coefficients. These redundancies and regularities are exploited to reduce computational complexity of performing the IDCT. One such matrix T, shown below, is an 8×8 transform matrix for calculating an 8-point IDCT. The matrix is composed of sixty four coefficients, each coefficient representing a different multiplication. ##EQU1## 
     FIG. 1 shows the steps performed to exploit these regularities and redundancies when designing an IDCT processor. In step 102, the transform matrix T is normalized or scaled so that many of the coefficients become equal to 1. Scaling reduces and simplifies the IDCT processor architecture because multipliers are not needed to multiply by 1. Instead, simple add operations can be performed. An 8-point scaling matrix S for the matrix T is shown below. 
     In step 104, the remaining coefficients are all expressed in terms of just three constants--a, b and c--by using basic trigonometric identities. The normalized matrix N, expressed in terms of constants a, b and c, is also shown below. ##EQU2## 
     In step 106, the matrix N is partitioned. Many of the same patterns and redundancies of the original transform matrix still exist, including the matching of columns necessary for a &#34;butterfly&#34; operation. It can be seen that the coefficients in left half (columns 0 through 3) of the normalized matrix N are identical to those in the right half (columns 7 through 4), except for the sign. Furthermore, the signs of the even rows (rows 0, 2, 4 and 6) of the normalized matrix N are the same on both sides, while the signs of the odd rows (rows 1, 3, 5, and 7) on the right side are the opposite of those on the left side. This allows the normalized matrix N to be split vertically right down the middle and horizontally along the even and odd-numbered rows. This partitioning allows for the &#34;butterfly&#34; operation to be performed. 
     The butterfly operation is illustrated by the following example. Let X 0-7  be an input matrix that has been scaled by matrix S 0-7 . Elements E 0-7  are the result of the input matrix X 0-7  being multiplied by the normalized matrix N. 
     Elements E 0  and E 7  are expressed as: 
     
         E.sub.0 =X.sub.0 +a X.sub.1 +b X.sub.2 +c X.sub.3 +X.sub.4 +X.sub.5 +X.sub.6 +X.sub.7 
    
     
         E.sub.7 =X.sub.0 -a X.sub.1 +b X.sub.2 -c X.sub.3 +X.sub.4 -X.sub.5 +X.sub.6 -X.sub.7 
    
     or 
     
         E.sub.0 =EVEN.sub.0 +ODD.sub.0 
    
     
         E.sub.7 =EVEN.sub.0 -ODD.sub.0 
    
     where 
     
         EVEN.sub.0 =X.sub.0 +bX.sub.2 +X.sub.4 +X.sub.6 
    
     
         ODD.sub.0 =aX.sub.1 +cX.sub.3 +X.sub.5 +X.sub.7 
    
     The remaining elements E 1  to E 6  can be grouped and expressed in the same manner: ##EQU3## where ##EQU4## 
     Thus, the only differences between the EVEN and ODD sums above are that the constants a, b and c are sometimes increased or decreased by 1, and that the ODD sum is sometimes multiplied by the constant (b-1)/2, which is approximately equal to 0.7071. All this commonality leads to an architecture that uses common hardware to calculate the EVEN sums, the ODD sums, and to optionally multiply by 0.7071 for each of the four equation sets. This is an advantage of the butterfly operation. 
     In step 108, computational efficiency of the IDCT processor can be further increased by modifying the EVEN and ODD sums using Boolean algebra and a 2&#39;s complement notation. Setting 
     
         -X=X+1 
    
     where X=logical inverse of X, 
     the ODD and EVEN sums are expressed as ##EQU5## 
     In step 110, the computationally efficiency can be increased even further by expressing the products of elements and constants a, b and c as ##EQU6## 
     The EVEN sums can be expressed as follows in equations (1) to (4). ##EQU7## 
     The ODD sums can be expressed as follows in equations (5) to (8). ##EQU8## 
     FIG. 2 shows an IDCT processor 10 that transforms 8×8 blocks of data utilizing the right hand sides of equations (1) to (8). A stream of data D i ,j, is provided to the processor 10 (where 0≦i≦7, and 0≦j≦7). The data D i ,j can be provided sequentially or non-sequentially, depending on the system supplying the data. In MPEG systems, data D i ,j is supplied in a zig-zag order. For example, zig-zagged data D i ,j could be provided in the following order: D 1 ,1, D 1 ,2, D 1 ,2, D 3 ,1, D 2 ,2, D 1 ,3, etc. The data D i ,j can be of any specified word length. In MPEG systems, the word length is specified at 18 bits. 
     Scaling of each 8×8 block can be done in a number of ways. For example, the 8×8 blocks can be multiplied by an 8×8 scaling matrix S i ,j, or the 8×8 blocks can be multiplied by a scaling vector S i  and then multiplied again by a scaling vector *S i . The scaling vectors S i  and *S.sub. i or the scaling matrix S i ,j can be stored in a lookup table 12 and can be multiplied with the data D i ,j by a first multiplier 14. The gate count for the lookup table 12 is roughly 160 gates, and the gate count for the first multiplier 14 is roughly 2500 gates. 
     The scaled data is stored in an 8×144 Zig-Zag RAM 16, which reorders the scaled data and stores it into a block consisting of 8 rows of 8×1 scaled input matrices. If, however, the scaled data is supplied sequentially (i.e., row-by-row or column-by-column) instead of a zig-zagged order, an 8×144 register can be used in place of the Zig-Zag RAM 16. 
     Once a complete row is available in the Zig-Zag RAM 16, it is read out and supplied to one input of a first multiplexer 18 (the first multiplexer 18 has two other inputs). A state machine selects the input corresponding to the Zig-Zag RAM 16. Even elements in the row are supplied to an EVEN Data Control 20 and EVEN Array 22, and odd elements in the row are supplied to an ODD Data Control 24 and ODD Array 26. 
     The EVEN Data Control 20 uses selective data inversion, shifting, and multiplexing to form the terms that go to the EVEN Array 22. The terms are shown in equations (1)-(4). The first term in equations (1)-(4) is X 0 . Therefore, X 0  is passed on directly to the EVEN Array 22. The second term in equations (1)-(4) is either 2X 2 , 0 or 2 (inverted X 2 ). The second term can be generated by selectively shifting X 2 , selectively inverting X 2 , and selecting the constant zero, the shifted and inverted X 2  or the shifted X 2 . The remaining terms for equations (1) to (4) are generated in a similar manner. Multiplication is performed by shifting to the left, division is performed by shifting to the right, inversion is performed by inverters, and constants are supplied by a lookup table or a state machine. Nine non-zero terms are provided by the EVEN Data Control 20. The EVEN Data Control 20 can be implemented with as few as 280 gates. 
     The EVEN Array 22 can be implemented as a 9-input Wallace tree that adds up all the non-zero terms from the EVEN Data Control 20. The gate count can be quite small. A 9-input Wallace-tree with a carry-select adder can be implemented with approximately 1300 gates. The EVEN Array 22 has an output bus-width of 22 bits, which is needed for IEEE accuracy requirements. The output of the EVEN Array 22 provides the EVEN 0 , EVEN 1 , EVEN 2  and EVEN 3  sums in sequence. 
     The ODD Data Control 24 also uses selective data inversion, shifting, and multiplexing to form the terms that go to the ODD Array 26. The first term of equations (5)-(8) is either 4X 1  or a constant 0. The first term can be generated by shifting X 1  to the left by two bits and selecting either 4X 1  or the constant 0. The second term, which is either X 1 , 2X 1  or the constant 0, can also be generated by selective shifting and multiplexing. As above, multiplication is performed by shifting to the left, division is performed by shifting to the right, inversion is performed by inverters, and constants are supplied by a lookup table or a state machine. The remaining terms of equations (5) to (8) are generated in a similar manner. The ODD Data Control 24 provides thirteen non-zero terms. It can be implemented with as few as 530 gates. 
     The ODD Array 26 can be implemented as a 13-input Wallace tree that adds up the thirteen non-zero terms from the ODD Data Control 24. A 13-input Wallace-tree with a carry-select adder can be implemented with approximately 1900 gates. As with the EVEN Array 22, the output of the ODD Array 26 must be at least 22 bits wide to meet IEEE accuracy requirements. The output of the ODD Array 26 provides the ODD 0 , ODD 1 , ODD 2  and ODD 3  sums in sequence. 
     The ODD 1  and ODD 2  sums from the ODD Array 26 must be multiplied by (b-1)/2. A second multiplier 28 can perform the multiplication as follows: ##EQU9## Multiplying the ODD 1  and ODD 2  sums by shifting and adding allows the second multiplier 28 to be implemented as a 5-input Wallace tree having a carry-select adder in the final stage. Thus, the second multiplier 28 can have a structure similar to the EVEN and ODD Arrays 22 and 26. The output of the second multiplier 28 is also 22-bits wide. The gate count of the second multiplier 28 is approximately 800 gates. 
     It is shown that all ODD sums are multiplied by the second multiplier 28, and that a second multiplexer 30 selects the output of the second multiplier 28 when the ODD 1  and ODD 2  sums are generated and the output of the ODD Array 26 when the ODD 0  and ODD 3  sums are generated. Selection can be made by a state machine (not shown). The second multiplexer 30 requires about 70 gates. In the alternative, the second multiplier 28 can be provided with control logic for performing selective multiplications. Although the control logic allows the second multiplexer 30 to be eliminated, it increases the gate count of the second multiplier 28. 
     A butterfly adder 32 adds together the outputs of the EVEN Array 22 and the second multiplexer 30 to generate the elements E 0 , E 1 , E 2  and E 3 . Simultaneously, a butterfly subtracter 34 subtracts the output of the second multiplexer 30 from the output of the EVEN Array 22 to generate the elements E 7 , E 6 , E 5  and E 4 . Subtraction can be performed for example, by taking the 2&#39;s complement of the output of the second multiplexer 30 and adding it to the output of the EVEN Array 22. The butterfly adder 32 can be a 22-bit adder having a gate count of approximately 430 gates, and the butterfly subtracter 34 can be a 22-bit subtracter having a gate count of approximately 480 gates. 
     An output of the butterfly adder 32 is provided to a first 4×144 Transpose RAM 36, and an output of the butterfly subtracter 34 is provided to a second 4×144 Transpose RAM 38. The transpose RAMs 36 and 38 cooperate to store an entire 8×8 block, and read out the block in a vertical direction (the blocks were read out of the Zig-Zag RAM 16 in a horizontal direction). When the elements E 0  and E 7  are generated, element E 0  is stored at location 1,1 of the first Transpose RAM 36 while element E 7  is stored at location 1,4 of the second Transpose RAM 38. With subsequent elements E 1-6 , the element E 1  is stored at location 1,2 of the first Transpose RAM 36 while the element E 6  is stored at location 1,3 of second Transpose RAM 38, the element E 2  is stored at location 1,3 of the first Transpose RAM 36 while the element E 5  is stored at location 1,2 of second Transpose RAM 38, and the element E 3  is stored at location 1,4 of the first Transpose RAM 36 while the element E 4  is stored at location 1,2 of second Transpose RAM 38. 
     Once a column is available in the Transpose RAMS 36 and 38, that column is read out to the first multiplexer 18. The state machine selects the two multiplexer inputs corresponding to the Transpose RAMs 36 and 38, and the even and odd elements of the column are provided to the EVEN and ODD Data Controls 20 and 24, respectively. 
     A two-dimensional IDCT on an 8×8 block is performed by the processor 10 as follows. First, the processor 10 performs a horizontal transform, and then it performs a vertical transform. During the horizontal transform, a row is supplied by the Zig-Zag RAM 16, with the even elements being split off and sent to the EVEN Data Control 20 for calculation of the EVEN 0 , EVEN 1 , EVEN 2  and EVEN 3  sums and the odd elements being split off and sent to the ODD Data Control 24 Array for calculation of the ODD 0 , ODD 1 , ODD 2  and ODD 3  sums. The ODD sums are multiplied by the constant 0.7071, with only the terms 0.7071ODD 2  and 0.7071ODD 3  being selected by the second multiplexer 30. A butterfly operation is performed by the butterfly adder 32 and subtracter 34. The elements E 0-7  are generated simultaneously in pairs: E 0  and E 7 , E 1  and E 6 , E 2  and E 5 , and E 3  and E 4 . Only four clock cycles are required to generate all four pairs. Only 32 clock cycles are required to complete the horizontal transformation on the entire 8×8 block. 
     The resulting rows of the one-dimensional IDCT are stored in the Transpose RAMs 36 and 38 as columns. Then the columns are read out of the Transpose RAMs 36 and 38, and the vertical transformation is performed. Again, only four clock cycles are required to generate the EVEN and ODD sums for each column. Performing the vertical transform on the entire 8×8 block takes just 32 cycles. 
     The IDCT 10 processor has only 6000 gates, yet requires only 64 clock cycles to perform the two-dimensional transformation. At an operating frequency of 27 MHZ, the IDCT processor 10 easily meets the throughput requirements for an MPEG-2 system. 
     The IDCT processor 10 can be fabricated on a single chip made of Silicon or Gallium Arsenide. Using the architecture and operating frequency described above, silicon is preferred because it is slightly faster. The slightly faster silicon allows the multipliers and adders to use ripple adders in place of the carry-select adders. This saves about 500 gates, bringing the overall total down to 5500 gates. 
     The processor 10 can be operated at frequencies other than 27 MHZ. For example, the operating frequency could be boosted to 54 MHZ. The boosted frequency would allow the IDCT processor 10 to perform the same operations in half the time, or it would allow the IDCT processor 10 to perform the same operations in the same amount of time, but using fewer gates. The gate count could be reduced as much as 35% for an operating frequency of 54 MHZ. 
     Thus disclosed is an IDCT processor 10 with less latency and fewer gates than conventional IDCT processors. Fewer gates, in turn, reduce power consumption and allow the IDCT processor 10 to be fabricated on a smaller chip. Because a smaller chip die results in a better yield, the actual cost savings per die is increased. What this all means is a dramatically reduced silicon cost and/or increased profit margin for the IDCT processor 10. 
     FIG. 3 shows a video decoder 50 that uses the IDCT processor 10. A bitstream B containing a formatted video signal is supplied to the decoder 50. The bitstream B can be formatted according to any standard, such as MPEG (full-motion video images), JPEG (still-frame video images) and H.261 (images for video phones). According to the MPEG standard, the incoming bitstream B includes not only video information but also transmission headers. The incoming bitstream B is supplied to a parser 52, which parses out the information in the transmission headers (e.g., an identifier, size of image, a quantization table and Huffman bits). The parsed bitstream provided by the parser 52 is converted from a variable length code to a fixed length code by a decoder 54 such as a Huffman decoder. The fixed length code is dequantized according to any well known dequantizer 56 to produce a stream of video data D i ,j. The data D i ,j is supplied to the IDCT processor 10. Video frames are provided on an output of the IDCT processor 10. 
     The frames from the IDCT processor 10 are supplied to a multiplexer 58 and a frame adder 60. If the frame is an intra frame (I-frame), the multiplexer 58 sends the frame directly to a display device 62 for display. If the frame is a prediction frame (P-frame) containing only incremental changes in pixel values from the previous frame or it is a bi-directional frame (B-frame) containing pixel values that are coded with respect to both an earlier frame and a later frame, the frame adder 60 adds the P-frame or B-frame to previous frame data, and the multiplexer 58 sends the output of the frame adder 60 to the display device 62. 
     It is understood that various changes and modifications may be made without departing from the spirit and scope of the invention. Block size of the data is not limited to 8 rows and 8 columns. The block size, which could be greater or smaller, is typically determined by system specifications. 
     Additional pairs of transpose RAMs could be used for processing in additional dimensions. The transpose RAMs could be eliminated altogether if processing is performed in one dimension only. 
     For two-dimensional processing, columns of blocks could be read out and processed before the rows are read out and processed. Thus, a vertical transformation could be performed and stored in the Transpose RAM. Then, a horizontal transformation could be performed on the block stored in the Transpose RAMs. 
     Moreover, the invention is not limited to IDCT processors. A Discrete Cosine Transform Processor could employ the same architecture, except that scaling would be done at the back end. 
     The processor architecture can be applied to current MPEG, DigiCipher, and JPEG applications currently begin used in a wide array of consumer products employing video compression such as DBS, cable TV and DAB systems. It can be readily modified for HDTV by using four Transpose RAMs instead of two. 
     Accordingly, various modifications can be made without departing from the spirit and scope of the invention as defined by the claims that follow.