Fuzzy based Search in Motion Estimation for Real Time Video Compression

Video compression ratio, quality and efficiency are determined by the motion estimation algorithm. Motion estimation is used to perform inter frame prediction in video sequences. The individual frames are divided into blocks the motion estimation is computed by a video codec such as H.264. A video codec computes the displacement of block between the previous frame (reference frame) and the current frame, for each block in current frame the best motion vector is determined in the reference frame as a block belongs to a current frame. In this, research paper, a novel technique has been presented for motion vector calculation, using fuzzy Gaussian membership function. The motion estimation block uses fuzzy membership function to estimate the connectedness of different blocks of the current frame to that of the reference frame The fuzzy decision matching is done based on the matching criterion and the best matching block is selected. The motion vectors are thus calculated with respect to the reference frame. The fuzzification process produces optimally matched blocks, which are then utilized to calculate the motion vectors of the predicted frame. Using fuzzy based search the search area is automatically updated and adaptive search steps provides an optimized result of search. As in real time streaming no file is exchanged during the transmission user is not able to download the file the only way for smooth transmission is frame management fuzzy based search for the motion estimation provides a better compression for the predicted frames. Keywords—Fuzzy logic; motion estimation; compression; current frame; reference frame; predicted frame


I. INTRODUCTION
High resolution images and videos have been made accessible to everyone by the use of the technology. Everyday millions of videos and images are being generated by users over the internet, which is being shared across different platforms freely and fastly. A video consists of an image series known as frames. Image frames need to be stored and transmitted in time and space using broadband transmission. This includes a modern video encoding format to safely and easily share video data in real time. H.261, H.263, H.264, and MPEG1, MPEG2, and MPEG4 are common video codec formats. These standards commonly use temporal redundancy reduction to enable video compression [1].
Motion estimation (ME) in general video-coding systems can effectively eliminate time-redundancy between adjacent videos. ME is also used as an integral part of a video encoder since many computing resources are needed. At the same time, ME contributes in particular to the difficulty of the encoder for its various block sizes and fractional pixel precision motion quest in the video encoding format H.264 [2]. Two main motion vector estimation techniques currently are available pel-recursive algorithm and the block matching algorithm. The pel-recursive technique offers a motion vector estimation method for each pixel that consists of a current frame pixel position in the previous frame [3]. Each picture is divided into a fixed size that does not overlap rectangular blocks of either current or reference frames in the corresponding block algorithms. These blocks are then matched, based on some cost function, to find the best matching block, for which motion vectors are calculated. It is very apparent that only objects displaying motion will change their location in the frames between two frames, while the remaining context remains unchanged. The discrepancy between the present frame and the frame of reference is a residual frame. This contains the details of the frame on which the modifications take place. The encoder describes the model that defines the movement of objects in the system, measuring the forecast frame or motion picture. The video coding standards were primarily used for block matching algorithms for the motion calculation. The hardware is easy to incorporate and predicts movement in real time.
Many strategies exist to find the best matching block. The full search algorithm is the easiest algorithm to find a block with minimal SAD in the reference frame. It's a basic routine that compares the best-matched block to a block in any search area. Although this algorithm seems simple, complicated computations are required which prevent it from being a realtime scheme [4]. Several algorithms for fast search and real time deployment were proposed to resolve the limitations of the complete search algorithm. Some of these algorithms look for the matching block only in a set of blocks in the search area. The logarithmic search, three step searches, four step search, diamond search, and octagon search algorithms are some of these algorithms. In all of these algorithms, unimodal error surface assumption is made. The pixel redundancy within frames of a video sequence may differ depending on the movement in the video. Thus regular boundary conditions to determine the blocks may not as effective. The uncertainty in pixel redundancy can be alleviated by using fuzzy techniques. Several fuzzy-based motion estimation have also been presented by the researchers. Spatio-temporal fuzzy search algorithm using a look-up table structure (LUT) is employed [5].

