1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-08-04 22:03:09 +02:00
Commit Graph

119505 Commits

Author SHA1 Message Date
db0e4eb845 avcodec/vulkan_{av1, h264, hevc}: demote per frame logs to AV_LOG_DEBUG
Matches vaapi and software decoding behavior

Signed-off-by: llyyr <llyyr.public@gmail.com>
2025-04-20 06:45:27 +02:00
7cd1edeaa4 vulkan: drop bgr_workaround
Vulkan's main issue around using BGR is simple.
The letters in the shader don't match up (rgba in shader, bgra in format).
So of course, rather than allowing "bgra" or other permutations of
formats in the shader, they went the nuclear option and spent months writing
an extension to get rid of the need to have a format in the shader to begin
with.

All this to solve a problem that should never have existed to begin with.
This fixes BGRA images since enabling WithoutFormat, as the GPU now remaps
without your involvement.
2025-04-19 18:45:13 +02:00
5fc424c27c ffmpeg/repo: Add dot-folders in the repository root to .gitignore
Those are often used by IDEs and FFmpeg doesn't have
any such folders in the repo.

Signed-off-by: softworkz <softworkz@hotmail.com>
2025-04-19 17:29:12 +02:00
02d7384ed5 avformat/dump: Print stream start offsets for input streams
Seeing the offset of video and audio streams to each other is often
a useful metric in diagnosing and understanding issues with playback
or transcoding.
This commit adds those offsets to the stream info print.

Signed-off-by: softworkz <softworkz@hotmail.com>
2025-04-19 17:05:30 +02:00
edd28770be avcodec/dvbsubdec: Fix conditions for fallback to default resolution
The previous code expected a segment of type CLUT definition to exist
in order to accept a set of segments to be complete.
This was an incorrect assumption as the presence of a CLUT segment
is not mandatory.
(version 1.6.1 of the spec is probably a bit more clear about this
than earlier versions: https://www.etsi.org/deliver/etsi_en/
300700_300799/300743/01.06.01_20/en_300743v010601a.pdf)

The incorrect condition prevented proper fallback to using the default
resolution for the decoding context.

This also adds variables and moves the fallback check to the outside
for better clarity.

Signed-off-by: softworkz <softworkz@hotmail.com>
2025-04-19 17:04:31 +02:00
fcc50c41ce avformat/hls demuxer: Add WebVTT subtitle support
This add support for WebVTT subtitles in HLS streams.
Just like for separate audio streams, it supports all available
WebVTT streams in all renditions.
No new options are added, it just works and provides subtitles streams
like any other demuxer.
The code prevents downloading subtitle segments which are farther
in the future than the main segments, to avoid loading hundreds
of subtitle segments in advance.

Signed-off-by: softworkz <softworkz@hotmail.com>
2025-04-19 17:02:24 +02:00
ec3f3457fd vulkan_decode: add STORAGE flag to output images
In filtering, and SDR encoding, we use storage images.
This fixes using Vulkan filters on Intel.
Tested not to break anything on the three major vendors.
2025-04-19 10:59:16 +02:00
ca6392e0a7 vulkan: always enable ReadWithoutFormat/WriteWithoutFormat
This implements support for reading and writing storage images with
no format.
The issue is that we define our images as arrays, and arrays can
only have a single type, which means that f.ex. NV12 needs two
different images, R8 and RG8.

The only driver known not to advertise support for the extension
as a whole is Intel, because they have parial support for odd formats
we never use. Therefore, just always enable it by default.
2025-04-19 10:59:11 +02:00
ff9f3fb607 avcodec/mjpegenc_huffman: Avoid AV_QSORT to sort entries by length
It is unnecessary, as we already have the entries sorted by
probability and therefore implicitly by length. All we need
on top of that to build the tree is the number of entries
of a given length.
Doing so gives a 3.6% speedup of ff_mjpeg_encode_huffman_close()
here; it also saves about 640B of .text here.

The new code puts values with higher probability to the left
of the tree. The old code did not and therefore
the FATE checksums needed to be updated. Due to MJPEG's
0xFF unescaping file sizes as well as file checksums
needed to be updated; the decoded picture hashes stayed
the same. Given that codes on the left of the tree have
on average fewer bits set than codes on the right, the
file sizes mostly improve (all except vsynth3-mjpeg-444).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-18 08:40:17 +02:00
c8ce9de5a0 avcodec/tests/mjpegenc_huffman: Also test length counts
This is better than just testing that the tree is not overdetermined.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-18 08:40:10 +02:00
7684243fbe fftools/textformat/avtextformat: Remove unused variable
Forgotten in a888975a3c.

Reviewed-by: softworkz . <softworkz-at-hotmail.com@ffmpeg.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-17 01:49:04 +02:00
bb3ce284d7 vulkan: use a single command buffer per command buffer pool
We violated the spec, which, despite the actual command buffer pool
*not* being involved in any functions which require external synchronization
of the pool, *require* external synchronization even if only the
command buffers are used.

