For encoding, a frame of video data can be segregated into macroblocks,
which can be segregated into slices, which in turn can be segregated into
slice groups. A macroblock identifier (ID) can be associated with each of
the macroblocks. When at least one slice from each of the slice groups
has been encoded, the macroblock IDs associated with the encoded slices
can be compared to determine an order in which the encoded slices are to
be placed in an access unit for the frame. Of the encoded slices, the
slice that includes the macroblock with the lowest macroblock ID will be
placed in the access unit before the other encoded slices.