Analysis of Block Matching Algorithms for Motion Estimation in H. 264
Total Page:16
File Type:pdf, Size:1020Kb
Darshna D.Jagiwala, Prof. Mrs. S. N. Shah/ International Journal of Engineering Research and Applications (IJERA) ISSN: 2248-9622 www.ijera.com Vol. 2, Issue 6, November- December 2012, pp.1396-1401 Analysis of Block Matching Algorithms for Motion Estimation in H.264 Video CODEC Darshna D.Jagiwala, Prof. Mrs. S. N. Shah M.Tech. (Research), ECED, SVNIT,Surat,Gujarat(INDIA), Assistant Professor, ECED, SVNIT,Surat,Gujarat(INDIA), ABSTRACT H.264 video compression standard has The latest addition to the lineup of these well-known already been introduced in new electronic gadgets standards is H.264/AVC. H.264 is the result of a such as mobile phones and digital video players, and joint project between the ITU-T‟s Video Coding has gained fast acceptance by end users. Service Experts Group and the ISO/IEC Moving Picture providers such as online video storage and Experts Group (MPEG). ITU-T is the sector that telecommunications companies are also beginning coordinates telecommunications standards on behalf to adopt H.264 standard. The key element to high of the International Telecommunication Union. ISO performance of video compression lies in an stands for International Organization for efficient reduction of the temporal redundancy. For Standardization and IEC stands for International this purpose, block matching algorithms used for Electrotechnical Commission, which oversees motion estimation technique has been successfully standards for all electrical, electronic and related applied in the video compression standards from technologies [1]. MPEG1 / H.261 to MPEG4 / H.264. This paper is Block matching motion estimation was one of the an analysis of the block matching algorithms used most important modules in the design of any video for motion estimation in H.264 video compression encoder[2].In motion estimation process, firstly, a standard. It implements and compares 5 different frame is partitioned into many non overlapping types of block matching algorithms which are blocks with different block sizes according to the Exhaustive Search, Three Step Search, Diamond motion contents, secondly, the target block in the Search, Four Step Search and Adaptive Road current frame is compared with the candidate blocks Pattern Search on H.264 Video codec. in the reference frame; under the constraint of cost function, we can obtain the best matched block by Keywords-H.264 video CODEC, Block matching minimizing the cost function, and finally, the motion algorithms, Motion estimation, PSNR vector(MV), which represents the displacement between the current block and the best matched I.INTRODUCTION block, together with the residual signal, which is the Video Compression is essential for Multi- pixel difference between the current block and the Media Communication. Video compression is the best matched block, are transported to the next process of reducing the amount of data required to process to be coded. Motion estimation is quite represent a digital video signal, prior to transmission computationally intensive and can consume up to or storage. Video compression (or video coding) is 80% of the computational power of the encoder if an essential technology for applications such as the full search (FS) is used by exhaustively digital television, DVD-Video, mobile TV, evaluating all possible candidate blocks within the videoconferencing and internet video streaming. search window. Therefore, fast algorithms are The complementary operation, decompression or highly desired to significantly speed up the process decoding, recovers a digital video signal from a without sacrificing the distortion seriously. Many compressed representation, prior to display. Since computationally variants [3]-[7] were developed for the early 1990s, when video coding technology was block based motion estimation. In this paper, the in its infancy, international standards such as H.261, fast motion estimation algorithms which are MPEG-1, H.262/MPEG-2 Video, H.263, and Exhaustive Search (ES), Three Step Search (TSS), MPEG- 4 Part 2 have been powerful engines behind Diamond Search (DS), Four Step Search (4SS) and the commercial success of digital video. They have Adaptive Road Pattern Search (ARPS) applied on played a pivotal role in establishing the technology H.264 CODEC. by ensuring interoperability among products The rest of this paper is organized as follows: the developed by different manufacturers. Moreover, H.264 encoder and the concept of fast ME these standards have permitted economies of scale algorithms has been reviewed separately in section to allow steep reductions in cost for mass-market II. Section III compares them on H.264 CODEC and affordability. 1396 | P a g e Darshna D.Jagiwala, Prof. Mrs. S. N. Shah/ International Journal of Engineering Research and Applications (IJERA) ISSN: 2248-9622 www.ijera.com Vol. 2, Issue 6, November- December 2012, pp.1396-1401 presents some simulation results, followed by and provides header information for conveyance by conclusion and references. transport layers or storage media. The VCL is specified to efficiently represent the content of the II.H.264 CODEC AND CONCEPT OF video data and fulfill the design objective of BLOCK MATCHING ALGORITHMS enhanced coding efficiency. The generalized block The H.264/AVC design consists of a diagram of typical encoder processing elements for network abstraction layer (NAL) and a video coding the VCL is provided in Figure 1. layer (VCL). The NAL, which was created to fulfill the network-friendly design objective, formats data MB of Image Prediction Quantized Signal Error Coefficients Entropy + Transform Quantization Coding Inverse Transform + Deblocking Intra-Frame Filter Prediction Motion Comp. Memory Prediction Intra / Inter Motion Motion Data Estimation Fig.1 Generalized Block Diagram of a Hybrid Video Encoder × N pixels, and the best matching block, along with Decoding processes are conceptually a subset of the motion vector is determined only after all the these encoding processes [8]. Two types of (2p + 1)2 search positions are exhaustively redundancy are responsible for compression. explored. By exhaustively testing all the candidate Redundancy between the pixels called spatial blocks within the search window, this algorithm redundancy. Redundancy between frames called gives the global minimum block distortion position temporal redundancy. Spatial redundancy, also which corresponds to the best matching block. known as Intra-frame redundancy is achieved using The search area for a good macro block match is techniques of Integer Transform, Quantization and constrained up to p pixels on all fours sides of the Entropy coding. Temporal redundancy, also known corresponding macro block in previous frame. This as Inter-frame redundancy is achieved using „p‟ is called as the search parameter. Larger techniques of motion estimation. Block based motions require a larger p, and the larger the search motion estimation is accepted in all the video parameter the more computationally expensive the coding standards proposed till date. It is easy to process of motion estimation becomes. Usually the implement in hardware and real time motion macro block is taken as a square of side 16 pixels, estimation and prediction is possible. If a block of and the search parameter p is 7 pixels. The N × N pixels from the candidates frame at the matching of one macro block with another is based coordinate position (r, s) is considered and then on the output of a cost function. The macro block consider a search window having a range ±w in that results in the least cost is the one that matches both end directions in the references frame, as the closest to current block. There are various cost shown in Figure 2. For each of the (2p + 1)2 functions, of which the most popular and less search position (including the current row and the computationally expensive is Mean Absolute current column of the reference frame), the Difference (MAD) given by equation (i). Another candidate block is compared with a block of size N cost function is Mean Squared Error (MSE) given 1397 | P a g e Darshna D.Jagiwala, Prof. Mrs. S. N. Shah/ International Journal of Engineering Research and Applications (IJERA) ISSN: 2248-9622 www.ijera.com Vol. 2, Issue 6, November- December 2012, pp.1396-1401 by equation (ii) [9]. Consequently, many macro blocks from the reference frame. Based on algorithms with a reduced number of search this theory some blocked based ME algorithms are locations have been proposed, including the explained below: (Peak to peak value of original data )2 Exhaustive Search (ES) [10], Three Step Search PSNR= 10( log ) (TSS) [11], Diamond Search (DS) [12], Four Step 10 MSE Search (4SS) [13] and Adaptive Road Pattern (iii) Search (ARPS) [14]. A. Exhaustive Search (ES): This algorithm is the 1 most computationally expensive block matching MAD = 푁−1 푁−1 퐶푖푗 − 푅푖푗 (i) 푁2 푖=0 푗=0 algorithm of all. It is also known as Full search 1 MSE = 푁−1 푁−1 퐶푖푗 − 푅푖푗 2 (ii) algorithm. This algorithm calculates the cost 푁2 푖=0 푗=0 Where N is the side of the macro bock, Cij function at each possible location in the search and Rij are the pixels being compared in current window. As a result it finds the best possible match macro block and reference macro block, and gives the highest PSNR amongst any block respectively. matching algorithm. Peak-Signal-to-Noise-Ratio (PSNR) given by B. Three Step Search (TSS): It became very equation (iii) characterizes the motion compensated popular because of its simplicity and also robust image that is created by using motion vectors and and near optimal performance n1 n1 p n2 n2 p (r,s) Search Window (2p x 2p) Reference Frame Candidate Frame Fig.2 Exhaustive (Full) Search Motion Estimation It searches for the best motion vectors in a course Fig. 3. (a) Large Diamond Search Pattern to fine search pattern. The algorithm may be (LDSP), (b) Small Diamond Search Pattern described as: (SDSP) Step 1: An initial step size is picked.