Added an autocontrast reference implementation.