Commit Graph

5509 Commits

Author SHA1 Message Date
Lynne
805e8d1921
lavu/tx: make slow ISA extension penalties smarter
Instead of having a fixed -64 prio penalty, make the penalties
more granular.
As the prio is based on the register size in bits, decrementing
it by 129 makes AVX SLOW functions be avoided in favor of any
SSE versions.
2022-05-21 02:10:14 +02:00
Lynne
19c0bb2aa9
x86/tx_float: add AV_CPU_FLAG_AVXSLOW/SLOW_GATHER flags where appropriate 2022-05-21 02:10:09 +02:00
Lynne
9e94c35941
Revert "x86/tx_float: remove vgatherdpd usage"
This reverts commit 82a68a8771.

Smarter slow ISA penalties makes gathers still useful.
The intention is to use gathers with the final stage of non-ptwo iMDCTs,
where they give benefit.
2022-05-21 02:10:02 +02:00
Lynne
82a68a8771
x86/tx_float: remove vgatherdpd usage
Its performance loss ranges from either being just as fast as individual loads
(Skylake), a few percent slower (Alderlake), 8% slower (Zen 3), to completely
disasterous (older/other CPUs).

Sadly, gathers never panned out fast on x86, even with the benefit of time and
implementation experience.

This also saves a register, as there's no need to fill out an additional
register mask.

Zen 3 (16384-point transform):
Before: 1561050 decicycles in           av_tx (fft),  131072 runs,      0 skips
After:  1449621 decicycles in           av_tx (fft),  131072 runs,      0 skips

Alderlake:
2% slower on big transforms (65536), to 1% (131072), to a few percent for smaller
sizes.
2022-05-20 10:12:34 +02:00
Andreas Rheinhardt
f2b79c5b85 lib*/version: Move library version functions into files of their own
This avoids having to rebuild big files every time FFMPEG_VERSION
changes (which it does with every commit).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-05-10 06:49:32 +02:00
Zhao Zhili
c3f00daa99 avutil/hwcontext_videotoolbox: create real buffer pool
vt_get_buffer shouldn't do buffer pool's job.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2022-04-29 17:27:37 +08:00
Marton Balint
0d666200d3 avutil/timecode: use timecode fps for number of frame digits
Signed-off-by: Marton Balint <cus@passwd.hu>
2022-04-22 22:54:58 +02:00
Marton Balint
58aa06bea0 avutil/cpu: #define _GNU_SOURCE before including any standard headers
Otherwise its effect might not work causing CPU_COUNT to not get defined.

Fixes cpu count detection to actually use sched_getaffinity if available.

Signed-off-by: Marton Balint <cus@passwd.hu>
2022-04-22 21:58:47 +02:00
Wenbin Chen
7e7b3a4c28 libavutil/hwcontext_qsv: Align width and heigh when download qsv frame
The width and height for qsv frame to download need to be
aligned with 16. Add the alignment operation.
Now the following command works:
ffmpeg -hwaccel qsv -f rawvideo -s 1920x1080 -pix_fmt yuv420p -i \
input.yuv -vf "hwupload=extra_hw_frames=16,format=qsv,hwdownload, \
format=nv12" -f null -

Signed-off-by: Wenbin Chen <wenbin.chen@intel.com>
Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
2022-04-13 13:41:27 +08:00
Ingo Brückl
02111be0c1 libavutil/hwcontext_vaapi: Re-enable support for libva v1
Commit e050959103 implemented passing in
modifiers by using the PRIME_2 memory type, which only exists in v2 of
the library.

To still support v1 of the library, conditionally compile using
VA_CHECK_VERSION() for both the new code and the old code before
the commit.

Note PRIME_2 memory was introduced from VA-API 1.1, so use
VA_CHECK_VERSION(1, 1, 0) instead of VA_CHECK_VERSION(2, 0, 0) (Haihao)

Signed-off-by: Ingo Brückl <ib@wupperonline.de>
Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
2022-04-06 17:12:26 +08:00
James Almer
f2967490f1 avutil/channel_layout: return earlier on UNSPEC layouts in av_channel_layout_subset()
No point running all 64 iterations in the loop to never write anything to ret.
Also make ambisonic layouts check its mask too while at it.

Signed-off-by: James Almer <jamrial@gmail.com>
2022-03-25 17:10:39 -03:00
James Almer
7602b4e4c2 avutil/tests/channel_layout: also test ambisonic layouts in av_channel_layout_subset()
Signed-off-by: James Almer <jamrial@gmail.com>
2022-03-25 17:10:39 -03:00
James Almer
cbeb827cfb avutil/tests/channel_layout: test av_channel_layout_check()
Should increase test coverage

Signed-off-by: James Almer <jamrial@gmail.com>
2022-03-25 12:09:21 -03:00
James Almer
95ac380252 avutil/tests/channel_layout: test the output of av_channel_layout_subset()
Should increase test coverage a bit

