1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-26 19:01:44 +02:00
Commit Graph

5468 Commits

Author SHA1 Message Date
Lynne
14b6805eb2
configure: improve non-pkgconfig Vulkan version check
Check for the patch version as well as the major+minor version.

The VK_API_VERSION macros are not usable in preprocessor code due
to casts.
The patch (header) version is meant to linearly increment and
not be reset, however it's better to trust, but verify.
2021-12-21 15:28:50 +01:00
Lynne
fa2e460f63
configure: autodetect vulkan 2021-12-21 12:30:10 +01:00
Aman Karmani
11aa9ca153 configure: fix metal detection and respect explicit disable
Signed-off-by: Aman Karmani <aman@tmm1.net>
2021-12-19 08:29:00 -08:00
Aman Karmani
4ac869ca2a avfilter: add vf_yadif_videotoolbox
deinterlaces CVPixelBuffers, i.e. AV_PIX_FMT_VIDEOTOOLBOX frames

for example, an interlaced mpeg2 video can be decoded by avcodec,
uploaded into a CVPixelBuffer, deinterlaced by Metal, and then
encoded to h264 by VideoToolbox as follows:

    ffmpeg \
           -init_hw_device videotoolbox \
           -i interlaced.ts \
           -vf hwupload,yadif_videotoolbox \
           -c:v h264_videotoolbox \
           -b:v 2000k \
           -c:a copy \
           -y progressive.ts

(note that uploading AVFrame into CVPixelBuffer via hwupload
 requires 504c60660d)

this work is sponsored by Fancy Bits LLC

Reviewed-by: Ridley Combs <rcombs@rcombs.me>
Reviewed-by: Philip Langdale <philipl@overt.org>
Signed-off-by: Aman Karmani <aman@tmm1.net>
2021-12-18 11:57:31 -08:00
Aman Karmani
c975946577 build: detect Metal.framework and build .metal files
Reviewed-by: Ridley Combs <rcombs@rcombs.me>
Signed-off-by: Aman Karmani <aman@tmm1.net>
2021-12-18 11:55:47 -08: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
Shiyou Yin
9a840ffa17 avutil: [loongarch] Add support for loongarch SIMD.
LSX and LASX is loongarch SIMD extention.
They are enabled by default if compiler support it, and can be disabled
with '--disable-lsx' '--disable-lasx'.

Change-Id: Ie2608ea61dbd9b7fffadbf0ec2348bad6c124476
Reviewed-by: Shiyou Yin <yinshiyou-hf@loongson.cn>
Reviewed-by: guxiwei <guxiwei-hf@loongson.cn>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-12-15 18:37:40 +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
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
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
Shiyou Yin
07f8f78a5f configure: Add support for loongarch.
For la464 cpu: ./configure --cpu=la464

With cross-compiler:
./configure --cross-prefix=loongarch64-linux-gnu- \
            --enable-cross-compile --arch=loongarch64 \
            --target-os=linux --cpu=la464

Reviewed-by: 陈昊 <chenhao@loongson.cn>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-12-01 17:44:56 +01:00
rcombs
da0179b262 lavc/proresdec: add videotoolbox hwaccel 2021-11-28 16:40:58 -06:00
rcombs
a41a2efc85 lavc/videotoolbox: add VP9 hardware acceleration
On M1 Max, this supports profiles 0 and 2, but not 1 and 3.
2021-11-28 16:40:58 -06:00
rcombs
d2229eca51 lavu/videotoolbox: add 422 and 444 pixel format mappings 2021-11-28 16:40:43 -06:00
Lynne
33be4e6ca9
configure: fix test_pkg_config_cpp after 1e5acc1b59 2021-11-27 04:46:39 +01:00
Andreas Rheinhardt
71204e8e3d Revert "Disable warnings for casting pointers to integers, there is nothing wrong with that."
This reverts commit 5258f64a14.
The premise of said commit (that conversions from pointer to int
are ok) is wrong: C99/C11 6.3.2.3 5: "Any pointer type may be converted
to an integer type. [...] If the result cannot be represented in the
integer type, the behavior is undefined." (C90 6.3.4 contains a similar
restriction.) So don't disable -Wpointer-to-int-cast.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-11-26 16:10:24 +01:00
Lynne
1e5acc1b59
configure: do not include -lvulkan to cflags in vulkan's pkg-config check
Also fixes the non-pkg-config check.
2021-11-26 10:35:21 +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
Lynne
da72aca7b0
lavu/vulkan: add support for using libshaderc as a GLSL compiler
It's got a much better API that's actually maintained, it eliminates
race conditions, it comes with a pkg-config file by default, and
unfortunately isn't currently packaged by Debian or other large
distributions.
2021-11-19 16:47:30 +01:00
Lynne
d1133e8c44
lavu/vulkan: move common Vulkan code from libavfilter to libavutil 2021-11-19 13:44:45 +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
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
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
7f3878828d
hwcontext_vulkan: bump required Vulkan loader version to 1.2 2021-11-12 03:36:35 +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
Limin Wang
6cab5206b0 avutil/hwcontext_videotoolbox: fix use of unknown builtin '__builtin_available'
OSX version: 10.11.6
Apple LLVM version 8.0.0 (clang-800.0.42.1)
Target: x86_64-apple-darwin15.6.0

Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
2021-11-03 21:20:47 +08:00
Brad Smith
dbfafe11ae configure: add initial RISC-V support
OpenBSD only supports riscv64 but this is an attempt at adding
some of the initial bits for RISC-V support.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-10-29 21:44:14 +02:00
Limin Wang
4e3ffc9c54 configure: add hls demuxer link dependencies
Fixes building with --disable-everything --enable-demuxer=hls

Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
2021-10-28 09:28:57 +08:00
James Almer
7a1976919c configure: export pkg-config includedir variable
Some packages may not define custom cflags, in which case a simple
"pkg-config --cflags" call will return an empty string.
This change will be useful to get a valid include path that can be
used in library checks.

