1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-26 19:01:44 +02:00
Commit Graph

111303 Commits

Author SHA1 Message Date
Zhao Zhili
b0c0fedcda avfilter/dnn_backend_tf: fix use of uninitialized value
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2023-06-08 10:50:24 +08:00
Zhao Zhili
d9f41a343e avfilter/dnn_backend_tf: check TF_OperationOutputType return value
This also fixed a warning: implicit conversion from enumeration
type 'TF_DataType' (aka 'enum TF_DataType') to different
enumeration type 'DNNDataType'.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2023-06-08 10:50:24 +08:00
Zhao Zhili
f3495ef4f8 avfilter/dnn_backend_tf: remove unused define
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2023-06-08 10:50:23 +08:00
Zhao Zhili
e67af9e7f7 avfilter/vf_dnn_processing: replace magic number by enum value
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2023-06-08 10:50:23 +08:00
Zhao Zhili
e7e80e2083 avfilter/vf_dnn_detect: replace magic number by enum value
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2023-06-08 10:50:23 +08:00
Zhao Zhili
a887bc4ff1 avfilter/vf_dnn_classify: replace magic number by enum value
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2023-06-08 10:50:23 +08:00
Zhao Zhili
016f2f61c3 avfilter/dnn: add log context to ff_get_dnn_module
Print backend type when failed.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2023-06-08 10:50:23 +08:00
Zhao Zhili
505c43bb65 avfilter/dnn: refactor ff_get_dnn_module to remove allocation
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2023-06-08 10:50:23 +08:00
Zhao Zhili
3f52b7eedc avfilter/dnn: define each backend as a DNNModule
To avoid export multiple functions for each backend
implementation.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2023-06-08 10:50:23 +08:00
Dave Airlie
2c4b6976d5 vulkan/hevc: fix 32x32 scaling list indexing
This fixes another problem in the hevc scaling lists and aligns
the code with what other hwaccels do.
2023-06-08 02:42:02 +02:00
Paul B Mahol
bfd5090628 avfilter/af_rubberband: rewrite EOF handling
Also pass correct EOF timestamp.
2023-06-08 02:31:19 +02:00
Paul B Mahol
1d7a6eaee6 avcodec/proresenc_kostya: set avctx->profile from ctx
Otherwise muxers may not be able to guess it.
Option is still set by user, but via private codec option.
2023-06-08 00:48:21 +02:00
Lynne
eff565dc19
hwcontext_vulkan: tune execution pools
Having less in-flight resources is better in this case.
2023-06-07 23:59:17 +02:00
Lynne
24c4307b80
vulkan_decode: halve execution pool size
Determined experimentally, on various videos and hardware.
On Intel, using less resources in-flight is around 15% faster,
with similar results on Nvidia hardware.
2023-06-07 23:59:17 +02:00
Lynne
5f1be341c2
vulkan: discard dependencies when explicitly waiting for execution
This reduces memory needed dramatically, as unneeded resources
can be immediately returned to the pool.
Although waitforfences is threadsafe, we add a mutex wait around
it, as the mutex fence in combination with waitforfences assures
us that no other thread will reset the fence in the meanwhile
whilst the mutex is locked. This allows is to call
ff_vk_exec_discard_deps.
2023-06-07 23:59:16 +02:00
Lynne
975cd48bb3
vulkan: synchronize access to execution pool fences
vkResetFences is specified as being user-synchronized
(yet vkWaitFences, is not).
2023-06-07 23:59:16 +02:00
Lynne
697382168d
hevcdec: remove redundant bits_used_for_short_term_rps field
It was introduced for Vulkan, but it is equivalent to
short_term_ref_pic_set_size when !short_term_ref_pic_set_sps_flag,
and when !!short_term_ref_pic_set_sps_flag, Vulkan hardcodes a zero
anyway.
2023-06-07 23:59:12 +02:00
Marvin Scholz
d8c7fea8ef lavfi/vf_blend_vulkan: fix leak on error 2023-06-07 23:59:06 +02:00
Marvin Scholz
dae393fe72 libavfilter: add vf_xfade_vulkan
This is an initial version of vf_xfade_vulkan based
on vf_xfade_opencl, for now only a subset of transitions
are supported.
2023-06-07 23:59:06 +02:00
Paul B Mahol
f11515c77f avcodec: add RTV1 decoder 2023-06-07 09:00:18 +02:00
Marvin Scholz
e62824835d lavfi/vf_xfade: rewrite activate inputs handling
The old code was not properly handling a bunch of edge-cases with
streams terminating earlier and also did not properly report back EOF
to the first input.