Signed-off-by: James Almer <jamrial@gmail.com>
2022-03-25 12:09:19 -03:00
James Almer
167c5a6afc avutil/tests/channel_layout: test the output of av_channel_layout_standard()
Should increase test coverage.

Signed-off-by: James Almer <jamrial@gmail.com>
2022-03-25 11:46:51 -03:00
James Almer
f9ed91abc9 avutil/tests/channel_layout: test generating a custom layout using ambisonic channels and a non diegetic channel with a custom name
Should increase test coverage a bit

Signed-off-by: James Almer <jamrial@gmail.com>
2022-03-25 11:46:48 -03:00
James Almer
e4f6fce9e0 avutil/channel_layout: add missing check for AV_CHAN_NONE in av_channel_description
Prevents printing "user -1" on invalid channel ids.

Signed-off-by: James Almer <jamrial@gmail.com>
2022-03-25 09:24:39 -03:00
James Almer
6e04ace7fe avutil/channel_layout: don't try to print NULL string pointers in av_channel_{name,description}
Instead fallback to print USR%d for channels id < 64 without a known name.

Signed-off-by: James Almer <jamrial@gmail.com>
2022-03-25 08:38:19 -03:00
James Almer
327efa6633 avutil/opt: add missing case for AV_OPT_TYPE_CHLAYOUT in av_opt_free()
Fixes potential memleaks for existing options of this type.

Signed-off-by: James Almer <jamrial@gmail.com>
2022-03-18 18:59:03 -03:00
Martin Storsjö
bea841a743 Fix libversion.sh for split version headers, to unbreak shared library builds
Signed-off-by: Martin Storsjö <martin@martin.st>
2022-03-17 11:11:17 +02:00
James Almer
8ddf1795b9 avutil/attributes: add support for clang in AV_NOWARN_DEPRECATED
Reviewed-by: Martin Storsjö <martin@martin.st>
Signed-off-by: James Almer <jamrial@gmail.com>
2022-03-16 12:29:37 -03:00
James Almer
f2fe17c56d avutil/channel_layout: remove duplicate stereo downmix entry
Signed-off-by: James Almer <jamrial@gmail.com>
2022-03-15 22:54:41 -03:00
Marton Balint
ab7a929684 avutil/channel_layout: do not copy alloc new map for extra channel layout
Also use av_channel_layout_bprint directly for describing channel layout for
extra channels.

Signed-off-by: Marton Balint <cus@passwd.hu>
2022-03-15 23:19:24 +01:00
Marton Balint
92f27c6728 avutil/channel_layout: fix av_channel_layout_describe_bprint with custom and ambisonic channels
bp->len cannot be used to detect if try_describe_ambisonic was successful
because the bprint buffer might contain other data as well.

Also describing an invalid ambisonic layout should not return 0 but
AVERROR(EINVAL) instead, so change try_describe_ambisonic to actually return
error on invalid ambisonics. This also allows us to fix the first issue.

Signed-off-by: Marton Balint <cus@passwd.hu>
2022-03-15 23:19:24 +01:00
Marton Balint
580f7b6c3a avutil/channel_layout: factorize ambisonic order detection
Signed-off-by: Marton Balint <cus@passwd.hu>
2022-03-15 23:19:24 +01:00
Marton Balint
bd40375dd2 avutil/channel_layout: print channels using av_channel_name_bprint in av_channel_layout_describe_bprint
This reduces code duplication an allows printing AMBI%d channel names for
custom layouts for non-standard or partial ambisonic layouts.

Signed-off-by: Marton Balint <cus@passwd.hu>
2022-03-15 23:19:24 +01:00
Andreas Rheinhardt
9e241bdffd avutil/channel_layout: Fix leak of string
Fixes memleaks in the channel_layout FATE-test.

Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-03-15 16:18:10 +01:00
James Almer
cdba98bb80 Bump minor versions after the channel layout changes
Forgotten in the respective commits adding new API.

Signed-off-by: James Almer <jamrial@gmail.com>
2022-03-15 11:12:21 -03:00
Vittorio Giovara
886847afa0 channel_layout: add support for Ambisonic
Signed-off-by: James Almer <jamrial@gmail.com>
2022-03-15 09:42:47 -03:00
Anton Khirnov
db6efa1815 avframe: switch to the new channel layout API
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2022-03-15 09:42:29 -03:00
Anton Khirnov
f423497b45 lavu: support AVChannelLayout AVOptions
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2022-03-15 09:42:29 -03:00
James Almer
f51e169d2b fate: add a channel_layout API test
Signed-off-by: James Almer <jamrial@gmail.com>
2022-03-15 09:42:29 -03:00
Anton Khirnov
086a804806 avutil/channel_layout: Add a new channel layout API
The new API is more extensible and allows for custom layouts.
More accurate information is exported, eg for decoders that do not
set a channel layout, lavc will not make one up for them.