II. LITERATURE REVIEW
There has been an innumerable number of researches in the field of motion estimation in the last 50 years or so. In this section, some latest research works have been discussed. Yun Cheng et al [6] suggested an algorithm named Modified Diamond Quest. MDS uses Small Diamond Search Pattern (SDSP), which evaluates if the MBD (Minimum Block Distortion) is the original search hub. Where the MBD point is not placed in the search centre, the following search stage would use Simplified Large Diamond Search Pattern (SLDSP). If the MBD point is not within the circular spectrum of a single-pixel radius, SLDSP would be continuously used to find the best equivalent block with a large vector until it becomes the MBD point. Finally, SDSP shall be taken to boost the motion vector, particularly with simple and slow motion vectors for certain video sequences.
A. Anusooya Devi et al. [7] suggested the algorithm entitled 'Efficient Motion Estimation Modified Diamond-Square Search Technique.' This manual includes an updated diamond search algorithm that updates the two DS search patterns. Compared to current search algorithms, the MDSS algorithm is advantageous since the amount of search objects used is reduced while the video quality is maintained. Moreover, relative to the diamond search algorithm, it attempts to accelerate the search.
A Fuzzy Logic Based Three Step Search Algorithm for Motion Vector Estimation [8] was proposed by Suvojit Acharjee and Sheli Sinha Chaudhuri. A fuzzy dependent logic has been introduced into this three step search algorithm. This is a superior algorithm than the Four steps (FSS), the Three step search (TSS) algorithm, the New Tree step search (NTSS).

