[FFmpeg-devel] [PATCH] lavfi: a minor fix to tonemap peak detection.

Vittorio Giovara vittorio.giovara at gmail.com
Mon May 21 22:11:56 EEST 2018


On Mon, May 21, 2018 at 2:58 AM, Ruiling Song <ruiling.song at intel.com>
wrote:

> If the transfer was SMPTE2084, use the peak of 10000 even if not tagged.
> Otherwise, we would assume it is HLG with a peak of 1200.
> Based on suggestion by Niklas Haas.
>
> Signed-off-by: Ruiling Song <ruiling.song at intel.com>
> ---
>  libavfilter/vf_tonemap.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/libavfilter/vf_tonemap.c b/libavfilter/vf_tonemap.c
> index 10308bd..ab45f2e 100644
> --- a/libavfilter/vf_tonemap.c
> +++ b/libavfilter/vf_tonemap.c
> @@ -131,10 +131,9 @@ static double determine_signal_peak(AVFrame *in)
>              peak = av_q2d(metadata->max_luminance) / REFERENCE_WHITE;
>      }
>
> -    /* smpte2084 needs the side data above to work correctly
> -     * if missing, assume that the original transfer was arib-std-b67 */
> +    /* if not SMPTE2084, we would assume HLG */
>      if (!peak)
> -        peak = 12;
> +        peak = in->color_trc == AVCOL_TRC_SMPTE2084 ? 100 : 12;
>
>      return peak;
>  }
> --
> 2.7.4
>
>
seems reasonable
-- 
Vittorio


More information about the ffmpeg-devel mailing list