Commit Graph

5909 Commits

Author SHA1 Message Date
Lynne
ed2391d341
ffv1enc: add a Vulkan encoder
This commit implements a standard, compliant, version 3 and version 4
FFv1 encoder, entirely in Vulkan. The encoder is written in standard
GLSL and requires a Vulkan 1.3 supporting GPU with the BDA extension.

The encoder can use any amount of slices, but nominally, should use
32x32 slices (1024 in total) to maximize parallelism.

All features are supported, as well as all pixel formats.
This includes:
 - Rice
 - Range coding with a custom quantization table
 - PCM encoding

CRC calculation is also massively parallelized on the GPU.

Encoding of unaligned dimensions on subsampled data requires
version 4, or requires oversizing the image to 64-pixel alignment
and cropping out the padding via container flags.

Performance-wise, this makes 1080p real-time screen capture possible
at 60fps on even modest GPUs.
2024-11-18 07:54:22 +01:00
Peter Ross
6ccd16dda2 configure: add rv60 decoder golomb dependency
Fixes standalone compilation of the rv60 decoder.
2024-11-16 19:08:39 +11:00
Anton Khirnov
13129f1af4 lavc: deprecate the omx encoders
They have not been relevant for a long time, and support for this API is
also being dropped from other projects.
2024-11-09 02:46:17 +01:00
Peter Ross
33802e7c32 avcodec/rv60: RealVideo 6.0 decoder
Reviewed-by: Anton Khirnov <anton@khirnov.net>
Reviewed-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Signed-off-by: Peter Ross <pross@xvid.org>
2024-11-03 10:53:15 +11:00
Fei Wang
e726fdeb05 lavc/vaapi_dec: Add VVC decoder
Signed-off-by: Fei Wang <fei.w.wang@intel.com>
2024-11-01 12:13:07 +08:00
Martin Storsjö
38d08f5c45 configure: Only try to use the -no_warn_duplicate_libraries flag on Darwin
While we only add the flag if the linker seems to support it,
it turns out that ld.bfd had a bug where the flag is accidentally
accepted, and the flag produces an output file named
"_warn_duplicate_libraries".

The ld.bfd bug was fixed in binutils 2.36, in
https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff;h=3991c7acb29aa8d7d52150695eb3efa03a08dd50.

Signed-off-by: Martin Storsjö <martin@martin.st>
2024-10-15 09:53:14 +03:00
vipyne
f5403e5f1e configure: suggest installing nasm before using --disable-x86asm
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2024-10-13 13:28:49 +02:00
Min Chen
37842f2caa avcodec/mfenc: add support for AV1 MF encoders
Signed-off-by: Dash Santosh <dash.sathyanarayanan@multicorewareinc.com>
Signed-off-by: Martin Storsjö <martin@martin.st>
2024-10-09 16:30:37 +03:00
Lynne
204558cee8
configure: explicitly disable spirv_compiler
spirv_compiler is an undeclared variable that was spontaneously
enabled if libshaderc or libglslang were detected, and served as
a way to enable filters.

However, it being undeclared had the effect that it was neither
considered explicitly disabled nor enabled if libshaderc or
libglslang were detected.

The only category we have which explicitly disables variables
is EXTERNAL_LIBRARY_LIST, however, spirv_compiler is not a real
external library, and making it present there would report its
detection on ./configure.
2024-10-09 00:59:33 +02:00
Lynne
57b7e96b04
configure: add spirv_compiler to avfilter_suggest as well
If someone were to enable libglslang/libshaderc, and then disable
all Vulkan filters, they would have the same issue as the earlier
fix for libavcodec.
2024-10-09 00:59:27 +02:00
Lynne via ffmpeg-devel
f339169f35 configure: add spirv_compiler to avcodec_suggest
893f3fde4c made libavcodec link to libshaderc/libglslang, though
no codecs depend on it at this immediate moment.

This was merged largely as a coordination effort to synchronize three
different developers' repositories to allow them to send patches without
overlapping functionality in between.

