avcodec/ivi: Factor width dereference out of the loops in ivi_output_plane()