Commit Graph

7122 Commits

Author SHA1 Message Date
openvela-robot 2abdb3a8da cbs: Always check for bitstream end before reading 2026-04-20 19:37:39 +08:00
Michael Niedermayer 7b8f1cdb55 avformat/mxfenc: Correct the Sample rate for PCM outside D10
Based on mail from IRT

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-04-20 19:37:36 +08:00
Clément Bœsch 994d1ee94c checkasm: use perf API on Linux ARM*
On ARM platforms, accessing the PMU registers requires special user
access permissions. Since there is no other way to get accurate timers,
the current implementation of timers in FFmpeg rely on these registers.
Unfortunately, enabling user access to these registers on Linux is not
trivial, and generally involve compiling a random and unreliable github
kernel module, or patching somehow your kernel.

Such module is very unlikely to reach the upstream anytime soon. Quoting
Robin Murphin from ARM:

> Say you do give userspace direct access to the PMU; now run two or more
> programs at once that believe they can use the counters for their own
> "minimal-overhead" profiling. Have fun interpreting those results...
>
> And that's not even getting into the implications of scheduling across
> different CPUs, CPUidle, etc. where the PMU state is completely beyond
> userspace's control. In general, the plan to provide userspace with
> something which might happen to just about work in a few corner cases,
> but is meaningless, misleading or downright broken in all others, is to
> never do so.

As a result, the alternative is to use the Performance Monitoring Linux
API which makes use of these registers internally (assuming the PMU of
your ARM board is supported in the kernel, which is definitely not a
given...).

While the Linux API is obviously cross platform, it does have a
significant overhead which needs to be taken into account. As a result,
that mode is only weakly enabled on ARM platforms exclusively.

Note on the non flexibility of the implementation: the timers (native
FFmpeg vs Linux API) are selected at compilation time to prevent the
need of function calls, which would result in a negative impact on the
cycle counters.
2026-04-20 19:37:33 +08:00
Tobias Rapp 39b8c506be fate: add test for asetnsamples filter with padding disabled
Adds another test for asetnsamples filter where padding of the last
frame is switched off. Renames the existing test to make the difference
obvious.

Tested-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Tobias Rapp <t.rapp@noa-archive.com>
2026-04-20 19:37:32 +08:00
Tobias Rapp 62a9bb3750 ffprobe: use consistent string for unspecified color_range value
Makes the handling of unspecified/unknown color_range values on stream
level consistent to the value used on frame level.

Signed-off-by: Tobias Rapp <t.rapp@noa-archive.com>
2026-04-20 19:37:32 +08:00
James Almer 52be5fc213 fate: fix fate-lavf-fits dependencies
We need the fits muxer/demuxer.
2026-04-20 19:37:31 +08:00
openvela-robot 56294c9719 avfilter/vf_datascope: make it possible for output window to automatically change position
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2026-04-20 19:37:29 +08:00
openvela-robot c727fd9de4 flvdec: Check the avio_seek return value after reading a metadata packet
If the metadata packet is corrupted, flv_read_metabody can accidentally
read past the start of the next packet. If the start of the next packet
had been flushed out of the IO buffer, we would be unable to seek to
the right position (on a nonseekable stream).

Prefer to clearly error out instead of silently trying to read from a
desynced stream which will only be interpreted as garbage.

Signed-off-by: Martin Storsjö <martin@martin.st>
2026-04-20 19:37:26 +08:00
openvela-robot 3111366040 avcodec/diracdec: Fix integer overflow in INTRA_DC_PRED()
Fixes: runtime error: signed integer overflow: 1168175789 + 1168178473 cannot be represented in type 'int'
Fixes: 3081/clusterfuzz-testcase-minimized-4807564879462400
Fixes: 2844/clusterfuzz-testcase-minimized-5561715838156800

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-04-20 19:37:22 +08:00
openvela-robot 64a2fcfaa9 Revert "checkasm: Test more h264 idct variants"
This reverts commit 547db1eaec.

