Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
From: "Xiang, Haihao" <haihao.xiang-at-intel.com@ffmpeg.org>
To: "ffmpeg-devel@ffmpeg.org" <ffmpeg-devel@ffmpeg.org>
Subject: Re: [FFmpeg-devel] [PATCH 1/3] lavfi/tonemap_vaapi: By default use bt709 for output frame
Date: Mon, 15 Apr 2024 01:50:22 +0000
Message-ID: <651a54f8d8681d4d815b92ab27fd004cdec7a179.camel@intel.com> (raw)
In-Reply-To: <20240318081246.3649869-1-haihao.xiang@intel.com>

On Ma, 2024-03-18 at 16:12 +0800, Xiang, Haihao wrote:
> From: Haihao Xiang <haihao.xiang@intel.com>
> 
> By default don't use the color properties from input frame as output
> frame properties when performing HDR to SDR conversion
> 
> Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
> ---
>  doc/filters.texi               | 4 ++--
>  libavfilter/vf_tonemap_vaapi.c | 7 +++++--
>  2 files changed, 7 insertions(+), 4 deletions(-)
> 
> diff --git a/doc/filters.texi b/doc/filters.texi
> index 913365671d..2cb84c1476 100644
> --- a/doc/filters.texi
> +++ b/doc/filters.texi
> @@ -27839,7 +27839,7 @@ Default is nv12.
>  @item primaries, p
>  Set the output color primaries.
>  
> -Default is same as input.
> +Default is bt709.
>  
>  @item transfer, t
>  Set the output transfer characteristics.
> @@ -27849,7 +27849,7 @@ Default is bt709.
>  @item matrix, m
>  Set the output colorspace matrix.
>  
> -Default is same as input.
> +Default is bt709.
>  
>  @end table
>  
> diff --git a/libavfilter/vf_tonemap_vaapi.c b/libavfilter/vf_tonemap_vaapi.c
> index 0b767202d2..a21f565e3a 100644
> --- a/libavfilter/vf_tonemap_vaapi.c
> +++ b/libavfilter/vf_tonemap_vaapi.c
> @@ -278,13 +278,16 @@ static int tonemap_vaapi_filter_frame(AVFilterLink
> *inlink, AVFrame *input_frame
>      if (err < 0)
>          goto fail;
>  
> +    /* Use BT709 by default for HDR to SDR output frame */
> +    output_frame->color_primaries = AVCOL_PRI_BT709;
> +    output_frame->color_trc = AVCOL_TRC_BT709;
> +    output_frame->colorspace = AVCOL_SPC_BT709;
> +
>      if (ctx->color_primaries != AVCOL_PRI_UNSPECIFIED)
>          output_frame->color_primaries = ctx->color_primaries;
>  
>      if (ctx->color_transfer != AVCOL_TRC_UNSPECIFIED)
>          output_frame->color_trc = ctx->color_transfer;
> -    else
> -        output_frame->color_trc = AVCOL_TRC_BT709;
>  
>      if (ctx->color_matrix != AVCOL_SPC_UNSPECIFIED)
>          output_frame->colorspace = ctx->color_matrix;

Will apply, 

Thanks
Haihao


_______________________________________________
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".

      parent reply	other threads:[~2024-04-15  1:50 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-18  8:12 Xiang, Haihao
2024-03-18  8:12 ` [FFmpeg-devel] [PATCH 2/3] lavfi/tonemap_vaapi: Update the log Xiang, Haihao
2024-03-18  8:12 ` [FFmpeg-devel] [PATCH 3/3] lavfi/tonemap_vaapi: Add support for HDR to HDR tone mapping Xiang, Haihao
2024-04-15  1:50 ` Xiang, Haihao [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=651a54f8d8681d4d815b92ab27fd004cdec7a179.camel@intel.com \
    --to=haihao.xiang-at-intel.com@ffmpeg.org \
    --cc=ffmpeg-devel@ffmpeg.org \
    /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