1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-11-23 21:54:53 +02:00
Commit Graph

121013 Commits

Author SHA1 Message Date
DE-AI
fbbb2996d5 vc1_parser: Reset unesc_index after extracting header with complete frames
When PARSER_FLAG_COMPLETE_FRAMES is set (e.g. in Matroska),
unesc_index is not reset after the first frame, which causes
subsequent frames to inherit leftover header data.

This leads to incorrect keyframe marking and broken decoding.

See also this bug report: https://trac.ffmpeg.org/ticket/8515

Signed-off-by: DE-AI <max.christoph@pentaxmedical.com>
2025-09-08 14:03:52 +00:00
Niklas Haas
1f2de0f618 avfilter/vf_libplacebo: ensure linear tex is blittable
Required to clear textures to a background color.
2025-09-08 15:42:01 +02:00
Timo Rothenpieler
f8a300c673 configure: fix CUDA compilation with SDK version 13 nvcc
Compute Capability 7.5 is now the lowest supported version.

Fixes #20454
2025-09-08 14:25:44 +02:00
Tong Wu
45db6945e9 avcodec/vaapi_encode: avoid potential overflow
The max_frame_size in byte will be filled in
VAEncMiscParameterBufferMaxFrameSize which receives size in bit.
This requires max_frame_size * 8.

Signed-off-by: Tong Wu <wutong1208@outlook.com>
2025-09-08 00:19:06 +00:00
Alan Kelly
f4b044bbe3 swscale: Disable avx2 hscale 8to15 on IceLake and below due to Intel Gather Data Sampling mitigation performance loss
Intel provided a microcode update to mitigate this security
    vulnerability which has a huge negative performance impact on gather
    instructions. This means that hscale 8to15 avx2, which uses gather
    extensively, is no longer faster than SSSE3 on impacted CPUs.

    https://www.intel.com/content/www/us/en/developer/articles/technical/software-security-guidance/technical-documentation/gather-data-sampling.html

    Broadwell:
    hscale_8_to_15__fs_4_dstW_512_c:                      3379.5 ( 1.00x)
    hscale_8_to_15__fs_4_dstW_512_sse2:                    615.7 ( 5.49x)
    hscale_8_to_15__fs_4_dstW_512_ssse3:                   613.4 ( 5.51x)
    hscale_8_to_15__fs_4_dstW_512_avx2:                    495.7 ( 6.82x)

    Skylake:
    hscale_8_to_15__fs_4_dstW_512_c:                      3411.4 ( 1.00x)
    hscale_8_to_15__fs_4_dstW_512_sse2:                    591.0 ( 5.77x)
    hscale_8_to_15__fs_4_dstW_512_ssse3:                   591.5 ( 5.77x)
    hscale_8_to_15__fs_4_dstW_512_avx2:                   1386.2 ( 2.46x)

    Cascade Lake:
    hscale_8_to_15__fs_4_dstW_512_c:                      3231.3 ( 1.00x)
    hscale_8_to_15__fs_4_dstW_512_sse2:                    517.9 ( 6.24x)
    hscale_8_to_15__fs_4_dstW_512_ssse3:                   521.6 ( 6.19x)
    hscale_8_to_15__fs_4_dstW_512_avx2:                   1775.0 ( 1.82x)

    Sapphire Rapids:
    hscale_8_to_15__fs_4_dstW_512_c:                      1840.0 ( 1.00x)
    hscale_8_to_15__fs_4_dstW_512_sse2:                    287.9 ( 6.39x)
    hscale_8_to_15__fs_4_dstW_512_ssse3:                   293.8 ( 6.26x)
    hscale_8_to_15__fs_4_dstW_512_avx2:                    219.2 ( 8.40x)
2025-09-06 20:57:48 +00:00
Leo Izen
1dcb0c6c3e avcodec/libjxldec: consume input on error
libjxl consumes no input if it returns an error, so this loops over
and over while it spits out the same error many times. If we got an
error from libjxl and consumed no input, then we instead consume the
whole packet.

Signed-off-by: Leo Izen <leo.izen@gmail.com>
2025-09-06 15:51:41 -04:00
Leo Izen
74e61981b5 avcodec/decode: treat orientation 1 as valid displaymatrix
Since 9dc79241d9 we now always pop the
orientation off of the IFD and use a display matrix instead. This means
we should not produce a warning and refuse if the orientation field
indicates a default orientation (i.e. 1).