Reviewed-by: Haihao Xiang <haihao.xiang@intel.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2021-10-09 09:50:12 -03:00
Roman Arzumanyan
ed084161ba avfilter/sharpen_npp: add sharpening video filter with borders control
Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
2021-10-07 18:07:53 +02:00
Martin Storsjö
cb8dc600d2 configure: arm: Don't add -march= to the compiler if no preference was passed
If no --cpu= option was passed to configure, we detect what the
compiler defaults to. This detected value was then fed back to the
rest of the configure logic, as if it was an explicit choice.

This breaks on Ubuntu 21.10 with GCC 11.1.

Since GCC 8, it's possible to add configure extra features via the
-march option, like e.g. -march=armv7-a+neon. If the -mfpu= option
is configured to default to 'auto', the fpu setting gets taken
from the -march option.

GCC 11.1 in Ubuntu seems to be configured to use -mfpu=auto. This
has the effect of breaking any compilation command that specifies
-march=armv7-a, because the driver implicitly also adds -mfloat-abi=hard,
and that combination results in this error:

    cc1: error: ‘-mfloat-abi=hard’: selected processor lacks an FPU

One can compile successfully by passing e.g. -march=armv7-a+fp.

Therefore, restructure configure. If no specific preference was set
(and the 'cpu' configure variable was set as the output of
probe_arm_arch), the value we tried to set via -march= was the same
value that we just tried to detect as the compiler default.

So instead, just try to detect what the compiler defaults to, with
to allow setting other configure settings (such as 'fast_unaligned'),
but don't try to spell out the compiler's default via the -march flag.

Signed-off-by: Martin Storsjö <martin@martin.st>
2021-09-21 14:04:28 +03:00
Timo Rothenpieler
06de593303 avfilter/frei0r: use win32dlfcn wrapper 2021-09-15 12:37:02 +02:00
Timo Rothenpieler
1d23e125b6 configure: account for openssl3 license change 2021-09-15 12:37:02 +02:00
Andreas Rheinhardt
a1292895cb configure: Remove null_bsf dependency
Unneeded since c96904f525
(a bsf-list with zero bsfs is used since that commit).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-09-14 13:36:19 +02:00
Paul B Mahol
94d4cc24c3 avfilter/af_asoftclip: rewrite oversampling
Fixes most aliasing issues.
2021-09-12 12:55:50 +02:00
James Almer
8a6beccf0d avformat: add an AV1 Low overhead bitstream format muxer
Suggested-by: BBB
Signed-off-by: James Almer <jamrial@gmail.com>
2021-09-01 19:55:30 -03:00
Paul B Mahol
376ac5b7a8 avfilter/vf_convolve: switch to TX FFT from avutil 2021-08-17 09:15:06 +02:00
Limin Wang
5f3df7afa6 avdevice/decklink: add sqd configuration option
Reviewed-by: Marton Balint <cus@passwd.hu>
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
2021-08-16 10:00:39 +08:00
Jin Bo
903c5d58f0 configure: [loongson] adjust MMI check in configure
After standardizing the use of 'pxor' in commit 'ebedd26', FFmpeg
build failed with upstream compiler, for 'pxor' is not supported
in time. This patch helps to workaround the build failure by
checking whether 'pxor' is supported during configuration, if not,
MMI will be disabled.

Reviewed-by: yinshiyou-hf@loongson.cn
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-08-10 16:16:06 +02:00
Paul B Mahol
b3117f376d avfilter/vaf_spectrumsynth: switch to TX FFT from avutil 2021-08-04 10:04:58 +02:00
Paul B Mahol
a428d2a487 avfilter/af_afftfilt: switch to TX FFT from avutil 2021-08-04 09:35:06 +02:00
Paul B Mahol
ae94868a57 avfilter/avf_showfreqs: switch to TX FFT from avutil 2021-07-30 09:44:51 +02:00
Paul B Mahol
0068b3d0f0 avfilter/avf_showcqt: switch to TX FFT from avutil 2021-07-27 21:16:28 +02:00
Paul B Mahol
925d41ebd4 avfilter/af_afftdn: switch to TX FFT from avutil 2021-07-27 20:48:40 +02:00
Paul B Mahol
60e2348e27 configure: remove sofalizer triggering of avcodec dependency 2021-07-24 17:01:20 +02:00
Paul B Mahol
014ace8f98 avfilter/avf_showspectrum: switch to TX FFT from avutil 2021-07-24 16:49:53 +02:00
Paul B Mahol
88b6342c2b avfilter/af_headphone: switch to TX FFT from avutil 2021-07-24 12:24:40 +02:00
Paul B Mahol
f6aeb94d72 avfilter/af_sofalizer: switch to TX FFT from avutil 2021-07-24 12:24:40 +02:00