In H.264 advanced video coding (AVC), variable block size motion estimation plays an important role in compression of interframes. In this paper, we propose a fast inter prediction algorithm based on hierarchical homogeneous detection and cost analysis to select the best mode effectively. For each macroblock, we first detect that whether the macroblock is spatial homogeneous or not. For the non spatial homogeneous macroblock, we then perform the 16×16 motion estimation and examine if the 16x16 block is temporal homogeneous or not. Once the homogeneous macroblock is detected in the above process, the best mode will be chosen as 16×16 mode. For the non-homogeneous macroblock, we then execute 8×8 motion estimation and analyze the cost of 8×8 mode and 16×16 mode for deciding the best inter mode should be 16x16 mode or any other mode. The process for searching the best 8×8 block subtype is similar to the process for macroblocks. Finally, the best inter mode is decided by selecting the inter mode with least cost from the candidate modes. Experimental results show that our proposed algorithm can save about 32-54% computation time without introducing any noticeable performance degradation.