better subpixel weight function