speedup invertHOG()