Deprecate the old API working with just uint64_t bitmasks.

Expanded and completed by Vittorio Giovara <vittorio.giovara@gmail.com>
and James Almer <jamrial@gmail.com>.
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2022-03-15 09:42:29 -03:00
Martin Storsjö
c3fea6d83b aarch64: Only emit the PAC/BTI note section when targeting ELF
This avoids build errors if such features are enabled while targeting
another binary format. (Using such features on other platforms
might require some other form of signaling/setup though, but
the ELF specific .note section isn't applicable at least.)

Signed-off-by: Martin Storsjö <martin@martin.st>
2022-03-15 00:44:28 +02:00
Zhao Zhili
910a24eb33 avutil/hwcontext_vulkan: fix typo in undef 2022-03-14 17:50:07 +01:00
Wu Jianhua
f629ea2e18 avutil/cpu: add AVX512 Icelake flag
Signed-off-by: Wu Jianhua <jianhua.wu@intel.com>
Reviewed-by: Henrik Gramner <henrik@gramner.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2022-03-10 16:45:48 -03:00
Andre Kempe
248986a0db arm64: Add Armv8.3-A PAC support to assembly files
This patch adds optional support for Arm Pointer Authentication Codes.

PAC support is turned on or off at compile time using additional
compiler flags. Unless any of these is enabled explicitly, no additional
code will be emitted at all.

Signed-off-by: André Kempe <andre.kempe@arm.com>
Signed-off-by: Martin Storsjö <martin@martin.st>
2022-03-09 15:04:25 +02:00
Hao Chen
5b812acdea avutil: [loongarch] Update loongson_intrinsics.h to v1.1.0
The loongson_intrinsics.h file is updated from v1.0.3 version
to v1.1.0. Some spelling mistakes are fixed and new functions are added.

Signed-off-by: Hao Chen <chenhao@loongson.cn>
Reviewed-by: 殷时友 <yinshiyou-hf@loongson.cn>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2022-03-01 23:53:40 +01:00
Limin Wang
188faab2bb avutil: support for CUVA Vivid HDR metadata
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
2022-03-01 09:08:43 +08:00
James Almer
ff145498b2 avutil: make lzo always compile
Having optionally installed headers is a bad idea as there's no way to know
if they are present or not (unless a define is added to avconfig.h, but that's
just ugly).

Signed-off-by: James Almer <jamrial@gmail.com>
2022-02-26 14:17:00 -03:00
Andreas Rheinhardt
636631d9db Remove unnecessary libavutil/(avutil|common|internal).h inclusions
Some of these were made possible by moving several common macros to
libavutil/macros.h.

While just at it, also improve the other headers a bit.

Reviewed-by: Martin Storsjö <martin@martin.st>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-02-24 12:56:49 +01:00
Andreas Rheinhardt
84f16bb5e6 avutil/avassert: Don't include avutil.h
Reviewed-by: Martin Storsjö <martin@martin.st>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-02-24 12:56:49 +01:00
Andreas Rheinhardt
155cd6baa4 Remove obsolete version.h inclusions
Forgotten in e7bd47e657.

Reviewed-by: Martin Storsjö <martin@martin.st>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-02-24 12:56:49 +01:00
Andreas Rheinhardt
b389ff9a85 avutil/display: Don't include avutil.h
Reviewed-by: Martin Storsjö <martin@martin.st>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-02-24 12:56:49 +01:00
Andreas Rheinhardt
2c2d76b50d avutil/integer: Don't include common.h
Reviewed-by: Martin Storsjö <martin@martin.st>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-02-24 12:56:49 +01:00
Andreas Rheinhardt
94d5892bea avutil/pixelutils: Don't include common.h
Reviewed-by: Martin Storsjö <martin@martin.st>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-02-24 12:56:49 +01:00
Andreas Rheinhardt
8e7d2e4621 avutil/samplefmt: Don't include attributes.h, avutil.h
Reviewed-by: Martin Storsjö <martin@martin.st>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-02-24 12:56:49 +01:00
Andreas Rheinhardt
e82d94ee46 avutil/imgutils: Don't include avutil.h
It is a remnant of an FF_API_* inclusion (back from when they were in
avutil.h and not in version.h).

Reviewed-by: Martin Storsjö <martin@martin.st>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-02-24 12:56:49 +01:00
Andreas Rheinhardt
9d78acd861 avutil/eval: Don't include avutil.h
It has been added for an FF_API_* at a time when these were in avutil.h.

Reviewed-by: Martin Storsjö <martin@martin.st>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-02-24 12:56:49 +01:00
Andreas Rheinhardt
eaba16ba70 avutil/file: Don't include avutil.h
Reviewed-by: Martin Storsjö <martin@martin.st>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-02-24 12:56:49 +01:00