Skip to content

spng_decode_image should use powf, not pow #282

@TuxSH

Description

@TuxSH

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;
        }

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions