for(int i = 0; i < 1000; i++)
gamma_curve (O.gamm[0], O.gamm[1], 2, (t_white << 3)/O.bright);
And run Canon 5Ds image though profiler (Intel VTune amplifier). Gamma curve (1000 repetitions) takes 0.619 seconds, so usual one-time run should be about than 0.6 msec
CPU: i7-7700k at base speed.
Other processing: 411ms for decode, 700ms for scale colors, 900ms for (fastest available) linear interpolation, so about 2sec total.
So, gamma_curve is less than 1/3000 of total processing time for such large files.
Either your profiler is wrong, or your math library (pow(), log(), or exp() functions) is incredibly slow.
Just changed (in copy_mem_image code)
From:
to
And run Canon 5Ds image though profiler (Intel VTune amplifier). Gamma curve (1000 repetitions) takes 0.619 seconds, so usual one-time run should be about than 0.6 msec
CPU: i7-7700k at base speed.
Other processing: 411ms for decode, 700ms for scale colors, 900ms for (fastest available) linear interpolation, so about 2sec total.
So, gamma_curve is less than 1/3000 of total processing time for such large files.
Either your profiler is wrong, or your math library (pow(), log(), or exp() functions) is incredibly slow.