Commit graph

122392 commits

Author SHA1 Message Date
Ramiro Polla
165448f7d1 avcodec/mjpegdec: remove buggy_avid field from MJpegDecodeContext
This field has been unused since b6c04b6821.
2026-01-08 16:29:32 +00:00
Nicolas Gaullier
af6a1dd0b2 avformat/demux: duplicate side_data in parse_packet()
If an input packet results in several output packets, the side data will be
exported only by the first output packet, and be missing from the rest.

Signed-off-by: Nicolas Gaullier <nicolas.gaullier@cji.paris>
Signed-off-by: James Almer <jamrial@gmail.com>
2026-01-07 20:25:18 -03:00
James Almer
0cca125a94 avformat/demux: prevent the loss of packet side data when using an parser
Many parsers will request data until they find what will be the start of the
next assembled packet in order to decide where to cut the current one. If this
happens, the loop in demux.c will, in case the demuxer exports already fully
assembled packets as is sometimes the case for MPEG-TS, discard the already
handled first input packet before it tries to move its side data to the output.

The affected FATE tests reflect this change by no longer dropping the side data
from the first input packet, nor exporting every other side data in the wrong
output packet.

Signed-off-by: James Almer <jamrial@gmail.com>
2026-01-07 20:25:18 -03:00
James Almer
70d84bdd84 avformat/demux: use a stream specific temporary packet for the parser
This will be useful for the next commit.

Signed-off-by: James Almer <jamrial@gmail.com>
2026-01-07 20:25:17 -03:00
Ruikai Peng
f1dbef3e38 avcodec/mjpegdec: avoid negative len in APP parser
The APP parser can read a fixed number of bytes without checking len,
making len negative and passing it to bytestream2_skipu(), which takes
an unsigned size. This can advance the buffer by a huge amount and
results in undefined behavior.

Add small len guards in the fixed-size AVI1/LJIF paths and only skip
the tail if len > 0.

Signed-off-by: Ruikai Peng <ruikai@pwno.io>
2026-01-07 17:33:02 +00:00
Andreas Rheinhardt
1461dfcde7 avcodec/amfdec: Check correct value, return error upon error
Found via an unused-variable warning from GCC.
Also just forward the error from amf_init_frames_context().

This bug has been introduced in
4479d28103.

Reviewed-by: Jan Ekström <jeebjp@gmail.com>
Reviewed-by: Mikhail Mironov <mikhail.mironov@amd.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2026-01-07 17:32:06 +01:00
Andreas Rheinhardt
d595a18287 fftools/graph/graphprint: Replace always-false check by assert
This check makes no sense, as the pointer arithmetic involved
in &fg->graph_print_buf would be UB if fg were NULL.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2026-01-07 16:36:07 +01:00
Andreas Rheinhardt
9f77cb3a98 fftools/graph/graphprint: Remove always-false checks
init_graphprint() already returns an error upon allocation
failure.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2026-01-07 16:36:07 +01:00
Andreas Rheinhardt
9baf1b2f82 fftools/textformat/avtextformat: Move avtext_print_integers to ffprobe.c
This is its only user and because this function is so specialised
it is very likely to stay that way. So move it back to ffprobe.c
(where it already was before d7a3f68fea).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2026-01-07 16:36:07 +01:00
Andreas Rheinhardt
60684932fb fftools/textformat/avtextformat: Separate mutable and immutable data
Only two fields of AVTextFormatSection are ever modified:
entries_to_show and show_all_entries (they are only used
by ffprobe; the graph printing code always prints everything).
These fields do not belong into AVTextFormatSection, they are
more ffprobe-internal (and if the graph printing code ever
made use of them, these fields could very well be
per GraphPrintContext).

This commit therefore moves them out of AVTextFormatSection
and adds a callback to AVTextFormatContext to decide which
elements to discard. This also allows to make the AVTextFormatSections
const.

This also fixes a race when initializing the sections
for graphprint.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2026-01-07 16:36:07 +01:00
Vann Harl
41342aea22 configure: bump CONFIG_THIS_YEAR to 2026 2026-01-07 15:07:09 +01:00
Cosmin Stejerean
3474ec01e7 avutil/dovi_meta - fix L11 dovi metadata definition
deprecate the incorrect fields in AVDOVIDmLevel11 and schedule them
for removal
2026-01-07 13:14:11 +00:00
Cosmin Stejerean
56bc8fd0a1 avcodec/dovi_rpu(enc|dec) - fix parsing and writing of L11 DoVi metadata
sharpness, noise_reduction, mpeg_noise_reduction,
frame_rate_conversion, brightness and color are not actual fields in
L11 metadata, this appears to be based on perhaps an out of date
patent specification. Instead the two bytes are considered
reserved.

