Lecture 21- ME Algorithms
Lecture 21- ME Algorithms
1
Block Based ME Algorithms
3
Matching Criteria for block-based ME
4
MSE criterion
• The MSE is calculated as:
5
MAD criterion
• Mean absolute difference at displacement (i,j) is computed as
𝑁 −1 𝑁 −1
1
𝑀 𝐴𝐷 ( 𝑖, 𝑗 )= 2 ∑ ∑ |𝑠 ( 𝑛1 ,𝑛 2 , 𝑘 ) − 𝑠 ( 𝑛1 +𝑖,𝑛2 + 𝑗 ,𝑘 −𝑙 )|
2
𝑁 𝑛 =0 𝑛 =0
1 2
6
MPC criterion
• Pixels of the candidate block B are compared with the
corresponding pixels of the block with displacement (i,j) in the
reference frames;
• Count the number of close matches, i.e., the difference is less
than a threshold.
• The displacement for which the count is maximum correspond
to the motion vector.
• Define,
1 if s (n1 , n2 , k ) s (n1 i, n2 j , k l )
count (n1 , n1 )
0 otherwise
• The matching pel count is given by MPC (n , n ) N 1 N 1count (n , n )
1 2 1 2
• Motion vector, n 0 n 0 1 2
7
FSBM
• Consider a block from the candidate frame
at coordinates (r,s).
• Then, consider a search window having a
range .
• For each of the (2w+1)2 positions, it is
compared with a block of size N×N.
• The motion vector is determined after
carrying out an exhaustive search.
• This is optimal in the sense that if the
search range is correctly defined, it is
guaranteed to give the best matching
position.
8
FSBM complexity
Matching Computations
criterion
+/- Comparison
MSE (2N2-1)(2w+1)2 N2(2w+1)2 (2w+1)2
MAD (2N2-1)(2w+1)2 --- (2w+1)2
MPC (2N2-1)(2w+1)2 --- N2(2w+1)2
9
2-D Logarithmic search
• Proposed by [Jain81]. Here, an initial search window is
considered, with an assumed best position as its centre; the
initial guess of the best position may be taken as the
position of the candidate block with respect to the
candidate frame.
• Search only in five locations comprising the centre and the
mid points between the centre and the four edges of the
search window.
[Jain81] J.R. Jain and A.K. Jain, “Displacement measurement and its
application in inter-frame image coding,” IEEE Trans. Commun., Vol.
COM-29, pp. , 1799-1808, Dec. 1981 10
2-D Logarithmic search
Points at (j+4,k-4), (j+4,k-6) and (j+5,k-7) are found to give the best match in
steps 1, 2 and 3 respectively.
Source: Image and Video Compression for Multimedia Engineering: Fundamentals … By
14
Yun Q. Shi, Huifang Sun
Conjugate Direction Search
• Developed by (Srinivasan84). Consists of two parts: in the first it finds the
minimum dissimilarity between along the horizontal direction with the fixed
vertical position;
16