Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
From: Niklas Haas <ffmpeg@haasn.xyz>
To: ffmpeg-devel@ffmpeg.org
Cc: "Kacper Michajłow" <kasper93@gmail.com>
Subject: Re: [FFmpeg-devel] [PATCH v2] avcodec/h2645_sei: validate Mastering Display Colour Volume SEI values
Date: Mon, 26 Feb 2024 13:04:15 +0100
Message-ID: <20240226130415.GD19837@haasn.xyz> (raw)
In-Reply-To: <20240225021819.1258-1-kasper93@gmail.com>

On Sun, 25 Feb 2024 03:17:55 +0100 Kacper Michajłow <kasper93@gmail.com> wrote:
> -        av_log(avctx, AV_LOG_DEBUG, "Mastering Display Metadata:\n");
> -        av_log(avctx, AV_LOG_DEBUG,
> -               "r(%5.4f,%5.4f) g(%5.4f,%5.4f) b(%5.4f %5.4f) wp(%5.4f, %5.4f)\n",
> -               av_q2d(metadata->display_primaries[0][0]),
> -               av_q2d(metadata->display_primaries[0][1]),
> -               av_q2d(metadata->display_primaries[1][0]),
> -               av_q2d(metadata->display_primaries[1][1]),
> -               av_q2d(metadata->display_primaries[2][0]),
> -               av_q2d(metadata->display_primaries[2][1]),
> -               av_q2d(metadata->white_point[0]), av_q2d(metadata->white_point[1]));
> -        av_log(avctx, AV_LOG_DEBUG,
> -               "min_luminance=%f, max_luminance=%f\n",
> -               av_q2d(metadata->min_luminance), av_q2d(metadata->max_luminance));
> +        metadata->has_luminance &= sei->mastering_display.min_luminance >= 1 &&
> +                                   sei->mastering_display.min_luminance <= 50000;

    ...                                    &&
    sei->mastering.display.min_luminance <
    sei->mastering_display.max_luminance;

According to spec, at least. Handles the edge case of min = max = 50000.
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

      reply	other threads:[~2024-02-26 12:04 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-25  2:17 Kacper Michajłow
2024-02-26 12:04 ` Niklas Haas [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240226130415.GD19837@haasn.xyz \
    --to=ffmpeg@haasn.xyz \
    --cc=ffmpeg-devel@ffmpeg.org \
    --cc=kasper93@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
		ffmpegdev@gitmailbox.com
	public-inbox-index ffmpegdev

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git