Seeing you seem to worry about the inaccuracy in LED current due to nonlinearity of PWM, do you realize LED Vf varies all over the place with temperature etc., and your 5V supply varies, too, so you never get regulated, accurate current with simple series resistor driver anyway. If you need accurate LED current, you need to measure it and feedback. If you need accurate output, you need to sense the light and feedback on that.