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

119580 Commits

Author SHA1 Message Date
1d5f660ff6 avcodec/mpegvideo_dec: Notify users of reinit
Namely of reinititialization performed by
ff_mpeg_update_thread_context(), so that they can simply
update their own dimension-based buffers accordingly.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-05-16 01:37:35 +02:00
2f971c7fda avcodec/ituh263dec: Fix indentation
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-05-16 01:37:35 +02:00
f82a75333a avcodec/mpegvideo: Move [fb]_code to Mpeg4Dec and MPVEncContext
It is only used by the MPEG-4 decoder and the encoders.
Notice that this field is a per-frame property and therefore
does not need to by synced in mpeg4_update_thread_context().

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-05-16 01:37:35 +02:00
545724f61e avcodec/mpeg4video: Pass parameters directly
Namely in ff_mpeg4_get_video_packet_prefix_length().
This will allow to move [fb]_code from MpegEncContext.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-05-16 01:37:35 +02:00
4e2bac279d avcodec/vc1: Remove unused topleft,bottomright fields
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-05-16 01:37:35 +02:00
728ef2245c avcodec/vc1: Remove write-only qs_last
Write-only since 9cc74c9f6e.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-05-16 01:37:35 +02:00
6ce86c9c11 avcodec/mpeg4videodec: Permute quant matrices directly upon IDCT reinit
When switching to the XviD IDCT, the IDCT permutation can change.
Given that we already permute the quant matrices when parsing
them, they need to be permuted, too. Up until now this has not been
done; instead the header has been parsed again in the expectation
that the currently active quant matrix is contained in this header.

This expectation is wrong; it is for example wrong when the VOL
header is only available via extradata (such a file can be easily
created from xvid_vlc_trac7411.h263 (in the FATE suite) via the
remove_extra BSF). It could also be wrong if the XviD user data
is only available in a subsequent packet.

This commit therefore switches to permuting the relevant matrices
directly. It also stops parsing the header a second time
when switching to the XviD IDCT.

(I wonder whether ff_mpv_idct_init() should take alternate_scan
into account when initializing permutated_intra_h_scantable
as the decoder does. Does the MPEG-4 encoder use a wrong scantable
in this case?)

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-05-16 01:37:35 +02:00
ca36689b39 avcodec/mpeg4videodec: Set [yd]c_scale_table during init
It does not change lateron.
(If we were to add short header support later, it would involve
a branch in mpeg4_decode_block() anyway and we would then
hardcode the dc_scaler value of eight there; the *_scale_tables
would stay the same.)

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-05-16 01:37:35 +02:00
476c70164e avcodec/mpeg_er: Don't zero ThreadFrame* unnecessarily
We never set the ThreadFrame*, because mpegvideo uses
ThreadProgress instead of ThreadFrames. Furthermore,
it is unnecessary because the ERPicture has just been zeroed.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-05-16 01:37:35 +02:00
3792cf52af avcodec/{x86,mips}/xvididct_init: Remove redundant checks
ff_xvid_idct_init() already checks in case of high_bit_depth,
lowres or an incompatible idct_algo.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-05-16 01:37:35 +02:00
1f2b8d7238 fftools/graphprint: Now, make it a Killer-Feature!
remember this: -sg   <= means Show Graph

Signed-off-by: softworkz <softworkz@hotmail.com>
2025-05-15 23:11:08 +02:00
45926bc09a fftools/graphprint: Add execution graph printing
The key benefits are:

- Different to other graph printing methods, this is outputting:
  - all graphs with runtime state
    (including auto-inserted filters)
  - each graph with its inputs and outputs
  - all filters with their in- and output pads
  - all connections between all input- and output pads
  - for each connection:
    - the runtime-negotiated format and media type
    - the hw context
    - if video hw context, both: hw pixfmt + sw pixfmt
- Output can either be printed to stdout or written to specified file
- Output is machine-readable
- Use the same output implementation as ffprobe, supporting multiple
  formats

Signed-off-by: softworkz <softworkz@hotmail.com>
2025-05-15 23:09:17 +02:00
50fcc0ce5f fftools/ffmpeg_mux: Make ms_from_ost() inline
Signed-off-by: softworkz <softworkz@hotmail.com>
2025-05-15 23:08:05 +02:00
517a805565 fftools/resources: Add resource manager files with build-time compression
Compression requires zlib to be available, otherwise resources will
be included uncompressed - in either case via BIN2C.

It can also be disabled via

./configure --disable-resource-compression

Size figures:

graph.css         7752
graph.css.min     6655 (css is always minified)
graph.html        2153

No Compression

graph.css.c      40026
graph.css.o       9344 (6688)
graph.html.c     13016
graph.html.o      4848 (2186)

