You are on page 1of 6

DESIGN AND ANALYSIS OF MOTION CONTENT CLASSIFIER FOR BLOCK MATCHING ALGORITHM IN H.

264/AVC
K.Rajeshkumar, D.Rukmanidevi and Dr.J.Raja paul perinbam R.M.K. Engineering college, Chennai-601206 krajeshkumarmevlsi@gmail.com

Abstract In order to reduce the computational complexity for motion estimation without affecting image quality and improve reliability of image sequence for super resolution reconstruction, the motion content classifier is presented. The combination of coarse to fine search algorithm and center biased fast estimation search algorithm based on the error descent rate are proposed in this paper. Index Terms Block matching algorithm, Motion estimation, Advanced video coding

I. INTRODUCTION In most of the digital video coding standards, e.g. H.264/AVC, motion estimation and compensation is a crucial process. Motion compensation compensates the displacements of objects from the reference frame to the current frame, and such displacements are found by motion estimation. Together they remove the temporal redundancy between frames in a video. [2] However, the computational complexity of motion estimation is very high. Recent research has shown that it takes 50-70% of the total H.264/AVC encoding time. To realize some common applications, for example real-time encoding, the computational complexity of the encoder has to be reduced. A more efficient motion estimation algorithm is therefore necessary. II. BLOCK MATCHING ALGORITHM Block matching motion estimation (BMME) in Fig.1 is the most popular and practical motion estimation method in video coding. Standards like the H.26X series and the MPEG series use BMME. Each frame is divided into square blocks called macro-blocks (MBs). For each block in the current frame, a search in Fig.2 is performed on the reference frame to find a matching based on a block distortion measure (BDM). Many fast block matching algorithms (FBMAs) have been proposed to speed up the

motion estimation (ME) process by reducing the number of search points based on two major strategies. One is coarse-to-fine search and the other is utilization of the centre-biased motion vector (MV) characteristic. To reduce the number of search points, 2D-logarithmic search (2DLOG) [1] and three-step search (3SS) [3] have been proposed which use a coarse-to-fine search approach. The coarse searches in these two algorithms locate the rough position of the global minimum and subsequent finer searches find the best motion vector. They perform well in large motion video sequences because search points are evenly distributed over the search window and therefore global minima at the outer area of the window can be located more easily. Nevertheless, for small motions, these algorithms are inefficient due to a waste of search efforts.

Fig.1 BMME performs in a search window In an analysis on motion vector distribution in [8], about half of all the macro-blocks are stationary, and there is a high percentage of motion vectors laying within the centre 5x5 region of the search window. To utilize this centre-biased global minimum

distribution, new

three-step search (N3SS)

(u,v)= SAD is almost the same as MAE(Mean Absolute Error), except that it omits the constant denominator N x N. It is a popular BDM in hardware implements. To calculate the absolute difference for one pixel, it requires one subtraction and one absolute operation, plus one addition for the accumulation of the difference from the previous pixel. Therefore for a typical MB of size 16 x 16 pixels, the calculation of one search point in a search window requires 3 x 16 x 16 -1 = 767 operations III. MOTION CONTENT CLASSIFIER An adaptive ME algorithm should be able to switch between search patterns or search strategies for different motion contents. However, the motion content of a macroblock has to be classified before subsequent searches can be applied. There are two motion content classifiers, namely the geographic classifier and the predicted MV classifier. An in-depth analysis of the motion estimation error surface is conducted. It is found that a global minimum point affects its nearby error surface more than the error surface further away from it. Based on this, the error descent rate (EDR)[1] at the search window centre can be used to estimate the motion content of a macro-block. A novel motion estimation algorithm called search patterns switching (SPS) algorithm, which uses the EDR as motion content classifier, is proposed. An optimum threshold for the SPS algorithm is found which universal and video content independent. Performance evaluations prove that SPS algorithm is very fast and robust.

Fig.2 A search point in a search window [6], four-step search (4SS) [4], block based gradient descent search (BBGDS) [7], diamond search (DS) [9], hexagon-based search (HEXBS) [10], and cross diamond search (CDS) [11] have been proposed. These algorithms have centre-biased search patterns. They achieve a substantial reduction of search points for small motion videos compared to coarse-to-fine search algorithms. Normally, these algorithms exhibit an excellent performance in terms of speed and quality for small motion videos. However, in large motion videos, they are subject to quality degradation because they are more easily trapped in a local minimum rather than finding the real global minimum in the other areas of the search window. Block Distortion Measure(BDM) The block distortion measures (BDMs) are the matching criteria of the BMAs. In video coding, motion estimation compensates the motion within a video sequence and only the motion compensated prediction error together with the MV information will be encoded and transmitted. Therefore, BDMs are also cost functions of the motion compensated prediction error between a current MB and a reference MB. A MV is found by a BMA to minimize a BDM. Sum of absolute differences (SAD)

