Commit Graph

9934 Commits

Author SHA1 Message Date
Niklas Haas
e9ba40c5c9 lavfi/vf_libplacebo: update deprecated option name
This was renamed upstream quite a while ago (v3.112.0). Rename the
option name as well for consistency (and expand the description just
slightly).

Signed-off-by: Niklas Haas <git@haasn.dev>
2021-12-15 23:38:29 +01:00
Niklas Haas
5317a6366f vf_libplacebo: switch to newer libplacebo helpers
Support for mapping/unmapping hardware frames has been added into
libplacebo itself, so we can scrap this code in favor of using the new
functions. This has the additional benefit of being forwards-compatible
as support for more complicated frame-related state management is added
to libplacebo (e.g. mapping dolby vision metadata).

It's worth pointing out that, technically, this would also allow
`vf_libplacebo` to accept, practically unmodified, other frame types
(e.g. vaapi or drm), or even software input formats. (Although we still
need a vulkan *device* to be available)

To keep things simple, though, retain the current restriction to vulkan
frames. It's possible we could rethink this in a future commit, but for
now I don't want to introduce any more potentially breaking changes.
2021-12-15 23:38:21 +01:00
Limin Wang
571e8ca2dd avfilter/af_astats: improve options descriptions
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
2021-12-14 22:36:50 +08:00
Paul B Mahol
996b13fac4 avfilter: add audio dynamic equalizer filter 2021-12-12 10:47:28 +01:00
Wu Jianhua
f176669a37 avfilter/vf_transpose_vulkan: simplify config_props_output function
It's no need to assign outlink here, which has been done in
ff_vk_filter_config_output already.

Signed-off-by: Wu Jianhua <jianhua.wu@intel.com>
2021-12-10 20:50:13 +01:00
Wu Jianhua
f106c72285 avfilter/vf_transpose_vulkan: add clock and cclock option
The following command is on how to apply cclock option:

ffmpeg -init_hw_device vulkan -i input.264 -vf \
hwupload=extra_hw_frames=16,transpose_vulkan=dir=cclock,hwdownload,format=yuv420p \
output.264

The following command is on how to apply clock_flip option:

ffmpeg -init_hw_device vulkan -i input.264 -vf \
hwupload=extra_hw_frames=16,transpose_vulkan=dir=clock_flip,hwdownload,format=yuv420p \
output.264

The following command is on how to apply clock option:

ffmpeg -init_hw_device vulkan -i input.264 -vf \
hwupload=extra_hw_frames=16,transpose_vulkan=dir=clock,hwdownload,format=yuv420p \
output.264

Signed-off-by: Wu Jianhua <jianhua.wu@intel.com>
2021-12-10 20:49:51 +01:00
Wu Jianhua
58816f6927 avfilter: add a transpose_vulkan filter
The following command is on how to apply transpose_vulkan filter:
ffmpeg -init_hw_device vulkan -i input.264 -vf \
hwupload=extra_hw_frames=16,transpose_vulkan,hwdownload,format=yuv420p output.264

Signed-off-by: Wu Jianhua <jianhua.wu@intel.com>
2021-12-10 16:48:20 +01:00
Wu Jianhua
ceeff7ae8d avfilter/vf_transpose: fix un-checked potential memory allocation failure
Signed-off-by: Wu Jianhua <jianhua.wu@intel.com>
2021-12-10 12:38:43 +01:00
Anton Khirnov
177a328c7c lavfi/vf_subtitles: stop using deprecated ass_set_aspect_ratio()
It has been deprecated in favor of ass_set_pixel_aspect() since version
0.11.0, roughly ~2014. Even Debian oldoldstable (stretch) has 0.13.
2021-12-07 11:16:14 +01:00
Anton Khirnov
b9c928a486 avfilter: add AVFILTER_FLAG_METADATA_ONLY
This flag allows distinguishing between filters that actually modify the
data and those that only modify metadata or gather some stream
information.
2021-12-04 14:07:19 +01:00
Anton Khirnov
944c34a94c lavfi/allfilters: move vf_chromaber_vulkan to video section 2021-12-04 14:06:42 +01:00
Andreas Rheinhardt
03ab1de429 avfilter/buffersink: Remove outdated comments
These lists have size fields since
e48ded8551.

Reviewed-by: Nicolas George <george@nsup.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-12-03 17:01:45 +01:00
Andreas Rheinhardt
01d158d1c8 all: Remove unused-but-set variables
Newer versions of Clang detect this and emit warnings for it.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-12-03 16:09:14 +01:00
Wu Jianhua
bdfb0e4da4 avfilter: add a flip_vulkan filter
This filter flips the input video both horizontally and vertically
in one compute pipeline, and it's no need to use two pipelines for
hflip_vulkan,vflip_vulkan anymore.

Signed-off-by: Wu Jianhua <jianhua.wu@intel.com>
2021-12-02 11:06:24 +01:00
Paul B Mahol
fc9a686688 avfilter: add audio dynamic smooth filter 2021-12-02 09:39:27 +01:00
Paul B Mahol
11b11577fe avfilter: add audio spectral stats filter 2021-12-02 09:35:36 +01:00
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