This line can be removed once the first component to depend on spirv_compiler
lands, but leaving it in is fine too.
2024-10-06 21:11:05 +02:00
James Almer
a77365d864 configure: include liblcevc_dec ldflags in avcodec_extralibs
This is more in line with other optional libraries, instead of littering avcodec_suggest.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-10-06 10:42:15 -03:00
Lynne
2f888fb99e
configure: drop yasm support
We started defauling to nasm 8 years ago.
We are still compatible with yasm 0.8.0, released in 2009. **15 years ago**.
The time has more than come to remove support for it.

Maintaining compatibility started cutting into writing new code long ago.
We still can't have 2-argument instructions, preprocessor booleans, and all
AVX2 code must still be wrapped in ifdefs. Newly added code often breaks this.
2024-10-06 01:32:47 +02:00
Martin Storsjö
2705c0bd81 configure: Enable -Wno-implicit-const-int-float-conversion if available
This silences a lot of compile warnings (around 160 instances at least), when
compiling with Clang.

These warnings look like this:

    libavformat/http.c:176:133: warning: implicit conversion from 'long long' to 'double' changes value from 9223372036854775807 to 9223372036854775808 [-Wimplicit-const-int-float-conversion]
      176 |     { "end_offset", "try to limit the request to bytes preceding this offset", OFFSET(end_off), AV_OPT_TYPE_INT64, { .i64 = 0 }, 0, INT64_MAX, D },
          |     ~                                                                                                                               ^~~~~~~~~

Signed-off-by: Martin Storsjö <martin@martin.st>
2024-10-04 22:57:51 +03:00
James Almer
358fdf3083 avfilter: add missing build deps to msad filter
Signed-off-by: James Almer <jamrial@gmail.com>
2024-10-02 12:44:49 -03:00
Jan Ekström
f9c5c5358c avcodec/videotoolbox: add AV1 hardware acceleration
Use AV1DecContext's current_obu to access the original OBUs, and
feed them to videotoolbox, rather than the bare slice data passed
via decode_slice.

This requires a small addition to AV1DecContext, for keeping track
of the current range of OBUs that belong to the current frame.

Co-authored-by: Ruslan Chernenko <ractyfree@gmail.com>
Co-authored-by: Martin Storsjö <martin@martin.st>
Signed-off-by: Martin Storsjö <martin@martin.st>
2024-10-02 11:19:27 +03:00
Martin Storsjö
bd22d7e601 configure: Silence Xcode warnings about duplicate libraries
Since Xcode 15, macOS developer tools use a new linker. The new
linker by default warns for duplicate -l options. As this is a
known and expected thing, not to be considered an issue, ask for
the warning to be silenced.

This silences linker warnings like this:

    ld: warning: ignoring duplicate libraries: '-lc++', '-lcrypto', '-lm', '-logg', '-lpthread', '-lssl', '-lvorbis', '-lvpx', '-lz'

The linker can also warn about duplicate -rpath options, and there's
currently no option to silence those warnings.

Signed-off-by: Martin Storsjö <martin@martin.st>
2024-09-27 13:42:42 +03:00
Martin Storsjö
e6e56fd7a7 configure: Add detection of assembler support for SVE/SVE2
Signed-off-by: Martin Storsjö <martin@martin.st>
2024-09-27 00:03:04 +03:00
Rémi Denis-Courmont
a7505ec562 compat: add a fallback implementation of C23 stdbit.h
Header contents taken from VLC commit 7a970a33329c9836d169727ddbaf49a33240d587.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2024-09-23 17:08:46 +02:00
Anton Khirnov
8c185ef4e7 compat: drop gcc, suncc, and pthreads stdatomic emulation
Since we now require a C11-compliant compiler, there should be no
supported configurations where any of these is used.
2024-09-23 17:08:46 +02:00
James Almer
660e7e6a0e avcodec: add LCEVC decoding support via LCEVCdec
Signed-off-by: James Almer <jamrial@gmail.com>
2024-09-23 10:20:47 -03:00
James Almer
aeb64d6fa5 configure: add missing filter dependencies to ffmpeg
Signed-off-by: James Almer <jamrial@gmail.com>
2024-09-23 09:02:23 -03:00
Marvin Scholz
4858a8ee2f configure: do not use interval regexp operators with awk
Some awk implementations like mawk (used on Ubuntu) do not support
these.
2024-09-20 02:50:01 +02:00
James Almer
dc11c12b64 avfilter: add an LCEVC decoding filter
Signed-off-by: James Almer <jamrial@gmail.com>
2024-09-19 10:06:05 -03:00
Marvin Scholz
7091da7129 configure: correctly set sanitizer toolchain compilers
Previously only the C compiler was set, which would lead to
confusing situations where even though clang-asan was selected,
it would still use g++ for C++ code, failing because configure
does not support mixing compilers in this way (which is a separate
issue not addressed by this commit).
2024-09-18 15:24:12 +02:00
Marvin Scholz
910bf33879 configure: fix symbol prefix detection
The symbol prefix check would incorrectly detect a bogus prefix in
circumstances where sanitizers instrument the build, like when
configuring with the clang-asan toolchain where it would detect the
prefix as __odr_asan_gen_, which is obviously wrong.

