fixed subpixel interpolate code