BP said Wednesday that it would spend $400 million to install pollution controls at its giant Whiting, Ind., refinery to allow it to process heavy crude oil from Canada, in a deal with federal and