CalRGB: optimize CalRGB calculations

Also fix one silly mistake.