This also has the effect of *significantly* speeding up execution
in case command buffers are contended.
2025-04-16 23:38:16 +02:00
36c6c66deb vulkan/rangecoder: minor cleanup 2025-04-16 23:38:16 +02:00
d220fa6189 fate/vvc: Add vvc-wpp-single-slice-pic
A sample with a particular partitioning structure that could not be read
correctly before 26c5d8cf5d

Signed-off-by: Frank Plowman <post@frankplowman.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2025-04-16 13:42:25 -03:00
b09501031a avcodec/libjxlenc: prevent color encoding from being set twice
We currently populate the color encoding bundle and then check to see
if there's an ICC profile to attach, and set the color encoding bundle
in either case. The ICC profile overrides the color encoding bundle, so
we should not calculate enum-based color encoding if we have an ICC
profile present. Fixes several unnecessary warnings from being emitted.

Signed-off-by: Leo Izen <leo.izen@gmail.com>
2025-04-16 10:10:01 -04:00
afe6c1238a libpostproc: update APIChanges and version for "deprecate the AMD 3DNow"
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-04-16 13:59:15 +02:00
6995372ea2 doc/filters: Fix video size of mptestsrc
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
2025-04-16 19:33:55 +08:00
058d49b168 Revert "lavf/id3v2dec: support multiple values and TIPL frames"
see: Re: [FFmpeg-devel] [PATCH 2/2] avformat/id3v2: Check that decode_str() did advance

but in short, first our API since 16years says we dont have multiple values per key
(which it supports since 9 years only)

and it causes some problems for ffprobe apparently.
I do believe the original patch is the correct direction but it requires
more changes. So revert this until other things are in place and until
we have a consensus.

This reverts commit 80b77e8e8d.
2025-04-16 13:09:05 +02:00
cf7dfddee4 avformat/rtpdec_mpeg4: add need_parsing for rtsp AAC
fix ticket #11531

the rtsp aac did not marked keyframe which cannot easy copy to output.
because f265f9c9d0 commit change the AAC props to match xHE-AAC.
in some formats like MOV, need_parsing is set, so AAC can be still parsed be keyframe
but rtsp did not, so this patch add it

Signed-off-by: Jack Lau <jacklau1222@qq.com>
Reviewed-by: Zhao Zhili <quinkblack@foxmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-04-16 13:09:04 +02:00
935a52c887 avcodec/ffv1enc: Use version 3 by default (CRCs by default)
Version 3 is since 2013 (FFmpeg 2.1) non experimental so should be widely supported

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-04-16 13:09:04 +02:00
0c28059b81 avcodec/ffv1enc: avoid repeating the same warning forever
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-04-16 13:09:04 +02:00
c818c67991 libpostproc: deprecate the AMD 3DNow! define
It was left unreferenced in 1f0948272a.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-04-16 13:09:03 +02:00
1946b7875c avformat/id3v2: Print the unknown encoding
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-04-16 13:09:03 +02:00
979608dde7 configure: Clearer documentation for "disable-safe-bitstream-reader"
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-04-16 13:09:03 +02:00
2fedb29780 avformat/fifo: Check for keyframe video type before stop dropping
The current behavior when using restart_with_keyframe is that it will
recover if it also encounters any audio packet, as they are flagged as a
keyframe.

The expectation is that packets are dropped until the next _video_
keyframe.

To fix that, check if exists a video stream, if it exists check the
packet stream codec type, only letting it recover when it is a video
one. If there is no video stream, resume to the original behavior, not
checking the codec type.

Fixes ticket: #11467

Signed-off-by: Arthur Grillo <arthurgrillo@riseup.net>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-04-16 13:09:02 +02:00
50910c32c5 tools: Fix deprecation warning in patcheck
GNU apparently deprecated their egrep alias, replace it with 'grep -E'
to avoid getting flooded with deprecation warnings.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-04-16 13:09:02 +02:00
a888975a3c fftools/textformat/avtextformat: Make close functions return void
Just like normal close functions.

Reviewed-by: softworkz . <softworkz-at-hotmail.com@ffmpeg.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-16 06:13:13 +02:00
37635d31cb fftools/textformat/avtextformat: Add missing AVERROR()
Reviewed-by: softworkz . <softworkz-at-hotmail.com@ffmpeg.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-16 06:13:03 +02:00
f873734f84 fftools/textformat/avtextformat: Initialize stuff earlier
avtext_context_close() calls av_opt_free() on an AVTextFormatContext
as well as av_bprint_finalize() on the containing section_pbuf
AvBPrints, yet it can happen that the AVBPrints have not been
initialized (only zeroed) and that av_opt_set_defaults() has
not been called. This works, but it is not really documented to do so.
So ensure that the options and the AVBPrints have been initialized
when avtext_context_close() is called.

Reviewed-by: softworkz . <softworkz-at-hotmail.com@ffmpeg.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-16 06:12:54 +02:00
50ef4b2a6b fftools/textformat/avtextformat: Fix segfault upon allocation error
Would happen if an AVTextFormatContext's private context
could not be allocated.