Signed-off-by: Leo Izen <leo.izen@gmail.com>
Reported-by: Ramiro Polla <ramiro.polla@gmail.com>
2025-09-06 13:15:24 -04:00
Zhao Zhili
742474bc24 avformat/mov: fix unused variable entry in parse_exif_item 2025-09-06 15:11:48 +00:00
Zhao Zhili
1ca2c68278 avcodec/pcm: fix some unused variables/functions warning
v is unused when ALAW/MULAW/VIDC are disabled.
2025-09-06 15:11:48 +00:00
Zhao Zhili
ca1ab8815c avcodec/pcm: use stricter conditional expressions for compilation 2025-09-06 15:11:48 +00:00
Andreas Rheinhardt
893250a734 avfilter/Makefile: Add dependencies for premultiply_dynamic filter
Reviewed-by: Timo Rothenpieler <timo@rothenpieler.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-09-06 16:06:31 +02:00
Jack Lau
adc66f30ee configure: remove openssl version check for whip
This version check for whip is unnecessary.
Since several rencet patches to the configure
have already added version checks for OpenSSL.

Signed-off-by: Jack Lau <jacklau1222@qq.com>
2025-09-06 11:27:54 +00:00
Marton Balint
7321e4b950 avformat/img2dec: support arbitrary path lengths
Signed-off-by: Marton Balint <cus@passwd.hu>
2025-09-05 21:05:13 +02:00
Marton Balint
8703dd74bd avformat/img2dec: remove path limits from find_image_range
Signed-off-by: Marton Balint <cus@passwd.hu>
2025-09-05 21:05:13 +02:00
Marton Balint
69d9c074ef avformat/img2dec: do not use av_get_frame_filename result buffer if the call fails
We have no way of knowing if the string was fully processed or got truncated
because of a parse error so it is better to use the original path if finding an
image sequence fails.

We do this by explicitly falling back to the PT_NONE mode if the provided
filename is not a valid pattern but the file exists or if the IO context is
already open.

This also means that filenames no longer need to be escaped even in sequence
mode if an invalid sequence (a sequence without %d) is provided, so a command
line such as ffmpeg -f image2 -i "100%.jpg" will just work, but "100%%.jpg"
will no longer work.

Signed-off-by: Marton Balint <cus@passwd.hu>
2025-09-05 21:05:13 +02:00
Marton Balint
8c1301cf9d avformat/webm_chunk: support for arbitrary path lengths
Signed-off-by: Marton Balint <cus@passwd.hu>
2025-09-05 21:05:13 +02:00
Marton Balint
35ceef40ad avformat/segment: support arbitrary path lengths
Signed-off-by: Marton Balint <cus@passwd.hu>
2025-09-05 21:05:13 +02:00
Marton Balint
4b8be1991c avformat/utils: support arbitrary path lengths for av_filename_number_test
Signed-off-by: Marton Balint <cus@passwd.hu>
2025-09-05 21:05:13 +02:00
Marton Balint
9458a6f8ec avformat/utils: add AV_FRAME_FILENAME_FLAGS_IGNORE_TRUNCATION flag
Signed-off-by: Marton Balint <cus@passwd.hu>
2025-09-05 21:05:13 +02:00
caifan3
7a1c737c35 libavcodec/v4l2_buffers: avoid redefinition of USEC_PER_SEC macro
The macro USEC_PER_SEC is already defined in system headers on some platforms,such as Nuttx nuttx/clock.h.
Check if it's already defined before defining it to avoid compiler warnings.

Signed-off-by: caifan3 <caifan3@xiaomi.com>
2025-09-05 17:21:30 +00:00
Dmitrii Ovchinnikov
6891314db1 MAINTAINERS: Update the entries for AMF
MAINTAINERS: Update the entries for AMF

Alphabetized the records
2025-09-05 17:52:46 +02:00
Dmitrii Ovchinnikov
8450d87ea5 forgejo/CODEOWNERS: add myself for relevant files 2025-09-05 17:52:46 +02:00
Martin Storsjö
f6bcd661f0 configure: Improve the check for schannel DTLS constants
This amends 307983b292 to fix
building with older versions of mingw-w64.

The previously checked constant, SP_PROT_DTLS1_X_CLIENT, was
added in mingw-w64 in df36f5deda23192d0ee99ffd661ea36df924e667
in 2020, and is included in released versions since v8.0.0.

The new checked constant SECPKG_ATTR_DTLS_MTU was added in
mingw-w64 in 0792283787cca8fc27dd38671107c791c87f4db3 in 2021,
and first appeared in mingw-w64 v9.0.0.

This fixes building with mingw-w64 v8, which is the version bundled
in Ubuntu 22.04.
2025-09-05 12:20:11 +00:00
Zhao Zhili
fc45127bcc avcodec/videotoolboxenc: support global_quality without qscale 2025-09-05 09:20:36 +00:00
Zhao Zhili
73750489a6 avcodec/videotoolboxenc: fix the loss of precision when calculating quality 2025-09-05 09:20:36 +00:00
Krzysztof Pyrkosz
fb4407797e Replace uxtl with umull in dmvr_hv_8
Before and after on A78:
dmvr_hv_8_12x20_neon:                                  205.3 ( 5.21x)
dmvr_hv_8_20x12_neon:                                  171.8 ( 3.15x)
dmvr_hv_8_20x20_neon:                                  282.7 ( 3.11x)