Drop reading them and write out 0s, the fields will be deprecated from
the struct in a future commit and scheduled for removal.
2026-01-07 13:14:11 +00:00
Leo Izen
ec42a0aec0
avcodec/exif: avoid overflow with supplemental extra IFDs
If extra IFDs occur outside of the top level, we don't allocate enough
buffer space for them. This commit changes our calculation to include
their size always, and then we shrink the allocated buffer once every
IFD is written (by at most 192 bytes).

Signed-off-by: Leo Izen <leo.izen@gmail.com>
2026-01-07 04:01:51 -05:00
cae
e21a51b203 .forgejo/CODEOWNERS: Add myself for jpeg2000htdec
Original author

Signed-off-by: cae <etemesicaleb@gmail.com>
2026-01-06 15:32:32 +00:00
Gyan Doshi
03541f0026 avformat/hls: show stream IDs
The subdemuxer may be MPEG-TS which sets stream id, and users may
want to see it for stream selection.
2026-01-06 04:05:47 +00:00
Michael Niedermayer
6c68cbfa92 .forgejo/CODEOWNERS: Add myself for mjpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-01-06 00:25:25 +00:00
Andreas Rheinhardt
90920a645e avcodec/vc1dec: Reduce size of allocation
blk_mv_type is only set for block 0-3, not for chroma blocks,
so it only needs four elements per MB.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2026-01-06 00:02:16 +01:00
Nicolas Gaullier
931b26528c avfilter/src_movie: fix support multiple frames per packet
Do not output more than one frame in one activate callback, though.

Fixes #20827.

Signed-off-by: Nicolas Gaullier <nicolas.gaullier@cji.paris>
2026-01-05 20:41:59 +00:00
stevxiao
b9d49a333f forgejo/CODEOWNERS: add myself to d3d12va related files 2026-01-05 10:44:22 -05:00
Timo Rothenpieler
b5d6cfd55b avcodec/notchlc: zero-initialize history buffer
Otherwise a specially crafted bitstream can potentially read
uninitialized stack memory.

Fixes #YWH-PGM40646-37
2026-01-05 13:30:38 +00:00
Timo Rothenpieler
7f44dcfbfb avcodec/notchlc: actually use HISTORY_SIZE to initialize history 2026-01-05 13:30:38 +00:00
Ramiro Polla
1debadd58e avcodec/mjpegdec: use GetByteContext instead of GetBitContext where possible
JPEG is mostly byte-aligned. We only really need GetBitContext while
decoding the image data.

Suggested-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2026-01-05 13:14:15 +00:00
Ramiro Polla
6f6826d2e0 avcodec/mxpegdec: remove unnecessary scope and indentation 2026-01-05 13:14:15 +00:00
Ramiro Polla
fdff03425b avcodec/mjpegdec: fix indentation for previous commit 2026-01-05 13:14:15 +00:00
Ramiro Polla
a84627aca9 avcodec/mjpegdec: add mjpeg_parse_len() helper
And check for length field in a consistent manner.
2026-01-05 13:14:15 +00:00
Ramiro Polla
abb0247017 avcodec/mjpegdec: improve check for length in ff_mjpeg_decode_dqt() 2026-01-05 13:14:15 +00:00
wangwenchao10
2892815c45 avformat/pcmdec: Mark raw PCM stream as having no timestamps
Signed-off-by: wangwenchao10 <wangwenchao10@xiaomi.com>
2026-01-05 01:23:17 +00:00
Andreas Rheinhardt
f4a1243481 doc/APIchanges: Fix typo
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2026-01-04 20:21:25 +01:00
Zhao Zhili
66f7e9db71 avutil/crc: use arm64 crc32 instruction
On rpi5 A76
crc_32_ieee_le_c:                       23146.3 ( 1.00x)
crc_32_ieee_le_crc:                      1060.1 (21.83x)

On RK3566 A55
crc_32_ieee_le_c:                       28773.8 ( 1.00x)
crc_32_ieee_le_crc:                      2602.4 (11.06x)