This commit wasn't supposed to be pushed (yet) since it hasn't
been reviewed.

Signed-off-by: Martin Storsjö <martin@martin.st>
2026-04-20 19:37:20 +08:00
openvela-robot 17e8e04310 avcodec/fits: add missing header includes
Fixes checkheaders.

Signed-off-by: James Almer <jamrial@gmail.com>
2026-04-20 19:37:14 +08:00
Martin Storsjö 23116b9212 checkasm: Test more h264 idct variants 2026-04-20 19:37:12 +08:00
Martin Storsjö ada2376abb Revert "fate: Skip the checkasm test if CONFIG_STATIC is disabled"
When we use dllexport properly for shared libraries on windows,
there's no longer any issue with linking the object files for
e.g. libavcodec statically into checkasm. (It's still not possible
to link the built object files for e.g. libavformat statically to
libavcodec though, since libavformat exepcts to load av_export_*
symbols from a DLL.)

This reverts commit 4e62b57ee0.

Signed-off-by: Martin Storsjö <martin@martin.st>
2026-04-20 19:37:12 +08:00
openvela-robot c83c6794f5 msvc: Properly specify dllexport for data symbols shared across dll boundaries
We currently only have exported data symbols within libavcodec, but
the concept is easy to extend to other libraries if necessary.
The attribute declaration needs to be in a private header though,
since we can't use CONFIG_SHARED in public installed headers.

Signed-off-by: Martin Storsjö <martin@martin.st>
2026-04-20 19:37:11 +08:00
Tobias Rapp 8525db6c39 fate: add tests for some video source filters
Adds FATE tests for the previously untested allrgb, allyuv, rgbtestsrc,
smptebars, smptehdbars and yuvtestsrc filters.

Also adds a test for testsrc2 filter with rgb+alpha.

Tested-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Tobias Rapp <t.rapp@noa-archive.com>
2026-04-20 19:37:09 +08:00
James Almer 061e6d9ccb fate/flvenc: set bitexact output format flag explicitly
Using the encoder flags to set the muxer in bitexact mode is deprecated.

Signed-off-by: James Almer <jamrial@gmail.com>
2026-04-20 19:37:09 +08:00
Martin Vignali 5281076f45 fate/pixlet : add test for rgb
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-04-20 19:37:09 +08:00
James Almer 05a53f4465 fate: stop using deprecated filter syntax in hls tests
Signed-off-by: James Almer <jamrial@gmail.com>
2026-04-20 19:37:08 +08:00
James Almer 1d9fa86463 fate: remove usage of deprecated AVCodecContext.me_method in vsynth snow tests
Signed-off-by: James Almer <jamrial@gmail.com>
2026-04-20 19:37:08 +08:00
openvela-robot c5ed9f1ee5 avfilter/vf_libvmaf: fix pre convert to framesync2 bugs
Hi, it fixes the errors while converting to framesync2.
libvmaf was changed recently, double *score variable is removed in the new
version since it's not used anywhere. This patch fixes all the warnings and
segmentation faults.

Signed-off-by: Ashish Singh <ashk43712@gmail.com>
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2026-04-20 19:37:07 +08:00
openvela-robot 51c82b2c0e lavf: make avio_read_partial() public
Main use-case is proxying avio through a foreign I/O layer and a custom
AVIO context, without losing latency and performance characteristics.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2026-04-20 19:37:05 +08:00
Paras Chadha 7c7441a6e2 FATE: Add FITS tests
Signed-off-by: Paras Chadha <paraschadha18@gmail.com>
2026-04-20 19:37:02 +08:00
openvela-robot 8f53bc3adc lavc/vaapi_encode_h265: Enable VBR mode
Follow vaapi_h264 style, enable the VBR mode.

