A new mapping algorithm is proposed for categorization of frames' macroblocks into two (or more) classes in flexible macroblock ordering to give error resilient video transmission. The successful transmission of macroblock data not only enhances the quality of the associated pixels, but also improves the quality of the adjacent lost macroblocks by improving the efficiency of error concealment. Therefore, in our scheme, by carefully modeling the decoder error concealment algorithm at the encoder side, we classify the macroblocks according to their eventual influence on picture quality. Within a limited bit rate budget, we employ an optimization algorithm to select the best group of high-priority macroblocks. We show that prioritized transmission of the more important macroblock group will improve the video quality in error situations where our mapping algorithm outperforms the default mappings of the H.264 codec.