Commit Graph

111909 Commits

Author SHA1 Message Date
Anton Khirnov
bff48e8d69 fftools/ffmpeg_mux: rename of_close() to of_free()
This function is primarily a destructor for OutputFile, the underlying
AVIOContext is normally closed earlier (right after writing the
trailer).
2023-08-30 11:53:50 +02:00
Anton Khirnov
d55262704e fftools/ffmpeg_filter: shorten a variable name 2023-08-30 11:53:50 +02:00
Anton Khirnov
fbcecdec8a fftools/ffmpeg_filter: reindent after previous commit 2023-08-30 11:53:50 +02:00
Anton Khirnov
d9c862b57f fftools/ffmpeg_filter: factor processing a single frame out of reap_filters()
This is easier to read.
2023-08-30 11:53:50 +02:00
Anton Khirnov
82dd4dbe3f fftools/ffmpeg_filter: sanitize framerate retrieved from the filtergraph
Lavfi uses 1/0 to signal unknown/VFR, which should not be passed to
encoders.
2023-08-30 11:53:50 +02:00
Anton Khirnov
d65d0f4df1 fftools/ffmpeg_enc: reindent after previous commit 2023-08-30 11:53:50 +02:00
Anton Khirnov
411ada649f fftools/ffmpeg_enc: only use fallback framerate when encoding CFR
When no output video framerate is specified by the user with -r or can
be inferred from the filtergraph, encoder setup will arbitrarily decide
that the framerate is 25fps. However, making up any framerate value for
VFR encoding is at best unnecessary.

Changes the results of the sub2video tests, where the input timebase is
now used instead of 1/25.
2023-08-30 11:53:50 +02:00
Anton Khirnov
8b6b2518fa fftools/ffmpeg_enc: reindent after previous commit 2023-08-30 11:53:50 +02:00
Anton Khirnov
d1a2cd1e13 fftools/ffmpeg_enc: factor out setting encoder timebase
Mainly this fixes handling special values of -enc_time_base ('demux' or
'filter') for audio. It also prints a warning if -enc_time_base is
specified for subtitles, instead of ignoring it silently (current
subtitle encoding API only works with AV_TIME_BASE_Q).
2023-08-30 11:53:50 +02:00
Anton Khirnov
8ecbb1f9af fftools/ffmpeg_mux: stop rescaling timestamps in of_streamcopy()
This function converts packet timestamps from the input stream timebase
to OutputStream.mux_timebase, which may or may not be equal to the
actual output AVStream timebase (and even when it is, this may not
always be the optimal choice due to bitstream filtering).

Just keep the timestamps in input stream timebase, they will be rescaled
as needed before bitstream filtering and/or sending the packet to the
muxer.

Move the av_rescale_delta() call for audio (needed to preserve accuracy
with coarse demuxer timebases) to write_packet.

Drop now-unused OutputStream.mux_timebase.
2023-08-30 11:53:46 +02:00
Anton Khirnov
ed5caaaf22 fftools/ffmpeg_mux: use correct timebases for bitstream filtering
Bitstream filtering input timebase is not always necessarily equal to
OutputStream.mux_timebase. Also, set AVPacket.time_base correctly for
packets output by bitstream filters

Do not rescale at all in of_output_packet() when not doing bitstream
filtering, as it's unnecessary - write_packet() will rescale to the
actual muxer timebase.
2023-08-30 11:51:42 +02:00
Anton Khirnov
b39b6b7456 fftools/ffmpeg: simplify handling input -t for streamcopy
Output stream will be closed implicitly after a NULL packet is sent to
it, there is no need to explicitly call close_output_stream().
2023-08-30 11:51:42 +02:00
Anton Khirnov
8f2e7e9dcf fftools/ffmpeg: stop explicitly closing output streams on input EOF
Sending an empty packet already does that implicitly.
2023-08-30 11:51:42 +02:00
Steinar H. Gunderson
69c308a6d1 avformat/matroskaenc: Fix writing of markers
When the marker writing code was merged from libav to FFmpeg
in dc62016c, it failed to take into account that the meaning of
cluster_pos had changed in bda5b662; in particular, the special
value for “I'm not currently working on a cluster” had changed
from 0 to -1. This makes the avio_write_marker() call never
be called. Update the if statement to fix it.

