1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-21 10:55:51 +02:00
Commit Graph

5352 Commits

Author SHA1 Message Date
Wu Jianhua
ff82bd5a00 avutil/vulkan_glslang: fix compiling failure issue
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
1d06084171
vulkan: fix checkheaders 2021-11-19 16:47:28 +01:00
Lynne
f6dd30df24
lavfi/vulkan: split off lavfi-specific code into vulkan_filter.c
The issue is that libavfilter depends on libavcodec, and when doing a
static build, if libavcodec also includes "libavfilter/vulkan.c", then
during link-time, compiling programs will fail as there would be multiple
definitions of the same symbols in both libavfilter and libavcodec's
object files.
Linkers are, however, more permitting if both files that include
a common file that's used as a template are one-to-one identical.
Hence, to make both files the same in the future, export all avfilter
specific functions to a separate file.
There is some work in progress to make templated files like this be
compiled only once, so this is not a long-term solution.

This also removes a macro that could be used to toggle SPIRV compilation
capability on #include-time, as this could cause the files to be different.
2021-11-19 16:47:26 +01:00
James Almer
67b92d68c6 x86/intmath: add VEX encoded versions of av_clipf() and av_clipd()
Prevents mixing inlined SSE instructions and AVX instructions when the compiler
generates the latter.

Signed-off-by: James Almer <jamrial@gmail.com>
2021-11-19 11:21:03 -03:00
Lynne
b2aec70bd6
lavu/vulkan: add option to switch between shader compilers and cleanup glslang 2021-11-19 13:44:47 +01:00
Lynne
d1133e8c44
lavu/vulkan: move common Vulkan code from libavfilter to libavutil 2021-11-19 13:44:45 +01:00
Soft Works
daef8cbff7 avutil/frame: Document the possibility of negative line sizes
Signed-off-by: softworkz <softworkz@hotmail.com>
Signed-off-by: Marton Balint <cus@passwd.hu>
2021-11-18 20:40:24 +01:00
Andreas Rheinhardt
9181b9ec7c avutil/hwcontext_qsv: Remove redundant check
It has already been checked immediately before that said
AVDictionaryEntry exists; checking again is redundant.
Furthermore, av_hwdevice_find_type_by_name() requires its argument
to be non-NULL, so adding a codepath that automatically calls it
with that parameter is nonsense. The same goes for the argument
corresponding to %s.

Fixes Coverity issue 1491394.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-11-18 19:50:08 +01:00
Andreas Rheinhardt
bd5ec3601f avutil/hwcontext_qsv: Fix leak of AVBuffer and AVBufferRef
This av_buffer_create() does nothing but leak an AVBuffer and an
AVBufferRef (except on allocation error).

Fixes Coverity issue 1491393.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-11-18 19:50:00 +01:00
Lynne
85a6b7f7b7
vulkan_loader: fix typo in error message 2021-11-18 06:40:52 +01:00
Derek Buitenhuis
54e65aa38a avutil: Add Dolby Vision RPU side data type
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2021-11-17 14:12:33 +00:00
Jonathan Wright
08b4716a9e aarch64: Add Armv8.5-A BTI support
Add Branch Target Identifiers (BTIs) to all functions defined in
AArch64 assembly files. Most of the BTI landing pads are added
automatically by the 'function' macro.

BTI support is turned on or off at compile time based on the presence
of the __ARM_FEATURE_BTI_DEFAULT feature macro.

A binary compiled with BTI support can be executed on an Armv8-A
processor without BTI support because the instructions are defined in
NOP space.

Signed-off-by: Jonathan Wright <jonathan.wright@arm.com>
Signed-off-by: Elijah Ahmad <elijah.ahmad@arm.com>
Signed-off-by: Martin Storsjö <martin@martin.st>
2021-11-16 13:43:56 +02:00
Mark Reid
c3502f4f75 libavutil/common: clip nan value to amin
Changes av_clipf to return amin if a is nan.
Before if a is nan av_clipf_c returned nan and
av_clipf_sse would return amax. Now the both
should behave the same.

This works because nan > amin is false.
The max(nan, amin) will be amin.

