Patent Publication Number: US-6223195-B1

Title: Discrete cosine high-speed arithmetic unit and related arithmetic unit

Description:
CROSS-REFERENCE TO RELATED APPLICATION 
     This application is a continuation of application Ser. No. 08/737,569, filed on Nov. 15, 1996, U.S. Pat. No. 6,029,185, the entire disclosure of which is a 371 of PCT/JP95/00953 filed May 18, 1995. 
    
    
     TECHNICAL FIELD 
     The present invention relates to an arithmetic unit of a computer system, and in particular, to a discrete cosine high-speed arithmetic unit suitable for achieving calculation of a sum of products using a plurality of constant function values and compressing and decompressing data at a high speed. Moreover, the present invention relates to a high-speed Hartley transform arithmetic unit suitable for calculating a sum of products using a plurality of constant function values and thereby executing the Hartley transform processing, which is related to a Fourier transform, at a high speed. Additionally, the present invention relates to image processing, and in particular, to a Hough transform circuit to achieve a Hough transform in which straight line components of an image are detected, the circuit being suitable for calculating a sum of products using a plurality of constant function values and executing the Hough transform processing at a high speed. 
     BACKGROUND ART 
     In voice and image processing, there has been widely employed a discrete Fourier transform (DFT) and its variations such as a discrete cosine transform and a discrete Hartley transform. In these transform processes, a plurality of trigonometric functions are utilized to primarily calculate sums of products between the trigonometric functions and data items. In general, the calculation cost of multiplication is higher than that of addition and subtraction. Consequently, there have been devised several high-speed calculation algorithms in which the number of multiplications are advantageously reduced using relationships between trigonometric functions, e.g., the formula of double angle and the formula of half-angle. These algorithms have been briefly described in pages 115 to 142 of the “Nikkei Electronics” No. 511 published on October 15, 1990. In practice, the trigonometric functions are stored as constants in a memory. Particularly, due to the relatively small number of figures of the values, there has been also adopted a method in which the results of products between data items and trigonometric functions are stored in a memory. In addition, it is possible to utilize a known method in which each trigonometric function value is calculated in a CORDIC method using the principle of rotation of coordinates and/or a formula of approximate expression of function. 
     In image processing, the Hough transform is often employed because the transform is advantageously applicable even when the data contains noises due to the detection of straight lines in the image. When the coordinates of an arbitrary pixel are expressed as (x,y), the Hough transform is defined as 
     
       
           R=x  cos θ+ y  sin θ= x  cos θ+ y  cos(π/2−θ).  
       
     
     FIG. 23 shows the geometric relationship of the transform. R stands for the length of a perpendicular drawn from the origin of the coordinate system to a straight line passing the pixel (x,y). Letter θ denotes the angle between the perpendicular and the positive direction of the x axis. In an actual application, for an arbitrary pixel, the angle θ takes a plurality of discrete values ranging from 0 to π such that R of expression (1) is calculated for each value of θ. R is also discretized and its frequency of occurrence is attained in the form of voting for all pixels so that (R, θ) having the highest number of votes obtained is detected as a straight line component. 
     A plurality of trigonometric functions are stored as constants in a memory for use in calculation later. Or, in the conventional method in which the value of each trigonometric function is directly calculated using, e.g., the CORDIC method, even when the number of multiplications is reduced by a clever algorithm, a considerable amount of multiplications are still necessary. Furthermore, it is not practical to provide a multiplier for each of the multiplications, namely, the multiplier is to be sequentially used. This is cause of hindrance to the high-speed operation. Additionally, since an arbitrary input is assumed in a multiplier, even when a value at a digit place of binary input data is zero, a partial product is uselessly calculated for the digit place. When there is used the method in which all of the results of products between data items and trigonometric function values are stored in the memory, although the arithmetic unit can be easily designed, the memory capacity is increased and hence the chip size becomes larger. 
     Moreover, to count the votes for the discrete (R, θ), there is required a large volume of memory. 
     DISCLOSURE OF INVENTION 
     It is therefore an object of the present invention to provide a discrete cosine high-speed arithmetic unit, a high-speed Hartley transform arithmetic unit, and a high-speed Hough transform circuit in which considering that each trigonometric function value is constant, to possibly minimize the number of non-zero coefficients in the binary value obtained by expanding the trigonometric function value, the value is beforehand recoded into a redundant binary representation of {−1,0,+1}. The resultant values are shifted such that a pair of non-zero coefficients is optimally grouped. For each digit position, associated data pairs are subjected to addition or subtraction according to the signs of the coefficients. Moreover, the resultant values are shifted to be aligned to a fixed position and are then inputted to a group of adders to thereby obtain partial products therebetween, thereby attaining the sum of the partial products. In consequence, the arithmetic units and circuit above are efficiently configured in a compact structure to operate at a high speed. 
     Since the number of non-zero coefficients is reduced in the constant and the pair of non-zero coefficient values are grouped for each digit position to commonly effect the addition in an optimal manner, the number of adders is decreased and the number of stages of gates is also minimized. 
    
    
     BRIEF DESCRIPTION OF DRAWINGS 
     FIG. 1 is a configuration diagram of a discrete cosine high-speed arithmetic unit of the present invention. 
     FIG. 2 is a DCT/IDCT calculation expressed in matrix form. 
     FIG. 3 is a table showing binary expansion values of seven cosine constants, values obtained by canonically recoding the expansion values, and values attained by multiplying the values by the square root of two. 
     FIG. 4 is a diagram showing a combination of variable pairs to beforehand accomplish addition or subtraction for the anterior addition and shift input positions for the posterior addition. 
     FIG. 5 is a circuit diagram for the calculation of the one-dimensional DCT/IDCT of the present invention. 
     FIG. 6 is a one-digit circuit diagram for implementing x i -x j  by use of simple gates in place of adders. 
     FIG. 7 is a one-digit circuit diagram of a redundant binary adder employed according to the present invention. 
     FIG. 8 is an explanatory diagram of a method of achieving the two-dimensional DCT/IDCT by reducing the two-dimensional form into a one-dimensional form and a method of directly calculating the two-dimensional DCT/IDCT. 
     FIG. 9 is a table showing binary expansion values of cos α×cos β at two-dimensional points, i.e., 4×4 points and recoded values thereof. 
     FIG. 10 is a DCT at two-dimensional 4×4 points in matrix representation. 
     FIG. 11 is an IDCT at two-dimensional points 4×4 in matrix representation. 
     FIG. 12 is a diagram showing a method in which the DCT/IDCT at two-dimensional 4×4 points is directly calculated without reducing the two-dimensional form into a one-dimensional form and a combination of pairs of variables to beforehand accomplish addition or subtraction for the anterior addition and shift input positions for the posterior addition. 
     FIG. 13 is a circuit construction diagram of the present invention in which the DCT at two-dimensional 4×4 points is directly calculated without reducing the two-dimensional form into a one-dimensional form. 
     FIG. 14 is a configuration diagram of a chip in which a DCT/IDCT high-speed arithmetic unit of the present invention is incorporated. 
     FIG. 15 is a construction diagram of a high-speed Hartley transform arithmetic unit as an embodiment of the present invention. 
     FIG. 16 is an explanatory diagram showing a 16-point Hartley transform in matrix representation. 
     FIG. 17 is an explanatory diagram showing a re-arranged 16-point Hartley transform in matrix representation. 
     FIG. 18 is an explanatory diagram showing a state in which constants are developed into binary values. 
     FIG. 19 is a circuit block diagram showing a product sum circuit. 
     FIG. 20 is a circuit block diagram showing an initial stage of a butterfly arithmetic circuit. 
     FIG. 21 is a circuit block diagram showing the second and subsequent stages of the butterfly arithmetic circuit. 
     FIG. 22 is a construction diagram of a high-speed Hough transform circuit as an embodiment of the present invention. 
     FIG. 23 is an explanatory diagram showing a geometric relationship of a 16-directional Hough transform. 
     FIG. 24 is an explanatory diagram related to a binary expansion of constant values of cosine functions and grouping of common parts. 
    
    
     BEST MODE FOR CARRYING OUT THE INVENTION 
     A description will first be given of an 8-point discrete cosine transform (to be abbreviated as DCT herebelow). Assuming that input data and calculation data are respectively x k  and X n , the formula of DCT is expressed as follows:                X   n     =       c   n            ∑     k   =   0     7                         x   k     ·   cos                       π                   n        (       2      k     +   1     )         16                   (   1   )                         
     Moreover, the formula of inverse DCT (to be abbreviated as IDCT herebelow) is expressed as:                x   k     =       c   n            ∑     n   =   0     7                       c   n            X   n     ·   cos                       π                   n        (       2      k     +   1     )         16                   (   2   )                         
     where,                  c   0     =       1   /   2                     2         ,                  c   n     =         1   /   2                   …                 n     ≠   0               (   3   )                         
     It is assumed g(i)=cos(πi/16), equation (1) can be represented in matrix equation as shown in FIG.  2 . Additionally, equation (2) can be represented as a matrix attained by transposing the rows and columns of the matrix in FIG.  2 . 
     Prior to conducting the DCT calculation, consider now the following formula of product sum:              X   =       ∑     k   =   1     n                       x   k          a   k                 (   4   )                         
     Assuming:                a   k     =       ∑     i   =   0       m   -   1                         a     k   ,   i            2   i                 (   5   )                         
     in equation (4), the following relationship results:              X   =         ∑     k   =   1     n                       x   k          a   k         =       ∑     k   =   1     n                       x   k     ·     (                  ∑     i   =   0       m   -   1                         a     k   ,   i            2   i         )                   (   6   )                         
     where, a k,1 ε {−1,0,30 1}. If there exist a pair of coefficients a k,i  and a j,i  having a relationship of a k,i =|a j,i |=1 for distinct k and j, then the following equation is obtained: 
     
       
         ( x   k   a   k,i   +x   j   a   j,i )2 i =( x   k   ±x   j )2 i    (7)  
       
     
     Furthermore, if there exist a pair of coefficients a k,i  and a j,m  having a relationship of a k,i =|a j,m |=1 for distinct i and m, the following equation results. 
     
       
         ( x   k   a   k,i   +x   j   a   j,m ·2 m−i )2 i =( x   k   ±x   j ·2 m−i )2 i    (8)  
       
     
     For the product sum x k ·a k +x j ·a j , if there exist a plurality of pairs of coefficients satisfying equation (7) or (8), the sums of and differences between x k  and x j  are calculated according to the principle represented by equation (7) and the sums of and differences between one of x k  and x j  and results obtained by multiplying the other one thereof by n-th power of two (n=(m−i) digit shift) are calculated according to the principle designated by equation (8), and then the obtained results are respectively shifted to digit positions to satisfy the condition above to be then added to each other, thereby reducing the number of calculations for the partial product sum. 
     In addition, appropriately using a relationship 
     
       
         2 i −2 0 =2 i−1 +2 i−2 +. . . +2 0    (9)  
       
     
     called a canonical recode in which the i non-zero coefficients can be decreased to two non-zero coefficients, there are conducted shift operations to thereby increase the pairs of coefficients satisfying equation (7) or (8). 
     Next, a description will be given of a method in which the amount of calculations of DCT partial product sum is minimized according to these principles. First, FIG. 3 shows a binary expansion values of seven cosine constants g(i) up to the 16-th digit. Also shown are the canonical recode values (the number of non-zero coefficients is changed from 59 to 42 through the recoding process). However, −1 is represented by applying an overline to 1. Additionally, since g( 4 ) multiplied by the square root of two results in a simple value of one, there are also shown the results obtained by multiplying the constants by the square root of two (the number of non-zero coefficients is changed from 46 to 43). As above, applying an appropriate fixed value to the cosine constant, the number of non-zero coefficients is increased or decreased after the recoding process, and hence existence of an optimal solution can be expected. This naturally depends on the number of figures assumed. In this case, considering also the inverse DCT calculation (inversely, the constant is divided in the IDCT by the fixed value used in the multiplication) since the digit place can be easily aligned through the shift operation, it can be noted that either one of g(i) and the result obtained by multiplying g(i) by the square root of two is significant. However, this is not the case if either the DCT calculation or the IDCT calculation is utilized. In this embodiment, description will be primarily given on the assumption that the value is multiplied by the square root of two. 
     In the DCT calculation, g( 2 k+1) and g( 2 k) are grouped, namely, to appear respectively in an odd-numbered row and an even-numbered row as shown in FIG.  2 . Furthermore, since g(k) appears as having the opposite sign in columns i and j, the difference u k =x i −x j  is beforehand calculated between x i  and x j . In this connection, for example, assuming u 1 =x 0 −x 7 , u 3 =x 1 −x 6 , u 5 =x 2 −x 5 , and u 7 =x 3 −x 4  in the first row, the total sum u 1 ·g( 1 )+u 3 ·g( 3 )+u 5 ·g( 5 )+u 7 ·g( 7 )= 
     
       
         =1. 011000110001u 1 +1. 001011010000u 3 +0. 110010010010u 6 +0. 010001101010u 7    
       
     
     (rounded up at the 13-th digit below the decimal point) is calculated as follows. First, as shown in FIG. 4, u 1 +u 3 , u 1 −u 3 , and u 5 +u 7  are calculated in the prior addition. Thereafter, a shift and input process is carried out for the results of additions and for the digit places of appearances respectively of u 1 , u 3 , u 5 , and u 7 , thereby achieving the posterior addition for these items at once. Next, assuming u 2 =(x 0 +x 7 )−(x 3 +x 4 ) and u 6 =(x 1 +x 6 )−(x 2 +x 5 ) in the second row, the total sum u 2 ·g( 2 )+u 6 ·g( 6 )= 
     
       
         1. 0100111010000u 2   +0. 100010101001u   6    
       
     
     is calculated as follows. First, as shown in FIG. 4, u 2  and u 6  are obtained to be added to each other in the anterior addition. Thereafter, a shift and input process is carried out for the results of additions and for the digit places of appearances respectively of u 2  and u 6 , thereby achieving the posterior addition for these items at once. In addition, for the 0-th and 4-th rows, assuming u 4 =(x 0 +x 7 )+(x 3 +x 4 ) and u 4 ′=−(x 1 +x 6 )−(x 2 +x 5 ), it is only necessary to first calculate u 4  and u 4 ′ to obtain the total sum (u 4 +u 4 ′)·g( 4 )=u 4 +u 4 ′. For the remaining rows, i.e., rows 3 and 6 and rows 5 and 7, the additions can be achieved by a configuration substantially similar to that used for the first and second rows. In this situation, providing selectors s 1 , s 3 , s 5 , s 7 , s 2 , s 3 , s 4 , and s 4 ′ as shown in FIG. 5, the hardware of the adder section can be commonly used such that the calculation is sequentially achieved for each of the odd-numbered rows and for each of the even-numbered rows. It is to be appreciated that the hardware of the adder section is not commonly utilized, but may be disposed in a parallel fashion. That is, to concurrently calculate the total sum for each row of the matrix representation shown in FIG. 2, adder hardware is independently arranged for each row. 
     In FIG. 5, it is only necessary to appropriately select the type of adders  120  to  126  and  220  to  241 , for example, a full adder and carry-propagation-free adder may be chosen for each adder. To particularly increase the processing speed, a carry-propagation-free adder should be selected. In such a case, there is required sections  210  and  211  to transform the result of total sum into a binary representation. Moreover, the carry-propagation-free adders are classified into a carry save type and a redundant binary type. Either of these types may be used. In relation to this embodiment, a description will now be given of a circuit construction method adopting a characteristic unique to the redundant binary adder. Since the carry-propagation-free adder includes the same circuit for each digit place, it is only necessary to consider the circuit for an arbitrary digit position. First, since the calculation circuits  100  to  103  for u k =x i −x j  associated with the respective digit places conduct operations of 0−0=0, 0−1=−1, 1−0=+1, and 1−1=0, the system can be configured with simple gate circuits shown in FIG. 6 without using any adder circuit. For the calculation circuits  104  to  107  for u k =x i −x j , it is only necessary to consider u k =x i +x j =x i −(−x j ). The value of −x i  can be obtained through {(inverted x j )+1} using the representation of two&#39;s complement. The inverted value of x j  is represented by an overline applied to x j . Since the additions in the second and subsequent stages are the redundant binary representation of {+1,0,−1}, the circuit shown in FIG. 7 is employed as the redundant binary adder circuit for each digit place. The result of the total sum obtained in the redundant binary representation is converted into a binary value. Since a redundant binary value can be decomposed into positive and negative binary values, the converter circuits  210  and  211  can be easily constituted with subtracters. The subtracter may be provided with a dedicated borrow-look-back circuit which corresponds to a carry-lookahead circuit in an adder. 
     Next, the IDCT calculation will be described. As shown in FIG. 2, the IDCT is attained by transposing the rows and columns of the DCT in the matrix representation. The difference therebetween resides in that the g(k) appearances are grouped according to odd and even values of k in DCT, but g(k) occurs for all values of k in the DCT. However, while g( 1 ), g( 3 ), g( 5 ) and g( 7 ) appear in the 0-th column, the same items with the opposite sign occur in the seventh column. In 0-th and seventh columns, g( 4 ), g( 2 ), g( 4 ), and g( 6 ) respectively appear with the same sign. Additionally, while g( 3 ), −g( 7 ), −g( 1 ), and −g( 5 ) occur in the first column, the same items with the opposite sign appear in the sixth column. In first and sixth columns, g( 4 ), g( 6 ), −g( 4 ), and −g( 2 ) respectively appear with the same sign. While g( 5 ), −g( 1 ), g( 7 ), and g( 3 ) occur in the second-column, the same items with the opposite sign appear in the fifth column. In second and fifth columns, g( 4 ), −g( 6 ), −g( 4 ), and g( 2 ) respectively appear with the same sign. In addition, while g( 7 ), −g( 5 ), g( 3 ), and −g( 1 ) occur in the third column, the same items with the opposite sign appear in the fourth column. In the third and fourth columns, g( 4 ), −g( 2 ), g( 4 ), and −g( 6 ) respectively appear with the same sign. In consequence, for the total sum of the grouped values of g(k) related to an odd number of k, by effecting addition of the values having opposite signs for the preceding and succeeding columns, the IDCT results can be attained for two columns at the same time. Adding the circuits  240  and  241  and selectors thereof and the selectors of input data items  110  to  117  to FIG. 5, the hardware of the DCT/IDCT circuit can be commonly used. 
     Arranging the DCT/IDCT block diagram of FIG. 5 described above for each row of FIG. 2 in a parallel fashion for each calculation, there is provided the configuration diagram of FIG. 1 showing the discrete cosine high-speed arithmetic unit of the present invention. In short, eight original/calculation data items are simultaneously inputted to the arithmetic unit. In an anterior adder section  10 , there are beforehand calculated the sums of and/or differences between the input data items (through the recoding process of cosine constant values) and the sums of and/or differences between the values obtained by multiplying the input data items by a fixed value (through the position shift operation of cosine constant values). Next, in the posterior adder section  20 , the resultant values from the anterior adder section  10  are shifted for the alignment to a predetermined digit position to be then inputted to the group of adders, thereby calculating partial products. Obtaining the total sum of the partial products, eight output (calculation/original) data items are simultaneously obtained. In the conventional multiplier-based system, there are required 12 multiplications (11×12=132 additions) and 29 additions. This requires 161 adders in total. Additionally, when one addition is denoted as one stage, there exist 14 stages of addition. According to the method of the present invention, there are required 116 (=29×4) adders in total and five stages of addition. In consequence, while decreasing the number of adders to about ⅔ of that of the conventional system, the processing speed can be advantageously increased to three times that of the conventional system. 
     The DCT/IDCT described above is related to one-dimensional calculations and is primarily adopted for the compression/decompression of voices. To apply the arithmetic unit to the compression/decompression of a two-dimensional image expressed with coordinates (x,y), the image is decomposed into two one-dimensional elements associated with x-directional and y-directional scans. Namely, the results of first one-dimensional elements related to the x-directional scan are provisionally stored in a random access memory (RAM). The rows and columns are transposed to be inputted to second one-dimensional elements related to the y-directional scan for the calculation. The obtained results are related to the two-dimensional image. In contrast to the conventional method described above, description will be given of a method of the present invention in which the calculation is directly achieved in the two-dimensional manner without decomposing the image in the one-dimensional elements. For simplicity of explanation, description will be given of the two-dimensional case of 4×4 points. This will be easily expanded to a case of 8×8 points. In the two-dimensional case, constant values of cos α·cos β are required to be calculated. If the fixed values respectively of cos and cos β are separately acquired for the calculation, multiplications will be required. However, in the case of 4×4 points, when the six combinations of the multiplied values are obtained in advance, the multiplications between the constants are unnecessary. Additionally, the storage operation of data in the RAM required in the conventional method in which the image is decomposed into two one-dimensional elements becomes unnecessary and hence the processing speed is increased. Assume f(i)=cos (πi/8). Then, the matrices of two-dimensional DCT and IDCT for 4×4 points are as shown in FIGS. 10 and 11. However, in this connection, the terms of coefficients which can be shifted are substantially unnecessary for the explanation and hence are not shown. Incidentally, matrix F t  indicates a transposed matrix of matrix F. 
     According to the expression of the two-dimensional DCT of FIG. 10, it can be seen from FIG. 12 that the values are attained up to the 16-th digit below the floating decimal point and the pairs of additions are attained as (f( 1 )f( 2 ),f( 2 )f( 3 )) and (f( 1 )f( 1 ),f( 3 )f( 3 )), and the single addition is as f( 1 )f( 3 ) and f( 2 )f( 2 ). As in the one-dimensional case, there are selected pairs of additions for the anterior addition and the results are subjected to a shift and input process according to the associated digit places so as to be added to each other at a time in the posterior addition  20 . FIG. 13 briefly shows the block diagram of the two-dimensional DCT for 4×4 points. In this situation, all data items are assumed to be calculated in a parallel manner. Therefore, 4×4=16 data items Xij are stored beforehand in buffer memories or registers. The calculation of x ij −x kl    60  is carried out by gates (for one digit position) of a circuit  600  without using any adder. The calculation of x ij +x kl    61  is performed by gates (for one digit position) of a circuit  610  without using any adder. However, such adders utilized thereafter as adders  50  and  51  are redundant binary adders of which a one-digit circuit is as shown in FIG.  7 . The additions in the group of adders are classified into three types  70  to  72  and there exist 16 blocks in total. Since the equation of the two-dimensional IDCT for 4×4 points is as shown in FIG. 11, the hardware of the DCT can be commonly used in a method similar to that applied to the one-dimensional case. According to the method of the present invention, since the two-dimensional item need not be decomposed into two one-dimensional elements, it is unnecessary to store the temporal data items in the transposing RAM, leading to an advantage that the calculation is executed without interruption and the processing speed is increased. However, the number of adders required is increased to about three times that used in the case in which the one-dimensional decomposing operation is effected. 
     FIG. 14 shows an example of a chip system  300  adopting the DCT/IDCT high-speed arithmetic unit of the present invention. An image is stored in a buffer memory section  320  such as a frame memory or a register in which a parallel access operation can be achieved. A DCT/IDCT section  310  simultaneously obtains all data items including 8×8=64 data items necessary for the operation and then outputs results of the operation to a quantizing section  330 . The data is then compressed by a variable-length encoding section  340  to be sent to a transmission route or stored on a storage media ( 350 ). Conversely, compressed data supplied from the transmission route or storage media to the system  300  is decompressed by a variable-length decoder section  340 . The data is then restored into the original calculation data by an inverse quantizing section  330  to be inversely transformed by IDCT  310  into the original image data. The image data is displayed as a picture via the buffer memory  320 . 
     Description will now be given of a 16-point discrete Hartley transform (DHT). Assuming input data and calculation data to be x k  and X n , the expression of the DHT is represented by equation (10). Moreover, the inverse equation is represented by equation (11).                  X   n     =       ∑     k   =   0     15                         x   k     ·   cas                       2      π                 nk     16                           where   ,             (   10   )                   x   k     =       1   16                    ∑       n   =   0     15                       x   n     ·   cas                       2      π                 nk     16                            (   11   )                 cas                 θ     =       cos                 θ     +     sin                 θ               (   12   )                         
     Since equations (10) and (11) are of the same form when the multiplication of {fraction (1/16)} (easily implemented by a shift operation) is ignored, only equation (10) will be described in the following paragraphs. Using the equation (13) shown below, equation (10) can be represented in matrix notation as shown in FIG.  16 . Moreover, the rows and columns of the matrix notation of FIG. 16 can be rearranged as shown in FIG.  17 . 
     
       
           p =cos(π/8)+sin(π/8)=cos(π/8)+cos(3π/8),  q =cos(5π/8)+sin(5π/8)=cos(3π/8)+cos(π/8)   (13)  
       
     
     Description will next be given of a method in which the amount of calculations of product sums is reduced in the DHT according to the principles of equations (4) to (9) described above. 
     In the calculation of a DHT, the values of p, q, and square root of two appear as multiplication terms in groups as shown in FIG.  17 . Furthermore, since these items are of the opposite signs and occur in two or more columns il, . . . , ij, the sums of and differences between xil, . . . , xij and wk=xil± . . . ±xij are calculated beforehand in a systematic fashion. 
     Additionally, in relation to a row in which, for example, X 1  is to be calculated, assuming 
     w 1 =x 0 −x 8 , w 2 =x 4 −x 12 , w 3 =x 2 −x 10 , w 4 =x 1 −x 9 , w 5 =x 3 −x 11 , w 6 =x 5 −x 13 , w 7 =x 7 −x 15 , and up=w 4 +w 5 , uq=w 6 −w 7 , the calculation of the total sum 
     
       
         w 1 +w 2 +w 3 ·{square root over ((2+L ))}+up·p+uq·q  
       
     
     is classified into three calculation groups of w 1 +w 2 , w 3 ·{square root over ((2+L ))}, and up·p+up·q. Calculation of w 1 +w 2  is accomplished by an adder  560 , w 3 ·{square root over ((2+L ))} is calculated by a multiplier  520 , and up·p+up·q is effected by a product sum unit  570 . 
     First, in the calculation of 
     
       
           up·p+uq·q=up· 1. 0100111001111011 +uq· 0. 1000101010001011  
       
     
     (rounded off at the 17-th digit below binary point), 2up+uq, uq−up, and uq+up are calculated in an anterior addition  555  and then a shift and input process is achieved for the results and digit places of occurrences of up and uq, thereby conducting posterior additions  552  to  554  for the resultant values at once as shown in FIGS. 18 and 19. In the calculation of W 3 ·{square root over ((2+L ))}=w 3 ·1.0110101000000101, w 3  is shifted to be supplied to the digit position of occurrence of 1 so as to calculate the result by the group of adders (multiplier  520 ). 
     First of all, the calculating circuit of each digit place of wk=xi−xj can be configured with simple gate circuits shown in FIG. 20 without using any adder circuit because the calculations are 0−0=0, 0−1=−1, 1−0=+1, and 1−1=0. 
     The calculation circuit of each digit place of wk=xi+xj can be configured only in consideration of wk=xi+xi=xi−(−xj). The value of −xi can be attained by {(inverse value of xj)+1} according to the representation of two&#39;s complement. The inverse value of xj is represented by drawing an overline over xj. Furthermore, since the additions in the second and subsequent stages are the redundant binary representation of {+1,0,−1}, a basic circuit  571  shown in FIG. 21 is adopted as the redundant binary adder circuit for each digit place. 
     Moreover, in the Hartley transform circuit, the operation of xy, a so-called butterfly operation, is often conducted. Therefore, the gate configuration is partially shared between the arithmetic circuits of x+y and x−y to resultantly obtain a butterfly arithmetic circuit  570 . The result of the total sum represented in the redundant binary representation is converted into a binary value. Since a redundant binary value can be decomposed into positive and negative binary values, the converter circuit can be easily constituted with subtracters. The subtracter may be provided with a borrow-look-back dedicated circuit which corresponds to a carry-lookahead circuit of an adder. 
     As a result of the description above, there is constructed a DHT arithmetic unit shown in FIG.  15 . Assuming that 16 data items x 0  to x 15  are inputted thereto in a parallel manner, a butterfly operation is performed for the data items by eight circuits  560 . Since the output therefrom is represented in redundant binary representation, the butterfly operations in the second and subsequent stages are accomplished entirely by the circuits  570 . According to the groups shown in FIG. 17, the operation is subdivided into a portion including X 0 , X 8 , X 4 , and X 12  in which the calculation is performed only by the group of butterfly arithmetic units, and a portion including X 2 , X 10 , X 6 , and X 14  in which the calculation is carried out by a circuit  520  additionally disposed to multiply the square root of two by an input value thereto, and a portion Xi (i is an odd number) in which the calculation is executed by a circuit  550  added to the system. 
     The flow of calculation steps is as shown in FIG. 15, which requires the following arithmetic units including  28  butterfly arithmetic units, four multipliers  520 , and four product sum units  550 . When the calculation above is conducted by the conventional multiplier-based system, 15 adders are used in the multiplier, since two adders are necessary in the butterfly arithmetic unit and 31 adders are required in the product sum unit  550 , it can be appreciated that 8×2+4×15+4×31=240 adders are required. In addition, when one addition is regarded as one stage, eight stages of addition are employed. In contrast therewith, according to the present invention, only 108 (=20×2+7×4+10×4) adders are necessary in total for each stage, and only six stages of addition are required. This consequently leads to an advantageous effect that while the number of adders is reduced to be equal to or less than half that of adders employed in the conventional system, the processing speed is increased to about 1.3 times that of the prior art. Since the number of multiplications is abruptly increased in a DHT for 32 points or more, the advantageous effect of the increased processing speed is much more enhanced. 
     Next, description will be given of a method in which the amount of calculations of partial product sum is decreased according to the principles of equations (4) to (9) already described above. Description will be given of the Hough transform in a case in which the angle θ is divided into 16 directions. Furthermore, only eight directions in the range of angle 0 to π/2 will be described. Since the minimization of the amount of calculations can be achieved by almost the same manner also for the remaining eight directions in the range of angle π/2 to π in which only the sign is partially changed, description thereof and a diagram related thereto will be omitted. 
     Prior to the realization of calculations of the Hough transform, consider first a formula of product sum represented by equation (14). 
     
       
           R=x·C   x   +Y·C   y    (14)  
       
     
     Assuming now                  c   x     =       ∑     i   =   0       m   -   1                         c     x   ,   i            2   i           ,                  c   y     =       ∑     i   =   0       m   -   1                         c     y   ,   i            2   i                   (   15   )                         
     the following equation results:              R   =         x   ·     c   x       +     y   ·     c   y         =       x   ·       ∑     i   =   0       m   -   1                         c     x   ,   i            2   i           +     y   ·       ∑     i   =   0       m   -   1                         c     y   ,   i            2   i                       (   16   )                         
     In the equations above, however, there is assumed a condition of cx, i, cy, iε{−1,0,+1}. If there exists a pair of coefficients of cx, i and cy, p for which cx, i=|cy,p|=1, equation (17) results: 
     
       
         ( x·cx,i+y·cy,p· 2 [−i )2 i=x±y· 2 p−i )2 i    (17)  
       
     
     For the product sum of x·cx+y·cy, if there exist a plurality of pairs of coefficients which satisfy equation (17), the sums of and differences between x and y·2n (n=shifted by (p−i) digit places) are calculated according to the principle designated by equation (17) and then the resultant values are shifted respectively to the digit positions to satisfy the condition above so as to be added to each other, thereby decreasing the number of calculations of partial product sums. 
     In addition, appropriately employing the relationship of equation (18) called a canonical recoding in which i non-zero coefficients can be reduced to two non-zero coefficients, there are conducted shift operations to thereby increase the pairs of coefficients satisfying equation (17) as follows: 
     
       
         2 i −2 0 =2 i−1 +2 i−2 + . . . +2 0    (18)  
       
     
     FIG. 24 shows the recoded results of eight cos values (rounded off at the 17-th digit below binary point). Moreover, according to the relationship between the equation of the Hough transform and equation (17), the common pairs of x and y for the addition and subtraction can be arranged as enclosed in a rectangle in FIG.  24 . 
     In a case of, for example, θ=3π/16, since R x cos(3π/16)+y cos(5π/16), the calculation can be conducted in groups of x+y for the first, fourth, and 14-th digit places below binary point, x−2y for the eighth and 11-th digit places below binary point, and x+2y for the 16-th digit place below binary point in the anterior addition. In addition, these anterior addition groups can also be commonly adopted for other values of θ. In the conventional method based on multipliers, the values of cos(3π/16) and cos(5π/16) stored in a table are read therefrom to be respectively multiplied by x and y. Consequently, the common anterior addition steps above have been impossible. 
     Values of R to be discretized are generated by an R decoder. Moreover, the R decoder is directly connected to a voting counter such that the value of the counter associated with votes is decoded and an operation of +1 is carried out. The R decoder and voting counter are arranged for each θ. 
     As a result of the description above, there is configured the Hough transform circuit shown in FIG.  22 . Assume that coordinate data (x,y) of an arbitrary pixel is inputted thereto. The data is subjected to additions and subtractions in the circuit  560 . Since the outputs therefrom are represented in redundant binary representation, the operations in the second and subsequent stages are accomplished entirely by a circuit  571 . 
     In the multiplier-based system of the prior art, since 15 adders are necessary for one multiplier (in a 16-bit processing system), there are required 8×(2×15+1)=248 adders. Additionally, when one addition is regarded as one stage, five stages of addition are used (under a condition that eight multipliers are adopted in parallel). According to the present invention, there are required in total only 24 adders including the circuit  571  (the adders of the circuit  560  are simple gates and are not included). Moreover, only four stages of addition need to be employed. Therefore, paying attention only to the Hough transform calculating section, there is attained an advantage that while reducing the number of adders to {fraction (1/10)} or less as compared with the conventional system, the processing speed is increased to about 1.25 times that of the prior art. Furthermore, in accordance with the present invention, since the read operation of the coefficient table is unnecessary and the update of the voting counter is executed without interruption, it can be expected that the processing speed is actually increased to at least ten times that of the conventional system. In addition, since only one multiplier is adopted and/or adders with carry propagation are utilized in many usual cases, the processing speed can be expectedly increased to at least 1000 times that of the ordinary conventional cases. 
     As an application example of the present invention, there can be considered, for example, an application in which such items primarily including straight line components as Chinese characters are to be recognized. Moreover, in a case in which when the directions are fixed to about 16 directions, there can be possibly adopted a utilization mode in which the straight line components are first detected through a coarse detection step to be then sieved for a fine detection. The sieved pixels can be further processed for a precise determination of the direction such that the operation efficiently proceeds to the subsequent work processes. For the fine determination of direction, the system conducts calculation of equation (19) according to the addition theorem of trigonometric functions,                                       R   =         x                 cos                 θ     +     y                 sin                 θ       =       x                 cos                   (     α   +   β     )       +     y                 cos                   (     α   +   β     )                       =       x        (       cos                 α                 cos                 β     +     sin                 αsin                 β       )       +     y        (       sin                 α                 cos                 β     +     cos                 α                 sin                 β       )                     =         (       x                 cos                 α     +     y                 sin                 α       )                   cos                 β     +       (       x                 sin                 α     +     y                 cos                 α       )                   sin                 β                             (   19   )                         
     where, α is an angle with the precision of 16 divisions and β indicates an angle with a finer division. Consequently, the calculation of equation (19) is precisely achieved using multipliers in a method similar to the conventional method. Assume X=(x cos α+y sin α) and Y=(x sin α+y cos α). It can be appreciated that these values can be immediately calculated by the hardware of the present invention. 
     The present invention is not limited to the discrete cosine transform and Hartley transform, but can be expanded generally to trigonometric functions. Therefore, the present invention is applicable also to the discrete Fourier transform and its associated operations (such as Wavelet transform). In addition, the present invention can be applied not only to general transforms using trigonometric functions, such as Hough transforms, but also to Radon transforms which are obtained by generalizing Hough transforms. Moreover, the trigonometric functions can be expanded to general periodic functions. Additionally, the application range can be expanded to a case in which either one of the operations is a product sum operation of constants. Dimensions can be increased from two dimensions to three or more dimensions, and the discretization points can be increased to more than eight. The shift operation of the present invention is fixed as a predetermined operation. When the system to conduct the shift operation is configured with shifters, there is obtained a variable construction and hence the application range is expanded. Although a large number of adders are employed, the basic circuit of an arbitrary one digit place has a regular repetitive structure and hence the design scale can be easily increased. 
     INDUSTRIAL APPLICABILITY 
     According to the present invention, there is attained an advantage that the number of gate stages is considerably reduced and the calculation speed is increased in the DCT/IDCT, Hartley transform, and Hough transform. Moreover, since the DCT/IDCT hardware is almost all commonly used, when the basic element is repeatedly used to hold (processing speed)×(area)=(constant) for the high-speed calculation, it is possible to minimize the chip area.