Fixes: Ticket9843
Signed-off-by: Steinar H. Gunderson <steinar+ffmpeg@gunderson.no>
Signed-off-by: Martin Storsjö <martin@martin.st>
2023-08-29 23:28:44 +03:00
Tong Wu
a25a60d763 avcodec/jpegxl_parser: fix a compile error
Compiler: MSVC 14.35.32215
Error type: error C2099: initializer is not a constant
Related commit: 0c0dd23 avcodec/jpegxl_parser: add JPEG XL parser

Signed-off-by: Tong Wu <tong1.wu@intel.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2023-08-28 22:11:51 -03:00
Lynne
d0a64f9a81
vulkan: do not leak bound_buffer_indices 2023-08-28 22:29:36 +02:00
Lynne
5f8feddd6a
lavfi/testsrc_vulkan: fix memory leaks 2023-08-28 22:29:36 +02:00
Lynne
3ef1e50c92
lavfi/transpose_vulkan: fix memory leaks 2023-08-28 22:29:36 +02:00
Lynne
d0ab2e2f98
lavfi/scale_vulkan: fix memory leaks 2023-08-28 22:29:35 +02:00
Lynne
0f2ae1ba69
lavfi/nlmeans_vulkan: fix memory leaks 2023-08-28 22:29:35 +02:00
Lynne
9944e96c61
lavfi/chromaber_vulkan: fix memory leaks 2023-08-28 22:29:34 +02:00
Lynne
a4673c9dff
lavfi/bwdif_vulkan: fix memory leaks 2023-08-28 22:29:34 +02:00
Lynne
b6cc53092a
lavfi/avgblur_vulkan: fix memory leaks 2023-08-28 22:29:34 +02:00
Lynne
f6cf3a40e4
vulkan: check for extension rather than function pointer
The loader ensures only that functions with tagged supported extensions
exist, rather than ensuring only those with supported extensions are
loaded.
As the init function uses Vulkan functions, whose loading requires them
to have the extension flags set, the extension flags are guaranteed
to also exist at this point.
2023-08-28 22:29:33 +02:00
Lynne
747871a42c
vulkan: do not leak cooperative matrix properties 2023-08-28 22:29:29 +02:00
Michael Niedermayer
b5273c619d
tests/fate: Add NoLegacy-cut.ape test
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2023-08-28 01:10:14 +02:00
Michael Niedermayer
86c092a0ed
avcodec/apedec: Implement interim mode detection
Fixes: NoLegacy.ape
Found-by: Matt Ashland <mail@monkeysaudio.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2023-08-28 01:10:13 +02:00
Michael Niedermayer
7995e175b8
avcodec/apedec: remove unused variable
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2023-08-28 01:10:13 +02:00
Jun Zhao
c48ec95ba3 lavc/libx264: replace ITU-T T35(A/53 CC) SEI type by enum value
replace ITU-T T35(A/53 CC) SEI type by enum value

Reviewed-by: Kieran Kunhya <kierank@obe.tv>
Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
2023-08-27 23:21:31 +08:00
Niklas Haas
3c9dc009b6 lavfi/vf_libplacebo: add extra_opts AVDictionary
Can be used to configure libplacebo's underlying raw options, which
sometimes includes new or advanced / in-depth settings not (yet) exposed
by vf_libplacebo.
2023-08-27 13:37:03 +02:00
Niklas Haas
816983d951 lavfi/vf_libplacebo: switch to new pl_options struct
This new upstream struct simplifies params struct management by allowing
them to all be contained in a single dynamically allocated struct. This
commit switches to the new API in a backwards-compatible way.