Signed-off-by: James Almer <jamrial@gmail.com>
2021-11-15 16:50:08 -03:00
Anton Khirnov
db932241ee */version.h: define FF_API macros unconditionally
There is no reason to wrap them in #ifndef guards, they should only be
defined here and nowhere else. The define guards just add the
possibility to accidentally use the same FF_API name in different
libraries.
2021-11-15 16:24:58 +01:00
Timo Rothenpieler
2ece70090d avutil/hwcontext_vulkan: add support for exporting memory via Win32 Handles 2021-11-14 12:50:32 +01:00
Timo Rothenpieler
fedf4ff85c avutil/vulkan: load win32 external memory functions 2021-11-14 12:50:32 +01:00
Soft Works
99a49f9147 avutil/opt: fix mis-alignment of option and constant values for filter help
Before:

overlay AVOptions:
  x                 <string>     ..FV....... set the x expression (default "0")
  y                 <string>     ..FV....... set the y expression (default "0")
  eof_action        <int>        ..FV....... Action to take when encountering EOF from secondary input  (from 0 to 2) (default repeat)
     repeat          0            ..FV....... Repeat the previous frame.
     endall          1            ..FV....... End both streams.
     pass            2            ..FV....... Pass through the main input.
  eval              <int>        ..FV....... specify when to evaluate expressions (from 0 to 1) (default frame)

After:
a
overlay AVOptions:
   x                 <string>     ..FV....... set the x expression (default "0")
   y                 <string>     ..FV....... set the y expression (default "0")
   eof_action        <int>        ..FV....... Action to take when encountering EOF from secondary input  (from 0 to 2) (default repeat)
     repeat          0            ..FV....... Repeat the previous frame.
     endall          1            ..FV....... End both streams.
     pass            2            ..FV....... Pass through the main input.
   eval              <int>        ..FV....... specify when to evaluate expressions (from 0 to 1) (default frame)

Signed-off-by: softworkz <softworkz@hotmail.com>
Signed-off-by: Marton Balint <cus@passwd.hu>
2021-11-13 19:55:32 +01:00
Soft Works
fba4d6f72b avutil/hwcontext_dxva2: add ARGB format
Required for uploading frames with alpha for qsv_overlay
(v2: remove tab indent)

Signed-off-by: softworkz <softworkz@hotmail.com>
Signed-off-by: Marton Balint <cus@passwd.hu>
2021-11-13 19:22:57 +01:00
Lynne
7f6dc9b386
hwcontext_vaapi: don't use the generic mapping struct for DRM/VAAPI
Avoids a per-frame allocation since we don't need the flag field.
2021-11-13 15:13:03 +01:00
Lynne
f388791ff9
hwcontext_vulkan: fix small memory leak when unmapping 2021-11-13 14:47:12 +01:00
Lynne
9dc544cdb4
hwcontext_vulkan: wait for semaphores when unmapping from VAAPI
We don't really want to do a full all-queue blocking wait here, since
this happens once per frame, and this could delay future frames.
2021-11-13 14:22:11 +01:00
Lynne
6a23a5597c
hwcontext_vulkan: print error information on queue submission failure
Makes it clearer what went wrong.
2021-11-13 14:21:36 +01:00
Lynne
c96d1ee401
hwcontext_vulkan: fix DMABUF import format check call
VkExternalImageFormatProperties is required to be present in the .pNext
chain of VkImageFormatProperties2, or some drivers crash (RADV).
2021-11-13 11:12:50 +01:00
Lynne
f74ceb358c
hwcontext_vulkan: improve CUDA error handling 2021-11-13 04:30:33 +01:00
Lynne
0d1992e025
hwcontext_vulkan: close exported memory FD on CUDA import error
Prevents resource leakage.
2021-11-13 00:40:46 +01:00
Lynne
015b487777
hwcontext_vulkan: do not dup() semaphore FDs for CUDA 2021-11-13 00:32:53 +01:00
Lynne
fa28c1b2f9
hwcontext_vulkan: properly migrate queue families with DRM import/export 2021-11-13 00:03:58 +01:00
Lynne
549d91ae3a
hwcontext_vulkan: properly migrate between queue families on CUDA import/export
It's more correct.
2021-11-13 00:03:56 +01:00
Lynne
8449baf9aa
hwcontext_vulkan: properly error out if timeline semaphores are unsupported
Missing goto.
2021-11-13 00:03:51 +01:00
Lynne
296cb99d46
hwcontext_vulkan: fix CreateSemaphore conflict with synchapi.h
Include windows.h to fix it. Normally, it'd be better to include it in
vulkan_functions.h, but I'm reasonably confident nothing else that uses
the Vulkan code will need to include Windows functions and not windows.h.
2021-11-12 14:45:20 +01:00
Lynne
57e11321ea
hwcontext_vulkan: use vkDeviceWaitIdle instead of vkWaitSemaphores on uninit
To silence a possible validation layer bug, switch the function. It only gets
triggered by vf_libplacebo, which is odd.
2021-11-12 14:45:17 +01:00
Lynne
8478d60d5b
doc/APIchanges: update for Vulkan API changes 2021-11-12 05:23:41 +01:00
Lynne
d05a18cdc7
lavu: move hwcontext_vulkan's function loader into separate files
This allows for the loader to be shared with libavcodec and libavfilter.
2021-11-12 05:23:40 +01:00
Lynne
1ffb59c056
hwcontext_vulkan: clean up extensions code and add additional defaults 2021-11-12 05:23:40 +01:00
Lynne
bde1fc5386
hwcontext_vulkan: host wait on semaphores before freeing frame 2021-11-12 05:23:39 +01:00
Lynne
f7f1613638
hwcontext_vulkan: report device that's used
Not sure why this wasn't done before.
2021-11-12 05:23:39 +01:00
Lynne
6bf9a6539e
vulkan: add support for encode and decode queues and refactor queue code
This simplifies and makes queue family picking simpler and more robust.
The requirements on the device context are relaxed. They made no sense
in the first place.

