**2. Statistical analysis of MV correlation characteristic**

Because of the consistency of object and the consistency of motion, MVs have high correlation in both spatial and temporal domains. Thus MV prediction technique is adopted in H.264/AVC to improve ME efficiency. A predicted motion vector, *mvpred* , is generated by previously coded neighbourhood motion vectors and MVD, the difference between the current vector and the predicted vector, is encoded and transmitted.

Simulated Annealing for Fast Motion Estimation Algorithm in H.264/AVC 179

= *MVD best pred d dd* − (1)

MV directional difference *MVD d* describes the directional similarity between predicted MV

where, [ 180 ,180 ] *MVD <sup>d</sup>* ∈ − is classified into 8 classes, with boundary of ± ° 22.5 , ± ° 67.5 , ± ° 112.5 and ± ° 157.5 as illustrated in Figure 3. The statistical calculation is carried out by exploding the MV directional distribution in these classes. Then the distribution probabilities ( )*<sup>i</sup> <sup>d</sup> p MVC* of MV directional correlation are obtained. If MV directional correlation is high, *best d* locates in forward or backward of *pred d* , as shown in Figure 4. Class ( ) <sup>1</sup> *d* ∈− ° 22.5 ,22.5 ° and Class ( )( ) <sup>2</sup> *d* ∈ − °− ° ° ° 180 , 157.5 157.5 ,180 indicate the forward and backward direction and

MV distance correlation is measured by the distance between global minimum point and searching centre, which is known as the motion vector difference (MVD). Several Octagon grids *<sup>j</sup> g* are utilized to categorise the MV distance correlation, as such circle-approximated pattern is more accurate to describe the MVD distribution. The interval between neighbour octagon grids is 4 pels, which is shown in figure 3. To evaluate the characteristic of MV distance correlation, MV distance correlation probabilities ( )*<sup>j</sup> <sup>g</sup> p MVC* are calculated. Considering both directional and distance, MV correlation probabilities , ( ) *i j d g p MVC* for the

(**a) Forward** *pred d* **(b) Backward** *pred d*

 *dbest*

**Start Point**

where (1,8) *<sup>i</sup> d* ∈ is the directional classes and ( ) 1, /4 *<sup>j</sup> g* ∈ *sr* is the octagon grids within search range *sr*. The MV correlation , ( ) *i j d g p MVC* represents the possibility of optimal MV obtained

( ) *i j* , ( )*<sup>i</sup>* ( )*<sup>j</sup> d g <sup>d</sup> <sup>g</sup> p MVC p MVC p MVC* = × (2)

direction *pred d* and optimal MV direction *best d* , and is measured in degrees as follows

normally have higher probabilities than other classes.

**Start Point**

**Figure 4.** Two situation of *best d* locating along *pred d*

current coding frame are defined as:

in the class (, ) *i j d g* .

For the regions with smooth motion of a moving background and uniform motion of rigid objects, there normally exist very high correlations between predicted and optimal motion vectors. So that the BMME search algorithm only need to check a few points to obtain optimal position. While for the poor motion vector correlation scenario, like the complex and irregular motion, more candidate points are needed to be checked. Therefore, MV correlation characteristic will affect the searching strategy chosen in the BMME algorithm. In order to adaptively select an appropriate search pattern, MV correlation is statistical analysed in this section.

**Figure 3.** Direction and distance classification of MV correlation ( ) , *i j d g p MVC*

To sufficient describe MV correlation characteristic, the MV correlation statistics are calculated in two aspects: motion vector directional correlation statistic and motion vector distance correlation statistic. Combining these two correlations together, the search window is divided into 8 direction regions *<sup>i</sup> d* and a group of octagon grids *<sup>j</sup> g* , as illustrated in Figure 3. Normally, the motion content of each video sequence is unique and the scene is changing with time. MVs correlation characteristic is changing with sequences and time. In this case, the analysis of MV correlation is frame based to improve the accuracy. The predicted and optimal motion vectors of previous frame are utilized for current coding frame.

