Commit Graph

5899 Commits

Author SHA1 Message Date
Zhao Zhili
f0d8ce99ba avcodec/mediacodecenc: add async mode support
It has better performance than poll in a loop.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-11-21 07:35:43 +00:00
Lynne
6f5247f5e6 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-19 12:34:12 +00:00
Peter Ross
0ca150a060 configure: add rv60 decoder golomb dependency
Fixes standalone compilation of the rv60 decoder.
2024-11-16 08:33:26 +00:00
Anton Khirnov
19bc5f88b8 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 07:26:18 +00:00
Martin Storsjö
53c95b6da0 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>
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2024-10-15 11:08:39 +02:00
Peter Ross
cb23d5cbbb 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-10-15 09:44:06 +02:00
vipyne
f96d6a0f15 configure: suggest installing nasm before using --disable-x86asm
Signed-off-by: Anton Khirnov <anton@khirnov.net>
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2024-10-14 15:08:28 +02:00
Lynne
da2c338300 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.

Signed-off-by: Paul B Mahol <onemda@gmail.com>
2024-10-10 13:33:46 +02:00
Lynne
da585e3471 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.

Signed-off-by: Paul B Mahol <onemda@gmail.com>
2024-10-10 13:33:46 +02:00
Lynne via ffmpeg-devel
8c3c630701 configure: add spirv_compiler to avcodec_suggest
893f3fde4cdeb 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.

Signed-off-by: Paul B Mahol <onemda@gmail.com>
2024-10-07 13:46:52 +02:00
Lynne
aa602d52de 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.

Signed-off-by: Paul B Mahol <onemda@gmail.com>
2024-10-07 13:45:01 +02:00
Martin Storsjö
3ff07ce282 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>
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2024-10-05 19:16:20 +02:00
James Almer
bb67ebeb4a avfilter: add missing build deps to msad filter
Signed-off-by: James Almer <jamrial@gmail.com>
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2024-10-04 09:34:49 +02:00
Martin Storsjö
fea8b6c171 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>
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2024-09-28 18:06:26 +02:00
Martin Storsjö
375992c573 configure: Add detection of assembler support for SVE/SVE2
Signed-off-by: Martin Storsjö <martin@martin.st>
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2024-09-28 18:06:25 +02:00
Rémi Denis-Courmont
75e99f0d01 compat: add a fallback implementation of C23 stdbit.h
Header contents taken from VLC commit 7a970a33329c9836d169727ddbaf49a33240d587.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2024-09-25 21:28:59 +02:00
Anton Khirnov
6de01ae75b 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.

Signed-off-by: Paul B Mahol <onemda@gmail.com>
2024-09-25 21:28:58 +02:00
James Almer
3157a204c6 configure: add missing filter dependencies to ffmpeg
Signed-off-by: James Almer <jamrial@gmail.com>
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2024-09-25 21:27:14 +02:00
Marvin Scholz
2adbd80351 configure: do not use interval regexp operators with awk
Some awk implementations like mawk (used on Ubuntu) do not support
these.

Signed-off-by: Paul B Mahol <onemda@gmail.com>
2024-09-25 21:27:10 +02:00
Paul B Mahol
a8b4e3681c remove obsolete opencv filter wrapper 2024-09-19 18:56:44 +02:00
Marvin Scholz
0a1867bbf4 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).

Signed-off-by: Paul B Mahol <onemda@gmail.com>
2024-09-19 18:49:03 +02:00
Marvin Scholz
4fa2696a08 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.

Signed-off-by: Paul B Mahol <onemda@gmail.com>
2024-09-19 18:49:03 +02:00
Lynne
18fa866d5a 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.

Signed-off-by: Paul B Mahol <onemda@gmail.com>
2024-09-19 18:39:37 +02:00
Lynne
cea0e9ecfb 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.

Signed-off-by: Paul B Mahol <onemda@gmail.com>
2024-09-19 18:39:28 +02:00
Lynne
21c0cbe5e6 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.

Signed-off-by: Paul B Mahol <onemda@gmail.com>
2024-09-19 18:39:28 +02:00
Brad Smith
996a8e32b4 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>
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2024-09-09 23:36:36 +02:00
Ramiro Polla
a7647a6f88 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.

Signed-off-by: Paul B Mahol <onemda@gmail.com>
2024-09-03 10:22:58 +02:00
Stefan Oltmanns
b73ac602f0 avformat/vapoursynth: load library at runtime
Signed-off-by: Stefan Oltmanns <stefan-oltmanns@gmx.net>
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2024-08-30 18:02:50 +02:00
Stefan Oltmanns
0902b0cc68 avformat/vapoursynth: Update to API version 4
Signed-off-by: Stefan Oltmanns <stefan-oltmanns@gmx.net>
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2024-08-30 18:02:50 +02:00
Niklas Haas
976f47a308 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.

