Commit Graph

9918 Commits

Author SHA1 Message Date
Limin Wang 86a2123a6e avfilter/src_movie: add format_opts for the opened file
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
2021-11-29 09:26:40 +08:00
Andreas Rheinhardt f5e74e8d48 avfilter/vf_paletteuse: Add missing parentheses
Fixes a mistake in dea673d0d5.
GCC emitted a -Wint-in-bool-context warning because of that.

Reviewed-by: Soft Works <softworkz@hotmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-11-27 19:15:19 +01:00
Paul B Mahol e38551180e avfilter/af_biquads: add svf transform type 2021-11-26 00:55:32 +01:00
Andreas Rheinhardt 01923579f4 avfilter/vf_huesaturation: Remove dead store
Fixes Coverity issue #1493345.

Reviewed-by: Steven Liu <lingjiujianke@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-11-19 20:37:17 +01:00
Wu Jianhua 3188b606d7 avfilter: add a vflip_vulkan filter
The following command is on how to apply vflip_vulkan filter:

ffmpeg -init_hw_device vulkan -i input.264 -vf hwupload=extra_hw_frames=16,vflip_vulkan,hwdownload,format=yuv420p output.264

Signed-off-by: Wu Jianhua <jianhua.wu@intel.com>
2021-11-19 16:47:48 +01:00
Wu Jianhua d313cb5a2f avfilter: add a hflip_vulkan filter
The following command is on how to apply hflip_vulkan filter:

ffmpeg -init_hw_device vulkan -i input.264 -vf hwupload=extra_hw_frames=16,hflip_vulkan,hwdownload,format=yuv420p output.264

Signed-off-by: Wu Jianhua <jianhua.wu@intel.com>
2021-11-19 16:47:48 +01:00
Wu Jianhua 999048b6b1 avfilter/overlay_vulkan: call av_vkfmt_from_pixfmt only one time
Signed-off-by: Wu Jianhua <jianhua.wu@intel.com>
2021-11-19 16:47:47 +01:00
Wu Jianhua 067da5c87e avfilter/scale_vulkan: call av_vkfmt_from_pixfmt only one time
Signed-off-by: Wu Jianhua <jianhua.wu@intel.com>
2021-11-19 16:47:47 +01:00
Wu Jianhua 404a58d5be avfilter/scale_vulkan: call av_pix_fmt_count_planes only one time
Signed-off-by: Wu Jianhua <jianhua.wu@intel.com>
2021-11-19 16:47:47 +01:00
Wu Jianhua 6e4efe439f avfilter/chromaber_vulkan: call av_vkfmt_from_pixfmt only one time
Signed-off-by: Wu Jianhua <jianhua.wu@intel.com>
2021-11-19 16:47:47 +01:00
Wu Jianhua 9f2b204461 avfilter/avgblur_vulkan: call av_vkfmt_from_pixfmt only one time
Signed-off-by: Wu Jianhua <jianhua.wu@intel.com>
2021-11-19 16:47:47 +01:00
Wu Jianhua 14f78d6234 avfilter/overlay_vulkan: use FF_ARRAY_ELEMS instead of magic number
Signed-off-by: Wu Jianhua <jianhua.wu@intel.com>
2021-11-19 16:47:47 +01:00
Wu Jianhua 8763bdc8cf avfilter/scale_vulkan: use FF_ARRAY_ELEMS instead of magic number
Signed-off-by: Wu Jianhua <jianhua.wu@intel.com>
2021-11-19 16:47:47 +01:00
Wu Jianhua 766b1c170b avfilter/chromaber_vulkan: use FF_ARRAY_ELEMS instead of magic number
Signed-off-by: Wu Jianhua <jianhua.wu@intel.com>
2021-11-19 16:47:47 +01:00
Wu Jianhua 6a2284711e avfilter/avgblur_vulkan: use FF_ARRAY_ELEMS instead of magic number
Signed-off-by: Wu Jianhua <jianhua.wu@intel.com>
2021-11-19 16:47:47 +01:00
Wu Jianhua a1d1663458 avfilter/avgblur_vulkan: check if shader is created with success
Signed-off-by: Wu Jianhua <jianhua.wu@intel.com>
2021-11-19 16:47:47 +01:00
Lynne 1d06084171
vulkan: fix checkheaders 2021-11-19 16:47:28 +01:00
Lynne f6dd30df24
lavfi/vulkan: split off lavfi-specific code into vulkan_filter.c
The issue is that libavfilter depends on libavcodec, and when doing a
static build, if libavcodec also includes "libavfilter/vulkan.c", then
during link-time, compiling programs will fail as there would be multiple
definitions of the same symbols in both libavfilter and libavcodec's
object files.
Linkers are, however, more permitting if both files that include
a common file that's used as a template are one-to-one identical.
Hence, to make both files the same in the future, export all avfilter
specific functions to a separate file.
There is some work in progress to make templated files like this be
compiled only once, so this is not a long-term solution.

