Commit Graph

117444 Commits

Author SHA1 Message Date
Martin Storsjö
a27f3c590f av1dec: Don't crash if decoding of some frames have failed
If decoding with hwaccel, but decoding fails, these pointers
are null at this point.

Signed-off-by: Martin Storsjö <martin@martin.st>
2024-10-04 22:57:03 +03:00
Nuo Mi
846fbc395b avcodec/vvc: simplify priority logical to improve performance for 4K/8K
For 4K/8K video processing, it's possible to have over 1,000 tasks pending on the executor.
In such cases, O(n) and O(log(n)) insertion times are too costly.
Reducing this to O(1) will significantly decrease the time spent in critical sections

clip                                                        | before | after  | delta
------------------------------------------------------------|--------|--------|-------
VVC_HDR_UHDTV2_OpenGOP_7680x4320_50fps_HLG10.bit            |    24  |   27   |  12.5%
VVC_HDR_UHDTV2_OpenGOP_7680x4320_50fps_HLG10_HighBitrate.bit|    12  |   17   |  41.7%
tears_of_steel_4k_8M_8bit_2000.vvc                          |    34  |  102   | 200.0%
VVC_UHDTV1_OpenGOP_3840x2160_60fps_HLG10.bit                |   126  |  128   |   1.6%
RitualDance_1920x1080_60_10_420_37_RA.266                   |   350  |  378   |   8.0%
NovosobornayaSquare_1920x1080.bin                           |   341  |  369   |   8.2%
Tango2_3840x2160_60_10_420_27_LD.266                        |    69  |   70   |   1.4%
RitualDance_1920x1080_60_10_420_32_LD.266                   |   243  |  259   |   6.6%
Chimera_8bit_1080P_1000_frames.vvc                          |   420  |  392   |  -6.7%
BQTerrace_1920x1080_60_10_420_22_RA.vvc                     |   148  |  144   |  -2.7%
2024-10-04 21:58:42 +08:00
Nuo Mi
40a14ef970 avcodec/executor: remove unused ready callback
Due to the nature of multithreading, using a "ready check" mechanism may introduce a deadlock. For example:

Suppose all tasks have been submitted to the executor, and the last thread checks the entire list and finds
no ready tasks. It then goes to sleep, waiting for a new task. However, for some multithreading-related reason,
a task becomes ready after the check. Since no other thread is aware of this and no new tasks are being added to
the executor, a deadlock occurs.

In VVC, this function is unnecessary because we use a scoreboard. All tasks submitted to the executor are ready tasks.
2024-10-04 21:58:42 +08:00
Nuo Mi
8446e27bf3 avcodec: make a local copy of executor
We still need several refactors to improve the current VVC decoder's performance,
which will frequently break the API/ABI. To mitigate this, we've copied the executor from
avutil to avcodec. Once the API/ABI is stable, we will move this class back to avutil
2024-10-04 21:58:42 +08:00
Marvin Scholz
f25c9cc213 fftools: log unconnected filter output label 2024-10-04 14:27:20 +02:00
Marvin Scholz
5beeb3a1f9 fftools: do not access out of bounds filtergraph
The log message was logged for `filtergraphs[j]` which would cause a
heap buffer overflow in certain circumstances.

