The present invention relates to arithmetic operations in microprocessors, both load-store architectures (i.e., RISC machines) and memory-oriented architectures (i.e., CISC machines). Specifically, the present invention relates to arithmetic operations used in motion-estimation algorithms and other applications using a sum-of-differences (SAD) operation.
Video images have become an increasingly important part of communications in general. An ability to nearly instantaneously transmit still images, and particularly, live moving images, has greatly enhanced global communications.
In particular, videoconferencing systems have become an increasingly important business communication tool. These systems facilitate meetings between persons or groups of persons situated remotely from each other, thus eliminating or substantially reducing the need for expensive and time-consuming business travel. Since videoconference participants are able to see facial expressions and gestures of remote participants, richer and more natural communication is engendered. In addition, videoconferencing allows sharing of visual information, such as photographs, charts, and figures, and may be integrated with personal computer applications to produce sophisticated multimedia presentations.
To provide cost-effective video communication, bandwidth required to convey video must be limited. A typical bandwidth used for videoconferencing lies in the range of 128 to 1920 kilobits per second (Kbps). Problems associated with available videoconferencing systems in an attempt to cope with bandwidth limitations include slow frame rates resulting in a non-lifelike picture having an erratic, jerky motion, the use of small video frames or limited spatial resolution of a transmitted video frame, and a reduction in the signal-to-noise ratio of individual video frames. Conventionally, if one or more of these effects is undesirable, then higher bandwidths are required.
At 768 Kbps, digital videoconferencing, using state-of-the-art video encoding methods, produces a picture that may be likened to a scene from analog television. Typically, for most viewers, twenty-four frames per second (fps) are required to make video frames look fluid and give the impression that motion is continuous. As the frame rate is reduced below twenty-four fps, an erratic motion results. In addition, there is always a tradeoff between a video frame size required and available network capacity. Therefore, lower bandwidth requires a lower frame rate and/or reduced video frame size.
A standard video format used in videoconferencing, defined by resolution, is Common Intermediate Format (CIF). The primary CIF format is also known as Full CIF or FCIF. The International Telecommunications Union (ITU), based in Geneva, Switzerland (www.itu.ch), has established this communications standard. Additional standards with resolutions higher and lower than CIF have also been established. Resolution and bit rate requirements for various formats are shown in Table 1. Bit rates (in megabits per second, Mbps) shown are for uncompressed color frames where 12 bits per pixel is assumed.
Video compression is a way of encoding digital video to take up less storage space and reduce required transmission bandwidth. Certain compression/decompression (CODEC) schemes are frequently used to compress video frames to reduce the required transmission bit rates. Overall, CODEC hardware or software compresses digital video into a smaller binary format than required by the original (i.e., uncompressed) digital video format. As can be noted from Table 1, there is an extraordinarily large number of bits (e.g., nearly 584 million bits each second in a 16CIF format), and consequently, a tremendous amount of processing of the bits that must occur for effective video processing and motion estimation. Consequently, an ever-increasing application for microprocessors is CODEC processing.
Motion estimation algorithms are a significant part of the CODEC processing. A sum-of-absolute-differences (SAD) operation is frequently the cornerstone of most motion estimation algorithms. Based on the amount of processing required for every frame in a video image, the SAD operation is extremely computationally intensive. Therefore, the operation must be performed as quickly and efficiently as possible.
A governing equation of the SAD operation:
where U and V are image frames and x and y are 2-dimensional spatial coordinates. Despite its apparent innocuous and simple form, the SAD governing equation in its current formulation, when coupled with the tremendously high number of bits requiring processing, is extremely computationally intensive and thus places a limit on a temporal speed of motion estimation algorithms. Adding additional hardware (e.g., multiple processors, additional memory, additional registers) increases a speed of the computation but at a sacrifice of geometrical space considerations and cost-to-implement.
Therefore, although the SAD operation and other compression methods have proven somewhat effective, there remains a need to improve video quality over low bandwidth transmission channels while not significantly increasing space for hardware performing the calculations or a cost of the implementing hardware.
The present invention implements an adaptation of the SAD governing equation in microprocessors by modifying hardware already present in all microprocessors. The adaptation yields a reduction of over 30% for a current SAD calculation by reducing required calculations in a normally time-intensive inner iteration loop.
In one exemplary embodiment, the present invention is a system for calculating sum-of-absolute-differences which includes a first and second operand register, each storing respectively a first and second set of binary data as 2's complement, an arithmetic logic unit, and a destination register.
The arithmetic logic unit has an add/subtract enable input to receive a most significant bit (MSB) of the second set of binary data. The MSB represents a sign of the second set of binary data. The arithmetic logic unit receives the first and second sets of binary data and adds the data sets if the MSB is a “0” and subtracts the second data set from the first data set if the MSB is a “1.” The add/subtract enable input has the effect of taking the absolute value of the second data set without having to first perform an absolute value determination, thus eliminating processing steps.
An embodiment of the present invention implements an adaptation of the SAD governing equation by modifying hardware already present in all microprocessors. The governing equation of the SAD operation
is conventionally implemented (in pseudocode) as
To increase computational speed, SAD operations can be implemented directly as a result of an operation of summing data registers; thus, SAD(U,V) may be implemented as
Result=Operand x+|Operand y| (2)
The operation defined by equation (2) and referred to as “Add Absolute Value” (ADDABS), will, when implemented by a suitable instruction, increase the SAD calculation speed compared with the conventional implementation of operation (1), supra. Equation (2) can be rewritten as
For 2's complements numbers, the sign of a binary number is given by the most significant bit (MSB) of the number. Thus, the “if” statement of the pseudocode of operation of (3) can be written as
Implementing the “if” statement (4) into operation (1) and applying the ADDABS operation (2) yields
This substitution yields a reduction from three operations currently used (operation (1)) down to two operations (operation (5)) in the normally time-intensive inner iteration loop.
In a specific exemplary embodiment, the ADDABS operation adds a location of the x-operand register 101 to a location of the y-operand register 103 and stores the result on the destination register 107. Thus, the operation is reduced to
Rd←Rx+|Ry| (6)
where Rx is the contents of the x-operand register 101, Ry is the contents of the y-operand register 103, and Rd are the data stored in the destination register 107. For a 16-bit word, operands for each register in equation (6) are {x,y,d}ε{0,1, . . . ,15}. In this specific exemplary embodiment, syntax of operations for equation (6) is ADDABS Rd, Rx, Ry.
In a specific exemplary embodiment of
An input to the multiplexer 201, “addsub_ctrl,” determines whether an addition or subtraction should be performed. This input becomes valid if “addsub_ctrl” is set to “1.” Providing a “1” input to “addsub_ctrl” forces a subtraction operation, while a “0” forces an addition operation.
For example, if “addabs_ctrl” is set to “0,” the MSB of operand y determines whether an addition or subtraction is performed. If the MSB of operand y is “1,” x-y is performed. If the MSB of operand y is “0,” x+y is performed.
Although the exemplary embodiments are described in terms of a video CODEC system, a skilled artisan will recognize the value of increasing a calculation speed of SAD operations in other areas as well. For example, calculation of spatial statistics frequently employ sum-of-absolute-difference calculations; specifically, autocorrelation functions and power spectral density functions (e.g., as employed in communication theory) can benefit from the increased computational speed of the present invention described herein.
Further, one skilled in the art will recognize that other hardware implementations may readily be employed as well. For example, other hardware implementations could include ripple-carry adders or carry-lookahead adders in place of the arithmetic logic unit. Such combinatorial circuits are well known in the art and may be readily combined to accomplish the SAD operations described herein. Additionally, a skilled artisan will recognize that the present invention will work readily with other word sizes, such as, for example, 32-bit words. Therefore, the specification and drawings are to be regarded in an illustrative rather than a restrictive sense.
Number | Name | Date | Kind |
---|---|---|---|
4422143 | Guttag | Dec 1983 | A |
4648059 | Gregorcyk | Mar 1987 | A |
4761759 | Nakagawa | Aug 1988 | A |
4814976 | Hansen et al. | Mar 1989 | A |
4849921 | Yasumoto et al. | Jul 1989 | A |
4953115 | Kanoh | Aug 1990 | A |
5148386 | Hori | Sep 1992 | A |
5305249 | Yoshida | Apr 1994 | A |
5379351 | Fandrianto et al. | Jan 1995 | A |
5485411 | Guttag et al. | Jan 1996 | A |
5563813 | Chen et al. | Oct 1996 | A |
5610850 | Uratani et al. | Mar 1997 | A |
5793655 | Harlap et al. | Aug 1998 | A |
5835389 | Wong | Nov 1998 | A |
5944771 | Shiraishi | Aug 1999 | A |
5957996 | Shiraishi | Sep 1999 | A |
6219688 | Guttag et al. | Apr 2001 | B1 |
6421698 | Hong | Jul 2002 | B1 |
6473529 | Lin | Oct 2002 | B1 |
6556716 | Hong | Apr 2003 | B2 |
20010046264 | Fandrianto et al. | Nov 2001 | A1 |
20050027969 | Simon et al. | Feb 2005 | A1 |
Number | Date | Country |
---|---|---|
WO-2006013023 | Dec 2006 | WO |
WO-2006130323 | Dec 2006 | WO |
Number | Date | Country | |
---|---|---|---|
20060285593 A1 | Dec 2006 | US |