Signed-off-by: Paul B Mahol <onemda@gmail.com>
2024-08-30 18:02:38 +02:00
Rémi Denis-Courmont
8e34942e9b configure: check if assembler supports RV zicbop
zicbop is the Cache Block Operation, Prefetch extension to RVI.

Signed-off-by: Paul B Mahol <onemda@gmail.com>
2024-07-31 17:43:44 +02:00
Fei Wang
1c9e1e7822 configure: Alphabetical order for av1 codecs
Signed-off-by: Fei Wang <fei.w.wang@intel.com>
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2024-07-31 17:43:42 +02:00
Zhao Zhili
069a7feebf 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>
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2024-07-24 00:53:43 +02:00
Zhao Zhili
ce9c8acfc4 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>
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2024-07-24 00:53:43 +02:00
James Almer
7342ff4125 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>
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2024-07-12 21:44:34 +02:00
James Almer
16d4738434 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>
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2024-07-12 21:44:33 +02:00
James Almer
ea24343c81 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>
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2024-07-12 21:44:33 +02:00
Ramiro Polla
d23d934c7a configure: restore autodetection of v4l2 and fbdev
The detection logic for v4l2 and fbdev was accidentally modified to
depend on v4l2-m2m in 43b3412.

Signed-off-by: Paul B Mahol <onemda@gmail.com>
2024-07-10 14:29:04 +02:00
Tong Wu
47488b3d24 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>
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2024-07-03 08:46:28 +02:00
Dawid Kozinski
9f8f3d7655 avcodec/evc: Alterations following changes in libxeve
Signed-off-by: Dawid Kozinski <d.kozinski@samsung.com>
Signed-off-by: James Almer <jamrial@gmail.com>
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2024-06-28 22:20:31 +02:00
Rémi Denis-Courmont
a72b68327f 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.

Signed-off-by: Paul B Mahol <onemda@gmail.com>
2024-06-27 09:03:07 +02:00
Andreas Rheinhardt
b890d27ca1 configure: Remove obsolete mpeg4_decoder->mpeg4video_parser dependency
Obsolete since 3ceffe7839.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2024-06-20 20:27:41 +02:00
Araz Iusubov
ee9932f6a9 libavcodec/amfenc: Update AMF release version
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2024-06-20 20:27:41 +02:00
Rémi Denis-Courmont
4d42288748 configure: remove stray bfin architecture
This seems to have been omitted in
880e2aa236.

Signed-off-by: Paul B Mahol <onemda@gmail.com>
2024-06-15 09:43:06 +02:00
Rémi Denis-Courmont
0cd153a2a3 avr32: remove explicit support
The vendor has long since switched to Arm, with the last product
reaching their official end-of-life over 11 years ago. Linux support for
the ISA was dropped 7 years ago. More importantly, this architecture was
never supported by upstream GCC, and the vendor fork is stuck at version
4.2, which FFmpeg no longer supports (as per C11 requirement).

Presumably, this is still the case given the lack of vendor support.
Indeed all of the code being removed here consisted of inline assembler
scalar optimisations. A sane C compiler should be able to perform those
automatically nowadays (with the sole exception of fast CLZ detection),
but this is moot as this architecture is evidently dead.

Signed-off-by: Paul B Mahol <onemda@gmail.com>
2024-06-15 09:43:06 +02:00
Rémi Denis-Courmont
084a8c006b sh4: remove architecture
Support for SuperH was dropped over a decade ago. There no longer is any
architecture-specific code to be found, so just remove the corresponding
test. Technically it is still possible to compile FFmpeg as the
"generic" (pure C) architecture.

Signed-off-by: Paul B Mahol <onemda@gmail.com>
2024-06-13 21:50:47 +02:00
Sean McGovern
d18560b59a libavcodec/alpha: remove DSP & support code
Introduced in 1992, the Alpha was a 64-bit RISC processor designed to replace the
VAX CISC machines sold by Digital Equipment Corporation.

After Digital was acquired by Compaq in 1998 -- who themselves would be later
purchased by Hewlett-Packard, the architecture was phased out over the following decade.
It became effectively defunct in 2007, the last publically available processor being the Alpha 21364.

FFmpeg has not added any DSP code for this architecture since lowres2 was introduced in 2012,
and it is more than unlikely someone still wishes to maintain it.

Remove the DSP and support code.
2024-06-12 00:09:09 +02:00
Andreas Rheinhardt
3b97133296 configure: Disable DNN without backend
The DNN filters are useless without a backend.
This will also "fix" Coverity issues #1598288 and #1601718.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2024-06-11 16:59:44 +02:00
Gyan Doshi
065f3bb0c9 configure: correct libopenjpeg description
Decoding is no longer possible as the decoder wrapper was removed
in 60ccb3fe78

Signed-off-by: Paul B Mahol <onemda@gmail.com>
2024-05-31 21:53:40 +02:00
Paul B Mahol
ebc3778228 configure: add check for CLAP support 2024-05-31 21:09:30 +02:00