1
0
Commit Graph

5867 Commits

Author SHA1 Message Date
Andreas Rheinhardt
9c4558b596 configure: Fix iamfdec dependencies
Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-03 22:04:46 +02:00
Andreas Rheinhardt
924402f783 configure: Add missing libdav1d/av1 decoders->dovi_rpu dependency
Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-04-03 20:07:54 +02:00
Eugene Zemtsov
591e27d1e7 configure: Separate subsystem for Immersive Audio Model
This change allows users to build libavfomat without support
for Immersive Audio Model by specifying --disable-iamf.
It helps to save on binary size in cases where it's important.

Co-authored-by: James Almer <jamrial@gmail.com>
Signed-off-by: Eugene Zemtsov <eugene@chromium.org>
Signed-off-by: James Almer <jamrial@gmail.com>
2024-04-03 09:57:52 -03:00
Andreas Rheinhardt
5d71f97e0e all: Don't use ATOMIC_VAR_INIT
C11 required to use ATOMIC_VAR_INIT to statically initialize
atomic objects with static storage duration. Yet this macro
was unsuitable for initializing structures [1] and was actually
unneeded for all known implementations (this includes our
compatibility fallback implementations which simply wrap the value
in parentheses: #define ATOMIC_VAR_INIT(value) (value)).
Therefore C17 deprecated the macro and C23 actually removed it [2].

Since commit 5ff0eb34d2 we default
to C17 if the compiler supports it; Clang warns about ATOMIC_VAR_INIT
in this mode. Given that no implementation ever needed this macro,
this commit stops using it to avoid this warning.

[1]: https://www.open-std.org/jtc1/sc22/wg14/www/docs/n2396.htm#dr_485
[2]: https://en.cppreference.com/w/c/atomic/ATOMIC_VAR_INIT

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-28 09:12:48 +01:00
Andreas Rheinhardt
8d8b5947c3 configure: Make hls demuxer select AAC, AC3 and EAC3 demuxers
The code relies on their presence and would presumably crash
when retrieving in_fmt->name if an encrypted stream with a codec id
without demuxer were encountered.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-26 06:36:43 +01:00
Lynne
ecdc94b97f
vulkan_av1: port to the new stable API
Co-Authored-by: Dave Airlie <airlied@redhat.com>
2024-03-25 08:54:40 +01:00
Andreas Rheinhardt
0d43adcbef configure: Explicitly check for static_assert, _Static_assert
C11 provides static assertions via _Static_assert and
provides static_assert as a convenience define for this
in assert.h. Our codebase uses the latter, as _Static_assert
has actually already been deprecated in C23.

Not all toolchains that declare support for C11 actually
support it; e.g. MSVC 19.27 does not support _Static_assert,
but somehow supports static_assert. MSVC 19.27 admits to be
a "preview implementation of the ISO C11 standard",
so this is not surprising (MSVC 19.28 does not come with
this caveat).

Furthermore some FATE boxes [1] use old GCC toolchains (with
only experimental support for C11) where _Static_assert is
supported, but assert.h does not provide the fallback define.
They are broken since the first usage of static_assert.

This commit therefore checks whether static_assert and
_Static_assert work with assert.h included; if not,
configure errors out.

This intentionally drops support for MSVC 19.27. Users like
the old FATE boxes above can still add -Dstatic_assert=_Static_assert
to cflags as a workaround if desired.

[1]: https://fate.ffmpeg.org/report.cgi?time=20240321123620&slot=sh4-debian-qemu-gcc-4.7

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-24 19:05:35 +01:00
Henrik Gramner
afa471d0ef x86: Update x86inc.asm
Make things up-to-date with upstream.

https://code.videolan.org/videolan/x86inc.asm
2024-03-24 14:53:57 +01:00
Matthieu Bouron
6567516a5e avformat: add Android content resolver protocol support
Handles Android content URIs starting with content://.
2024-03-23 11:37:29 +01:00
Zhao Zhili
5229778440 avcodec/libx264: fix extradata when config annexb=0
AVCodecContext extradata should be an AVCDecoderConfigurationRecord
when bitstream format is avcc. Simply concatenating the NALUs output
by x264_encoder_headers does not form a standard
AVCDecoderConfigurationRecord. The following cmd generates broken
file before the patch:

ffmpeg -i foo.mp4 -c:v libx264 -x264-params annexb=0 bar.mp4

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-03-22 20:26:53 +08:00
James Almer
5ff0eb34d2 configure: check for C17 by default
Signed-off-by: James Almer <jamrial@gmail.com>
2024-03-20 17:11:18 -03:00
James Almer
6c2ff982dc configure: make the C and C++ standard settable
While ensuring it's at least C11, the minimum supported version.
Also, enforce C11 on the host compiler, same as we already do for C11 on the
target compiler.

Tested-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: James Almer <jamrial@gmail.com>
2024-03-20 17:10:55 -03:00
Jan Ekström
471c0a34c1 avcodec/libx264: add support for writing out CLL and MDCV
Both of these two structures were first available with X264_BUILD
163, so make relevant functionality conditional on the version
being at least such.

Keep handle_side_data available in all cases as this way X264_init
does not require additional version based conditions within it.

Finally, add a FATE test which verifies that pass-through of the
MDCV/CLL side data is working during encoding.
2024-03-20 19:15:05 +02:00
Wenbin Chen
f4e0664fd1 libavfi/dnn: add LibTorch as one of DNN backend
PyTorch is an open source machine learning framework that accelerates
the path from research prototyping to production deployment. Official
website: https://pytorch.org/. We call the C++ library of PyTorch as
LibTorch, the same below.

To build FFmpeg with LibTorch, please take following steps as
reference:
1. download LibTorch C++ library in
 https://pytorch.org/get-started/locally/,
please select C++/Java for language, and other options as your need.
Please download cxx11 ABI version:
 (libtorch-cxx11-abi-shared-with-deps-*.zip).
2. unzip the file to your own dir, with command
unzip libtorch-shared-with-deps-latest.zip -d your_dir
3. export libtorch_root/libtorch/include and
libtorch_root/libtorch/include/torch/csrc/api/include to $PATH
export libtorch_root/libtorch/lib/ to $LD_LIBRARY_PATH
4. config FFmpeg with ../configure --enable-libtorch \
 --extra-cflag=-I/libtorch_root/libtorch/include \
 --extra-cflag=-I/libtorch_root/libtorch/include/torch/csrc/api/include \
 --extra-ldflags=-L/libtorch_root/libtorch/lib/
5. make

To run FFmpeg DNN inference with LibTorch backend:
./ffmpeg -i input.jpg -vf \
dnn_processing=dnn_backend=torch:model=LibTorch_model.pt -y output.jpg

The LibTorch_model.pt can be generated by Python with torch.jit.script()
api. https://pytorch.org/tutorials/advanced/cpp_export.html. This is
pytorch official guide about how to convert and load torchscript model.
Please note, torch.jit.trace() is not recommanded, since it does
not support ambiguous input size.

Signed-off-by: Ting Fu <ting.fu@intel.com>
Signed-off-by: Wenbin Chen <wenbin.chen@intel.com>
Reviewed-by: Guo Yejun <yejun.guo@intel.com>
2024-03-19 14:48:58 +08:00
Andreas Rheinhardt
c00cd007e8 configure: Remove av_restrict
All versions of MSVC that support C11 (namely >= v19.27)
also support the restrict keyword, therefore av_restrict
is no longer necessary since 75697836b1.

Reviewed-by: Martin Storsjö <martin@martin.st>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-15 12:51:15 +01:00
Marton Balint
7196b12b2b avformat/daudenc: force 2000 sample packet size with a bsf
The samples I found all have 2000 sample packets, and by forcing the packet
size with a bsf we could automagically make muxing work for packets containing
more than 3640 samples.

Signed-off-by: Marton Balint <cus@passwd.hu>
2024-03-14 01:37:31 +01:00
Gyan Doshi
9e8be937fc configure: add threads dep for vulkan
Fixes #10900
2024-03-13 09:57:54 +05:30
Andreas Rheinhardt
b800327f4c avformat/avformat: Add FFInputFormat, hide internals of AVInputFormat
This commit does for AVInputFormat what commit
59c9dc82f4 did for AVOutputFormat:
It adds a new type FFInputFormat, moves all the internals
of AVInputFormat to it and adds a now reduced AVInputFormat
as first member.

This does not affect/improve extensibility of both public
or private fields for demuxers (it is still a mess due to lavd).

This is possible since 50f34172e0
(which removed the last usage of an internal field of AVInputFormat
in fftools).

(Hint: tools/probetest.c accesses the internals of FFInputFormat
as well, but given that it is a testing tool this is not considered
a problem.)

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-07 08:53:31 -03:00
James Almer
5b23b18d40 avcodec: remove deprecated FF_CODEC_CRYSTAL_HD
Signed-off-by: James Almer <jamrial@gmail.com>
2024-03-07 08:53:30 -03:00
Marth64
59981b47db configure: do not specify -ldvdread, as pkg-config check is already done
Reported-by: BtbN
Signed-off-by: Marth64 <marth64@proxyid.net>
2024-03-04 18:54:50 +01:00
Marth64
a1304272c3 libavformat/dvdvideo: add DVD-Video demuxer, powered by libdvdread and libdvdnav
Signed-off-by: Marth64 <marth64@proxyid.net>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2024-03-02 08:12:29 +01:00
Andreas Rheinhardt
45c612702f configure: Add missing vvc_decoder->cbs_h266 dependency
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-02 13:28:21 +08:00
Zhao Zhili
f7545e90df avutil/hwcontext_opencl: Add map from Videotoolbox to OpenCL
For example:
./ffmpeg -hwaccel videotoolbox \
	-hwaccel_output_format videotoolbox_vld \
	-i foo.mp4 \
	-vf hwmap=derive_device=opencl,transpose_opencl=dir=clock,hwmap,format=nv12 \
	-c:v hevc_videotoolbox \
	-c:a copy \
	-b:v 2M -tag:v hvc1 bar.mp4

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-03-01 17:24:00 +08:00
Andreas Rheinhardt
25e0e087c4 configure: Disable linker warnings for common symbols
Common symbols are not part of ISO-C and therefore not used
by FFmpeg at all. Yet linker warnings to ensure it stays
that way are nevertheless wrong, because the existence of
common symbols does not imply that there is a bug in our code.

More precisely, Clang's ASAN implementation uses a common symbol
___asan_globals_registered when used on Elf targets with
the -fsanitize-address-globals-dead-stripping option;
said option is the default since Clang 17 [1].
This leads to 1883 warnings about ___asan_globals_registered
when linking here.
(Even without that option there were warnings like
_ZN14__interception10real_vforkE being overridden.)

Said warning is also unnecessary: The proper way to ensure
that our code is free of common symbols is to let the compiler
enforce this. But this is already the default since GCC 10
and Clang 11, so there is no risk of introducing our own
common symbols.

[1]: https://reviews.llvm.org/D152604

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-02-26 22:09:19 +01:00
Gyan Doshi
ecb3c8a536 configure: select iamfenc as movenc dep
Unbreaks movenc compilation in minimal configuration.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-02-24 19:44:38 -03:00
Martin Storsjö
1f1abb27f1 configure: Fix a typo
Signed-off-by: Martin Storsjö <martin@martin.st>
2024-02-21 23:28:21 +02:00
James Almer
fe637161db avformat/mov: add support for Immersive Audio Model and Formats in ISOBMFF
Signed-off-by: James Almer <jamrial@gmail.com>
2024-02-20 11:24:19 -03:00
James Almer
c95c8a0158 avformat/iamfenc: further split into shareable modules
Signed-off-by: James Almer <jamrial@gmail.com>
2024-02-19 20:53:36 -03:00
James Almer
c7266ad60f avformat/iamfdec: further split into shareable modules
Signed-off-by: James Almer <jamrial@gmail.com>
2024-02-19 20:53:36 -03:00
Andreas Rheinhardt
e8cdce88e9 configure, libavutil/version: Remove unused HAVE_MMX2
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-02-20 00:09:05 +01:00
Lynne
e43615fc2a
configure: fix compilation with glslang 14
The configure check already had fallback for the previous version
of glslang, which had different requirements for flags.
This commit simply moves the flags needed for glslang 13 to the
fallback, while first trying to use new flags for glslang 14.

This drops support for ~3 year old glslang versions, which
I'm not sure had the complete C API we're using anyway.
2024-02-18 19:57:47 +01:00
Anton Khirnov
75697836b1 Require compilers to support C11.
It should be available in all relevant modern compilers and will allow
us to use features like anonymous unions.

Note that stdatomic.h is still emulated on MSVC, as current versions
require the /experimental:c11atomics, and do not support
ATOMIC_VAR_INIT() anyway.
2024-02-18 07:38:28 +01:00
Brad Smith
fd16d8c68c avutil/thread: add support for setting thread name on *bsd and solaris
FreeBSD/DragonFly/Solaris use pthread_setname_np(). OpenBSD uses pthread_set_name_np().

Signed-off-by: Brad Smith <brad@comstyle.com>
Signed-off-by: Marton Balint <cus@passwd.hu>
2024-02-04 20:45:10 +01:00
Thomas Siedel
db6e360afb avformat/mpegts: add ts stream types for H266/VVC
Add transport stream stream type 0x33 for vvc.
Add STREAM_TYPE_VIDEO_VVC to MPEG-1/2 and MPEG-2 transport stream.
Add basic transport stream support for TS mux/demux.

Tested with:
ffmpeg -i NovosobornayaSquare_1920x1080.mp4 -c:v libvvenc test.ts && ffmpeg -i test.ts -f null -
ffmpeg -i NovosobornayaSquare_1920x1080.mp4 -c:v copy test.ts     && ffmpeg -i test.ts -f md5 -

Signed-off-by: Marton Balint <cus@passwd.hu>
Signed-off-by: Thomas Siedel <thomas.ff@spin-digital.com>
Co-Authored-By: Nuo Mi <nuomi2021@gmail.com>
2024-01-31 22:14:12 +08:00
Connor Worley
dfbbd11a4b lavc/dxvenc: add DXV encoder with support for DXT1 texture format
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2024-01-23 21:31:22 +01:00
Brad Smith
6d3cd399bd configure: remove Bitrig OS
Bitrig has been defunct for 7 years.

Signed-off-by: Brad Smith <brad@comstyle.com>
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-01-12 10:38:15 +08:00
Haihao Xiang
440e08e4bb configure: autodetect libdrm
option kernel_driver for vaapi device creation can be used to choose the
desired device on Linux, which is more convenient than DRM render node
in a multiple-device system (e.g. Intel iGPU + AMD dGPU or inverse), but
this option requires libdrm works. vaapi is autodetected at
configuration time, let's make libdrm autodetected too.

Reviewed-by: Zhao Zhili <quinkblack@foxmail.com>
Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
2024-01-09 09:47:56 +08:00
Martin Storsjö
de9bc4f205 configure: Don't pass -mfp16-format to MSVC on ARM
The check for this option does succeed - MSVC accepts the option,
but prints a warning about it being unknown and ignored, for
each compiled object file:

    cl : Command line warning D9002 : ignoring unknown option '-mfp16-format=ieee'

The configure script only attempts to add this option on ARM,
therefore this warning isn't seen by the majority of people
building with MSVC.

Making this option into a no-op probably isn't entirely right,
but on the other hand, we don't want to litter the code that
checks for support for the option with compiler specific
conditions either.

Signed-off-by: Martin Storsjö <martin@martin.st>
2024-01-05 13:47:57 +02:00
Martin Storsjö
102045028e configure: Disable inline assembly with nonlocal labels with LTO on Clang on Windows
The file libavcodec/x86/mlpdsp_init.c uses inline assembly with
nonlocal labels that are referenced outside of the assembly in C.
This fails to link with LTO when built with Clang when targeting
Windows.

The root cause has been reported upstream at
https://github.com/llvm/llvm-project/issues/76046.

Fixes: https://trac.ffmpeg.org/ticket/10548
Signed-off-by: Martin Storsjö <martin@martin.st>
2024-01-05 13:46:01 +02:00
Thilo Borgmann
7ec4835386 avfilter: Add fsync filter 2024-01-05 09:29:05 +01:00
Nuo Mi
301ed950d1 vvcdec: add vvc decoder
vvc decoder plug-in to avcodec.
split frames into slices/tiles and send them to vvc_thread for further decoding
reorder and wait for the frame decoding to be done and output the frame

Features:
    + Support I, P, B frames
    + Support 8/10/12 bits, chroma 400, 420, 422, and 444 and range extension
    + Support VVC new tools like MIP, CCLM, AFFINE, GPM, DMVR, PROF, BDOF, LMCS, ALF
    + 295 conformace clips passed
    - Not support RPR, IBC, PALETTE, and other minor features yet

Performance:
    C code FPS on an i7-12700K (x86):
        BQTerrace_1920x1080_60_10_420_22_RA.vvc      93.0
        Chimera_8bit_1080P_1000_frames.vvc          184.3
        NovosobornayaSquare_1920x1080.bin           191.3
        RitualDance_1920x1080_60_10_420_32_LD.266   150.7
        RitualDance_1920x1080_60_10_420_37_RA.266   170.0
        Tango2_3840x2160_60_10_420_27_LD.266         33.7

    C code FPS on a M1 Mac Pro (ARM):
        BQTerrace_1920x1080_60_10_420_22_RA.vvc     58.7
        Chimera_8bit_1080P_1000_frames.vvc          153.3
        NovosobornayaSquare_1920x1080.bin           150.3
        RitualDance_1920x1080_60_10_420_32_LD.266   105.0
        RitualDance_1920x1080_60_10_420_37_RA.266   133.0
        Tango2_3840x2160_60_10_420_27_LD.266        21.7

    Asm optimizations still working in progress. please check
    https://github.com/ffvvc/FFmpeg/wiki#performance-data for the latest

Contributors (based on code merge order):
    Nuo Mi <nuomi2021@gmail.com>
    Xu Mu <toxumu@outlook.com>
    Frank Plowman <post@frankplowman.com>
    Shaun Loo <shaunloo10@gmail.com>
    Wu Jianhua <toqsxw@outlook.com>

Thank you for reporting issues and providing performance reports:
    Łukasz Czech <lukaszcz18@wp.pl>
    Xu Fulong <839789740@qq.com>

Thank you for providing review comments:
    Ronald S. Bultje <rsbultje@gmail.com>
    James Almer <jamrial@gmail.com>
    Andreas Rheinhardt <andreas.rheinhardt@outlook.com>

Co-authored-by: Xu Mu <toxumu@outlook.com>
Co-authored-by: Frank Plowman <post@frankplowman.com>
Co-authored-by: Shaun Loo <shaunloo10@gmail.com>
Co-authored-by: Wu Jianhua <toqsxw@outlook.com>
2024-01-03 23:15:12 +08:00
Stefano Sabatini
030e140145 lavfi: add quirc filter 2024-01-01 20:12:52 +01:00
Stefano Sabatini
899302bb5f lavfi: add qrencode source and filter 2024-01-01 20:12:52 +01:00
Gyan Doshi
e1c1dc8347 configure: correct lensfun header function check
The function lf_db_new was deprecated in lensfun 09dcd3e7ad in 2017
in favour of lf_db_create. The AVfilter was adjusted in 8b78eb312d
but the configure check wasn't changed.

lensfun removed lf_db_new declaration in lf 35c0017593 so configure
fails to find lensfun.
2024-01-01 15:31:36 +05:30
Lynne
b95ee2ec5f configure: update copyright year 2024-01-01 00:58:30 +01:00
Brad Smith
6066c430e3
configure: Enable section_data_rel_ro for FreeBSD and NetBSD aarch64 / arm
Fixes the build. It's a requirement when utilizing PIE.

Signed-off-by: Brad Smith <brad@comstyle.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2023-12-25 23:52:37 +01:00
Martin Storsjö
4f493659fd configure: Fix linking d3d12va in UWP mode
Signed-off-by: Martin Storsjö <martin@martin.st>
2023-12-22 12:04:17 +02:00
Martin Storsjö
6d04518788 configure: Remove/factorize a redundant check for UWP mode
The check for UWP mode was duplicated from right above, in
d54127c41a.

Also, instead of several lines with "enabled uwp && ...", make one
"if enabled uwp; then" block.

Signed-off-by: Martin Storsjö <martin@martin.st>
2023-12-22 12:04:12 +02:00
Martin Storsjö
1e42a48e37 configure: Add a --disable-version-tracking option
This disables regenerating ffversion.h whenever the checked out
git commit changes, speeding up development rebuilds.

Whenever this option is set, force the version to be printed as
"unknown" rather than showing potentially stale information.

Signed-off-by: Martin Storsjö <martin@martin.st>
2023-12-21 11:00:34 +02:00
Wu Jianhua
ffa158edbd avcodec: add D3D12VA hardware accelerated VC1 decoding
The command below is how to enable d3d12va:
ffmpeg -hwaccel d3d12va -i input.mp4 output.mp4

Signed-off-by: Wu Jianhua <toqsxw@outlook.com>
Signed-off-by: Tong Wu <tong1.wu@intel.com>
2023-12-21 16:15:23 +08:00
Wu Jianhua
c6c05dd34a avcodec: add D3D12VA hardware accelerated MPEG-2 decoding
The command below is how to enable d3d12va:
ffmpeg -hwaccel d3d12va -i input.mp4 output.mp4

Signed-off-by: Wu Jianhua <toqsxw@outlook.com>
Signed-off-by: Tong Wu <tong1.wu@intel.com>
2023-12-21 16:15:23 +08:00
Wu Jianhua
b16fd96c5f avcodec: add D3D12VA hardware accelerated AV1 decoding
The command below is how to enable d3d12va:
ffmpeg -hwaccel d3d12va -i input.mp4 output.mp4

Signed-off-by: Wu Jianhua <toqsxw@outlook.com>
Signed-off-by: Tong Wu <tong1.wu@intel.com>
2023-12-21 16:15:23 +08:00
Wu Jianhua
326288c70a avcodec: add D3D12VA hardware accelerated VP9 decoding
The command below is how to enable d3d12va:
ffmpeg -hwaccel d3d12va -i input.mp4 output.mp4

Signed-off-by: Wu Jianhua <toqsxw@outlook.com>
Signed-off-by: Tong Wu <tong1.wu@intel.com>
2023-12-21 16:15:23 +08:00
Wu Jianhua
cbb93c4ff6 avcodec: add D3D12VA hardware accelerated HEVC decoding
The command below is how to enable d3d12va:
ffmpeg -hwaccel d3d12va -i input.mp4 output.mp4

Signed-off-by: Wu Jianhua <toqsxw@outlook.com>
Signed-off-by: Tong Wu <tong1.wu@intel.com>
2023-12-21 16:15:23 +08:00
Wu Jianhua
349ce30e4e avcodec: add D3D12VA hardware accelerated H264 decoding
The implementation is based on:
https://learn.microsoft.com/en-us/windows/win32/medfound/direct3d-12-video-overview

With the Direct3D 12 video decoding support, we can render or process
the decoded images by the pixel shaders or compute shaders directly
without the extra copy overhead, which is beneficial especially if you
are trying to render or post-process a 4K or 8K video.

The command below is how to enable d3d12va:
ffmpeg -hwaccel d3d12va -i input.mp4 output.mp4

Signed-off-by: Wu Jianhua <toqsxw@outlook.com>
Signed-off-by: Tong Wu <tong1.wu@intel.com>
2023-12-21 16:15:23 +08:00
Wu Jianhua
142f727b9c libavutil: add hwcontext_d3d12va and AV_PIX_FMT_D3D12
Signed-off-by: Wu Jianhua <toqsxw@outlook.com>
Signed-off-by: Tong Wu <tong1.wu@intel.com>
2023-12-21 16:15:23 +08:00
Kalev Lember
b391fdbf1a lavc/libopenh264: Drop openh264 runtime version checks
With the way the runtime checks are currently set up, every single
openh264 release, no matter how minor, is considered an ABI break and
requires ffmpeg recompilation. This is unnecessarily strict because it
doesn't allow downstream distributions to ship any openh264 bug fix
version updates without breaking ffmpeg's openh264 support.

Years ago, at the time when ffmpeg's openh264 support was merged,
openh264 releases were done without a versioned soname (the library was
just libopenh264.so, unversioned). Since then, starting with version
1.3.0, openh264 has started using versioned sonames and the intent has
been to bump the soname every time there's a new release with an ABI
change.

This patch drops the exact version check and instead adds a minimum
requirement on 1.3.0 to the configure script.

Signed-off-by: Kalev Lember <klember@redhat.com>
Signed-off-by: Martin Storsjö <martin@martin.st>
2023-12-18 23:59:51 +02:00
Zhao Zhili
eddac2aed4 configure: check VTPixelTransferSessionCreate for scale_vt
It's available on macOS since 10.8, but not available on iOS until
16.0.

Reported and tested by xufuji456.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2023-12-17 13:52:14 +08:00
Rémi Denis-Courmont
b3825bbe45 riscv: test for assembler support
This should fix the build on LLVM 16 and earlier, at the cost of turning
all non-RVV optimisations off.
2023-12-08 17:21:09 +02:00
Haihao Xiang
5717fbbea2 configure: don't warn deprecated symbols from libvpl
libvpl deprecated some symbols (e.g. MFX_EXTBUFF_VPP_DENOISE2 is used to
replace MFX_EXTBUFF_VPP_DENOISE), however the new symbols aren't support
by MediaSDK runtime. In order to support the combination of libvpl and
MediaSDK runtime on legacy devices, we continue to use the deprecated
symbols in FFmpeg. This patch added -DMFX_DEPRECATED_OFF to CFLAGS to
silence the corresponding compilation warnings.

Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
2023-12-05 10:10:29 +08:00
Dawid Kozinski
cfe2947887 avcodec/evc_decoder: Provided support for EVC decoder
- Added EVC decoder wrapper
- Changes in project configuration file and libavcodec Makefile
- Added documentation for xevd wrapper

Signed-off-by: Dawid Kozinski <d.kozinski@samsung.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2023-11-20 11:55:51 -03:00
Dawid Kozinski
c59a96fd08 avcodec/evc_encoder: Provided support for EVC encoder
- Added EVC encoder wrapper
- Changes in project configuration file and libavcodec Makefile
- Added documentation for xeve wrapper

Signed-off-by: Dawid Kozinski <d.kozinski@samsung.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2023-11-20 11:55:51 -03:00
Rémi Denis-Courmont
954d50e2ae riscv: set fast half-precision conversion
This is only supported at compilation time. If Zfhmin is supported, then
conversions are fast, which is what the flag is used for. At this time,
run-tiem detection is not possible, as in not supported by Linux. But even
if it were, the current FFmpeg approach seems unable to deal with it (same
problem as on x86, really).
2023-11-19 20:06:20 +02:00
Dai, Jianhui J
c9fe9fb863 avcodec/cbs_vp8: Add support for VP8 codec bitstream
This commit adds support for VP8 bitstream read methods to the cbs
codec. This enables the trace_headers bitstream filter to support VP8,
in addition to AV1, H.264, H.265, and VP9. This can be useful for
debugging VP8 stream issues.

The CBS VP8 implements a simple VP8 boolean decoder using GetBitContext
to read the bitstream.

Only the read methods `read_unit` and `split_fragment` are implemented.
The write methods `write_unit` and `assemble_fragment` return the error
code AVERROR_PATCHWELCOME. This is because CBS VP8 write is unlikely to
be used by any applications at the moment. The write methods can be
added later if there is a real need for them.

TESTS: ffmpeg -i fate-suite/vp8/frame_size_change.webm -vcodec copy
-bsf:v trace_headers -f null -

Signed-off-by: Jianhui Dai <jianhui.j.dai@intel.com>
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2023-11-15 10:29:03 -05:00
Zhao Zhili
a1a6a328f0 fftools/ffplay: add hwaccel decoding support
Add vulkan renderer via libplacebo.

Simple usage:
$ ffplay -hwaccel vulkan foo.mp4

Use cuda to vulkan map:
$ ffplay -hwaccel cuda foo.mp4

Create vulkan instance by libplacebo, and enable debug:
$ ffplay -hwaccel vulkan \
	-vulkan_params create_by_placebo=1:debug=1 foo.mp4

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2023-11-15 01:20:11 +08:00
Peter Ross
10869cd849 avcodec: LEAD MCMP decoder
Partially fixes ticket #798

Reviewed-by: James Almer <jamrial@gmail.com>
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Peter Ross <pross@xvid.org>
2023-11-08 17:37:58 +11:00
Anton Khirnov
f9fdaa2ca9 configure: warn when threading is disabled
Explicitly state what the implications of this are.
2023-11-05 11:30:13 +01:00
Reimar Döffinger
a31992634f configure: fix _Pragma check.
The test can currently pass when _Pragma is not supported, since
_Pragma might be treated as a implicitly declared function.
This happens e.g. with tinycc.
Extending the check to 2 pragmas both matches the actual use
better and avoids this misdetection.
2023-11-02 21:03:43 +01:00
Martin Storsjö
2c3d2a0245 configure: Improve aarch64 feature detection on older, broken Clang versions
Clang versions before 17 (Xcode versions up to and including 15.0)
had a very annoying bug in its behaviour of the ".arch" directive
in assembly. If the directive only contained a level, such as
".arch armv8.2-a", it did validate the name of the level, but it
didn't apply the level to what instructions are allowed. The level
was applied if the directive contained an extra feature enabled,
such as ".arch armv8.2-a+crc" though. It was also applied on the
next ".arch_extension" directive.

This bug, combined with the fact that the same versions of Clang
didn't support the dotprod/i8mm extension names in either
".arch <level>+<feature>" or in ".arch_extension", could lead to
unexepcted build failures.

As the dotprod/i8mm extensions couldn't be enabled dynamically
via the ".arch_extension" directive, someone building ffmpeg could
try to enable them by configuring their build with
--extra-cflags="-march=armv8.6-a".

During configure, we test for support for the i8mm instructions
like this:

    # Built with -march=armv8.6-a
    .arch armv8.2-a             # Has no visible effect here
    #.arch_extension i8mm       # Omitted as the extension name isn't known
    usdot v0.4s, v0.16b, v0.16b
    # Successfully assembled as armv8.6-a is the effective level,
    # and i8mm is enabled implicitly in armv8.6-a.

Thus, we would enable assembling those instructions. However if
we later check for another extension, such as sve (which those
versions of Clang actually do support), we can later run into the
following situation when building actual code:

    # Built with -march=armv8.6-a
    .arch armv8.2-a             # Has no visible effect here
    #.arch_extension i8mm       # Omitted as the extension name isn't known
    .arch_extension sve         # Included as "sve" is as supported extension name
    # .arch_extension effectively activates the previous .arch directive,
    # so the effective level is armv8.2-a+sve now.
    usdot v0.4s, v0.16b, v0.16b
    # Fails to build the instructions that require i8mm. Despite the
    # configure check, the unrelated ".arch_extension sve" directive
    # breaks the functionality of the i8mm feature.

This patch avoids this situation:
- By adding a dummy feature such as "+crc" on the .arch directive
  (if supported), we make sure that it does get applied immediately,
  avoiding it taking effect spuriously at a later unrelated
  ".arch_extension" directive.
- By checking for higher arch levels such as armv8.4-a and armv8.6-a,
  we can assemble the dotprod and i8mm extensions without the user
  needing to pass -march=armv8.6-a. This allows using the dotprod/i8mm
  codepaths via runtime detection while keeping the binary runnable
  on older versions. I.e. this enables the i8mm codepaths on Apple M2
  machines while built with Xcode's Clang.

TL;DR: Enable the I8MM extensions for Apple M2 without the user needing
to do a custom configuration; avoid potential build breakage if a user
does such a custom configuration.

Once Xcode versions that have these issues fixed are prevalent, we
can consider reverting this change.

Signed-off-by: Martin Storsjö <martin@martin.st>
2023-10-31 12:23:31 +02:00
TADANO Tokumei
21bfadd9b4 lavc/libaribcaption: add MSZ character related options
This patch adds two MSZ (Middle Size; half width) character
related options, mapping against newly added upstream
functionality:

* `replace_msz_japanese`, which was introduced in version 1.0.1
  of libaribcaption.
* `replace_msz_glyph`, which was introduced in version 1.1.0
  of libaribcaption.

The latter option improves bitmap type rendering if specified
fonts contain half-width glyphs (e.g., BIZ UDGothic), even
if both ASCII and Japanese MSZ replacement options are set
to false.

As these options require newer versions of libaribcaption, the
configure requirement has been bumped accordingly.

Signed-off-by: TADANO Tokumei <aimingoff@pc.nifty.jp>
2023-10-29 18:20:43 +02:00
Martin Storsjö
0679e85331 aarch64: Stop using asm/hwcap.h for the HWCAP_* detection
Including sys/auxv.h should be enough (it pulls in bits/hwcap.h,
which provides the same defines).

Signed-off-by: Martin Storsjö <martin@martin.st>
2023-10-24 14:46:14 +03:00
Leo Izen
86ed68420d
avcodec/librsvgdec: fix memory leaks and deprecated functions
At various points through the function librsvg_decode_frame, errors are
returned from immediately without deallocating any allocated structs.
This patch both fixes those leaks, and also fixes the use of functions
that are deprecated since librsvg version 2.52.0. The older calls are
still used, guarded by #ifdefs while the newer replacements are used if
librsvg >= 2.52.0. One of the deprecated functions is used as a check
for the configure shell script, so it was replaced with a different
function.

Signed-off-by: Leo Izen <leo.izen@gmail.com>
2023-10-22 15:18:13 -04:00
Michael Riedl
721857483f avformat/mxfenc: fix static building
MXF muxer requires rangecoder otherwise static linking fails.

Signed-off-by: Michael Riedl <michael.riedl@nativewaves.com>
2023-10-17 14:46:34 +02:00
Lynne
fec6e84b18
configure: disable libglslang/libshaderc if the vulkan is disabled
Fixes build failures when the Vulkan headers are too old and libglslang
or libshaderc are enabled.
2023-10-15 17:11:47 +02:00
Leo Izen
1e888462a1
configure: improve libmfx deprecation warning
The libmfx deprecation warning tells you to build against libmfx 1.x,
but the actual solution is to use --enable-libvpl instead of using
--enable-libmfx. Update the warning message to reflect this.

Signed-off-by: Leo Izen <leo.izen@gmail.com>
2023-10-14 20:55:23 -04:00
John Mather
7251dfdcee avcodec/libkvazaar: Bump minimum version to 2.0.0
0cd8769207 utilized the rc_algorithm member of the kvz_config struct, which
was introduced in Kvazaar 2.0.0. This patch bumps the minimum version of
Kvazaar to 2.0.0 so that FFmpeg compiles successfully.

Signed-off-by: John Mather <johnmather@sidefx.com>
2023-10-11 21:26:52 +03:00
Timo Rothenpieler
3914abf76e configure: fix --custom-allocator
The custom-allocator logic has been completely defunct since a while,
since nothing depends on those targets, they never get used.
This updates jemalloc to pkg-config, adds the fallback option for
potential arbitrary allocators, and finally actually adds the libraries
to LDFLAGS.
2023-10-09 20:14:07 +02:00
Andreas Rheinhardt
6f7bf64dbc avcodec: Remove DCT, FFT, MDCT and RDFT
They were replaced by TX from libavutil; the tremendous work
to get to this point (both creating TX as well as porting
the users of the components removed in this commit) was
completely performed by Lynne alone.

Removing the subsystems from configure may break some command lines,
because the --disable-fft etc. options are no longer recognized.

Co-authored-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2023-10-01 02:25:09 +02:00
Andreas Rheinhardt
d9464f3e34 avcodec/mpegaudiodsp: Init dct32 directly
This avoids using dct.c and will allow removing it.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2023-10-01 01:53:32 +02:00
Andreas Rheinhardt
12e9c68bbd configure: Remove unnecessary vf_spp->fft dependency
The AVDCT API used by this filter does in no way depend
upon the FFT subsystem.

Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2023-09-29 01:44:46 +02:00
Andreas Rheinhardt
cbba45de68 configure: Remove obsolete ffplay->rdft dependency
Forgotten in 4acd08be6c.

Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2023-09-29 01:44:39 +02:00
Andreas Rheinhardt
44aa46184c configure: Remove obsolete wmavoice->rdft,dct dependencies
Forgotten in a810126501.

Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2023-09-29 01:44:25 +02:00
Andreas Rheinhardt
433925ac4d avcodec/snow: Move initializing HpelDSPContext to snowenc.c
Only used by the encoder.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2023-09-29 01:04:38 +02:00
Roman Arzumanyan
05f8b2ca0f avutil/hwcontext_cuda: add option to use current device context
Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
2023-09-28 19:23:51 +02:00
Kyle Swanson
7f685d0f49 avfilter: add libvmaf_cuda
Signed-off-by: Kyle Swanson <kswanson@netflix.com>
2023-09-27 10:22:33 -07:00
Fei Wang
3be81e3b44 lavc/vaapi_encode: Add VAAPI AV1 encoder
Signed-off-by: Fei Wang <fei.w.wang@intel.com>
Acked-by: Neal Gompa <ngompa13@gmail.com>
2023-09-22 13:15:00 +08:00
James Almer
abc346de73 configure: rework parsing --cpu arguments to support all features unless blacklisted
Keeping an ever growing list of CPUs just to pass -march to the compiler and
enable fast_cmov is a waste of time. Every CPU we know has limitations is
already handled here, so just fallback to enabling everything when a passed in
argument is not one of those.

This will enable optimizations for CPU architectures released in the past 7 or
so years with supported GCC and clang compilers when used as argument in
configure, instead of silently ignoring them.

Signed-off-by: James Almer <jamrial@gmail.com>
2023-09-19 12:47:38 -03:00
Leo Izen
9b454fdaef
avformat/libssh: avoid deprecated functions
Avoid using the deprecated functions ssh_try_publickey_from_file among
others in favor of symbols introduced in libssh 0.6.0 (Jan 2014) and
update configure to require this version.

Signed-off-by: Leo Izen <leo.izen@gmail.com>
2023-09-18 08:43:24 -04:00
Lynne
358919506d
vulkan: enable VK_KHR_cooperative_matrix
It's of interest to API users, and of interest to us,
as a DCT/DST can be implemented via matrix multiplies.
2023-08-26 23:14:53 +02:00
Wenbin Chen
e79bd1f1b1 lavfi/dnn: Add OpenVINO API 2.0 support
OpenVINO API 2.0 was released in March 2022, which introduced new
features.
This commit implements current OpenVINO features with new 2.0 APIs. And
will add other features in API 2.0.
Please add installation path, which include openvino.pc, to
PKG_CONFIG_PATH mannually for new OpenVINO libs config.

Signed-off-by: Ting Fu <ting.fu@intel.com>
Signed-off-by: Wenbin Chen <wenbin.chen@intel.com>
2023-08-26 14:12:10 +08:00
Martin Storsjö
aea2d269db configure: Include objbase.h when checking for CoTaskMemFree
ddc1cd5cdd defined WIN32_LEAN_AND_MEAN
globally, which makes for much fewer transitive includes from
windows.h. With that define, CoTaskMemFree no longer gets
implicitly declared by just including windows.h, but one has to
include the right header objbase.h too.

That commit caused ole32 to no longer get detected, which caused
dxva2 to no longer be enabled. This gets fixed by this patch.

Signed-off-by: Martin Storsjö <martin@martin.st>
2023-08-21 23:11:43 +03:00
L. E. Segovia
ddc1cd5cdd configure: Set WIN32_LEAN_AND_MEAN at configure time
Including winsock2.h or windows.h without WIN32_LEAN_AND_MEAN cause
bzlib.h to parse as nonsense, due to an instance of #define char small
in rpcndr.h.

See:

https://stackoverflow.com/a/27794577

Signed-off-by: L. E. Segovia <amy@amyspark.me>
Signed-off-by: Martin Storsjö <martin@martin.st>
2023-08-14 22:57:28 +03:00
Brad Smith
f6d8464590
configure: use just the pkg-config for sndio
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2023-08-07 22:31:06 +02:00
Andreas Rheinhardt
e35dfe864d avcodec/avcodec: Add FFHWAccel, hide internals of AVHWAccel
This commit is the AVHWAccel analogue of commit
20f9727018: It moves the private fields
of AVHWAccel to a new struct FFHWAccel extending AVHWAccel
in an internal header (namely hwaccel_internal.h).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2023-08-07 09:50:29 +02:00
Zhao Zhili
89f5124d0a avfilter: add transpose_vt for videotoolbox pix_fmt
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2023-07-23 11:52:28 +08:00
Zhao Zhili
c2c96c4c24 avfilter: add scale_vt for videotoolbox pix_fmt
For example,

./ffmpeg -hwaccel videotoolbox \
	-hwaccel_output_format videotoolbox_vld \
	-i ios-265.mov \
	-c:v hevc_videotoolbox \
	-profile:v main \
	-b:v 3M \
	-vf scale_vt=w=iw/2:h=ih/2:color_matrix=bt709:color_primaries=bt709:color_transfer=bt709 \
	-c:a copy \
	-tag:v hvc1 \
	/tmp/test.mp4

Input: hevc (Main 10) (hvc1 / 0x31637668), yuv420p10le(tv, bt2020nc/bt2020/arib-std-b67), 3840x2160
Output: hevc (Main) (hvc1 / 0x31637668), yuv420p(tv, bt709, progressive), 1920x1080
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2023-07-23 11:51:57 +08:00
Kieran Kunhya
a4e616824b libavutil: Remove TOMI CPU 2023-07-22 00:36:53 +01:00
Stephen Hutchinson
efa6cec759 configure: bump minimum AviSynth+ header version
AVISYNTH_INTERFACE_VERSION 10 fell in-between the releases of
3.7.2 and 3.7.3, and is required to be able to read the channel
layout information.

Signed-off-by: Stephen Hutchinson <qyot27@gmail.com>
2023-07-19 19:33:20 -04:00
Marton Balint
36f4e6f8f4 avformat/hlsenc: use av_random_bytes() for generating AES128 key
av_random_bytes() can use OS provided strong random functions and does not
depend soley on openssl/gcrypt external libraries.

Fixes ticket #10441.

Signed-off-by: Marton Balint <cus@passwd.hu>
2023-07-16 11:48:31 +02:00
Rémi Denis-Courmont
f032234953 aarch64: remove VFP feature check
This is not actually used for anything. The configure check causes the
CPU feature flag to be set, but nothing consumes it at all.

While AArch64 does have VFP, it is only used for the scalar C code.
Conversely, it is still possible to disable VFP, by changing the
C compiler flags as before (though that only makes sense for an
hypothetical non-standard Armv8 platform without VFP).

Note that this retains the "vfp" option flag, for backward
compatibility and on the very remote but theoretically possible chance
that FFmpeg actually makes use of it in the future.

AV_CPU_FLAG_VFP is retained as it is actually used by AArch32.
2023-07-15 22:56:30 +03:00