Signed-off-by: Jun Zhao <jun.zhao@intel.com>
Signed-off-by: Mark Thompson <sw@jkqxz.net>
2026-04-20 19:36:59 +08:00
openvela-robot d6b24a2408 swscale: Do not expand a macro with 'defined' in it
Fixes:

    libswscale/utils.c:1632:5: warning: macro expansion producing 'defined' has undefined behavior [-Wexpansion-to-defined]
    #if USE_MMAP
        ^
    libswscale/utils.c:1577:49: note: expanded from macro 'USE_MMAP'
    #define USE_MMAP (HAVE_MMAP && HAVE_MPROTECT && defined MAP_ANONYMOUS)
                                                    ^
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2026-04-20 19:36:57 +08:00
pkviet 82b8aa911c ffmpeg options: Enable trailing ? for map_channel
The -map option allows for a trailing ? so that an error is not thrown if
the input stream does not exist.
This capability is extended to the map_channel option.
This allows a ffmpeg command not to break if an input channel does not
exist, which can be of use (for instance, scripts processing audio
channels with sources having unset number of audio channels).

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-04-20 19:36:52 +08:00
openvela-robot 4af5536f55 avfilter/af_agate: switch to activate
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2026-04-20 19:36:50 +08:00
openvela-robot c0df136248 configure: Include d3d11va_extralibs in libavutil
This fixes shared WinRT/UWP builds with d3d11va enabled.

Signed-off-by: Martin Storsjö <martin@martin.st>
2026-04-20 19:36:48 +08:00
James Almer 1cd2350cab checkasm/vf_blend: rename addition128 and difference128 to grainmerge and grainextract
This was missing from f8d0689d3f.
Fixes checkasm.
2026-04-20 19:36:45 +08:00
Alex Converse 54cb9dc577 fate: add test vector aac-al04sf_48 2026-04-20 19:36:45 +08:00
Dale Curtis 28bcf3c1de avformat/mov: Fix trampling of ctts during seeks when sidx support is enabled.
When sidx box support is enabled, the code will skip reading all
trun boxes (each containing ctts entries for samples inthat box).

If seeks are attempted before all ctts values are known, the old
code would dump ctts entries into the wrong location. These are
then used to compute pts values which leads to out of order and
incorrectly timestamped packets.

This patch fixes ctts processing by always using the index returned
by av_add_index_entry() as the ctts_data index. When the index gains
new entries old values are reshuffled as appropriate.

This approach makes sense since the mov demuxer is already relying
on the mapping of AVIndex entries to samples for correct demuxing.

As a result of this all ctts entries are now 1-count. A followup
change will be submitted to remove support for > 1 count entries
which will simplify seeking.

Notes for future improvement:
Probably there are other boxes (stts, stsc, etc) that are impacted
by this issue... this patch only attempts to fix ctts since it
completely breaks packet timestamping.

This patch continues using an array for the ctts data, which is not
the most ideal given the rearrangement that needs to happen (via
memmove as new entries are read in). Ideally AVIndex and the ctts
data would be set-type structures so addition is always worst case
O(lg(n)) instead of the O(n^2) that exists now; this slowdown is
noticeable during seeks.

Signed-off-by: Dale Curtis <dalecurtis@chromium.org>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-04-20 19:36:44 +08:00
openvela-robot 5bfef89719 libavdevice/decklink: configurablity to set max queue size
Signed-off-by: Ravindra Patagar <rpatagar@akamai.com>
Signed-off-by: Marton Balint <cus@passwd.hu>
2026-04-20 19:36:43 +08:00
openvela-robot 8a6966744a yadif: Account for the buffer alignment while processing the frame edges
Avoid out of bound reads.

Bug-Id: 1031
CC: libav-stable@libav.org
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2026-04-20 19:36:41 +08:00
openvela-robot 36baa52d31 lavc/g726: Add a little-endian G.726 encoder.
Fixes ticket #6596.
2026-04-20 19:36:37 +08:00
openvela-robot d82712c491 png: Report more details regarding unsupported pixel formats 2026-04-20 19:36:35 +08:00
openvela-robot 9273b63c15 avfilter/vf_pseudocolor: add support for some subsampled formats 2026-04-20 19:36:32 +08:00
Mark Thompson ea38a87743 mpeg2enc: Don't mark all streams as component video
Since there is no information about the source format, "unspecified"
is the correct value to write here.