With Compression

graph.css.c      10206
graph.css.o       4368 (1718)
graph.html.c      5725
graph.html.o      3632 (971)

Numbers in brackets: .rodata size from 'size -Ax -d *.o'

Signed-off-by: softworkz <softworkz@hotmail.com>
2025-05-15 23:08:05 +02:00
e2f39671ae avfilter/avfilter: Add avfilter_link_get_hw_frames_ctx()
Signed-off-by: softworkz <softworkz@hotmail.com>
2025-05-15 23:04:44 +02:00
34bb7f5d87 fftools/ffmpeg_filter: Move some declaration to new header file
to allow filtergraph printing to access the information.

Signed-off-by: softworkz <softworkz@hotmail.com>
2025-05-15 23:04:44 +02:00
b71b444a3a fftools/textformat: Add flags param to function avtext_print_integer()
Make this function work analog to avtext_print_string() which already
has a flags parameter.

Signed-off-by: softworkz <softworkz@hotmail.com>
2025-05-15 23:04:44 +02:00
bb3a14489e fftools/tf_internal: Use av_default_item_name
Reviewed-by: Stefano Sabatini <stefasab@gmail.com>
Signed-off-by: softworkz <softworkz@hotmail.com>
2025-05-15 23:04:44 +02:00
cee7b8a051 fftools/textformat: Introduce common header and deduplicate code
Also change writer_printf signature in AVTextWriter to use va_list,
so that it can be called by the new function writer_printf()
in tf_internal.h.

Reviewed-by: Stefano Sabatini <stefasab@gmail.com>
Signed-off-by: softworkz <softworkz@hotmail.com>
2025-05-15 23:04:44 +02:00
e4830b8c5e fftools/textformat: Introduce AVTextFormatOptions for avtext_context_open()
This allows future addition of options without
changes to the signature of avtext_context_open().

Reviewed-by: Stefano Sabatini <stefasab@gmail.com>
Signed-off-by: softworkz <softworkz@hotmail.com>
2025-05-15 23:04:44 +02:00
4ff90f05c7 fftools/avtextformat: Re-use BPrint in loop
Instead of initializing a new BPrint in case of UTF decode error,
re-use the same BPrint struct and just clear it
for each iteration.

Reviewed-by: Stefano Sabatini <stefasab@gmail.com>
Signed-off-by: softworkz <softworkz@hotmail.com>
2025-05-15 23:04:44 +02:00
d225928703 fftools/textformat: Rename name param to key for API consistency
Reviewed-by: Stefano Sabatini <stefasab@gmail.com>
Signed-off-by: softworkz <softworkz@hotmail.com>
2025-05-15 23:04:44 +02:00
4baeb9ffe9 fftools/textformat: Remove unused print_rational() pointer from AVTextFormatter
Reviewed-by: Stefano Sabatini <stefasab@gmail.com>
Signed-off-by: softworkz <softworkz@hotmail.com>
2025-05-15 23:04:44 +02:00
5f90eea8a8 fftools/textformat: Apply quality improvements
Perform multiple improvements to increase code robustness.
In particular:
- favor unsigned counters for loops
- add missing checks
- avoid possible leaks
- move variable declarations to inner scopes when feasible
- provide explicit type-casting when needed

Signed-off-by: softworkz <softworkz@hotmail.com>
2025-05-15 23:04:44 +02:00
8f42d90413 fftools/textformat: Apply formatting and whitespace changes
Reviewed-by: Stefano Sabatini <stefasab@gmail.com>
Signed-off-by: softworkz <softworkz@hotmail.com>
2025-05-15 23:04:44 +02:00
f51c385a8e tools/merge-all-source-plugins: Check that there are no uncommited changes
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-05-15 16:19:59 +02:00
a06b86a09b tools/merge-all-source-plugins: Try merging a tag or branch matching the current version
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-05-15 16:19:58 +02:00
12b853530a Add tools/merge-all-source-plugins
Simple script to merge all source plugins.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-05-15 12:17:04 +02:00
23592f942d swscale/output: fix integer overflow in yuv2rgba64_full_1_c_template()
Fixes: signed integer overflow: -293650 * 16525 cannot be represented in type 'int'
Fixes: 408304111/clusterfuzz-testcase-minimized-ffmpeg_SWS_fuzzer-4762210299871232

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-05-15 03:03:58 +02:00
05f8c8c4c2 avformat/matroskadec: check that channels fit in signed 32bit int
Fixes: signed integer overflow: -1384566925600903168 * 16 cannot be represented in type 'long'
Fixes: 407069502/clusterfuzz-testcase-minimized-ffmpeg_dem_WEBM_DASH_MANIFEST_fuzzer-5159255372267520

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-05-15 03:03:57 +02:00
8e6db875af avcodec/takdec: Check remaining space for first predictors
Fixes: Timeout
Fixes: 403673829/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TAK_fuzzer-5498240154009600

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-05-15 03:03:57 +02:00
4a9d907b5e avcodec/4xm: Check frame_4cc before allocation
Fixes: Timeout
Fixes: 403402798/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_FOURXM_fuzzer-5012819292782592

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-05-15 03:03:57 +02:00
8168ebdcc5 tools/target_dec_fuzzer: Adjust threshold for WEBP
Fixes: Timeout
Fixes: 403345121/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_WEBP_fuzzer-6408323910139904

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-05-15 03:03:56 +02:00
c06f5b3ab9 avcodec/svq3: Check there are bits left before decompression
Fixes: out of array read
Fixes: 402587670/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SVQ3_fuzzer-6343867775647744

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-05-15 03:03:56 +02:00
fd0a792766 avcodec/sonic: Check num_taps
The encoder uses max 128 taps, which is quiet a lot already
If work is done to improve sonic, it will be more radical than changing the taps

