Jun 12, 2021, 00:26 by t...@rothenpieler.org: > On 11.06.2021 17:33, Steven Liu wrote: > >> >> >>> 在 2021年6月11日,22:43,Timo Rothenpieler <t...@rothenpieler.org> 写道: >>> >> Hi Timo, >> >>> >>> --- >>> configure | 2 + >>> doc/filters.texi | 46 ++ >>> libavfilter/Makefile | 1 + >>> libavfilter/allfilters.c | 1 + >>> libavfilter/cuda/vector_helpers.cuh | 14 +- >>> libavfilter/version.h | 2 +- >>> libavfilter/vf_format_cuda.c | 433 ++++++++++++++ >>> libavfilter/vf_format_cuda.cu | 849 ++++++++++++++++++++++++++++ >>> 8 files changed, 1345 insertions(+), 3 deletions(-) >>> create mode 100644 libavfilter/vf_format_cuda.c >>> create mode 100644 libavfilter/vf_format_cuda.cu >>> >>> diff --git a/configure b/configure >>> index 6bfd98b384..7041c09177 100755 >>> --- a/configure >>> +++ b/configure >>> @@ -3078,6 +3078,8 @@ qsvvpp_select="qsv" >>> vaapi_encode_deps="vaapi" >>> v4l2_m2m_deps="linux_videodev2_h sem_timedwait" >>> >>> +format_cuda_filter_deps="ffnvcodec" >>> +format_cuda_filter_deps_any="cuda_nvcc cuda_llvm" >>> hwupload_cuda_filter_deps="ffnvcodec" >>> scale_npp_filter_deps="ffnvcodec libnpp" >>> scale_cuda_filter_deps="ffnvcodec" >>> diff --git a/doc/filters.texi b/doc/filters.texi >>> index 78faf767cf..27a0184cb3 100644 >>> --- a/doc/filters.texi >>> +++ b/doc/filters.texi >>> @@ -12324,6 +12324,52 @@ format=pix_fmts=yuv420p|yuv444p|yuv410p >>> @end example >>> @end itemize >>> >>> +@anchor{format_cuda} >>> +@section format_cuda >>> + >>> +Convert the input video to one of the specified pixel formats. >>> +Libavfilter will try to pick one that is suitable as input to >>> +the next filter. >>> + >>> +It accepts the following parameters: >>> +@table @option >>> + >>> +@item format >>> +The name of the desired output format. >>> +If none is specified, the input format will be used. >>> + >>> +@item passthrough >>> +If true, input frames matching the output format will be passed >>> +through as-is. >>> +If false, every input frame is processed. Frames matching the >>> +output format will be copied without data modification. This is >>> +the default mode. >>> + >>> +@end table >>> + >>> +@subsection Examples >>> + >>> +@itemize >>> +@item >>> +Convert the input video to the @var{yuv420p} format. >>> +@example >>> +format_cuda=yuv420p >>> >> maybe need an format for alpha blend, be used in overlay_cuda for colorkey >> linkly feature. >> > > I had this lying around for a long time. It's also lacking support for the > RGB formats. > Planned to enhance this, but never got around to it. > > Kinda just want to get this merged as-is now, to enable work on enhancements > of the filter. > > Adding the alpha formats should be fairly simple, though I'm not sure what to > do in the conversion. Should it just discard the alpha channel in the one > direction, and add a fully opaque one the other way around? >
Just a nit, could the filter get merged into scale_cuda? I'm used to how other scale filters work. _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".