Fig.3 Find the distortion difference between the centre point and its minimum distortion neighbor. Error Descent Rate (EDR) The steepest error descent slope is used to estimate whether the global minimum is near or far away from the search window centre in fig 3. EDR=DA/DB where DB is the minimum distortion of the four adjacent points of the search window centre and DA is the distortion at the search window centre. IV. PROPOSED WORK Based on the analysis in the previous sections, a search patterns switching (SPS) motion estimation algorithm is proposed. This algorithm uses the error descent rate (EDR) at the centre of the search window to estimate whether the global minimum would be near the centre or would be at the outer area of the search window. If it is estimated to be near the centre, a search pattern suitable for small motion searching will be used. Otherwise a search pattern apt at searching large motions will be applied instead. That is, the algorithm uses the EDR as the motion content classifier for a block. The flow diagram is shown in Fig. 4
Distortion at(0,0) is Calculated

Fig.4 Flow diagram of the proposed Search Patterns Switching (SPS) algorithm EDR is calculated at the search window centre as described in the previous section. If EDR > 1, all the four immediately adjacent points have distortion higher than the search window centre point. Previous research [8] shows that a large percentage of MVs are within 1 pixel distance from the search window centre, especially those in static videos. Therefore if EDR > 1, the search stops and a ZMV is returned.

(a) An example of 3SS if EDR>threshold T

Four neighboring points are searched and EDR is found Yes EDR>1? Zero MV returned Yes EDR> threshold Global minimum far away

No Global minimum near by No

Small motion search pattern

Large motion search pattern

(b) An Example of EDR<threshold T .Fig 5

BBGDS

if

End

If EDR is higher than a threshold T, for example T=0.9, (in other words, there is a less than 10% distortion drop at the centre of the

search window), the global minimum has a high probability at the outer area of the search window. Three-step search (3SS), which is apt at searching large motions, is applied. If EDR is lower than or equal to the threshold T=0.9 (therefore, there is a more than or equal to 10% distortion drop at the centre of the search window), the global minimum is likely near the centre of the search window. Then block based gradient descent search (BBGDS), which is apt at searching small motions, will be applied. Fig.5(a) and (b) show examples of subsequent searches using 3SS and BBGDS respectively after EDR is calculated.

For example diamond search (DS) instead of BBGDS can be used for small motion search; 4SS instead of 3SS for large motion search, etc. The SPS combinations are represented as SPS (X, Y), where X and Y are the names of the small and large search patterns respectively. Fig.6 ( a ) shows an example of small motion search using diamond pattern for SPS (DS, Y). Fig. 6(b) shows an example of the subsequent large motion search using 4SS for SPS (X, 4SS). Many combinations for this SPS algorithm are tested. Basically, the best combinations are those using centre-biased search patterns, e.g. BBGDS and DS, to search small motion blocks and coarse-to-fine search patterns, e.g. 3SS and 4SS, for large motion blocks. For each of the SPS combinations, an optimum threshold value T can be found using empirical method. It is found that the optimum threshold values for all of the combinations are in the range of 0.85~0.95. The SPS name representation can be rewritten as SPS (X, Y, T), where T is the threshold value. All the optimum threshold values work well for different test video sequences. Format CIF (352x288, 200 frames) Sequences Foreman, News, Stefan

Fig.6 (a) An example of EDR threshold T for sps(DS,Y)

DS

if

Table 1 Video sequences used in simulation V. EXPERIMENTAL RESULTS To evaluate the optimum threshold values for a selected number of SPS combinations and to compare the performance of the SPS algorithm with other algorithms, simulations are conducted with the luminance components of a number of popular video sequences in different resolutions. In all simulations, the sum of absolute difference (SAD) is used as the block distortion measure each (BDM) and block size is 1616 pixels range is 16 pixels. Simulation results are expressed in average number of search points used per block and average PSNR (peak signal-to-noise ratio) per frame of the tested sequences. Here only the optimum threshold evaluation for S PS combinations, namely the SPS (BBGDS, 3SS , T) and the other combinations can be evaluated similarly.

Fig.6 (b)An example of 4SS if EDR>threshold T for sps(X,4SS) The SPS algorithm can incorporate other small and large search combinations.

TABLE-2 Performance comparison of different values of threshold T for SPS (BBGDS, 3SS, T) in test sequences of CIF size News SPS(BBGDS,3SS,T) 0.70 0.80 0.90 0.05 TABLE-3 PSNR(db) 36.681 36.702 36.750 36.694 # Search points 7.314 6.810 6.343 6.108 Stefan PSNR(db) 24.250 24.249 24.231 24.031 # Search points 20.77 20.186 15.119 15.119 Foreman PSNR(db) 32.258 32.284 32.300 32.243 # Search points 19.700 17.572 14.895 14.895

Performance comparison between SPS and other popular fast motion estimation algorithms in CIF sequences News Stefan Foreman PSNR(db) 36.972
36.607 36.660 36.694 36.730

SPS(BBGDS,3SS,T) FS 3SS BBGDS DS SPS(BBGDS,3SS,0.9)

# Search points 983.919


33.000 9.247 11.898 6.343

PSNR(db)
25.724 24.042 23.575 24.033 24.231

# Search points
983.919 33.000 15.516 17.608 17.045

PSNR(db) 32.881 31.920 32.240 32.096 32.300

# Search points 983.919 33.000 16.725 17.925 15.648

VI CONCLUSION & FUTURE WORK For current digital video coding standards, e.g. H.264/AVC, motion estimation and compensation is a crucial process. The computational complexity of motion estimation is very high. Recent researches have shown that it uses 50-70% of the total H.264 encoding time To realize some common applications, for example real-time encoding, it is necessary to reduce the computational complexity of the encoder. Therefore, a more efficient motion estimation method is needed. In this research work, two new block matching algorithms (BMAs) and variable block size motion estimation (VBSME) algorithm are proposed. Performance of motion estimation algorithm in hardware systolic array architecture Several systolic array implementations for fast BMAs as well as an implementation of a modified SPS algorithm are proposed. Equations are derived which estimate th e speed and power consumption of BMAs in systolic array implementations. Based on the equations, simulations are performed which show that SPS algorithm is also a very efficient algorithm in hardware implementation. This study aids future researches in hardwareoriented motion estimation algorithms. It is also greatly beneficial to the design of video encoding chip. REFERENCES 1. Ka-Ho Ng, Lai-Man Wong, Chi-Wang, and Kwok-Wai Cheung A Serach Patterns Switching Algorithm for Block Motion Estimation IEEE Trans. Circuits Syst. Video., vol. 19, no. 5,May 2009. T. Wiegand, G. J. Sullivan, G. Bjontegaard, and A. Luthra, Overview of the H.264/AVC video coding standard, Technol., vol. 13, no. 7, pp. 560 576, Jul. 2003. R. Li, B. Zeng, and M. L. Lio, "A new threestep search algorithm for block motion estimation," IEEE Trans. on Circuits and Systems for Video Technology, vol. 4, pp. 438-443, Aug. 1994. L. M. Po and W. C. Ma, A novel four-step search algorithm for fast block motion estimation, IEEE Trans.Circuits Syst. Video Technol.,vol. 6, no. 3, pp. 313 317, Jun. 1996.

2.

3.

4.

5.

C. H. Cheung and L. M. Po, A novel crossdiamond search algorithm for fast block motion estimation, IEEE Trans. Circuits Syst. VideoTechnol. vol 12, no. 12, pp. 1168 177, Dec. 2002. 6. R. Li, B. Zeng, and M. L. Lio, A new three-step search algorithm for block motion estimation, IEEE Trans. Circuits Syst. Video Technol., vol. 4, no. 4, pp 438 442, Aug. 1994. 7. L. K. Liu and E. Feig, A block-based gradient descent search algorithm for block motion estimation in video coding, IEEE Trans. Circuits Syst. Video Technol., vol. 6, no. 4, pp. 419 422, Aug. 1996. 8. P. Kuhn, Algorithms, Complexity Analysis and VLSI Architectures for MPEG-4 Motion Estimation, chapter 7, pp.175-188, Kluwer Academic Publisher, 1999. 9. . Y. Tham, S. Ranganath, M. Ranganath, and A. A. Kassim, "A novel unrestricted center-biased diamond search algorithm for block motion estimation," IEEE Trans. on Circuits and Systems for Video Technology, vol. 8, pp. 369-377, Aug. 1998. 10. C. Zhu, X. Lin, and L. P. Chau, "Hexagonbased search pattern for fast block motion estimation," IEEE Trans. on Circuits and Systems for Video Technology, vol. 12, pp. 349-355, May 2002. 11. C. H. Cheung and L. M. Po, "A novel crossdiamond search algorithm for fast block motion estimation," IEEE Trans. on Circuits and Systems for Video Technology, vol. 12, pp. 1168-177, Dec. 2002.

You might also like