Co-authored-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2026-01-04 15:49:30 +01:00
Zhao Zhili
0645c48453 avutil/cpu: add CPU feature flag for arm crc32
Co-Authored-by: Martin Storsjö <martin@martin.st>
2026-01-04 15:49:30 +01:00
Martin Storsjö
3dcbcce80c configure: Check for the AArch64 CRC extension
Name the feature "arm_crc" rather than plain "crc", to make it
clear that this is about a CPU feature extension, not CRC
implementations in general.

This requires dealing with the extension slightly differently
than other extensions, as the name of the feature and the
".arch_extension" extension name differ.

Naming it with an "arm" prefix rather than "aarch64", as the
CPU extension also is available in 32 bit ARM form, even though
we don't intend to use it there.
2026-01-04 15:49:30 +01:00
Martin Storsjö
34784c89bf configure: Support aarch64 arch_extension with a different name than the feature
This allows naming the ffmpeg wide feature with a different (more
elaborate) name than the raw cpu extension as it is spelled in
the ".arch_extension" directives.
2026-01-04 15:49:30 +01:00
Martin Storsjö
d4e5c08e18 configure: Use a different aarch64 feature in Clang workaround
We use a dummy aarch64 feature to work around an issue in older
Clang, where an .arch line such as ".arch armv8.2-a" doesn't take
effect immediately, while one like ".arch armv8.2-a+feature" works.

Previously, we used "crc" for this dummy feature to add (as an
old feature that would be supported widely by old toolchains).
But as we may want to actually use crc features and detect whether
they are supported, we may want to switch to another feature.

Use the "fp" feature instead, for the purposes of this extra
feature in the .arch lines. (The "fp" feature indicates floating
point support, which is implicitly part of the baseline feature
set anyway.)
2026-01-04 15:49:30 +01:00
Andreas Rheinhardt
dc03cffe9c avutil/crc: Use x86 clmul for CRC when available
Observed near 10x speedup on AMD Zen4 7950x:
av_crc_c:                                            22057.0 ( 1.00x)
av_crc_clmul:                                         2202.8 (10.01x)

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2026-01-04 15:49:30 +01:00
Shreesh Adiga
1b6571c765 avutil/crc: add x86 SSE4.2 clmul SIMD implementation for av_crc
Implemented the algorithm described in the paper titled
"Fast CRC Computation for Generic Polynomials Using PCLMULQDQ Instruction"
by Intel.
It is not used yet; the integration will be added in a separate commit.

Observed near 10x speedup on AMD Zen4 7950x:
av_crc_c:                                            22057.0 ( 1.00x)
av_crc_clmul:                                         2202.8 (10.01x)
2026-01-04 15:49:30 +01:00
Andreas Rheinhardt
0629ebb5ff tests/checkasm: Add CRC test
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2026-01-04 15:49:30 +01:00
Andreas Rheinhardt
cf7e2b6773 tests/checkasm: Add support for using opaques to decide whether to test
This is in preparation for adding checkasm support for av_crc(),
which will always call the same function, but uses different CRC
tables to distinguish different implementations.
This reuses checkasm_check_func() for this; one could also add
a new function or use unions. This would allow to avoid casting
const away in the crc test to be added. It would also allow
to avoid converting function pointers to void* (which ISO C
does not allow).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2026-01-04 15:49:30 +01:00
Andreas Rheinhardt
52190efade avutil/crc: Don't assert AVCRCId to be valid
This function is supposed to return NULL on failure.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2026-01-04 15:49:30 +01:00
Shreesh Adiga
e382772e4a avutil/cpu: add x86 CPU feature flag for clmul
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2026-01-04 15:49:30 +01:00
Ayose
120987543a avfilter/tests/drawvg: fix warnings on WIN32
The compiler was emitting a warning on every Cairo function replaced by
the `MOCK_FN_n` macros:

    warning: 'cairo_...': redeclared without dllimport attribute after
    being referenced with dll linkage

The macro `CAIRO_WIN32_STATIC_BUILD` prevents the attribute `dllimport` on
the declarations for these functions.

Signed-off-by: Ayose <ayosec@gmail.com>
2026-01-04 13:42:20 +00:00
Ayose
1333ee5294 doc/drawvg-reference: changes on color syntax.
Colors expressions (like `#RRGGBB`) can now be used as arguments for `setvar`
and `call`.