Reviewed-by: softworkz . <softworkz-at-hotmail.com@ffmpeg.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-16 06:12:48 +02:00
7ee7632cb8 fftools/textformat/avtextformat: Fix segfault upon allocation error
Reviewed-by: softworkz . <softworkz-at-hotmail.com@ffmpeg.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-16 06:12:41 +02:00
b9450583bc textformat/tw_avio: Remove close_on_uninit param from create_file
avtextwriter_create_file() creates an AVIOContext whose pointer
resides in its private context. If it were not always closed on
uninit, the AVIOContext would leak, so it makes no sense
to have this parameter.

Reviewed-by: softworkz . <softworkz-at-hotmail.com@ffmpeg.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-16 06:12:09 +02:00
f73badbf47 fftools/textformat/tw_avio: Use avio_closep()
Avoids leaving dangling pointers behind.

Reviewed-by: softworkz . <softworkz-at-hotmail.com@ffmpeg.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-16 06:12:05 +02:00
79fa31d159 fftools/textformat/tw_avio: Don't flush unnecessarily
avio_close() automatically flushes the AVIOContext.

Reviewed-by: softworkz . <softworkz-at-hotmail.com@ffmpeg.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-16 06:11:58 +02:00
395c91347f fftools/textformat/tw_avio: Remove unused private class
This AVTextWriter does not have any options.

Reviewed-by: softworkz . <softworkz-at-hotmail.com@ffmpeg.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-16 06:11:52 +02:00
c9dc6ca02b fftools/textformat: Use "", not <> for lavu headers
Also remove unused headers.

Reviewed-by: softworkz . <softworkz-at-hotmail.com@ffmpeg.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-16 06:11:45 +02:00
2ab1021264 fftools/textformat/avtextformat: Simplify avtext_print_rational()
Use snprintf() directly instead of initializing an AVBPrint
just for this.

Reviewed-by: softworkz . <softworkz-at-hotmail.com@ffmpeg.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-16 06:05:58 +02:00
0e59675698 avutil/hwcontext_vulkan: use the typedef'd name for the expect_assume struct
Signed-off-by: James Almer <jamrial@gmail.com>
2025-04-15 16:52:51 -03:00
f29475a89e avutil/hwcontext_vulkan: check if expect_assume is supported by the header
Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: James Almer <jamrial@gmail.com>
2025-04-15 16:44:45 -03:00
0040d7e608 lavfi/src_movie: set pkt_timebase
Fix “Could not update timestamps for skipped samples” warning
and associated misfeature.
2025-04-15 15:49:38 +02:00
2229b74127 avformat/movenc: fix setting elst/stss for IAMF with Opus 2025-04-14 17:25:39 -03:00
d36883f119 avformat/iamf_writer: fix setting skip_samples and discard_padding for OPUS 2025-04-14 17:25:34 -03:00
3b2a9410ef avcodec/decode: Only use ff_progress_frame_get_buffer() with blank input
All users (namely HEVC) that use ff_progress_frame_alloc()
should just use ff_thread_get_buffer(). Using
ff_progress_frame_get_buffer() is not a must; it is merely
a convenience wrapper.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-14 10:15:08 +02:00
29b85cd4b8 vulkan_ffv1: add cached symbol reader for AMD
Speeds up everything on AMD by 3x.
This uses 32 local invocations to load state into cache, as well
as to do the RCT faster.
2025-04-14 06:10:43 +02:00
e040c087c7 vulkan: add support for expect/assume
This commit adds support for compiler hints.
While on AMD these are not used/needed, Nvidia benefits from them, and gives
a sizeable 10% speedup on 4k.
2025-04-14 06:10:43 +02:00
985a26be28 vulkan_ffv1: shortcut +-1 coeffs in symbol reading
Slightly faster, and allows for further optimizations.
2025-04-14 06:10:43 +02:00
4d561e6a1e vulkan_ffv1: remove need for scratch data during setup
This saves on some VRAM, but mainly allows for a more unified path.
2025-04-14 06:10:43 +02:00
8ceabb677c vulkan_ffv1: externalize extended lookup check
8% speedup on nvidia on 4k.
2025-04-14 06:10:43 +02:00
77f777d925 ffv1/vulkan: redo context count tracking and quant_table_idx management
This commit also makes it possible for the encoder to choose a different
quantization table on a per-slice basis, as well as adding this capability
to the decoder.

Also, this commit fully fixes decoding of context=1 encoded files.
2025-04-14 06:10:42 +02:00
66b8c92df2 vulkan_ffv1: cache only 2 lines when decoding RGB
This reduces the intermediate VRAM used for RGB decoding by a
factor of 100x for 6k video.
This also speeds the decoder up by 16% for 4k RGB24 and 31% for 6k video.

This is equivalent to what the software decoder does, but with less pointers.
2025-04-14 06:10:42 +02:00