This fixes at least one case where the filter could stop doing
anything:

ffmpeg -f lavfi -i "color=blue:d=10" -f lavfi -i "color=aqua:d=0" -filter_complex "[0][1]xfade=duration=2:offset=0:transition=wiperight" -f null -
2023-06-07 08:56:24 +02:00
Michael Niedermayer
0889ebc577
avcodec/noise_bsf: Check for wrapped frames
Wrapped frames contain pointers so they need specific code to
noise them, the generic code would lead to segfaults

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2023-06-06 21:38:02 +02:00
Michael Niedermayer
8d5de4e12f
tools/target_dec_fuzzer: Test lowres
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2023-06-06 21:37:53 +02:00
Roman Arzumanyan
402d98c9d4 libavcodec/cuviddec: determine amount of decoded surfaces from within cuvid parser
Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
2023-06-06 15:32:41 +02:00
James Almer
20584cdd89 avformat/av1: reduce the scope of a variable
Signed-off-by: James Almer <jamrial@gmail.com>
2023-06-06 09:26:19 -03:00
James Almer
a5e45988ac avformat/av1dec: don't return EIO when the input file is truncated
There was no problem reading the file, so EIO is not correct.

Signed-off-by: James Almer <jamrial@gmail.com>
2023-06-06 09:26:19 -03:00
James Almer
da61ed80fd avformat/av1dec: fix EOF check in Annex-B demuxer
And return any packet buffered by the bsf.

Signed-off-by: James Almer <jamrial@gmail.com>
2023-06-06 09:26:19 -03:00
Dave Airlie
65a1e8ee2c vulkan/hevc: fix scaling lists sizes. 2023-06-06 12:27:02 +02:00
Logan Lyu
e79686be96 lavc/aarch64: new optimization for 8-bit hevc_qpel_h hevc_qpel_uni_w_hv
Signed-off-by: Martin Storsjö <martin@martin.st>
2023-06-06 12:50:18 +03:00
Logan Lyu
15972cce8c lavc/aarch64: new optimization for 8-bit hevc_qpel_uni_w_h
Signed-off-by: Martin Storsjö <martin@martin.st>
2023-06-06 12:50:18 +03:00
Logan Lyu
0b7356c1b4 lavc/aarch64: new optimization for 8-bit hevc_pel_uni_w_pixels and qpel_uni_w_v
Signed-off-by: Martin Storsjö <martin@martin.st>
2023-06-06 12:50:18 +03:00
Martin Storsjö
c76643021e aarch64: Add Windows runtime detection of the dotprod instructions
For Windows, there's no publicly defined constant for checking for
the i8mm extension yet.

Signed-off-by: Martin Storsjö <martin@martin.st>
2023-06-06 12:50:15 +03:00
Martin Storsjö
9b0052200a aarch64: Add Apple runtime detection of dotprod and i8mm using sysctl
For now, there's not much value in this since Clang don't support
enabling the dotprod or i8mm features with either .arch_extension
or .arch (it has to be enabled by the base arch flags passed to
the compiler). But it may be supported in the future.

Signed-off-by: Martin Storsjö <martin@martin.st>
2023-06-06 12:41:20 +03:00
Martin Storsjö
493fcde50a aarch64: Add Linux runtime cpu feature detection using HWCAP_CPUID
Based partially on code by Janne Grunau.

Signed-off-by: Martin Storsjö <martin@martin.st>
2023-06-06 12:40:57 +03:00
Martin Storsjö
397cb623c8 aarch64: Add cpu flags for the dotprod and i8mm extensions
Set these available if they are available unconditionally for
the compiler.

Signed-off-by: Martin Storsjö <martin@martin.st>
2023-06-06 12:40:42 +03:00
Martin Storsjö
fb1b88af77 configure: aarch64: Support assembling the dotprod and i8mm arch extensions
These are available since ARMv8.4-a and ARMv8.6-a respectively,
but can also be available optionally since ARMv8.2-a.

Check if ".arch armv8.2-a" and ".arch_extension {dotprod,i8mm}" are
supported, and check if the instructions can be assembled.