Fixes: Timeout
Fixes: 402539974/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SONIC_fuzzer-6122944271286272

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-05-15 03:03:56 +02:00
d28bec8c4d avformat/imf_cpl: fix indention after previous commit 2025-05-15 03:03:55 +02:00
39800d78b0 avformat/imf_cpl: do not continue looping forever
Fixes: infinite loop
Fixes: 401658595/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-5756875014733824
Regression since: 61fa1e14e4

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-05-15 03:03:55 +02:00
9fc2702f6f avformat/mov: reject negative ELST durations
Fixes: multiple integer overflows
Fixes: 401016767/clusterfuzz-testcase-minimized-ffmpeg_dem_MOV_fuzzer-6242067591790592

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-05-15 03:03:55 +02:00
76e29bb8bf avcodec/dnxuc_parser: Use ff_parse_close()
Fixes: buffer leak
Fixes: 398894512/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-6716597473705984

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-05-15 03:03:54 +02:00
6a47046981 avformat/avidec: Ignore duplicate GAB2
Fixes: memleak
Fixes: 398401912/clusterfuzz-testcase-minimized-ffmpeg_dem_AVI_fuzzer-4669849976766464

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-05-15 03:03:54 +02:00
1a5ed492e5 MAINTAINERS: Add entry for samples-request
This is based on discussion with the GA and its simply the people
who have done or tried to do some uploads recently.

Everyone who has a shell account on ffmpeg.org should have powers to
upload samples.

CC: compn <compn@ffmpeg.org>
CC: Thilo Borgmann <thilo.borgmann@mail.de>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-05-15 03:03:54 +02:00
a9d39d6eb9 libavformat/oggdec.{c, h}: Implement packet skip on packet return value of 1
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-05-15 03:03:53 +02:00
6d54af6599 libavformat/oggdec.h: Document packet function return value.
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-05-15 03:03:53 +02:00
0d7172a9ff avcodec/cbs: Avoid branch
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-05-15 01:51:34 +02:00
f71d0f0559 avcodec/apv_parser: Mark close as av_cold
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-05-15 01:51:34 +02:00
d794ecd9d2 avcodec/vulkan_encode_hevc: Fix memleak on error
Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-05-15 01:51:28 +02:00
70fa44dfa8 avcodec/vulkan_encode_h264: Fix memleak on error
Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-05-15 01:26:07 +02:00
b18aaf209f fftools/ffmpeg_dec: Always receive frames from decoder
Up until now if avcodec_send_packet() returned an error,
no attempt to receive a frame from the decoder would be made.
Instead the decoder was presumed to be drained, so that more
packets could be sent to it. Yet this need not be so:
It can happen that a packet would decode to multiple frames
and that decoding the first of these (the one that is decoded
during the avcodec_send_packet() call) returns an error,
in which case the decoder is not yet ready to receive more
input as the remaining parts of the packet have not been decoded
yet. In this case, an AERROR_BUG is triggered.

This happens in ticket #11553 with VP9 (which uses a BSF
to split VP9 superframes and is therefore affected by this).

Fix this by always calling avcodec_receive_frame() unless
xerror is set.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-05-15 01:23:41 +02:00
8588770367 avformat/av1dec: Avoid branch for setting position
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-05-15 01:20:46 +02:00
c914fd2977 avformat/av1dec: Remove redundant avio_tell()
AV1DemuxContext.temporal_unit_size is zero after reading the header,
so the position set when reading the header will not be used at all.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-05-15 01:20:46 +02:00