Rewrite mt_xxpand a bit

Optimize square mode by doing vertical and horizontal xxpand