The only nontrivial change that was required was to handle
`sigmoid_params` in a way consistent with the rest of the params
structs, instead of setting it directly to the upstream default.
2023-08-27 13:37:03 +02:00
Leo Izen
e8a63b4763
avformat/jpegxl: remove jpegxl_probe, instead call avcodec/jpegxl_parse
This prevents code duplication in the source form by calling the parse
code that was moved to avcodec last commit. The code will be duplicated
in binary form for shared builds (it's not that large), but for source
code it will only exist in one location now.

Signed-off-by: Leo Izen <leo.izen@gmail.com>
2023-08-27 01:36:18 -04:00
Leo Izen
0c0dd23fe1
avcodec/jpegxl_parser: add JPEG XL parser
Add a full parser to libavcodec for AV_CODEC_ID_JPEGXL. It finds the
end of the stream in order to packetize the codec, and it looks at
the headers to set preliminary information like dimensions and pixel
format.

Note that much of this code is duplicated from avformat/jpegxl_probe.c,
but that code will be removed and call this instead in the next commit.

Signed-off-by: Leo Izen <leo.izen@gmail.com>
2023-08-27 01:36:08 -04:00
Leo Izen
7a69f7312e
avcodec/libjxldec: use internal AVFrame as buffered space
Before this commit, the decoder erroneously assumes that the AVFrame
passed to the receive_frame is the same one each time. Now it keeps an
internal AVFrame to write into, and copies it over when it's done.

Signed-off-by: Leo Izen <leo.izen@gmail.com>
2023-08-27 01:36:03 -04:00
Leo Izen
245910d5c9
avcodec/libjxldec: fix errors when decoding grayscale after rgb
Fixes an error that's caused by decoding a grayscale JXL image after an
RGB image is decoded, with the same decoder instance.

Signed-off-by: Leo Izen <leo.izen@gmail.com>
2023-08-27 01:36:00 -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
Christophe Gisquet
8028b8260e avcodec/huffyuvdec: don't prepare unnecessary joint tables
The number of planes can be lower than 4.
2023-08-26 19:22:25 +02:00
Zhao Zhili
67d392b979 examples/transcode: flush decoder on EOF
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2023-08-26 17:02:21 +08:00
Zhao Zhili
2387328fa2 avfilter/vf_transpose_vt: fix declaration-after-statement
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2023-08-26 16:31:43 +08:00
Zhao Zhili
7cca9c07ca avfilter/vf_transpose_vt: fix output frame dimension
Create a new hardware frame context when necessary.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2023-08-26 16:31:43 +08:00
Zhao Zhili
9b543881ef avfilter/vf_scale_vt: fix output frame dimension
The output frame dimension is incorrect because it shares hardware
frame context with input.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2023-08-26 16:31:43 +08: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
Michael Niedermayer
80ad0e2198
avcodec/apedec: Fix 48khz 24bit below insane level
Fixes: Ticket9816
Fixes: vlc.ape and APE_48K_24bit_2CH_02_01.ape

Regression since: ed0001482a.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2023-08-26 00:20:23 +02:00
Michael Niedermayer
696e161919
avcodec/apedec: Fix CRC for 24bps and bigendian
Fixes CRC for vlc.ape and APE_48K_24bit_2CH_02_01.ape

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2023-08-26 00:20:09 +02:00
Kacper Michajłow
9f66286f0b avcodec/vulkan_decode: print also codec header name
Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
2023-08-24 22:51:36 +02:00
Kacper Michajłow
9d0da996f0 avcodec/vulkan_decode: fix struct type for h265_profile
Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
2023-08-24 22:51:25 +02:00
Marvin Scholz
15a89a9422 lavfi/vf_xfade_vulkan: add wipes
Add the wipetl, wipetr, wipebl, wipebr effects.
2023-08-24 22:50:57 +02:00
Marvin Scholz
85c7c79a62 lavfi/vf_xfade_vulkan: add pixelize 2023-08-24 22:50:57 +02:00
Marvin Scholz
98bd8a7f5c lavfi/vf_xfade_vulkan: add dissolve 2023-08-24 22:50:57 +02:00
Marvin Scholz
8d3fd489e2 lavfi/vf_xfade_vulkan: reindent after last commit 2023-08-24 22:50:57 +02:00