[FFmpeg-devel] [PATCH v15 03/15] lavc/tiff: Convert DNGs to sRGB color space
Moritz Barsnick
barsnick at gmx.net
Thu Aug 22 15:52:09 EEST 2019
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
More information about the ffmpeg-devel
mailing list