The Fuzzy Logic Based Four
Step Search Algorithm for Motion Vector Estimation. Suvojit Acharjee and Sheli Sinha Chaudhuri [9]. A fuzzy membership value added by strength for each block is used in the Four Step Search algorithm based on fuzzy logic. A value that determines whether the macro block is in the darker or lighter area is determined from the intensity values of the pixels within a macroblock. Only if the macro block's macro frame macro membership value is beyond the permitted macro block region of the current frame will the search continue. The pattern of quest and the other stage is like four stages of the search.
The proposed Fuzzy Thresholding Quick Motive Estimating Scheme for Video Coding was proposed for Fuzzy Thresholding Cheng et al. [10]. The suggested algorithm is an early termination scheme based on fluctuating inference threshold values. Using the MDGDS algorithm search patterns, we used the fluctuating inference variables for the MDGDS three-round alternate search pattern. It is decided before each search round to avoid needless computation that a search is to be terminated at an early stage. In contrast with the MDGDS, the proposed algorithm will reduce the average considerable number of search points. The algorithm increases the motion prediction greatly.
Y. Pattnaik et al. [11] recommended the use of the adjacent blocks to predict the motion vector of the block. They implemented a sorting search algorithm that is more likely to aid in the prediction by using the motion vectors of adjacent lines. With the aid of these motion vectors, a search centre is located and around it, a search window is mounted. The search approach was compared by the authors using a particular neighborhood combination and after a detailed analysis, the sorted algorithm was found to produce the other current PSNR and computing algorithms.
The Fuzzy logic inference system-based hybrid prediction model for the wireless 4k UHD 4k H.265 coded video streaming was proposed by Mohammed Alreshoodi, et al. [12]. The calculation techniques available that follow a complete reference model are inefficient for streaming in real time, as the original video sequences on the recipient side are required. Investigations of service quality (QoS) parameters in the experimental setting for 4kUHD H.265 coded video transmission; secondly, an objective model based on the fuzzy logic inference method is created, with the goal of predicting the visual quality by mapping of the calculated quality of experience parameters with QoS.
For high delay applications of HEVC, Davoud Fani et al. [13] suggested an algorithm for GOP level fuzzy rate management. A Rate Control Algorithm (RCA) has been developed with this algorithm for high-delay HEVC Standard applications with buffering constraints. This RCA is fitted with a fluid controller and a simulated buffer. The fluctuation of the quantization parameter (QP) is designed to eliminate variability when the buffer restriction is complied with. For each pictures category (GOP), it determines a QP basis in order to avoid unwanted variations of the QP at the GOP stage.
The new quick motion evaluation algorithm was developed by Masahiro Hiramori et al. [14]. It concurrently scans 4-pixel groups and uses the value concatenated with the exclusive OR of the low 6-bit absolute upper 2-bit gap. The search accuracy results reveal that, as opposed to the searchrelated algorithm with a 4-bit absolute difference accumulator, the cumulative difference is improved to 4 of 7 video sequences. The synthesis findings have seen a 61 percent decrease in the required loop, a 15.2 percent decrease in the circuit size, and the operating frequency is improved from 334.67 MHz to 616.90 MHz relative to a total 4-bit absolute.
C. Wu and J. Wu and J. Huang [15] implemented the mobile application motion prediction root predictive pattern search algorithm. The adaptive Root pattern search algorithm is combined to increase the accuracy of the image and reduce search points for two kinds of predictive patterns. The motion vectors of top-left and upper-middle macroblocks are chosen as candidates of ARPS if the block is placed on the right-hand side of the picture. As otherwise, ARPS candidates are the motion vectors of the macro-blocks upper-left, mid-right, and top-right. Where motion vectors are introduced into the algorithm in the previous and neighboring blocks, the trend of the surrounding blocks and the probability for trapping in the local optimum decreases. The results of experiments demonstrated better than other block matching processes, particularly for large and quick motion chips, the image quality of the proposed system. www.ijacsa.thesai.org Arnaudov and Ogunfunmi proposed Fast Motion Prediction adaptive search patterns for HD video. The algorithm tried, not based on the video set, to make the search mode versatile or adaptable for each scene within a given video. As for the writer, it will have a certain output penalty relative to a fixed pattern scan. Every "I" frame is taught a new pattern. It has emerged from the findings that the Adaptive Search Pattern makes around 10% -70% of the PSNR difference between current fixed and complete search algorithms [16].
Nijad A-Najdawi [17] suggested a real-time video encoding device that can render immersive, including video conferencing, inexpensive, real-time applications. The proposed algorithm looks at frequency domain motion estimation. Block matching is conducted in the frequency domain, where a group of carefully selected frequencies is checked to accurately classify each block.
Ali Al-Naji et al. [18] suggested quality video measurement index based on the fuzzy inference system, suggesting a new solution based on a floating interface system known as the quality assessment system (QES). As inputs to three fluctuating logic controller systems, their feedback to another fluctuating logic controller system was used as inputs to achieve nine quality metrics; PSNR, visual signal-to-noise ratio; weighted signal-to-noise ratio, structural similarity (SSIM), multi-scale SSIM, uniform image quality index, visual information fidelity; and noise quality analysis (IFQA) Despite the inability of some IQA approaches to provide the quality output of the input video in certain cases, this approach leads to the obtaining of a specific quality index.
Linh Van Ma, et al. [19] suggested an Adaptive Streaming algorithm to boost mobile data efficiency in order to reduce DASH's entropy rate of Bitrate Fluctuation. Dynamic adaptive Hypertext Transmission Protocol (HTTP) streaming is a stateof-the-art video streaming technology that while always and constantly evolving, has one downside. The quality of viewing of videos fluctuates along with changes in the network which could decrease service quality. The average moving bandwidth and buffer values are first determined for a given time. In order to deduce the importance of the video quality representation in the following request, a fuzzy logic method is used based on discrepancies between actual and average values. The entropy speed is often used to calculate the predictable/stabilizing of a bandwidth measurement chain. The experiment leads to decreased video quality variability in contrast with the current approaches and increased 40% of bandwidth consumption.
The suggested modification of the Fuzzy logic-based performance enhancement scheme of DASH (mFDASH) has been proposed by Hyun Jun Kim et al. [20]. By changing the Fuzzy Logic Controller (FLC) for the next line, a more acceptable bandwidth is calculated for the proposed scheme by using the history-based TCP Throughput Calculation, than for FDASH. In addition, mFDASH decreases the number of shifts in the video bit rate by using the SBFM section and uses Launch Function to produce high-quality videos at the very early stage. Finally, the Sleeping Mechanism is used to prevent the predicted overload of buffers. The NS-3 Network Simulator had been used to check mFDASH results. The MFDASH displays a buffer overflow not assured in the FDASH within a restricted buffer capacity. Of the three systems, mFDASH presents DASH consumers with the best quality.
Adaptive Order Cross-Hexagonal Quest for H.264 in motion estimate suggested by Bachu Srinivas and K Manjunathachari [21]. The algorithm uses a smaller crossshaped model before the first step of a square pattern and in subsequent steps replaces the square pattern with the hexagonal search patterns. The patterns of searches help locate the best matching block, regardless of a large number of search points. The matching points can be measured using the speed and distortion parameters using a fluid-based tangent weighted function. In order to reach visual quality and distortion targets, the suggested approaches are used successfully in the block estimation process. Srinivas Bachu and N. Ramya Teja have also suggested "Fuzzy Adaptive Selection Mode for H.264 Video Coding based Holoentropy". The main downside, as indicated by the developers, in H.264 is a detailed check over the prediction of the interlayer to obtain the best rate distortion. A new approach for interdiction mode selection, based on the fuzzy holoentropy, has been implemented to reduce the overall measurement due to a comprehensive search on the mode prediction process. In order to determine mode, the device uses pixel values and probabilistic distributions of pixel symbols. This selection of adaptive mode is made possible by the consideration of the pixel values of the current block to be coded using the fuzzy holoentropic for the motioncompensated referential block. The mode judgment that is adaptively chosen will minimize the time of the computation without impacting frame vision [22].

