not only improves the visual effects of a restored image but also reduces the amount of necessary calculation allowing realtime compensation application_number US 37706199 A description reference will now be made in detail to the preferred embodiments of the present invention examples of which are illustrated in the accompanying drawings in general if an error occurs in a slice many successive macro blocks are damaged therefore information on macro blocks around a damaged block i e adjacent macro blocks on top sides and bottom of a damaged block is available fig2 shows a current frame cf and a previous frame pf wherein pixel values of a previous frame pf in the position corresponding to the hatched portions of the current frame cf is utilized according to the present invention by applying a weighted cost function to search for the optimal motion vector having the least error from the motion vectors v x and v y in a search region s of a previous frame a damaged macro block is replaced with a macro block from a previous frame obtained by the optimal motion vector particularly the optimal motion vector v x v y is predicted according to equation 1 below v x v y argmin vx vy u2208 s ue89e ue89e u2211 t 1 3 ue89e ue89e d ij t ue8a0 v x v y 1 where d ij 1 ue8a0 v x v y ue89e u2211 k 0 n 1 ue89e ue89e u2211 m 1 w ue89e ue89e w 1 ue8a0 m x1 ue8a0 i m j k ue89e x u2032 ue89e 1 ue89e i m v x j k v y ue89e 2 d ij.