All tests using the MPEG-2 encoder are updated, as this changes the
header on all outputs.
2026-04-20 19:36:30 +08:00
openvela-robot e3613e06db lavc: Add mpeg2_metadata bitstream filter 2026-04-20 19:36:29 +08:00
openvela-robot 88e5255639 lavc/vaapi_encode_h264: add "coder" option support
Follow libx264 style to support "coder" option, and set it to
cabac by default.

Signed-off-by: Yi A Wang <yi.a.wang@intel.com>
Signed-off-by: Jun Zhao <jun.zhao@intel.com>
Reviewed-by: Steven Liu <lingjiujianke@gmail.com>
Signed-off-by: Mark Thompson <sw@jkqxz.net>
2026-04-20 19:36:26 +08:00
openvela-robot 4b41db93bc cbs_h2645: Return error if writing fails 2026-04-20 19:36:23 +08:00
openvela-robot 66eb88b55e Add macros to x86util.asm .
Improved version of VBROADCASTSS that works like the avx2 instruction.
Emulation of vpbroadcastd.
Horizontal sum HSUMPS that places the result in all elements.
Emulation of blendvps and pblendvb.

Signed-off-by: Ivan Kalvachev <ikalvachev@gmail.com>
2026-04-20 19:36:19 +08:00
openvela-robot 525be6b180 h264dec: use a large enough field for reference list modification values
pic_num can be at most 17-bit, so uint8_t is not sufficient.

Found-By: Bradley Sepos <bradley@bradleysepos.com>
CC: libav-stable@libav.org
2026-04-20 19:36:17 +08:00
Marton Balint b72c13efe3 fate: add overlay filter tests with alpha
Signed-off-by: Marton Balint <cus@passwd.hu>
2026-04-20 19:36:14 +08:00
Paul B Mahol 9f425462f5 avfilter/vf_weave: fix top vs bottom field order
Fixes #6590.
2026-04-20 19:36:14 +08:00
Vittorio Giovara 444a55a553 Add single precision planar RGB pixel formats
Add a pixel format flag to identify this family.

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2026-04-20 19:36:13 +08:00
openvela-robot 773a310335 avfilter/scale_npp: fix passthrough mode
Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
2026-04-20 19:36:12 +08:00
openvela-robot 6b584e3d38 lavc: Add coded bitstream read/write API 2026-04-20 19:36:08 +08:00
openvela-robot 1c91b8efaf h264: Add support for alternative transfer characterics SEI
The use of this SEI is for backward compatibility in HLG HDR systems:
older devices that cannot interpret the "arib-std-b67" transfer will
get the compatible transfer (usually bt709 or bt2020) from the VUI,
while newer devices that can interpret HDR will read the SEI and use
its value instead.

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2026-04-20 19:36:05 +08:00
openvela-robot 54e1d567ee h264: Add support for alternative transfer characterics SEI
The use of this SEI is for backward compatibility in HLG HDR systems:
older devices that cannot interpret the "arib-std-b67" transfer will
get the compatible transfer (usually bt709 or bt2020) from the VUI,
while newer devices that can interpret HDR will read the SEI and use
its value instead.

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2026-04-20 19:36:02 +08:00
Sasi Inguva 7bc06e2f92 lavf/movenc.c: Set sgpd and sbgp atoms to represent decoder delay for AAC.
According to https://developer.apple.com/library/content/documentation/QuickTime/QTFF/QTFFAppenG/QTFFAppenG.html and ISO-IEC-14496-12 Section 10.1.1.1 and 10.1.1.3

Signed-off-by: Sasi Inguva <isasi@google.com>
Reviewed-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-04-20 19:35:59 +08:00
Michael Niedermayer 32ad8607b1 avcodec/dvenc: Change quantizer dead zone default to 7
This improves the quality and reduces the "blocking" in flat areas

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-04-20 19:35:59 +08:00