hevc: reorder loops

iterate over memory in a more continuous order

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>