1. A method for performing mode selection in a video encoder, said method comprising: encoding with a plurality of encoding modes from a set of encoding modes; computing a distortion value for each encoding mode from the plurality of encoding modes, wherein computing said distortion value comprises using a function for reducing the impact of outliers; computing a bit rate value for each encoding mode from the plurality of encoding modes; computing a Lagrangian value for each encoding mode from the plurality of encoding modes, using said distortion value, said bit rate value, and a Lagrangian multiplier; and selecting an encoding mode based on said Lagrangian values.