MV directional difference *MVD d* describes the directional similarity between predicted MV direction *pred d* and optimal MV direction *best d* , and is measured in degrees as follows

$$d\_{MVD} = d\_{best} - d\_{pred} \tag{1}$$

where, [ 180 ,180 ] *MVD <sup>d</sup>* ∈ − is classified into 8 classes, with boundary of ± ° 22.5 , ± ° 67.5 , ± ° 112.5 and ± ° 157.5 as illustrated in Figure 3. The statistical calculation is carried out by exploding the MV directional distribution in these classes. Then the distribution probabilities ( )*<sup>i</sup> <sup>d</sup> p MVC* of MV directional correlation are obtained. If MV directional correlation is high, *best d* locates in forward or backward of *pred d* , as shown in Figure 4. Class ( ) <sup>1</sup> *d* ∈− ° 22.5 ,22.5 ° and Class ( )( ) <sup>2</sup> *d* ∈ − °− ° ° ° 180 , 157.5 157.5 ,180 indicate the forward and backward direction and normally have higher probabilities than other classes.

(**a) Forward** *pred d* **(b) Backward** *pred d*

**Figure 4.** Two situation of *best d* locating along *pred d*

178 Simulated Annealing – Single and Multiple Objective Problems

analysed in this section.

frame.

**2. Statistical analysis of MV correlation characteristic** 

current vector and the predicted vector, is encoded and transmitted.

**Figure 3.** Direction and distance classification of MV correlation ( ) , *i j d g p MVC*


112.5

*d7 d5*




*d8*


0

5

10

157.5

15

To sufficient describe MV correlation characteristic, the MV correlation statistics are calculated in two aspects: motion vector directional correlation statistic and motion vector distance correlation statistic. Combining these two correlations together, the search window is divided into 8 direction regions *<sup>i</sup> d* and a group of octagon grids *<sup>j</sup> g* , as illustrated in Figure 3. Normally, the motion content of each video sequence is unique and the scene is changing with time. MVs correlation characteristic is changing with sequences and time. In this case, the analysis of MV correlation is frame based to improve the accuracy. The predicted and optimal motion vectors of previous frame are utilized for current coding


*d6*

*d2 d1*

*g1*

*g2*


*d4*

*d3*

22.5

Because of the consistency of object and the consistency of motion, MVs have high correlation in both spatial and temporal domains. Thus MV prediction technique is adopted in H.264/AVC to improve ME efficiency. A predicted motion vector, *mvpred* , is generated by previously coded neighbourhood motion vectors and MVD, the difference between the

For the regions with smooth motion of a moving background and uniform motion of rigid objects, there normally exist very high correlations between predicted and optimal motion vectors. So that the BMME search algorithm only need to check a few points to obtain optimal position. While for the poor motion vector correlation scenario, like the complex and irregular motion, more candidate points are needed to be checked. Therefore, MV correlation characteristic will affect the searching strategy chosen in the BMME algorithm. In order to adaptively select an appropriate search pattern, MV correlation is statistical

67.5

*g4*

0.18%

*g3*


MV distance correlation is measured by the distance between global minimum point and searching centre, which is known as the motion vector difference (MVD). Several Octagon grids *<sup>j</sup> g* are utilized to categorise the MV distance correlation, as such circle-approximated pattern is more accurate to describe the MVD distribution. The interval between neighbour octagon grids is 4 pels, which is shown in figure 3. To evaluate the characteristic of MV distance correlation, MV distance correlation probabilities ( )*<sup>j</sup> <sup>g</sup> p MVC* are calculated. Considering both directional and distance, MV correlation probabilities , ( ) *i j d g p MVC* for the current coding frame are defined as:

$$p\left(MVC\_{d\_i,\mathcal{G}\_j}\right) = p\left(MVC\_{d\_i}\right) \times p\left(MVC\_{\mathcal{G}\_j}\right) \tag{2}$$