Correctly it should be logged for the current filtergraph, so just
use `fg` here.
2024-10-04 14:27:20 +02:00
Lynne
ac092c6707
hwcontext_vulkan: guard all uses of new spec defines and fix stray bracket
This fixes compilation with less recent Vulkan headers.
2024-10-04 10:41:03 +02:00
Lynne
a304cbeb8d
vulkan: add profiling debug setting
This simply keeps all shader optimizations, but allows debug
data to be generated.
2024-10-04 10:10:46 +02:00
Lynne
832947be02
vulkan: don't enable GL_EXT_buffer_reference by default
Only nlmeans_vulkan uses it.
2024-10-04 10:10:45 +02:00
Lynne
2bb0b6dd2c
vulkan_shaderc: add more stages, target Vulkan 1.3 and only output debug if needed 2024-10-04 10:10:45 +02:00
Lynne
a2a983e1d0
vulkan_glslang: add more stages, target Vulkan 1.3 and output debug info 2024-10-04 10:10:45 +02:00
Lynne
0bc4e03322
lavfi/*vulkan: forward FFVulkanContext to SPIR-V compilers
We need to know what extensions are supported.
2024-10-04 10:10:44 +02:00
Lynne
356d1cc8ff
vulkan: parse instance list and add the DEBUG_UTILS extension
Required to let users know whether debugging is active.
2024-10-04 10:10:44 +02:00
Lynne
e3676d96cb
hwcontext_vulkan: move device feature struct setup to a new function 2024-10-04 10:10:43 +02:00
Lynne
535e5eb7f3
hwcontext_vulkan: enable VK_KHR_shader_relaxed_extended_instruction 2024-10-04 10:10:43 +02:00
Lynne
0d5bfd0b21
vulkan_functions: change extension type to a typedef uint64_t
We were getting a bit too close for comfort to the 32-bit limit
on enums.
2024-10-04 10:10:42 +02:00
Lynne
d80f9f55c8
vulkan: always enable GL_EXT_scalar_block_layout
This makes std430 (which we use everywhere already) fully match C
layout.
Extension was made mandatory in 1.2.
2024-10-04 10:10:42 +02:00
Lynne
37d5cb84e8
vulkan: check if current buffer has finished execution before picking another
This saves resources, as dependencies are freed/reclaimed with a lower latency,
and provies a speedup.
2024-10-04 10:10:42 +02:00
Lynne
877c5a9692
vulkan: use shader objects if supported
Shader objects finally allow completely independent shaders.
2024-10-04 10:10:41 +02:00
Lynne
d233d9902f
vulkan: move shader data execution state to execution pools
This finally permits using fully compiled shaders across
multiple execution contexts.
2024-10-04 10:10:41 +02:00
Lynne
0a37d5a3b1
vulkan: merge FFVkSPIRVShader and FFVkPipeline into FFVkShader
Pipelines are just shaders. There's no reason to treat them
differently.
This also lets us implement shader objects and is an overall
cleanup.
2024-10-04 10:10:36 +02:00
Anton Khirnov
aad4d5745d lavfi/vsrc_testsrc: switch to query_func2() 2024-10-04 10:03:34 +02:00
Anton Khirnov
28bde4a141 lavfi/vaf_spectrumsynth: switch to query_func2() 2024-10-04 10:03:34 +02:00
Anton Khirnov
3824ee2faf lavfi/vf_stack_{vaapi,qsv}: replace query_formats with a pixfmt list 2024-10-04 10:03:34 +02:00
Anton Khirnov
014a4214a9 lavfi/src_movie: switch to query_func2() 2024-10-04 10:03:34 +02:00
Anton Khirnov
55c99fb9c4 lavfi/src_avsynctest: switch to query_func2() 2024-10-04 10:03:34 +02:00
Anton Khirnov
534eef2ace lavfi/qrencode: switch to query_func2() 2024-10-04 10:03:34 +02:00
Anton Khirnov
f10986a5ec lavfi/f_streamselect: drop useless query_formats() callback
It achieves the same effect as ff_default_query_formats(), which gets
called implicitly.
2024-10-04 10:03:34 +02:00
Anton Khirnov
a6f579544a lavfi/f_select: switch to query_func2()
Also, drop redundant calls that also happen implicitly in generic code.
2024-10-04 10:03:34 +02:00
Anton Khirnov
9e1184b122 lavfi/f_graphmonitor: switch to query_func2() 2024-10-04 10:03:34 +02:00
Anton Khirnov
60192367a8 lavfi/f_ebur128: switch to query_func2()
Also, drop redundant calls that also happen implicitly in generic code.
2024-10-04 10:03:34 +02:00
Anton Khirnov
4e66d0c5d0 lavfi/f_drawgraph: switch to query_func2() 2024-10-04 10:03:34 +02:00
Anton Khirnov
670530a927 lavfi/buffersrc: switch to query_func2() 2024-10-04 10:03:34 +02:00
Anton Khirnov
a7fe27f964 lavfi/buffersrc: validate hw context presence in video_init()
That is the more appropriate place for it than query_formats().
2024-10-04 10:03:34 +02:00
Anton Khirnov
2fa142f7c0 lavfi/buffersink: switch to query_func2() 2024-10-04 10:03:34 +02:00
Anton Khirnov
b8bf2f4e17 lavfi/buffersink: move channel layout parsing to init
That is a more appropriate place for this, and will also be useful in
future commits.
2024-10-04 10:03:34 +02:00
Anton Khirnov
2aad37ffb5 lavfi/buffersink: move the option sanity check to init
Options are set before init, so that is the appropriate place to
validate them.
2024-10-04 10:03:34 +02:00
Zhao Zhili
eff9ed7bff avcodec/mediacodecenc: Fix access of uninitialized value
When crop is skipped, av_strlcatf will access `str` which isn't
initialized properly.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-10-04 15:43:57 +08:00
Michael Niedermayer
556c767786
avcodec/ffv1enc: Correct error message about unsupported version
Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-10-03 22:05:46 +02: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
James Almer
b094c47ab2 fate/mov: add a test for heic images with cropping and rotation metadata
Signed-off-by: James Almer <jamrial@gmail.com>
2024-10-02 12:38:24 -03:00
James Almer
650ce61745 avformat/mov: don't abort on invalid clap box data
Unless explode is requested.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-10-02 12:38:24 -03:00
James Almer
7573f02840 avformat/mov: get heif image mirroring from imir box
Complements 76eb3e5ff3.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-10-02 12:38:24 -03:00
James Almer
f225e6f3c6 avformat/mov: parse clap boxes that reference heif items
Signed-off-by: James Almer <jamrial@gmail.com>
2024-10-02 12:38:24 -03:00
James Almer
ba6eeb2c65 avformat/mov: parse colr boxes that reference tile grids
Signed-off-by: James Almer <jamrial@gmail.com>
2024-10-02 12:38:24 -03:00
James Almer
58c265d956 avformat/mov: factorize getting the current item
Signed-off-by: James Almer <jamrial@gmail.com>
2024-10-02 12:38:24 -03:00
Tobias Rapp
c8cc58a13d avcodec/dxva2: Fix compilation with Mingw-w64
Adds missing ifdef guards to function prototypes depending on definitions from
dxva.h which are not available in Mingw-w64 version 4.0. The configure script
already checks for HEVC/VP9 types in dxva.h.

Signed-off-by: Tobias Rapp <t.rapp@noa-archive.com>
2024-10-02 17:28:30 +02:00
Martin Storsjö
a7449e4cbb libavcodec: Makefile: Move the librsvg entry to the right section
Signed-off-by: Martin Storsjö <martin@martin.st>
2024-10-02 11:25:34 +03:00
Martin Storsjö
04a59bcac4 libavutil: Makefile: Fix alphabetical order for the film_grain_params files
Signed-off-by: Martin Storsjö <martin@martin.st>
2024-10-02 11:25:14 +03:00
Martin Storsjö
4d204aa29b videotoolbox: Fix indentation of old existing code
Signed-off-by: Martin Storsjö <martin@martin.st>
2024-10-02 11:24:17 +03:00