Gamma correction for LED Display

Hello, everyone!!

I am doing a project that use an arduino board as a controller for small LED display. LED driver IC is MBI5042 which has 16-bit color depth PWMs.

My task at the moment is converting 8-bit source data to gamma-corrected 16-bit data.

I simply wrote a routine for this.

void gamma12(int i) {
  value = pow(float(i)*16/4096,2.2)*65536;
  // 'i' is a 8-bit source value, 0 to 255 and gamma 2.2

The number 16 in the code can be changed to 12, if I want to use 75% of PWM depth.

This code is called several hundred times in a loop.
Please, check this and let me know it is good or bad solution.

It's probably a good solution if it doesn't matter how long the "few hundred times" take.

Thank you, AWOL.

I think so it's too slow.
Is there another way to increase speed?
Actually I am looking for better way than I am thinking.

How about a lookup table of, say, 256 entries, with simple linear interpolation?