ons 2023-08-16 klockan 01:20 -0400 skrev Leo Izen:
> By default the OpenEXR decoder outputs linear light pixel data by
> applying a gamma=1.0 transfer (i.e. a no-op). When it does so, it
> should tag the data as linear so color-managed filters or other tools
> can work with it correctly.
> 
> Signed-off-by: Leo Izen <leo.i...@gmail.com>
> ---
>  libavcodec/exr.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/libavcodec/exr.c b/libavcodec/exr.c
> index fae1d08ab0..518066facf 100644
> --- a/libavcodec/exr.c
> +++ b/libavcodec/exr.c
> @@ -2088,6 +2088,8 @@ static int decode_frame(AVCodecContext *avctx,
> AVFrame *picture,
>  
>      if (s->apply_trc_type != AVCOL_TRC_UNSPECIFIED)
>          avctx->color_trc = s->apply_trc_type;
> +    else if (s->gamma > 0.9999f && s->gamma < 1.0001f)
> +        avctx->color_trc = AVCOL_TRC_LINEAR;

I'm going to be difficult here and point out that gamma=0.99991 is not
linear. It's probably linear *enough* most of the time, but also 1.0
can be exactly represented by float so an equality check seems
appropriate

/Tomas

_______________________________________________
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