The trick of setting a variable with a `0xRRGGBBAA` value is not valid anymore.

Signed-off-by: Ayose <ayosec@gmail.com>
2026-01-04 13:42:20 +00:00
Ayose
c7a2646bc7 avfilter/vf_drawvg: values from the p() function can be used as colors.
To be able to reuse colors from the original frame, the last value returned by
`p()` is tracked in the eval state, and if it is assigned to a variable, the
original color components are copied to `color_vars`. Thus, commands like
`setcolor` and `colorstop` can use those variables:

    setvar pixel (p(0, 0))
    ...
    setcolor pixel

`fate-filter-drawvg-video` now also verifies the `p()` function.

Signed-off-by: Ayose <ayosec@gmail.com>
2026-01-04 13:42:20 +00:00
Ayose
46c9584dc5 avfilter/vf_drawvg: support color expressions as setvar/call arguments.
The arguments for `setvar` and `call` commands can be colors (like `#rrggbb`).
This replaces the previous trick of using `0xRRGGBBAA` values to use colors as
procedure arguments.

The parser stores colors as the value expected by Cairo (a `double[4]`). This
array is allocated on the heap so the size of the union in `VGSArgument` is
not increased (i.e. it is still 8 bytes, instead of 32).

Signed-off-by: Ayose <ayosec@gmail.com>
2026-01-04 13:42:20 +00:00
Ayose
6300e340d3 avfilter/vf_drawvg: skip conversions when a color is assigned to a variable.
In libcairo, colors are defined as 4 separate components, and each one is double
between 0 and 1. Before this commit, colors stored in variables (like `defhsla`)
were converted to a `0xRRGGBBAA` value, which introduced some issues due to
rounding errors.

Now, when a color is assigned to a variable, the original values (a `double[4]`)
are stored in a dedicated array (`color_vars`), so no conversion is needed.

This change also reduces the cost of reading a color from a variable (no need
for `av_be2ne32`, or the `color[i] / 255` operations).

Signed-off-by: Ayose <ayosec@gmail.com>
2026-01-04 13:42:20 +00:00
Zhao Zhili
840183d823 aarch64/hpeldsp_neon: fix out-of-bounds read
Fix #21141

The performance improved a little bit.
On A76:
                              Before            After
put_pixels_tab[0][1]_neon:    32.4 ( 3.91x)     31.6 ( 3.99x)
put_pixels_tab[0][3]_neon:    88.0 ( 4.50x)     74.6 ( 5.31x)
put_pixels_tab[1][1]_neon:    33.5 ( 2.52x)     31.2 ( 2.71x)
put_pixels_tab[1][3]_neon:    30.5 ( 3.61x)     21.7 ( 5.08x)

On A55:
                             Before            After
put_pixels_tab[0][1]_neon:   175.2 ( 2.41x)    138.7 ( 3.04x)
put_pixels_tab[0][3]_neon:   334.3 ( 2.71x)    296.1 ( 3.07x)
put_pixels_tab[1][1]_neon:   168.3 ( 1.78x)     94.1 ( 3.19x)
put_pixels_tab[1][3]_neon:   112.3 ( 2.20x)     90.0 ( 2.74x)
2026-01-04 03:22:55 +00:00
James Almer
4fad136704 avfilter/vf_stack: add checks for the final canvas dimensions
Prevents potential integer overflows when trying to stitch absurdly huge images together.

Fixes #YWH-PGM40646-38.

Signed-off-by: James Almer <jamrial@gmail.com>
2026-01-03 21:31:30 -03:00
Andreas Rheinhardt
649a4e98f4 tests/fate/demux: Fix dependencies of jxs-concat-demux test
It uses ffmpeg, not ffprobe.
Fixes https://fate.ffmpeg.org/report.cgi?time=20260102215443&slot=x86_64-archlinux-gcc-disableavfilter

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2026-01-03 01:27:53 +01:00
Andreas Rheinhardt
25c7f91256 tests/checkasm: Add report to tests missing them
Reviewed-by: Kacper Michajłow <kasper93@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2026-01-03 00:04:05 +01:00
Andreas Rheinhardt
10b9984e59 tests/fate/checkasm: Run vvc_sao test during FATE
Forgotten in 45bea45c7b.

Reviewed-by: Martin Storsjö <martin@martin.st>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2026-01-02 19:48:23 +01:00