[FFmpeg-devel] [PATCH 1/2] lavu: add a gamma field to AVMasteringDisplayMetadata

wm4 nfxjfg at googlemail.com
Wed Sep 20 21:18:15 EEST 2017


On Wed, 20 Sep 2017 04:00:27 +0100
Rostislav Pehlivanov <atomnuker at gmail.com> wrote:

> PNG exposes it and its required in order to correctly display some images,
> particularly images crafted to contain 2 different images which appear
> differently depending on whether the gamma has been taken into account.
> 
> Signed-off-by: Rostislav Pehlivanov <atomnuker at gmail.com>
> ---
>  libavutil/mastering_display_metadata.h | 10 ++++++++++
>  libavutil/version.h                    |  2 +-
>  2 files changed, 11 insertions(+), 1 deletion(-)
> 
> diff --git a/libavutil/mastering_display_metadata.h b/libavutil/mastering_display_metadata.h
> index 847b0b62c6..3de58bf468 100644
> --- a/libavutil/mastering_display_metadata.h
> +++ b/libavutil/mastering_display_metadata.h
> @@ -66,6 +66,16 @@ typedef struct AVMasteringDisplayMetadata {
>       */
>      int has_luminance;
>  
> +    /**
> +     * The power-law response exponent needed to compensate for nonlinearity.
> +     */
> +    AVRational gamma;
> +
> +    /**
> +     * Flag indicating whether the gamma has been set.
> +     */
> +    int has_gamma;
> +
>  } AVMasteringDisplayMetadata;

Why have the last field, instead of making gamma={0,0} mean unset?


More information about the ffmpeg-devel mailing list