A more efficient coding scheme for H.264 by heuristically assign macroblock partition types for video foreground and background coding is proposed. High visual quality of foreground regions are retained while low bit-rate background coding is achieved. More importantly, the encoding time is reduced significantly owing to the elimination of the exhausted searches over all partition types during the RD optimization.