The video encode/decode extension is still in beta, at least on paper,
but I really doubt they'd change needing a separate queue family.
2021-11-12 05:23:36 +01:00
Lynne
09e4687b5b
hwcontext_vulkan: port CUDA interop to use timeline semaphores 2021-11-12 03:36:44 +01:00
Lynne
0370a580dc
hwcontext_vulkan: fix mapping from/to DRM/VAAPI frames 2021-11-12 03:36:42 +01:00
Lynne
00ef53c3ea
hwcontext_vulkan: switch to using timeline semaphores 2021-11-12 03:36:40 +01:00
Lynne
7f3878828d
hwcontext_vulkan: bump required Vulkan loader version to 1.2 2021-11-12 03:36:35 +01:00
Zhao Zhili
9fd2b39428 avutil/opt: handle whole range of int64_t in av_opt_get_int
Make get_int/set_int symetric. The int64_t to double to int64_t
conversion is unprecise for large value.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-11-11 13:14:58 +01:00
Limin Wang
8dc8c01d6c avutil/parseutils: add qhd(Quad HD) or wqhd(Wide Quad HD) for 1440p
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
2021-11-03 21:38:37 +08: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
Michael Niedermayer
e154353fdb avutil/mathematics: Document av_rescale_rnd() behavior on non int64 results
Reviewed-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-10-21 14:13:03 +02:00
Limin Wang
9997047a18 avutil/detection_bbox: Fix av_detection_bbox_alloc failed if nb_bboxes == 0
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
2021-10-08 10:11:59 +08:00
Limin Wang
e724004fd8 avutil/detection_bbox: use offsetof for bboxes_offset
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
2021-10-08 10:11:59 +08:00
Andreas Rheinhardt
03a0dbaff3 avutil/md5: Avoid av_unused variable
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-10-02 17:13:57 +02:00
Andreas Rheinhardt
ff80090374 avutil/utils: Remove racy check from avutil_version()
avutil_version() currently performs several checks before
just returning the version. There is a static int that aims
to ensure that these tests are run only once. The reason is that
there used to be a slightly expensive check, but it has been removed
in 92e3a6fdac. Today running only
once is unnecessary and can be counterproductive: GCC 10 optimizes
all the actual checks away, but the checks_done variable and the code
setting it has been kept. Given that this check is inherently racy
(it uses non-atomic variables), it is best to just remove it.

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-09-29 02:58:07 +02:00