> -----Original Message----- > From: Song, Ruiling > Sent: Tuesday, May 29, 2018 4:47 PM > To: FFmpeg development discussions and patches <ffmpeg- > de...@ffmpeg.org> > Subject: RE: [FFmpeg-devel] [PATCH] lavfi: add opencl tonemap filter. > > > > > -----Original Message----- > > From: ffmpeg-devel [mailto:ffmpeg-devel-boun...@ffmpeg.org] On > Behalf > > Of myp...@gmail.com > > Sent: Tuesday, May 29, 2018 3:40 PM > > To: FFmpeg development discussions and patches <ffmpeg- > > de...@ffmpeg.org> > > Subject: Re: [FFmpeg-devel] [PATCH] lavfi: add opencl tonemap filter. > > > > 2018-05-29 13:54 GMT+08:00 Ruiling Song <ruiling.s...@intel.com>: > > > This filter does HDR(HDR10/HLG) to SDR conversion with tone-mapping. > > > > > > An example command to use this filter with vaapi codecs: > > > FFMPEG -init_hw_device vaapi=va:/dev/dri/renderD128 -init_hw_device > \ > > > opencl=ocl@va -hwaccel vaapi -hwaccel_device va - > > hwaccel_output_format \ > > > vaapi -i INPUT -filter_hw_device ocl -filter_complex \ > > > > '[0:v]hwmap,tonemap_opencl=t=bt2020:tonemap=linear:format=p010[x1]; > > \ > > > [x1]hwmap=derive_device=vaapi:reverse=1' -c:v hevc_vaapi -profile 2 > > OUTPUT > > > > > > v2: > > > add peak detection. > > > > > > Signed-off-by: Ruiling Song <ruiling.s...@intel.com> > > > +static int tonemap_opencl_config_output(AVFilterLink *outlink) > > > +{ > > > + AVFilterContext *avctx = outlink->src; > > > + TonemapOpenCLContext *s = avctx->priv; > > > + int ret; > > > + if (s->format == AV_PIX_FMT_NONE) > > > + av_log(avctx, AV_LOG_WARNING, "format not set, use default > > format NV12\n"); > > I think we can give a default format with AV_PIX_FMT_NV12 in > > tonemap_opencl_options[] for this case > > and I think now we only support NV12/P010 output in current implement. > Sounds good. Hi Jun,
I realized that if I default it to NV12 in the table, I would have no chance to catch whether user already passed in a format or not. In fact, I still prefer user explicitly passed in the format that they want (10bit or 8bit). If user did not choose a format, I would generate a warning message that default was used. Does this make sense? Thanks! Ruiling _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel