In spng_decode_image, pow is used instead of powf, even though all operands are float, not double. This unnecessarily pulls the double exp/log LUTs (instead of the expf/logf LUTs), increasing binary sizes by almost 10KiB for a project already using powf.
exponent = 1.0f / exponent;
unsigned i;
for(i=0; i < lut_entries; i++)
{
float c = pow((float)i / max, exponent) * max;
if(c > max) c = max;
gamma_lut[i] = (uint16_t)c;
}
In
spng_decode_image,powis used instead ofpowf, even though all operands arefloat, notdouble. This unnecessarily pulls thedoubleexp/logLUTs (instead of theexpf/logfLUTs), increasing binary sizes by almost 10KiB for a project already using powf.