III. PROPOSED METHODOLOGY
Real-time videos involve slow and fast content mixtures of motions. No set quick-block matching algorithm will essentially eliminate the temporal redundancy of wide-motion video sequences. Larger motions warrant a bigger search parameter but make the motion estimation more costly. The complete search motion estimation algorithm coincides with all potential displaced blocks in the reference frame's field of search, among all block matching algorithms, to find a block with minimal distortion. In order to perform a full search, a huge amount of calculation is required. Adaptive step size should also be used to obtain actual motion vectors. The fuzzy logic method can be used to calculate motion by adopting measures. Fig. 1 shows the block diagram of the proposed model. www.ijacsa.thesai.org The motion estimation based methodology is based on selecting suitable blocks in the video frames. As shown in Fig. 1, the current frames and the reference are both subjected to blocking, i.e. dividing the individual frames into smaller sub-frames or blocks. The motion estimation block uses fuzzy membership function to estimate the connectedness of different blocks of the current frame to that of the reference frame. Gaussian membership function has been used to evaluate the fuzzy membership values for every macroblock. The fuzzy decision matching is done based on the matching criterion and the best matching block is selected. The motion vectors are thus calculated with respect to the reference frame, which can then be used further for facilitating the video compression. The definition of a fuzzy set begins with fuzzy logic. A fuzzy set has no narrow, specifically defined limit. Elements with only a partial membership can be included. A function that defines the extent to which a certain input is part of a set. The membership degree implies that the production is often restricted to a membership function between 0 and 1. Also referred to as a membership or membership category.

