Abstract:
A motion estimation method for an adaptive dynamic search range is provided to solve the problems of reading a large quantity of reference frame data for a search and having an insufficient bandwidth of the dynamic random access memory. The invention uses a component of a motion estimation vector of a predictor and the position of its present macroblock data to determine a predicted position, and the estimation method for an adaptive dynamic search range is carried out to determine the search range, and a uniform distribution quantified hierarchical method is used to reduce the power consumption and area. Therefore, the invention can effectively lower the bandwidth of the dynamic random access memory (compared with the algorithm of a fixed search range) and reduce the overall power consumption and effectively maintain the original compression quality.

Description:
BACKGROUND OF THE INVENTION  
       [0001]     1. Field of the Invention  
         [0002]     The present invention relates to a motion estimation method for an adaptive dynamic search range, more particularly to a motion estimation method for an adaptive dynamic search range that uses components of a motion estimation vector of a predictor and corresponding positions of macroblock data to determine a predicted position and further carries out the motion estimation method for an adaptive dynamic search range.  
         [0003]     2. Description of Related Art  
         [0004]     Video sequence consists of a series of frames, and motion estimation is a method of finding a motion in each region between two adjacent frames of video data. Motion estimation is a very important technology to video compression standards. With reasonable assumptions, the video sequences of two adjacent frames are similar to each other. The motion estimation can find and eliminate similar portions, and the remaining different portions are compressed by transcoding and run length encoding to effectively achieve a high compression ratio.  
         [0005]     As to prior arts, R.O.C. Patent Publication No. 535440 entitled “Motion estimation method for video coding” discloses an estimation method for video coding by using a predicted point of a motion vector. The row of a predicted point of a motion vector is set as Row p, and two consecutive rows prior to and next to Row p are set to Row p+1 and Row p−1 respectively. The differences among all corresponding points located at Row p, Row p+1 and Row p−1 are computed, and a minimum deviation is obtained by comparing the difference. The minimum deviation is examined to determine whether its value falls into Row p, Row p+1 or Row p−1 so as to obtain the motion vector.  
         [0006]     Further, R.O.C. Patent Publication No. 550952 entitled “Method for detecting a video change in compressed video data” discloses a method for detecting a change of the images in a compressed video data. Firstly, the time code recorded in the compressed video data corresponding to two consecutive video frames in user data area is read, and then the time interval of the two time codes are compared to determine whether the time interval is larger than a standard time interval. If the time interval is larger than the standard time interval, then it is determined that there is a change of the images between the two consecutive video frames.  
         [0007]     In the MPEG compression specification, a maximum range for integral points of a motion estimation vector is defined, which is known as an image scaling information (F_CODE), which restricts the integral values of the motion estimation vector so obtained must fall within this range. In general, the image scaling information is set with a large value to make sure that the relative positions for two consecutive pictures with motions can be found precisely, and thus increasing its compression ratio. However, such setup reads a great deal of data of the reference frames when a data is searched, and thus causing insufficient bandwidth for the dynamic random access memory.  
       SUMMARY OF THE INVENTION  
       [0008]     In view of the foregoing shortcomings of the prior arts that a large quantity of reference frame data is read for searching a data and an sufficient bandwidth for the dynamic random access memory is resulted, the inventor of the present invention conducted extensive researches and put theories into practices, and finally invented a motion estimation method for an adaptive dynamic search range.  
         [0009]     Therefore, it is a primary objective of the present invention to provide a motion estimation method for an adaptive dynamic search range by using components of a motion estimation vector of a predictor and corresponding positions of macroblock data to determine the length and width of the search range.  
         [0010]     To achieve the foregoing objective, the motion estimation method for an adaptive dynamic search range in accordance with the present invention comprises the steps of: installing a direction predictor of a macroblock data; determining whether or not the direction predictor is the smallest total absolute deviation and the smallest total absolute deviation is smaller than a critical value; and determining whether or not a direction component of a motion estimation vector of a macroblock data is smaller than a critical value of a motion estimation vector; thereby the prediction direction and the search range of the macroblock data can be determined. 
     
    
     BRIEF DESCRIPTION OF THE DRAWINGS  
       [0011]      FIG. 1  is a flow chart of a motion estimation method for an adaptive dynamic search range in accordance with the present invention;  
         [0012]      FIGS. 2A and 2B  are detailed flow charts of a motion estimation method for an adaptive dynamic search range in accordance with the present invention; and  
         [0013]      FIG. 3  is a flow chart of a computing method for a total absolute deviation in accordance with the present invention. 
     
    
     DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS  
       [0014]     To make it easier for our examiner to understand the technology, method and objective to achieve the objectives of the invention, the following detailed description of a preferred embodiment together with the attached drawings are given, such that the objective, features and advantages of present invention will become apparent. However, the invention is not intended to be limited by the drawings which are provided for reference and the sake of clarity only.  
         [0015]     In the technical specification of the prior art MPEG compression, a large quantity of reference frame data is read during a search and the problem of having insufficient bandwidth for the dynamic random access memory occurs. Therefore, the present invention provides a motion estimation method for an adaptive dynamic search range, and the method comprises the steps of producing a full search range according to the image scaling information and the current position of a macroblock data such that a finally obtained motion estimation vector must fall into this range; using a predictor to estimate a required partial search range, wherein the partial search range can be adjusted into the full search range automatically, and the range can only be equal to or smaller than the full search range. The partial search range has a larger flexibility and thus the present invention provides a motion estimation method for an adaptive dynamic search range, such that the partial search range varies according to the similarly and the motion vector of the predictor to effectively lower the using bandwidth of the dynamic random access memory (compared with the algorithm for a fixed search range) and effectively maintains its original compression quality.  
         [0016]     Referring to  FIG. 1 , a flow chart of a motion estimation method for an adaptive dynamic search range in accordance with the present invention is illustrated. The method comprises the steps: (S 100 ) installing a direction predictor of a macroblock data; (S 102 ) finding out a direction predictor with the smallest total absolute deviation; (S 104 ) determining whether or not the total absolute deviation of the direction predictor is smaller than a critical value; (S 106 ) determining whether or not a direction component of a motion estimation vector of the macroblock data is smaller than a critical value of the motion estimation vector, if the determination result obtained from (S 104 ) is affirmative; (S 108 ) obtaining a direction component search range of the direction component, if the determination result obtained from (S 106 ) is affirmative; and (S 110 ) calculating a total absolute deviation of the obtained direction component search range; (S 112 ) examining another set of direction component search range of the macroblock data, if the determination result obtained from (S 106 ) is negative; (S 114 ) obtaining a total absolute deviation larger than a critical value and determining whether or not a direction component of a motion estimation vector of the total absolute deviation is smaller than a critical value of the motion estimation vector, if the determination result obtained from (Step  104 ) is negative; (S 116 ) examining a direction component search range of the macroblock data, if the determination result obtained from (S 114 ) is affirmative; and (S 118 ) examining another set of direction component search range, if the determination result obtained from (S 114 ) is negative.  
         [0017]     Referring to  FIGS. 2A and 2B , detailed flow charts of a motion estimation method for an adaptive dynamic search range in accordance with the present invention are illustrated. The method further comprises the steps of: (S 200 ) installing a direction predictor of a macroblock data, and the direction predictor includes the position of the macroblock data and its left, top and right positions of the macroblock data; (S 202 ) finding out the smallest total absolute deviation from the position of the macroblock data and its left, top and right positions of the macroblock data; (S 204 ) determining whether or not the smallest total absolute deviation is smaller than a critical value; (S 210 ) determining the direction predictor as one with a total absolute deviation larger than a critical value, if the determination result obtained from (S 204 ) is negative, and indicating that the direction predictor and the reference frame have a low similarity with each other; (S 212 ) obtaining a middle horizontal search range and a middle vertical search range of the motion estimation vector of the macroblock data, if the direction predictor is a direction component of the macroblock data; (S 214 ) determining whether or not the direction component of a motion estimation vector of the macroblock data on the left is smaller than a critical value of a motion estimation vector, if the direction predictor is a macroblock data on the left, and by that time the direction component of the motion estimation vector of the macroblock data on the left is determined as a horizontal component; (S 216 ) obtaining a middle horizontal search range and a middle vertical search range of the motion estimation vector of the macroblock data on the left, if the determination result obtained from (S 214 ) is affirmative; (S 218 ) obtaining a large horizontal search range and a large vertical search range of the motion estimation vector of the macroblock data on the left, if the determination result obtained from (S 214 ) is negative; (S 220 ) determining whether or not a direction component of a motion estimation vector at the top of the macroblock data is smaller than a critical value of the motion estimation vector, if the direction predictor is a macroblock data at the top, and by that time the direction component is a vertical component; (S 222 ) obtaining a middle horizontal search range and a middle vertical search range of the motion estimation vector of the macroblock data at the top, if the determination result obtained from (S 220 ) is affirmative; (S 224 ) obtaining a middle horizontal search range and a large vertical search range of the motion estimation vector of the macroblock data at the top, if the determination result obtained from (S 220 ) is negative; (S 226 ) determining whether or not a direction component of a motion estimation vector of a macroblock data at the upper right is smaller than a critical value of the motion estimation vector, if the direction predictor is a macroblock data at the upper right, wherein the direction component is a horizontal component or a vertical component; (S 228 ) obtaining a middle horizontal search range and a middle vertical search range of the motion estimation vector of the macroblock data at the upper right, if the determination result from (S 226 ) is affirmative and the direction component is the horizontal component or the vertical component; (S 230 ) obtaining a large horizontal search range and a large vertical search range of the motion estimation vector of the macroblock data at the upper right, if the determination result from (S 226 ) is negative and the direction component is the horizontal component or the vertical component; (S 232 ) concluding that the direction predictor and the reference frame have a high similarity with each other, if the determination result of (S 204 ) is affirmative; (S 232 ) concluding that the direction predictor has a total absolute deviation smaller than a critical value; (S 234 ) obtaining a small horizontal search range and a small vertical search range of the motion estimation vector of the macroblock data, if the direction predictor is a direction component of the macroblock data; (S 236 ) determining whether or not a direction component of a motion estimation vector of a macroblock data on the left is smaller than a critical value of the motion estimation vector, if the direction predictor is a macroblock data on the left, wherein the direction component is a horizontal component; (S 238 ) obtaining a small horizontal search range and a middle vertical search range of the motion estimation vector of the macroblock data on the left, if the determination result obtained from (S 236 ) is affirmative; (S 240 ) obtaining a middle horizontal search range and a middle vertical search range of the motion estimation vector of the macroblock data on the left, if the determination result obtained from (S 236 ) is negative; (S 242 ) determining whether or not a direction component of a motion estimation vector of a macroblock data at the top is smaller than a critical value of the motion estimation vector, if the direction predictor is a macroblock data at the top, wherein the direction component is a vertical component; (S 244 ) obtaining a middle horizontal search range and a small vertical search range of the motion estimation vector of the macroblock data at top, if the determination result obtained from (S 242 ) is affirmative; (S 246 ) obtaining a middle horizontal search range and a middle vertical search range of the motion estimation vector of the macroblock data at top, if the determination result obtained from (S 242 ) is negative; (S 248 ) determining whether or not a direction component of a motion estimation vector of a macroblock data on the upper right is smaller than a critical value of the motion estimation vector, if the direction predictor is a macroblock data on the upper right, wherein the direction component is a horizontal component or a vertical component; (S 250 ) obtaining a small horizontal search range and a small vertical search range of the motion estimation vector of the macroblock data at the upper right, if the determination result obtained from (S 242 ) is affirmative and the direction component is a horizontal component or a vertical component; (S 252 ) obtaining a middle horizontal search range and a middle vertical search range of the motion estimation vector of the macroblock data at the upper right, if the determination result obtained from (S 242 ) is negative and the direction component is a horizontal component or a vertical component; and (S 208 ) computing the total absolute value after the direction component search range of the direction component is obtained.  
         [0018]     Referring to  FIG. 3  for a flow chart of a method for calculating the total absolute value in accordance with the present invention, the method comprises the steps of: (S 300 ) determining whether or not the pixel value obtained from the reference frame is larger than or equal to the first largest data determining value; wherein the method for calculating the total absolute deviation is a uniform distribution quantified hierarchical method, and the pixel value obtained from the reference frame is divided into 15 equal ranges according to the uniform distribution quantified hierarchical method, and the ranges include data of values from the smallest 0 to the largest 255; (S 308 ) determining whether or not the pixel value obtained from the reference frame is larger, and if the determination result is affirmative, then the last four bits (which are the most significant four bits) of the first largest data value of that value are obtained; (S 302 ) determining whether or not that value is smaller than a first smallest data determining value, if the determination result is negative; (S 310 ) obtaining the first smallest data determining value, if the determination result obtained from (S 302 ) is affirmative; (S 304 ) concluding that the data falls in a range between the first largest data determining value and the smallest data determining data; and (S 306 ) obtaining an optimal total absolute deviation.  
         [0019]     The foregoing method for calculating the total absolute deviation is similar to the rounding-up algorithm, which coverts the data originally distributed in the range of 0 to 255 into a uniform quantified hierarchy. The conversion value set by the present invention is done by adding 8 to the original value. Since the four bits of the least significant byte of the value of each quantified hierarchy are 0 and the four bits of the least significant byte of the converted value are 0, therefore the largest conversion error is 8. The largest error of the prior art is 8, which directly uses the four bits of the most significant byte as the conversion value. Therefore, the conversion method provided by the invention can greatly reduce the error of calculating the total absolute deviation. Most importantly, when such conversion value is used for calculating the total absolute deviation to obtain the optimal search result, there is almost no deviation between the 8-bit total absolute deviation and the search result. The method for calculating the total absolute deviation in accordance with the present invention can be used effectively in integral motion estimation.  
         [0020]     With the foregoing disclosed technology, the present invention provides a novel design over the prior arts and improves the overall application value, which complies with the patent application requirements. While the invention has been described in terms of what is presently considered to be the most practical and preferred embodiments, it is to be understood that the invention needs not be limited to the disclosed embodiment. On the contrary, it is intended to cover various modifications and similar arrangements included within the spirit and scope of the appended claims which are to be accorded with the broadest interpretation so as to encompass all such modifications and similar structures.