To fix this, adjust the prefix detection to only detect a
one-character prefix, which is the only case that matters
anywhere right now.
2024-09-18 15:24:12 +02:00
Lynne
4b4f0b68f8
lavc: add hevc_vulkan hardware encoder
This commit adds a Vulkan hardware HEVC encoder, with full support
of the spec - I, P, and B-frames.
2024-09-17 21:12:32 +02:00
Lynne
f85d94730c
lavc: add h264_vulkan hardware encoder
This commit adds the first Vulkan hardware encoder.

Currently, P, and **B**-frames are supported. This marks the
first implementation to support both.

The encoder has feature-parity with VAAPI.
2024-09-16 14:04:06 +02:00
Lynne
37243b2a08
lavc: add Vulkan video encoding base code
This commit adds the common Vulkan video encoding framework.
It makes full use of the asynchronous features of our new common
hardware encoding code, and of Vulkan.
The code is able to handle anything from H264 to AV1 and MJPEG.
2024-09-16 14:04:05 +02:00
Brad Smith
a3f79fd22a aarch64: Implement support for elf_aux_info(3) on FreeBSD and OpenBSD
FreeBSD 12.0+, OpenBSD -current and what will be OpenBSD 7.6 support
elf_aux_info(3).

Signed-off-by: Brad Smith <brad@comstyle.com>
2024-09-09 07:17:49 -04:00
Ramiro Polla
00b64fca55 configure: improve check for POSIX ioctl
Instead of relying on system #ifdefs which may or may not be correct,
detect the POSIX ioctl signature at configure time.
2024-09-01 18:01:43 +02:00
Matthieu Bouron
0a780d3076 avcodec: add Mediacodec audio decoders support
Signed-off-by: Matthieu Bouron <matthieu.bouron@gmail.com>
2024-09-01 12:25:56 +02:00
Stefan Oltmanns
d42cd5b75b avformat/vapoursynth: load library at runtime
Signed-off-by: Stefan Oltmanns <stefan-oltmanns@gmx.net>
2024-08-26 10:30:52 +02:00
Stefan Oltmanns
eac611f1a4 avformat/vapoursynth: Update to API version 4
Signed-off-by: Stefan Oltmanns <stefan-oltmanns@gmx.net>
2024-08-26 10:30:50 +02:00
Niklas Haas
b3d33f11fa avcodec/bsf/dovi_rpu: add new bitstream filter
This can be used to strip dovi metadata, or enable/disable dovi
metadata compression. Possibly more use cases in the future.
2024-08-16 11:48:02 +02:00
Fei Wang
be7ab63552 lavc/qsvdec: Add vvc_mp4toannexb bsf for QSV VVC decoder
Fix error:
$ ffmpeg -hwaccel qsv -i input.mp4 -f null -
..
[vvc_qsv @ 0000026890D966C0] Error decoding stream header: unknown error (-1)
[vvc_qsv @ 0000026890D966C0] Error decoding header