This also removes a macro that could be used to toggle SPIRV compilation
capability on #include-time, as this could cause the files to be different.
2021-11-19 16:47:26 +01:00
Lynne b2aec70bd6
lavu/vulkan: add option to switch between shader compilers and cleanup glslang 2021-11-19 13:44:47 +01:00
Lynne d1133e8c44
lavu/vulkan: move common Vulkan code from libavfilter to libavutil 2021-11-19 13:44:45 +01:00
Paul B Mahol 8c150d3d97 avfilter/af_drmeter: improve measurement precision 2021-11-18 22:23:28 +01:00
Paul B Mahol 2f472d5d65 avfilter/af_drmeter: refactor number of bins out 2021-11-18 22:23:28 +01:00
Limin Wang be43eacb7e avfilter/vf_gblur_vulkan: Fix use of uninitialized value
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
2021-11-17 06:56:29 +01:00
Wu Jianhua e95969c07e avfilter/gblur_vulkan: fix memory leak
Whether failed or not, the block of codes labeled with fail should
be always run to ensure the av_free(kernel_def) is executed.

Signed-off-by: Wu Jianhua <jianhua.wu@intel.com>
2021-11-17 04:24:33 +01:00
Paul B Mahol d401b1ccec avfilter: add colorspectrum source video filter 2021-11-16 20:41:39 +01:00
Lynne 20c66fe2f9
lavfi/vulkan: fix issues the previous commit introduced
One typo and one think-before-you-paste.
2021-11-16 11:20:13 +01:00
Lynne 8af7bcb6c3
lavfi/vulkan: add mutliqueue emulation code
This helps with testing multiple queues when the hardware only
has a single queue.
2021-11-16 10:32:37 +01:00
Lynne 8f9888a8d4
lavfi/vulkan: fix static descriptor set updating
Update all descriptor sets for all queues if a descriptor set hasn't
been initialized yet.
2021-11-16 10:32:35 +01:00
Wu Jianhua 5fc935c7fa libavfilter: add a gblur_vulkan filter
This commit adds a powerful and customizable gblur Vulkan filter,
which provides a maximum 127x127 kernel size of Gaussian Filter.
The size could be adjusted by requirements on quality or performance.

The following command is on how to apply gblur_vulkan filter:

ffmpeg -init_hw_device vulkan -i input.264 -vf hwupload=extra_hw_frames=16,gblur_vulkan,hwdownload,format=yuv420p output.264

Signed-off-by: Wu Jianhua <jianhua.wu@intel.com>
2021-11-16 10:32:21 +01:00
Paul B Mahol a7dfa6b446 avfilter/v360: add support for off-axis projection output 2021-11-15 20:41:27 +01:00
Anton Khirnov db932241ee */version.h: define FF_API macros unconditionally
There is no reason to wrap them in #ifndef guards, they should only be
defined here and nowhere else. The define guards just add the
possibility to accidentally use the same FF_API name in different
libraries.
2021-11-15 16:24:58 +01:00
Marton Balint 0a9edac48e avfilter/af_apad: do not add infinite silence for zero pad_dur or whole_dur
Unfortunately pad_len and pad_dur behaviour was different if 0 was specified,
pad_dur handled 0 duration as infinity, for pad_len, infinity was -1.

Let's make the behaviour consistent by handling 0 duration for pad_dur and
whole_dur as indeed 0 duration. This somewhat changes the behaviour of the
filter if 0 was explicitly specified, but deprecating the old option and adding
a new for the corrected behaviour seemed a bit overkill. So let's document the
change instead.