dmvr_hv_8_12x20_neon:                                  172.7 ( 5.58x)
dmvr_hv_8_20x12_neon:                                  133.3 ( 3.36x)
dmvr_hv_8_20x20_neon:                                  214.6 ( 3.40x)
2025-09-05 07:20:15 +00:00
Jack Lau
85b5d4adf2 avformat/tls_gnutls: cleanup the pointer name
Pure cleanup, no functional changes
Unify local pointer names to `TLSContext *c` and `TLSShared *s` to
reduce confusion from inconsistent names (e.g. p, s, c)

Signed-off-by: Jack Lau <jacklau1222@qq.com>
2025-09-05 04:31:07 +00:00
Jack Lau
3c7315c345 avformat/whip: simplify the udp read in whip_write_packet
Reduce nested if statements to make the code structure clearer

Add logic to check if EOF is received from UDP socket.

Signed-off-by: Jack Lau <jacklau1222@qq.com>
2025-09-05 04:29:39 +00:00
Jack Lau
785a4e0d6c avformat/whip: fix potential 8bit overflow for profile_idc
The profile contains profile_idc and constraint_set*_flag,
throws away high 8 bit flags and then we get profile_idc.

Signed-off-by: Jack Lau <jacklau1222@qq.com>
2025-09-05 04:28:55 +00:00
Jack Lau
6c2768bf8c avformat/whip: fix 8 bits overflow and map constraint_set bits for H264
profile_iop is an 8 bits field. Previous code copied
AVCodecParameters::profile (which can contain bits
beyond 8 bits) into profile_iop, producing overflow
and wrong values.

This patch maps the constrained flags into the proper
profile_iop bits (constraint_set1 / 3)

Signed-off-by: Jack Lau <jacklau1222@qq.com>
2025-09-05 04:28:55 +00:00
Jack Lau
39a63e3d07 avformat/whip: make time measure more precise
Use av_gettime_relative() replace av_gettime() to get
better measure

Changed the display precision from showing only integers
to showing two decimal places (in milliseconds)

Signed-off-by: Jack Lau <jacklau1222@qq.com>
2025-09-05 04:28:24 +00:00
Jack Lau
b41f8207c4 avformat/whip: fix SDP ICE candidates parsing
fix issue #20407

Refer to RFC 5245 15.1,
the foundation may be any string up to 32 chars.
The old code could misread foundations as transport("udp").
This patch fully parse all these attr to avoid parsing error.

Signed-off-by: Jack Lau <jacklau1222@qq.com>
2025-09-05 04:27:51 +00:00
Jack Lau
7fd967c2c1 avformat/whip: add PRIORITY and ICE_CONTROLLING for STUN binding request
fix issue #20402

See RFC 8445 7.1,
The PRIORITY and ICE-CONTROLLED or ICE-CONTROLLING must be included
in a Binding request.

FFmpeg is always ICE Controlling role so we use ICE-CONTROLLING attr.

Co-author-by: Sergio Garcia Murillo <sergio.garcia.murillo@gmail.com>
Signed-off-by: Jack Lau <jacklau1222@qq.com>
2025-09-05 01:21:28 +00:00
Niklas Haas
8ff34b29c7 fate/filter-audio: update acrossfade to test multiple inputs 2025-09-04 23:12:34 +00:00
Niklas Haas
dfc3256da1 avfilter/af_afade: support multiple inputs
Instead of just 2 files, generalize this filter to support crossfading
arbitrarily many files. This makes the filter essentially operate similar
to the `concat` filter, chaining multiple files one after another.

Aside from just adding more input pads, this requires rewriting the
activate function. Instead of a finite state machine, we keep track of the
currently active input index; and advance it only once the current input is
fully exhausted.

This results in arguably simpler logic overall.
2025-09-04 23:12:34 +00:00
Niklas Haas
81c1004891 avfilter/af_afade: shorten crossfade on too short inputs
This behavior is currently completely broken, leading to an abrupt end of the
first audio stream. I want to generalize this filter to multiple inputs, but
having too short input files will always represent a significant problem.

I considered a few approaches for how to handle this more gracefully, but
most of them come with their own problems; in particular when a short input
is sandwiched between two longer ones; or when there is a sequence of short
inputs. In the end, it's simplest to just shorten the crossfade window.

I also considered (and tested) padding the input with silence, but this also
has its own aesthetic implications and strange edge cases.

