An improved method and apparatus for prediction coding with motion estimation uses a hierarchical approach in which a motion vector updating routine is performed with respect to multiple levels of smaller and smaller regions of a frame. The motion vector updating routine updates the motion vector of a smaller region by assigning to it a best motion vector selected from among an initial motion vector assigned to the smaller region, motion vectors of neighboring regions, and a matched motion vector obtained by performing a block matching technique for the smaller region. The best motion vector for each region is selected according to a priority scheme and a predetermined threshold value. Adjacent regions having the same motion vector are then merged together, and a region shape representation routine is used to specify contour pixels that will allow the merged regions to be recovered by a decoder. A contour coding routine is then used to encode the contour pixels for transmission to the decoder.