Signed-off-by: Marton Balint <cus@passwd.hu>
2021-11-14 18:13:58 +01:00
Niklas Haas a943f527a1 lavfi/vf_libplacebo: pick log level dynamically
In particular, allows users to go all the way up to PL_LOG_TRACE if
desired. (While also avoiding some potentially unnecessary callbacks for
filtered messages, including e.g. the CPU cost of printing out shader
sources)

Response to runtime log level changes by updating it once per
filter_frame(), which should hopefully be often enough.
2021-11-12 22:00:14 +01:00
Niklas Haas 51e03409d7 lavfi: add a libplacebo filter
This filter conceptually maps the libplacebo `pl_renderer` API into
libavfilter, which is a high-level image rendering API designed to work
with an RGB pipeline internally. As such, there's no way to avoid e.g.
chroma interpolation with this filter, although new versions of
libplacebo support outputting back to subsampled YCbCr after processing
is done.

That being said, `pl_renderer` supports automatic integration of the
majority of libplacebo's shaders, ranging from debanding to tone
mapping, and also supports loading custom mpv-style user shaders, making
this API a natural candidate for getting a lot of functionality out of
relatively little code.

In the future, I may approach this problem either by rewriting this
filter to also support a non-renderer codepath, or by upgrading
libplacebo's renderer to support a full YCbCr pipeline.

This unfortunately requires a very new version of libplacebo (unreleased
at time of writing) for timeline semaphore support. But the amount of
boilerplate needed to hack in backwards compatibility would have been
very unreasonable.
2021-11-12 14:45:36 +01:00
Limin Wang ec6187b05b avfilter/src_movie: make the number of decode thread configurable
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
2021-11-12 17:23:01 +08:00
Lynne f705e9ea05
lavfi/vulkan: refactor, fix and fully implement multiple queues 2021-11-12 05:23:41 +01:00
Lynne 246f841b53
lavfi/glslang: migrate to the C API and robustify library detection
Finally, this is as close to usable as it gets for glslang.
Much faster to compile as well, and eliminates the need for a C++
compiler, which is great.
Also, changes to the resource limits won't break users, as we
can use designated initializers in C90.
2021-11-12 05:23:41 +01:00
Lynne fef85c376a
lavfi/vulkan: use libavutil's vulkan loader
This finally fully eliminates the need to statically link to libvulkan!
2021-11-12 05:23:40 +01:00
Lynne 6bf9a6539e
vulkan: add support for encode and decode queues and refactor queue code
This simplifies and makes queue family picking simpler and more robust.
The requirements on the device context are relaxed. They made no sense
in the first place.

The video encode/decode extension is still in beta, at least on paper,
but I really doubt they'd change needing a separate queue family.
2021-11-12 05:23:36 +01:00
Lynne dfc61800a2
lavfi/vulkan: port to using timeline semaphores 2021-11-12 03:36:46 +01:00
Paul B Mahol 047c362d3c avfilter/vf_nlmeans: add x86 SIMD 2021-11-11 21:54:46 +01:00
Paul B Mahol aebdffb9c5 avfilter/vf_estdif: allow to change two more options 2021-11-11 21:54:40 +01:00
Limin Wang afcf226b33 avfilter/af_atilt: use ff_filter_execute()
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
2021-11-11 21:54:17 +01:00
Paul B Mahol a13646639f avfilter/vf_estdif: do some clip calculations only once in loop 2021-11-09 09:49:40 +01:00
Paul B Mahol dcf83fd59d avfilter/vf_estdif: export distance cost as filter option 2021-11-09 09:49:39 +01:00
Paul B Mahol 45dc668aea avfilter/f_reverse: readjust frame timestamps for areverse 2021-11-07 20:47:21 +01:00
Paul B Mahol 0370c3e3d4 avfilter/af_adelay: use outlink where applicable 2021-11-07 20:47:21 +01:00
Roman Arzumanyan 08a501946f avfilter/scale_npp: add scale2ref_npp filter
Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
2021-11-03 19:06:14 +01:00
Paul B Mahol bf9950446d avfilter/vf_chromanr: improve filtering results 2021-11-03 11:55:46 +01:00
Paul B Mahol 8164fe1139 avfilter: add huesaturation filter 2021-10-29 23:18:27 +02:00