See-Also: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/20388
2025-09-04 23:12:34 +00:00
Niklas Haas
2e0885a091 avfilter/af_afade: don't leak memory on error
This first frame was never cleaned up if the second input fails.
2025-09-04 23:12:34 +00:00
Niklas Haas
386264ae16 avfilter/af_afade: generalize pass_crossfade() signature
Prerequisite to an upcoming refactor.
2025-09-04 23:12:34 +00:00
Andreas Rheinhardt
2451e06f19 all: Use "" instead of <> to include internal headers
Reviewed-by: Niklas Haas <ffmpeg@haasn.dev>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-09-04 22:20:58 +02:00
Andreas Rheinhardt
7dc4c4f6f5 swscale/ops: Fix linking with x86 assembly disabled
Reviewed-by: Niklas Haas <ffmpeg@haasn.dev>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-09-04 22:14:39 +02:00
Ramiro Polla
6696a9b8bd avcodec/mjpegdec: ignore APPx stubs unless AV_EF_EXPLODE is set
Consider APPx fields that are too short to contain an id field (32-bit)
as stubs, and ignore them if AV_EF_EXPLODE is not set.

This has been seen in the MJPEG output from some webcams (such as the
Logitech C270 and C920) and the JPEG images embedded in DNG images
from the Pentax K-1 camera.
2025-09-04 15:28:41 +00:00
Ramiro Polla
e207520b82 avcodec/mjpegdec: fix skipping of bytes for unknown APPx markers
The loop to skip the remaining bytes was off by one for all markers
except for Adob.

This patch uses post-decrement instead of pre-decrement in the while
loop to make the len value easier to understand, and updates the len
value to reflect this change for the Adob marker.
2025-09-04 15:28:41 +00:00
Andrey Semashev
9ee7796c54 avcodec/librsvgdec: fix compilation with librsvg 2.50.3
This fixes compilation with librsvg 2.50.3: error: viewport undeclared

This was a regression since commit
86ed68420d.

Fixes #10722.

Reviewed-by: Leo Izen <leo.izen@gmail.com>
2025-09-04 07:01:13 -04:00
Andreas Rheinhardt
2611874a50 avcodec/cbrt_tablegen: Deduplicate common code
Namely the part that creates a temporary LUT.

Reviewed-by: Zhao Zhili <quinkblack@foxmail.com>
Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-09-04 10:15:09 +02:00
Andreas Rheinhardt
9bacefc41e avcodec/cbrt_tablegen: Avoid LUT only used once
This can be done by reusing the destination array to store
a temporary LUT (with only half the amount of elements, but
double the element size). This relies on certain assumptions
about sizes, but they are always fulfilled for systems supported
by us (sizeof(double) == 8 is needed/guaranteed since commit
3383a53e7d). Furthermore,
sizeof(uint32_t) is always >= four because CHAR_BIT is eight
(in fact, sizeof(uint32_t) is four, because the exact width
types don't have any padding).

Reviewed-by: Zhao Zhili <quinkblack@foxmail.com>
Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-09-04 10:15:03 +02:00
Andreas Rheinhardt
cd337c46d5 avcodec/cbrt_tablegen: Reduce size of LUT only used once
ff_cbrt_tableinit{,_fixed}() uses a LUT of doubles of the same size
as the actual LUT to be initialized (8192 elems). Said LUT is only
used to initialize another LUT, but because it is static, the dirty
memory (64KiB) is not released. It is also too large to be put on
the stack.

This commit mitigates this: We only use a LUT for the powers of
odd values, thereby halving its size. The generated LUT stays unchanged.

Reviewed-by: Zhao Zhili <quinkblack@foxmail.com>
Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-09-04 10:14:53 +02:00
Andreas Rheinhardt
77e5e61f1a avcodec/cbrt_tablegen: Remove always-false branch
Each ff_cbrt_tableinit*() is called at most once, making this
check always-false.

Reviewed-by: Zhao Zhili <quinkblack@foxmail.com>
Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-09-04 10:12:25 +02:00
Cameron Gutman
37f02603b1 avutil/hwcontext_drm: fix mapping when dst format is unset
av_hwframe_map() is documented to work with a blank dst frame, but
hwcontext_drm currently fails if dst->format == AV_PIX_FMT_NONE.

Signed-off-by: Cameron Gutman <aicommander@gmail.com>
2025-09-03 20:21:51 -05:00
Wu Jianhua
858aa6176b avutil/version: bump minor after recent change
See c2ce387385

Signed-off-by: Wu Jianhua <toqsxw@outlook.com>
2025-09-03 22:34:40 +00:00
Andreas Rheinhardt
79058e7014 avformat/demux: Reindent after the previous commit
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-09-03 21:10:21 +00:00