Current clang versions fail to support the dotprod and i8mm
features in the .arch_extension directive, but do support them
if enabled with -march=armv8.4-a on the command line. (Curiously,
lowering the arch level with ".arch armv8.2-a" doesn't make the
extensions unavailable if they were enabled with -march; if that
changes, Clang should also learn to support these extensions via
.arch_extension for them to remain usable here.)

Signed-off-by: Martin Storsjö <martin@martin.st>
2023-06-06 12:40:26 +03:00
Leo Izen
fa11c4c7fa
avformat/jpegxl_anim_dec: add animated JPEG XL demuxer
Animated JPEG XL files requires a separate demuxer than image2, because
the timebase information is set by the demuxer. Should the timebase of
an animated JPEG XL file be incompatible with the timebase set by the
image2pipe demuxer (usually 1/25 unless set otherwise), rescaling will
fail. Adding a separate demuxer for animated JPEG XL files allows the
timebase to be set correctly.

Signed-off-by: Leo Izen <leo.izen@gmail.com>
2023-06-05 12:15:05 -04:00
Leo Izen
99da411322
avcodec/libjxldec: add animated decode support
Migrate the libjxl decoder wrapper from the decode_frame method to the
receive_frame method, which allows sending more than one frame from a
single packet. This allows the libjxl decoder to decode JPEG XL files
that are animated, and emit every frame of the animation. Now, clients
that feed the libjxl decoder with an animated JPEG XL file will be able
to receieve the full animation.

Signed-off-by: Leo Izen <leo.izen@gmail.com>
2023-06-05 12:14:43 -04:00
Anton Khirnov
141d11cb3c fftools/ffmpeg_mux: make OutputStream.pkt private
It is no longer used outside of muxing code.
2023-06-05 16:16:13 +02:00
Anton Khirnov
730a2221af fftools/ffmpeg_enc: use a private AVPacket instance for encoding
The code currently uses OutputStream.pkt, which complicates its
ownership semantics.
2023-06-05 16:16:12 +02:00
Anton Khirnov
f94957e8f4 fftools/ffmpeg_mux: simplify calling of_output_packet()
Use NULL packets to signal EOF instead of a separate variable. This is
made possible by the previous commit.
2023-06-05 16:16:12 +02:00
Anton Khirnov
96e1325d91 fftools/ffmpeg_mux: use a dedicated packet for BSF output
Currently of_output_packet() reuses the input packet, which requires its
callers to submit blank packets even on EOF, which makes the code more
complex.
2023-06-05 16:16:12 +02:00
Anton Khirnov
c803b36b8f fftools/ffmpeg_enc: stop using OutputStream.initialized
It is set by the muxing code, which will not be synchronized with
encoding code after upcoming threading changes. Use an encoder-private
variable instead.
2023-06-05 16:15:04 +02:00
Anton Khirnov
568d414074 fftools/ffmpeg: attach filter framerate to frames
This way the encoder does not need to reach backward into the filter.
2023-06-05 16:15:04 +02:00
Anton Khirnov
9630341073 fftools/ffmpeg: factor out attaching FrameData to a frame
Will be useful in following commits.
2023-06-05 16:15:04 +02:00
Anton Khirnov
d7781cfb95 fftools/ffmpeg: convert timestamps inside the muxer
Packets submitted to the muxer now have their timebase attached to them,
so the muxer can do conversion to muxing timebase and avoid exposing it
to callers.
2023-06-05 16:15:04 +02:00
Anton Khirnov
cf121592c5 fftools/ffmpeg_mux_init: do not overwrite OutputStream.frame_rate for encoding
The values currently written into it are not used after
enc_open(), so it is better to confine them to that function.
2023-06-05 16:15:04 +02:00
Anton Khirnov
5bea8daa78 fftools/ffmpeg_enc: do not guess frame durations from output framerate
There is no reason to expect input frame durations to match output
framerate.
2023-06-05 16:15:04 +02:00
Anton Khirnov
2f92650c5d fftools/ffmpeg_enc: inline init_encoder_time_base() into its callers
The function now reduces to a ternary operator, so it is shorter and
clearer to eliminate it.
2023-06-05 16:15:04 +02:00
Anton Khirnov
93e26a4db7 fftools/ffmpeg: handle -enc_time_base -1 during stream creation
There is no reason to postpone it until opening the encoder. Also, abort
when the input stream is unknown, rather than disregard an explicit
request from the user.
2023-06-05 16:15:04 +02:00