where (1,8) *<sup>i</sup> d* ∈ is the directional classes and ( ) 1, /4 *<sup>j</sup> g* ∈ *sr* is the octagon grids within search range *sr*. The MV correlation , ( ) *i j d g p MVC* represents the possibility of optimal MV obtained in the class (, ) *i j d g* .



Simulated Annealing for Fast Motion Estimation Algorithm in H.264/AVC 181

Further illustration is demonstrated in Figure 6. The directional division describe the direction difference between the predicted motion vector and the optimal motion vector. The Octagon grid partitions represent the distance difference between two vectors. Such category division is not in image pels domain. It represents the unique motion character of each frame. Direction class *d1* covers 22.5*<sup>o</sup>* ± of direction different between predicted motion vector and optimal motion vector. For each MB, the predicted motion vector determines the initial direction *d1* and then the division pattern is rotated accordingly. As the motion correlation for each frames are different, the division pattern is different among frames. For each macroblock, the predicted MVs are different, so that the search pattern is also

Based on above satiric analysis, SAAS algorithm is proposed, which provides a more accurate approach to obtain optimal motion vector. Similar to PIDS algorithm, the number of search points in each division is adaptively adjusted. But more computational complexity can be saved as the intensive searching areas are more precisely divided with help of

adaptively changed.

different Octagon grids.

**algorithm** 

**Figure 6.** MV correlation statistics of coastguard, the 10th frame

**3.1. Simulated annealing algorithm** 

**3. Observations of simulated annealing and simulated quenching** 

Simulated annealing (SA) [13] is a probabilistic method for finding the global minimum of an optimization problem. It works by emulating the physical process where liquids are slowly cooled so that the atoms are often able to line themselves up and form a pure crystal.

**Table 1.** MV correlation probabilities of video sequence coastguard, the 10th frame

One example is given in Table 1, which shows the MV correlation characteristic in the 10th frame of "coastguard" CIF video sequence. For better understanding, the 10th frame of the "coastguard" is given in Figure 5. It can be observed that the fast moving boats bring some fast and irregular motion, while camera panning generates smooth movement on background. According to Table 1, more than 35% of optimal MVs are detected in the directional class <sup>2</sup> *d* . In class <sup>5</sup> *d* and class <sup>6</sup> *d* , there are also big percentage of optimal MVs appears, which implies the motion of this frame is directional irregular. While the distance correlation suggests that 90% of optimal MVs locate within the radius of 8 pels, which is quite stable when considering distance correlation. Considering both directional and distance correlation, there are only 3 partition regions, i.e.( ) 2 1 *d g*, , ( ) 2 2 *d g*, and ( ) 6 1 *d g*, with more than 10% probabilities to contain the optimal position. In the meanwhile, 21 of 64 regions' MV correlation probabilities are more than 0.1%. This suggests that intensive search is only needed to be performed in these regions. While the rest of regions, it is sufficient to be coarsely searched or even be totally skipped.

**Figure 5.** The 10th frame of CIF video sequence "coastguard".

Further illustration is demonstrated in Figure 6. The directional division describe the direction difference between the predicted motion vector and the optimal motion vector. The Octagon grid partitions represent the distance difference between two vectors. Such category division is not in image pels domain. It represents the unique motion character of each frame. Direction class *d1* covers 22.5*<sup>o</sup>* ± of direction different between predicted motion vector and optimal motion vector. For each MB, the predicted motion vector determines the initial direction *d1* and then the division pattern is rotated accordingly. As the motion correlation for each frames are different, the division pattern is different among frames. For each macroblock, the predicted MVs are different, so that the search pattern is also adaptively changed.

Based on above satiric analysis, SAAS algorithm is proposed, which provides a more accurate approach to obtain optimal motion vector. Similar to PIDS algorithm, the number of search points in each division is adaptively adjusted. But more computational complexity can be saved as the intensive searching areas are more precisely divided with help of different Octagon grids.

**Figure 6.** MV correlation statistics of coastguard, the 10th frame