Signed-off-by: Fei Wang <fei.w.wang@intel.com>
2024-08-16 14:15:04 +08:00
Rémi Denis-Courmont
4570b9f3c4 configure: check if assembler supports RV zicbop
zicbop is the Cache Block Operation, Prefetch extension to RVI.
2024-07-30 18:41:51 +03:00
Fei Wang
d30a9fdc80 lavc/qsvdec: Add VVC decoder
Signed-off-by: Fei Wang <fei.w.wang@intel.com>
2024-07-30 13:40:21 +08:00
Fei Wang
cf9c398fc1 configure: Alphabetical order for av1 codecs
Signed-off-by: Fei Wang <fei.w.wang@intel.com>
2024-07-30 13:32:44 +08:00
Zhao Zhili
8ca60e14d2 configure: Fix Apple framework dependencies in .pc file
configure use "-Wl,-framework,foo" and "-framework foo" to specify
dependencies on Apple frameworks. These two styles essentially do
the same thing when build ffmpeg. However, they do make difference
when generate pkg-config files. Some tools interact with pkg-config
cannot handle "-Wl,-framework,foo" in Libs field, e.g., cmake with
pkg_check_modules.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-07-16 22:50:41 +08:00
Zhao Zhili
e713a2d85d avutil/file_open: Fix build error with wasi
Don't assume tempnam is available when !HAVE_MKSTEMP. Check tempnam
explicitly in configure.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-07-16 22:50:21 +08:00
James Almer
70c6b904be x86/intreadwrite: add missing casts to pointer arguments
Should make strict compilers happy.

Also, make AV_COPY128 use integer operations while at it. Removing the
inclusion of immintrin.h ensures a lot less intrinsic related headers are
included as well, which fixes a clash of defines with some Clang versions.

Reviewed-by: Martin Storsjö <martin@martin.st>
Signed-off-by: James Almer <jamrial@gmail.com>
2024-07-11 18:24:26 -03:00
James Almer
bd1bcb07e0 x86/intreadwrite: use intrinsics instead of inline asm for AV_COPY128
This has the benefit of removing any SSE -> AVX penalty that may happen when
the compiler emits VEX encoded instructions.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-07-10 13:25:44 -03:00
James Almer
4a04cca69a x86/intreadwrite: use intrinsics instead of inline asm for AV_ZERO128
When called inside a loop, the inline asm version results in one pxor
unnecessarely emitted per iteration, as the contents of the __asm__() block are
opaque to the compiler's instruction scheduler.
This is not the case with intrinsics, where pxor will be emitted once with any
half decent compiler.

This also has the benefit of removing any SSE -> AVX penalty that may happen
when the compiler emits VEX encoded instructions.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-07-10 13:25:44 -03:00
Ramiro Polla
7405f1ad53 configure: restore autodetection of v4l2 and fbdev
The detection logic for v4l2 and fbdev was accidentally modified to
depend on v4l2-m2m in 43b3412.
2024-07-10 12:24:33 +02:00
Tong Wu
ba0c14e6bf avcodec: add D3D12VA hardware HEVC encoder
This implementation is based on D3D12 Video Encoding Spec:
https://microsoft.github.io/DirectX-Specs/d3d/D3D12VideoEncoding.html

Sample command line for transcoding:
ffmpeg.exe -hwaccel d3d12va -hwaccel_output_format d3d12 -i input.mp4
-c:v hevc_d3d12va output.mp4

Signed-off-by: Tong Wu <tong1.wu@intel.com>
2024-07-02 14:15:12 +02:00
Dawid Kozinski
3e6c794862 avcodec/evc: Alterations following changes in libxeve
Signed-off-by: Dawid Kozinski <d.kozinski@samsung.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2024-06-28 12:20:15 -03:00
Gyan Doshi
9a3bc59a38 configure: fix alignment of conditional lib dependencies 2024-06-27 15:12:35 +05:30
Gyan Doshi
27284b7800 configure: fix assignment of dep libs for QR-code filters 2024-06-27 15:12:06 +05:30
Rémi Denis-Courmont
0d748eec8d configure: detect 64-bit generic platforms
Currently, any unrecognised platform is treated as 32-bit. This should
detect *most* 64-bit platforms, namely LP64 and LLP64 ones.
Unfortunately this will not work for ILP32 ABIs on 64-bit ISAs, but
still better than nothing.
2024-06-24 20:23:32 +03:00