<s>
A	O
Block	O
Matching	O
Algorithm	O
is	O
a	O
way	O
of	O
locating	O
matching	O
macroblocks	B-General_Concept
in	O
a	O
sequence	O
of	O
digital	O
video	O
frames	O
for	O
the	O
purposes	O
of	O
motion	O
estimation	O
.	O
</s>
<s>
This	O
can	O
be	O
used	O
to	O
discover	O
temporal	O
redundancy	O
in	O
the	O
video	O
sequence	O
,	O
increasing	O
the	O
effectiveness	O
of	O
inter-frame	O
video	O
compression	O
by	O
defining	O
the	O
contents	O
of	O
a	O
macroblock	B-General_Concept
by	O
reference	O
to	O
the	O
contents	O
of	O
a	O
known	O
macroblock	B-General_Concept
which	O
is	O
minimally	O
different	O
.	O
</s>
<s>
A	O
block	O
matching	O
algorithm	O
involves	O
dividing	O
the	O
current	O
frame	O
of	O
a	O
video	O
into	O
macroblocks	B-General_Concept
and	O
comparing	O
each	O
of	O
the	O
macroblocks	B-General_Concept
with	O
a	O
corresponding	O
block	O
and	O
its	O
adjacent	O
neighbors	O
in	O
a	O
nearby	O
frame	O
of	O
the	O
video	O
(	O
sometimes	O
just	O
the	O
previous	O
one	O
)	O
.	O
</s>
<s>
A	O
vector	O
is	O
created	O
that	O
models	O
the	O
movement	O
of	O
a	O
macroblock	B-General_Concept
from	O
one	O
location	O
to	O
another	O
.	O
</s>
<s>
This	O
movement	O
,	O
calculated	O
for	O
all	O
the	O
macroblocks	B-General_Concept
comprising	O
a	O
frame	O
,	O
constitutes	O
the	O
motion	O
estimated	O
in	O
a	O
frame	O
.	O
</s>
<s>
The	O
search	O
area	O
for	O
a	O
good	O
macroblock	B-General_Concept
match	O
is	O
decided	O
by	O
the	O
‘	O
search	O
parameter’	O
,	O
p	O
,	O
where	O
p	O
is	O
the	O
number	O
of	O
pixels	B-Algorithm
on	O
all	O
four	O
sides	O
of	O
the	O
corresponding	O
macro-block	O
in	O
the	O
previous	O
frame	O
.	O
</s>
<s>
Typical	O
inputs	O
are	O
a	O
macroblock	B-General_Concept
of	O
size	O
16	O
pixels	B-Algorithm
and	O
a	O
search	O
area	O
of	O
p	O
=	O
7	O
pixels	B-Algorithm
.	O
</s>
<s>
Block-matching	B-Algorithm
and	I-Algorithm
3D	I-Algorithm
filtering	I-Algorithm
makes	O
use	O
of	O
this	O
approach	O
to	O
solve	O
various	O
image	B-Algorithm
restoration	I-Algorithm
inverse	O
problems	O
such	O
as	O
noise	O
reduction	O
and	O
deblurring	B-Algorithm
in	O
both	O
still	O
images	O
and	O
digital	O
video	O
.	O
</s>
<s>
The	O
motion	O
vectors	O
may	O
relate	O
to	O
the	O
whole	O
image	O
(	O
global	O
motion	O
estimation	O
)	O
or	O
specific	O
parts	O
,	O
such	O
as	O
rectangular	O
blocks	O
,	O
arbitrary	O
shaped	O
patches	O
or	O
even	O
per	O
pixel	B-Algorithm
.	O
</s>
<s>
Applying	O
the	O
motion	O
vectors	O
to	O
an	O
image	O
to	O
predict	O
the	O
transformation	O
to	O
another	O
image	O
,	O
on	O
account	O
of	O
moving	O
camera	O
or	O
object	O
in	O
the	O
image	O
is	O
called	O
motion	B-Algorithm
compensation	I-Algorithm
.	O
</s>
<s>
The	O
combination	O
of	O
motion	O
estimation	O
and	O
motion	B-Algorithm
compensation	I-Algorithm
is	O
a	O
key	O
part	O
of	O
video	O
compression	O
as	O
used	O
by	O
MPEG	O
1	O
,	O
2	O
and	O
4	O
as	O
well	O
as	O
many	O
other	O
video	B-Application
codecs	I-Application
.	O
</s>
<s>
A	O
metric	O
for	O
matching	O
a	O
macroblock	B-General_Concept
with	O
another	O
block	O
is	O
based	O
on	O
a	O
cost	O
function	O
.	O
</s>
<s>
where	O
N	O
is	O
the	O
size	O
of	O
the	O
macro-block	O
,	O
and	O
and	O
are	O
the	O
pixels	B-Algorithm
being	O
compared	O
in	O
current	O
macroblock	B-General_Concept
and	O
reference	O
macroblock	B-General_Concept
,	O
respectively	O
.	O
</s>
<s>
The	O
motion	O
compensated	O
image	O
that	O
is	O
created	O
using	O
the	O
motion	O
vectors	O
and	O
macroblocks	B-General_Concept
from	O
the	O
reference	O
frame	O
is	O
characterized	O
by	O
Peak	O
signal-to-noise	O
ratio	O
(	O
PSNR	O
)	O
,	O
</s>
<s>
The	O
idea	O
behind	O
TSS	O
is	O
that	O
the	O
error	O
surface	O
due	O
to	O
motion	O
in	O
every	O
macro	O
block	O
is	O
unimodal	B-Algorithm
.	O
</s>
<s>
A	O
unimodal	B-Algorithm
surface	O
is	O
a	O
bowl	O
shaped	O
surface	O
such	O
that	O
the	O
weights	O
generated	O
by	O
the	O
cost	O
function	O
increase	O
monotonically	O
from	O
the	O
global	O
minimum	O
.	O
</s>
<s>
However	O
a	O
unimodal	B-Algorithm
surface	O
cannot	O
have	O
two	O
minimums	O
in	O
opposite	O
directions	O
and	O
hence	O
the	O
8	O
point	O
fixed	O
pattern	O
search	O
of	O
TSS	O
can	O
be	O
further	O
modified	O
to	O
incorporate	O
this	O
and	O
save	O
computations	O
.	O
</s>
<s>
However	O
the	O
peak	O
signal-to-noise	O
ratio	O
achieved	O
is	O
poor	O
as	O
compared	O
to	O
TSS	O
as	O
the	O
error	O
surfaces	O
are	O
not	O
strictly	O
unimodal	B-Algorithm
in	O
reality	O
.	O
</s>
