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.s...@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 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel