• 沒有找到結果。

Chapter 4 Adaptive search pattern prediction for fractional motion estimation

4.2 ORIGINAL SEARCH ALGORITHM

Fig 14 Search algorithm in reference software.

Fig 14 details a typical search algorithm for the ME process 100 according to the reference software. The search process in fractional motion estimation is typically divided into two parts. The first part consists of half-pel motion estimation, where specific pixels at half-pel spacing are searched for comparison. The second part consists of quarter-pel motion estimation, where pixels at quarter-pel spacing centered around a search point obtained in the first part are used for comparison.

In the first part of half-pel ME, a cost value for each of eight search points 120 in a square search pattern surrounding the integer spaced pel called search center 110 is calculated. A cost value calculation for the search center 110 is not performed. The single search point from the group of search points 120 possessing the lowest cost value is then selected as the quarter-pel motion estimation search center 130 in the next step. The fractional motion estimation step utilizes an additional eight fractional search points 140 displaced around the FME search center 130 in a smaller square pattern. A total of 17 search points (1 search point from integer pel, 8 search points from half-pel ME and 8 search points from quarter-pel motion estimation) are therefore searched and compared in a single round of the traditional ME procedure according to the reference software.

Although the typical search algorithm for the ME process 100 does manage to

sufficiently locate suitable search points for the motion vector refinement process, the excess amount of search points may result in significant delays in the encoding process. The typical search algorithm for the ME process 100 may possess too many search points to visit within one motion vector refinement process. Furthermore, the search pattern used in the ME process 100 may provide further constraints in finding optimal search points, as refinement in the fractional ME searching can cause the search area to stray away from the search center.

In order to overcome these problems, and produce a more efficient search pattern, a fast ME search algorithm is proposed. This algorithm produces a search pattern based on the high statistical probability that fractional motion is located close to the integer search center (as shown in Fig 13). In this way, fewer search points based near or on the integer search center should be visited in the proposed algorithm. This allows the complete fractional ME process to be accomplished with fewer overall search points compared to the original method, while providing a comparable accuracy. Furthermore, the overall computational resources and complexity to search a predefined search area is greatly reduced.

4.3 PROPOSED ALGORITHM

Fig 15 Proposed algorithm for half-pel.

Fig 15 illustrates a fast ME search algorithm. The algorithm is used to determine an optimized search pattern comprising a half-pel search pattern 200 and a quarter-pel search pattern (discussed later). An integer spaced pel 210, or search center is shown as a circle in the center of the macroblock in Fig 15. The first stage of the algorithm comprises half-pel ME, where the half-pel search pattern is formulated. A total of 5 search points 220 are selected to form the half-pel search pattern: four search points aligned to form a cross pattern around the search center and one search point located at the search center. Fewer search points can be used in other embodiments. Once the half-pel search pattern has been determined, the cost value for each search point 220 is calculated. Any suitable cost function can be used in this step, however, the sum of absolute transform differences (SATD) is generally used for the fractional ME. The cost function is used to determine the lowest 2 (or 3) cost values of the search points 220. Upon determination of the search points 220 producing the lowest cost values, a quarter-pel search pattern for the fractional ME process is adaptively selected.

The next stage of the fast ME algorithm process entails selecting a quarter-pel search pattern. The quarter-pel search pattern is selected according to the ranking of cost values for each specific search point, and provides search points in a certain area to approach the global minimum cost in the search window. In an effort to reduce confusion, the search points deduced in the quarter-pel ME stage will be referred to as

quarter-pel search points. However, both types of search points serve the same purpose in providing matching points for the ME process.

Once the quarter-pel search pattern is determined (further below), cost values for the quarter-pel search points of the fractional search pattern are then calculated. The cost values attained here are used in conjunction with the cost data accumulated from search points in the first stage to determine whether the current macroblock is a suitable match to the reference macroblock. The entire search pattern therefore comprises the half-pel search pattern used in the first stage and the quarter-pel search pattern used the second stage for fractional ME.

The following cases illustrate how the quarter-pel search pattern is selected in the second stage in fractional ME. The quarter-pel search pattern is based on a ranking of the cost values for each search point in the first stage for half-pel ME. The cases are as follows

Case 1: The lowest cost search point is located at the search center, and the second and third lowest search points are opposite to each other.

This case is illustrated in Fig 16. In this case, the lowest cost search point 320 is the located at the search center 310, and the second lowest cost search point 330 and third lowest cost search point (not shown) are opposite each other. For this case, three quarter-pel search points 340 placed between the minimum cost search point 320 and the second lowest cost search point 330 are selected as the quarter-pel search pattern in fractional ME. The three quarter-pel search points 340 are configured such that they form a straight line perpendicular to the axis formed by the lowest cost search point 320 and the second lowest cost search point 330, and are located in between the two half-pel search points 320 and 330.

Fig 16 Proposed algorithm for quarter-pel (case 1).

Case 2: The lowest cost search point is located at the search center, and the second and third lowest cost search points are adjacent to each other.

This case is illustrated in Fig 17. The lowest cost search point 420 is located at the search center 410, and the second lowest cost search point 430 is adjacent to the third lowest cost search point 440. For this case, three quarter-pel search points 450 are used to form the quarter-pel search pattern in fractional ME. The three quarter-pel search points 450 are arranged between the three lowest cost search points such that a connection among the three quarter-pel search points 450 would from a right angle with the vertex of the right angle concave to the search center 410.

Fig 17 Proposed algorithm for quarter-pel (case 2).

Case 3: The two lowest cost search points are adjacent to each other and surround the search center.

This case is illustrated in Fig 18. The lowest cost search point 520 and the second lowest cost search point 530 are adjacent to each other and both surround the search center 510. For this case, three quarter-pel search points 550 are used to form the quarter-pel search pattern in fractional ME. The three quarter-pel search points 550 are arranged between the two lowest cost search points such that lines connecting the three quarter-pel search points 550 would from a right angle, with the vertex of the right angle convex to the search center 510.

Fig 18 Proposed algorithm for quarter-pel (case 3).

Case 4: The two lowest cost search points are opposite to each other and surround the search center.

This case is illustrated in Fig 19. The lowest cost search point 620 is opposite to the second lowest cost search point 630, neither being located at the search center 610.

For this case, four quarter-pel search points 650 are used to form the quarter-pel search pattern in fractional ME. The quarter-pel search pattern is arranged such that the four quarter-pel search points 650 surround the lowest cost search point 620 in a square pattern.

Fig 19 Proposed algorithm for quarter-pel (case 4).

Once a fractional search pattern is selected based on one of the 4 above cases, calculations for each quarter-pel search point using a specified cost function can be performed to complete the matching process. The data provided from the half-pel search points and the quarter-pel search points serve to provide a comprehensive data set in an area approaching a local minimum of the cost function. This allows for a more accurate match result, while lowering the need for calculating additional search points. The best matching macroblock that minimizes the difference between the current and reference macroblock can now be chosen.

相關文件