1. An apparatus comprising: a skip checking module to determine whether a macroblock in a current picture frame may be skipped from motion estimation; an integer search module to search a reference frame for the macroblock at integer pixel locations if the macroblock is not skipped from motion estimation; a macroblock partitioning module to determine a macroblock partition based on results from the integer search module; and a bidirectional motion estimation refinement module to determine whether a selected video encoding standard allows each subblock to have its own decision on whether prediction should be forward or backward; if not, find the best macroblock partition in each direction and select the partition direction with smaller distortion; if so, merge backward and forward motion vectors for all subblocks and obtain the best macroblock partition based on the merged vectors; and determine whether the selected video encoding standard allows each subblock to have its own decision on whether prediction should be unidirectional or bidirectional; if not, choose the final direction pattern by comparing bidirectional results for the chosen partition with all subblocks having unidirectional and being bidirectional; if so, chose the final direction by comparing bidirectional results for the chosen partition.