On Tue, Aug 20, 2019 at 16:37:35 +0300, Nick Renieris wrote:
> +static float av_always_inline linear_to_srgb(float value) {
> +    if (value <= 0.0031308)
> +        return value * 12.92;
> +    else
> +        return pow(value * 1.055, 1.0 / 2.4) - 0.055;
> +}

Do you need the intermediate double precision, which this promotes to?
If not:
- The constants require the suffix 'f'.
- pow() should be powf().

    if (value <= 0.0031308f)
        return value * 12.92f;
    else
        return powf(value * 1.055f, 1.0f / 2.4f) - 0.055f;

Cheers,
Moritz
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Reply via email to