The field of invention relates to motion estimation; and, more specifically, to a motion estimation Sum of All Differences (SAD) logic circuit having reduced semiconductor die area consumption.
Digital video is typically embodied as a collection of digital still frames that convey motion when displayed in succession. Because visual information (such as digital video) naturally consumes large amounts of data, data compression is often applied to reduce the amount of data without substantially degrading the original imagery. Motion estimation is a compression technique that is most often applied to digital video.
According to the motion estimation approach, a first frame is broken down into small pieces (referred to as “macro blocks”); then, each macro block is searched for in a data field (referred to as a “search window”) of a second frame that follows or precedes the first frame (in the sequence of frames that the video information is comprised of). The macro block being searched for may be referred to as a “reference macro block” or a “reference block”. For each found reference macro block (ideally all reference macro blocks are found in the second frame), a displacement vector is recorded that describes the movement of the reference macro block. Thus, compression is achieved by preserving displacement vectors instead of actual visual content.
It is important to point out that other scenarios are possible as between which frame is the “first” frame having the reference block and which frame is the “second” frame having the search window. For example, alternatively, the second frame may be a subsequent frame relative to the first frame (rather than a previous frame as described just above with respect to
Note that other reference macro blocks would be defined in current frame 103. Notably, the sequence of the previous and current frames 101, 103 portray the automobile moving a distance K to the right. According to basic motion estimation, a field of data 104 larger than a macro block is taken from the previous frame 101 and used as a search window for finding the reference macro block 102b of the current frame 103. The search window 104 may be centered around the center position of the current frame's reference macro block 102b (i.e., the search window 104 is centered at a horizontal offset of K from the frame origin in the example of
The present invention is illustrated by way of example, and not limitation, in the figures of the accompanying drawings in which like references indicate similar elements and in which:
a shows an exemplary depiction of an AD unit having improved power and surface area consumption and its corresponding macro block data and search window data;
b relates to the different resolutions between a SAD calculation process that processes all bits per data value and an SAD calculation process that processes less than all bits per data value;
a shows an exemplary depiction of another AD unit embodiment having improved power and semiconductor die area consumption and its corresponding macro block data and search window data;
b relates to the different resolutions between a SAD calculation process that processes all bits per data value and a SAD calculation process that can be performed with the circuitry depicted in
c shows a methodology for determining which M bits to use for SAD calculation purposes when video data values are naturally expressed as N values;
In order to “find” a macro block in a search window, a Sum of Absolute Differences (SAD) approach is often used.
That is, basic operational flow involves calculating and summing over absolute differences for each pair of corresponding data values between the first frame's reference macro block data 202 and a specific macro block worth of data within the search window data 203. Once the sum of the absolute differences for the specific macro block worth of data is determined, the basic operational flow is repeated for a next specific macro block worth of data within the search window data 203. When a sum of absolute differences has been determined for all macro blocks worth of data that can be identified within the search window data 203, the macro block worth of data having the lowest sum of absolute differences is deemed the “found” macro block within the search window.
For example,
The depiction of
For the same macro block A 305, SAD unit (X-1)(Y-1) is designed to calculate the absolute difference between: 1) a data value 304 that is held within a register 302; and 2) a corresponding data value 307 to data value 304 within macro block A 305. Likewise, for macro block B 306, AD unit 33 is designed to calculate the absolute difference between data value 311 and data value 313; and, AD unit (X-1)(Y-1) is designed to calculate the absolute difference between data value 304 and data value 308.
The absolute differences for all the data values are added to together by an adder 315 to form a SAD value for the particular macro block within the search window being analyzed (e.g., macro block_A or macro block_B). The computed SAD value is then compared by comparator 316 against the lowest SAD value obtained so far within the search window (which is stored in register 317). When the search window has been completely analyzed, the macro block within the search window having the lowest SAD value is recognized as the “found” reference block within the search window. A motion vector is then calculated. With each new reference macro block loaded into register 302, a new field of search window data is loaded into RAM 303.
A problem, however, is that large arrays of AD units consume large amounts of semiconductor die area and electrical power.
In order to address the power and semiconductor die area consumption issues, it is helpful to recognize that a SAD calculation acts to compare likeness between two fields of data (e.g., current frame's macro block and previous frame's search window macro blocks); while, the specific fields of data themselves contain data points that express different intensity values. As such, efficiency can be realized by recognizing that the number of bits needed per data value (e.g., per pixel) to allow a range of intensity values for images of sufficient contrast (e.g., typically 8 bits per pixel) is greater than the number of bits needed per data value to confirm or deny sameness between fields of data.
Simply put, the resolution of the data (in terms of the number of bits per data value) does not need to be as high for SAD calculations as it does for image rendering. An AD unit within an AD array can therefore be designed to process less than the full number of bits per data value than what is provided by the frames themselves; and, as a consequence, conserve power and semiconductor die consumption.
a shows an example. Note that
a suggests that the reduction in bit width from N to M bits is accomplished by reading a full N wide data value from both the reference macro block 402 (e.g., from register 302 in
With the understanding that efficiency is gained through SAD calculations involving less bits per data value than the image data itself, the question arises as to which bits should be ignored and which bits should be selected for purposes of performing SAD calculations. The following discussion outlines various approaches including: 1) ignoring only lowest ordered bits in succession; 2) ignoring the highest ordered bit and one or more successive lower ordered bits; and, 3) custom calculating which bits are to be ignored based upon the data itself. Each of these are discussed immediately below.
Ignoring Only the Lowest Ordered Bits in Succession
Ignoring the lowest order bits has the biggest impact on resolution but the smallest impact on dynamic range.
b attempts to graphically depict the comparison outlined above (albeit qualitatively and not to scale). The leftmost depiction 420 provides a qualitative feel for the dynamic rage and resolution at which macro block data values can be expressed when all of the bits per data value from a video frame are employed (e.g., all 8 bits as discussed in the example above). The rightmost depiction 421 provides a qualitative feel for the dynamic rage and resolution at which the same macro block data values can be expressed when a set of successive lower ordered bits per data value from a video frame are dropped (e.g., the three lowest bits are dropped as discussed in the example above).
Here, note that the data profile observed in depictions 420, 421 of
Clearly the leftmost depiction 420 has higher resolution than the rightmost depiction 421. For example, referring to the set of data points 422, note that the data points are expressed with a different numeric value in the leftmost depiction 420 (because each data point is binned between a different pair of horizontal lines); while, for the rightmost depiction 421 these same data points must be expressed with the same data value (because they are each binned between the same pair of horizontal lines). The loss in dynamic range is depicted as a hashed region 423 where values cannot be expressed. Here, any value that under full resolution would fall in the blacklisted region 423 would be given a “clipped” maximum value at the highest space between neighboring lines.
With an understanding of the loss in dynamic range and resolution that occurs when lower ordered bits are dropped, depictions 420 and 421 help to emphasize the point that full resolution (e.g., as qualitatively observed in the leftmost depiction 420) is not necessary to identify matching patterns or at least patterns having a high degree of sameness. That is, for many practical situations, the resolution observed in depiction 421 is “good enough” to identify matching patterns. A pair of identical or nearly-identical macro block patterns as observed in depiction 421 (and expressed with the resolution and dynamic range observed in depiction 421) should correctly produce a very small SAD value (so as to mark sameness or near sameness between the pair of patterns) because the unique features of the entire pattern as a whole is weighed into the SAD calculation (e.g., the smaller left peak, the large right peak, etc.).
Ignoring the Highest Ordered Bit and One or More Successive Lower Ordered Bits
Ignoring the highest ordered bit has a significant impact on dynamic range but allows for better resolution. As an example, consider again frame data implemented as 8 bits per data value (i.e., N=8) where 3 three bits are to be ignored (i.e., M=5) including the highest ordered bit and the two lowest ordered bits (i.e., a mask of the original 8 bit value can be represented as X— — — — — XX, where X is an ignored bit and _ is a non ignored bit). According to the numerics of such an approach, the dynamic range is more than cut in half on a linear scale; but, the resolution is better than that observed in depiction 421 of
Comparing the rightmost depiction 521 of
In order to treat data that is for the most part stuffed into a higher half of the full dynamic range (as observed in
According to one embodiment of that the architecture of
Custom Calculating which Bits are to be Ignored Based Upon the Data Itself
In another (more sophisticated) embodiment to which the architecture of
Thus generally, as depicted in
log2|2M/MaxValue|
where MaxValue is the maximum value observed in the reference block worth of data. For example, if M=8, N=5 and MaxValue=128, then the number of most significant bits that can be masked out is log2|2M/MaxValue|=log2|256/128|=log2|2|=1 and the two least significant bits are masked out (i.e., X— — — — — XX). As another example, if M=8, N=5 and MaxValue=64, then the number of most significant bits that can be masked out is log2|2M/MaxValue|=log2|256/64|=log2|4|=2 and the least significant bit is masked out (i.e., XX— — — — — X).
In the foregoing specification, the invention has been described with reference to specific exemplary embodiments thereof. It will, however, be evident that various modifications and changes may be made thereto without departing from the broader spirit and scope of the invention as set forth in the appended claims. The specification and drawings are, accordingly, to be regarded in an illustrative rather than a restrictive sense.
Number | Name | Date | Kind |
---|---|---|---|
5506747 | Bain | Apr 1996 | A |
6421466 | Lin | Jul 2002 | B1 |
6888943 | Lam et al. | May 2005 | B1 |
20040098548 | Hansen et al. | May 2004 | A1 |
20040120197 | Kondo et al. | Jun 2004 | A1 |
Number | Date | Country |
---|---|---|
WO 03024117 | Mar 2003 | WO |
Number | Date | Country | |
---|---|---|---|
20050147168 A1 | Jul 2005 | US |