IV. PROPOSED ALGORITHM
The key factor of the proposed algorithm is adaptive step size search minimize the search cost because it does not have the fixed steps it depends on the fuzzy membership (Gaussian Membership Function)of each pixel and the value of sum of difference. These steps are followed by the algorithm Fig. 2 shows the initial point of the search and Fig. 3 the updated search point and the new search area.
Step 1: This algorithm tends to reduce the search steps for this an adaptive step search strategy is taken and the key factor is the sum of absolute differences (SAD) which is a measurement of the similarities between the blocks which are taken for comparison as block size 8x8 or 16x16 the absolute difference between each pixel in the reference frame block and the corresponding pixel in the block of target frame. Unlike the other algorithm here the SAD is calculated by the Gaussian membership function (GMF) which is assigned for macroblock for previous frame and the macroblocks of target frame for each pixel and a membership data matrix is created.
Step 2: Start searching for the pixel with minimum SAD as compared to target frame the centre point of membership function is decided on the basis of minimum SAD and a search area is constructed and with a updated centre of the membership function a new search area is constructed.
Step 3: The Sum of Absolute Differences (SAD) parameter is utilized to obtain the motion vectors of the moving blocks. The blocks for which minimum SAD is obtained constitute the candidates for motion vectors.
This work determines the membership values of block coefficients to show the consistency of the coefficients by using numeric values to determine the fluctuating and unsure pixel quality. Fuzzy sets can then be employed to measure the degree of value for any pixel.  273 | P a g e www.ijacsa.thesai.org The Gaussian membership function has only two parameters that can be determined by macro block pixels; thus, image pixels distribution can be treated as a regular distribution according to the membership function. A macro block with size "M x N" can be treated as the data matrix, and for this the corresponding membership matrix can be obtained using Gaussian membership functions. This membership matrix contains an array of fuzzy sets, namely the fuzzy set of corresponding pixels values. u(im ij ) represents the degree of membership each pixels [23], as in eq 1. After formulating the membership function, each crisp pixel value im(i,j) is assigned as a membership value u(im ij ) value which is the corresponding membership degree of the fuzzy set.
Where imij represents the macroblocks' intensity, φ is the amplification factor, σ the macroblocks standard deviation and their width is the GMF, c the centre of the GMF and the macroblock's average value is described.
Where im(i,j) is the pixel value at position (i, j),M and N is the size of the block.
The membership functions as defined in above equations are calculated for both current frame and the previous or reference frame. The fuzzy decision for the predicted frame motion vectors is calculated by finding difference of the two membership values. em=(abs(ur(imij)-uc(imij))) (4) where ur(imij) is membership of reference block and uc(imij) is membership of current frame blocks. The sum of absolute difference of membership value of all blocks is the de-fuzzification expression. SAD= ∑ (5) where "B" represents all the macroblocks. The Sum of Absolute Differences (SAD) parameter is utilized to obtain the motion vectors of the moving blocks. The blocks for which minimum SAD is obtained constitute the candidates for motion vectors.

V. RESULT AND DISCUSSION
The proposed algorithm was implemented using MATLAB software and tested with "football.mp4" video sequence. The frames have been derived from the original video sequence which is of the size 352x288. The bit rate of the video is 4Mb/s. In most of the researches done earlier a grayscale or monochrome version has been chosen for analysis but here in this work, colored frame retrieved as from the original video has been utilized for the analysis. Step Search(3SS) and proposed Algorithm using different search area "p", and block size "b". Fig. 4(a), 4(b), 4(c), 4(d), 4(e), 4(f), 4(g), 4(h), 4(i), 4(j), 4(k) and 4(l) show the predicted frame, residual frame and motion vector plot for FS,H.264, 3SS and the Proposed Method for p=8 and b=8. Similarly in Fig. 5(a), 5(b), 5(c), 5(d), 5(e), 5(f), 5(g), 5(h), 5(i), 5(j), 5(k) and 5(l) similar results for the three techniques and a proposed fuzzy method have been shown for, p=8 and b=16 and in Fig. 6(a), 6(b), 6(c), 6(d), 6(e), 6(f), 6(g), 6(h), 6(i), 6(j), 6(k) and 6(l) all these three technique and a proposed fuzzy method have been applied for the p=16 and b=16.
A. Results for clip football.mp4 sequence Search area p=8, Block Size, b=8.

D. PSNR Analysis Comparison Table Football.mp4
The Peak Signal-to-Noise Ratio is expressed for the ratio between two values the maximum possible value of a signal and power of distortion the higher the value the image quality is better because of the Mean square error between the original frames and predicted is very low. Here the PSNR value is computed between the target frame and predicted frame .While computing the PSNR value of different algorithm as Full search, three step search and H.264 the proposed algorithm shows that it has higher PSNR value than other algorithms. The comparison results are shown in Table I and the related graph in Fig. 7.

F. SSIM Comparison (Football.mp4)
Structural Similarity index which measures the difference between predicted frame and target frame, based on visible structures in the image and perceptual metric is given in the Table II and the related graph in Fig. 8. respectively. It proves that the fuzzy based search provides an optimal search and maintains the frame quality which is more suitable in real time video streaming. Thus it can be asserted that the proposed algorithm achieves a better PSNR as compared to other algorithms. In the same way SSIM is also found better than other algorithms. This proves the fact that the proposed motion estimation algorithm is more suitable for the compression standards to yield the optimized performance.