[FFmpeg-devel] [PATCH v2] avfilter: Add tonemap vaapi filter for H2S

Sun, Xinpeng xinpeng.sun at intel.com
Thu Nov 28 07:37:12 EET 2019


Hi Carl,

> -----Original Message-----
> From: ffmpeg-devel <ffmpeg-devel-bounces at ffmpeg.org> On Behalf Of Carl
> Eugen Hoyos
> Sent: Wednesday, November 27, 2019 6:14 PM
> To: FFmpeg development discussions and patches <ffmpeg-devel at ffmpeg.org>
> Subject: Re: [FFmpeg-devel] [PATCH v2] avfilter: Add tonemap vaapi filter for
> H2S
> 
> Am Mi., 27. Nov. 2019 um 10:51 Uhr schrieb Xinpeng Sun
> <xinpeng.sun at intel.com>:
> >
> > It performs HDR(High Dynamic Range) to SDR(Standard Dynamic Range)
> > conversion with tone-mapping. It only supports HDR10 as input temporarily.
> >
> > An example command to use this filter with vaapi codecs:
> > FFMPEG -hwaccel vaapi -vaapi_device /dev/dri/renderD128
> > -hwaccel_output_format vaapi \ -i INPUT -vf
> > 'tonemap_vaapi=format=p010' -c:v hevc_vaapi -profile 2 OUTPUT
> 
> Why is HDR10 -> P010 (10bit -> 10 bit) called H2S?

It is P010 SDR here. SDR is not necessarily related to 8bit or 10bit. 
Here is a reference you might be interested in: https://www.itu.int/pub/R-REP-BT.2390

> 
> [...]
> 
> > +    if (input_frame->color_trc != AVCOL_TRC_SMPTE2084) {
> > +        av_log(avctx, AV_LOG_ERROR, "Only support HDR10 as input for vaapi
> tone-mapping\n");
> > +        return AVERROR(EINVAL);
> 
> Shouldn't this also accept unknown trc?
> (With a warning)

Sorry if I misunderstand "unknown trc". Did you mean the trc undefined by ffmpeg or the trc unsupported by the driver?
If it is the former,  it has been checked in tonemap_vaapi_init().

> 
> [...]
> 
> > +    { "format", "Output pixel format set",
> > + OFFSET(output_format_string), AV_OPT_TYPE_STRING, .flags = FLAGS,
> > + "format" },
> 
> Sorry if I misremember how this is done for other filters:
> Shouldn't the output format be set by the filter chain or the format filter?
> 
> Carl Eugen

If I got it correctly, what you mean is setting the filter parameters by -vf"tonemap_vaapi, format=p010" instead of -vf"tonemap_vaapi=format=p010"?
In my opinion, from the perspective of transcoding, it is better to finish the complete pipeline in hw. This "format" option is used to set hw output surface format 
for the tonemap_vaapi filter, so that the trancode pipeline can work in video memory without any sw color space convertion.

Thanks,
Xinpeng

> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> 
> To unsubscribe, visit link above, or email ffmpeg-devel-request at ffmpeg.org
> with subject "unsubscribe".


More information about the ffmpeg-devel mailing list