Commit Graph

12120 Commits

Author SHA1 Message Date
Zhao Zhili
eb14d45824 avfilter/vf_colordetect: add aarch64 asm
| rpi5 gcc 12  | m1 clang -fno-vectorize | m1 clang
---------------------------------------------------------------------------
alpha_8_full_c:        | 32159.2 ( 1.00x) | 135.8 ( 1.00x) |  26.4 ( 1.00x)
alpha_8_full_neon:     |  1266.0 (25.40x) |   8.0 (17.03x) |   8.4 ( 3.15x)
alpha_8_limited_c:     | 37561.9 ( 1.00x) | 169.1 ( 1.00x) |  47.7 ( 1.00x)
alpha_8_limited_neon:  |  3967.0 ( 9.47x) |  12.5 (13.53x) |  13.3 ( 3.59x)
alpha_16_full_c:       | 15867.9 ( 1.00x) |  64.5 ( 1.00x) |  13.7 ( 1.00x)
alpha_16_full_neon:    |  1256.9 (12.62x) |   7.9 ( 8.15x) |   8.3 ( 1.64x)
alpha_16_limited_c:    | 16723.7 ( 1.00x) |  88.7 ( 1.00x) | 103.3 ( 1.00x)
alpha_16_limited_neon: |  4031.3 ( 4.15x) |  12.5 ( 7.08x) |  13.2 ( 7.86x)
range_8_c:             | 21819.7 ( 1.00x) | 120.0 ( 1.00x) |   9.4 ( 1.00x)
range_8_neon:          |  1148.3 (19.00x) |   4.3 (27.60x) |   4.8 ( 1.97x)
range_16_c:            | 10757.1 ( 1.00x) |  45.7 ( 1.00x) |   7.9 ( 1.00x)
range_16_neon:         |  1141.5 ( 9.42x) |   4.4 (10.38x) |   4.6 ( 1.72x)
2025-09-01 15:35:16 +00:00
Niklas Haas
f07c12d806 avfilter/x86/vf_colordetect: fix alpha detect tail handling
This wrapping logic still considered any nonzero return from the ASM function
to be the overall result, but this is not true since the addition of
FF_ALPHA_TRANSPARENT.

Fix it by only early returning if FF_ALPHA_STRAIGHT is detected.

Fixes: 9b8b78a815
See-Also: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/20301#issuecomment-4802
2025-09-01 15:33:43 +00:00
Vittorio Palmisano
73d411c399 avfilter/af_whisper: fix srt file format
The SRT file format requires commas in the time string, not periods.
2025-08-30 14:30:51 +00:00
James Almer
fa23202cc7 configure: bump LCEVCdec minimum required version to 4.0.0
The project introduced API breaking changes to some of their public functions,
and given the library is relatively new, just bump the minimum supported
version instead of adding ifdeffery to the source files.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-08-25 10:43:23 -03:00
Robert Nagy
1b62f9d3ae avfilter/vf_scale: add more color_matrix aliases
Add more color_matrix aliases to make vf_scale consistent with e.g. vf_setparams aliases.
2025-08-25 08:12:37 +00:00
Niklas Haas
6825f6f1e2 avfilter/vf_libplacebo: add bwdif option
See-Also: https://code.videolan.org/videolan/libplacebo/-/merge_requests/737
2025-08-21 15:34:03 +00:00
Niklas Haas
8e0de5d811 avfilter/setpts: also preserve duration when not stripping fps
It makes sense to treat the presence of a frame duration and the presence
of frame rate metadata identically - because both convey effectively the same
amount of information.

In f121d95 and fa110c3 respectively, this information was stripped by default,
originally to work-around bugs when changing the PTS information of a stream
being fed to some encoders. (See https://trac.ffmpeg.org/ticket/10886)

Later, commit 959b799c restored the ability to preserve the frame rate
medatata via the `strip_fps` option, but this option did not extend to also
include the frame duration.

This commit resolves the scenario by making `frame_rate` and `duration`
handled in a consistent manner, so that the frame rate information is
generally preserved unless explicitly stripped by the user.

While it does regress the exact invocation presented in the trac ticket unless
using `strip_fps=yes`, I consider this an acceptable trade-off, especially in
light of the fact that the `fps` filter also exists and is arguably the better
tool for the task at hand.
2025-08-21 14:55:12 +02:00
Zhao Zhili
2796ce20d9 avfilter/vf_colordetect: Reorder to avoid null pointer check
Follow the general practice to assign the C implementation to DSP,
then the SIMD-optimized version.
2025-08-21 11:01:35 +08:00
Lynne
451e6bed43 lavfi/bwdif_vulkan: fix typo in temp_diff assignment
Thanks to Niklas Haas for pointing this out.
2025-08-20 22:06:21 +09:00
Niklas Haas
9b8b78a815 avfilter/vf_colordetect: detect fully opaque alpha planes
It can be useful to know if the alpha plane consists of fully opaque
pixels or not, in which case it can e.g. safely be stripped.

This only requires a very minor modification to the AVX2 routines, adding
an extra AND on the read alpha value with the reference alpha value, and a
single extra cheap test per line.

detect_alpha_8_full_c:                                2849.1 ( 1.00x)
detect_alpha_8_full_avx2:                              260.3 (10.95x)
detect_alpha_8_full_avx512icl:                         130.2 (21.87x)
detect_alpha_8_limited_c:                             8349.2 ( 1.00x)
detect_alpha_8_limited_avx2:                           756.6 (11.04x)
detect_alpha_8_limited_avx512icl:                      364.2 (22.93x)
detect_alpha_16_full_c:                               1652.8 ( 1.00x)
detect_alpha_16_full_avx2:                             236.5 ( 6.99x)
detect_alpha_16_full_avx512icl:                        134.6 (12.28x)
detect_alpha_16_limited_c:                            5263.1 ( 1.00x)
detect_alpha_16_limited_avx2:                          797.4 ( 6.60x)
detect_alpha_16_limited_avx512icl:                     400.3 (13.15x)
2025-08-18 18:50:00 +00:00
Niklas Haas
ae3c5ac2c1 avfilter/vf_colordetect: remove extra safety margin on premul check
This safety margin was motivated by the fact that vf_premultiply sometimes
produces such illegally high values, but this has since been fixed by
603334a043, so there's no more reason to have this safety margin, at
least for our own code. (Of course, other sources may also produce such
broken files, but we shouldn't work around that - garbage in, garbage out.)

See-Also: 603334a043
2025-08-18 18:50:00 +00:00
Niklas Haas
c96ccd78fc avfilter/vf_colordetect: rename p, q, k variables for clarity
Purely cosmetic.

Motivated in part because I want to depend on the assumption that P
represents the maximum alpha channel value.
2025-08-18 18:50:00 +00:00
Niklas Haas
34ad857d2b avfilter/vf_colordetect: slightly change detect_alpha() signature
Basically cosmetic.

I want to expand this to detect more than a single property about the alpha
channel at the same time; so we first need a way for this function to
return a more complex result.

Move the enum AlphaMode to the header and formally generalize the return
signature a bit to allow returning more than just one value.
2025-08-18 18:50:00 +00:00
Gyan Doshi
7df9271272 avfilter/whisper: correct option formatting 2025-08-17 00:58:03 +00:00
Zhao Zhili
1d06e8ddcd avfilter/af_whisper: fix broken output for multibyte character
text + 1 can break a multibyte character, e.g., Chinese in UTF-8.
There is no space at the beginning in this case.
2025-08-16 13:58:14 +00:00
Jiasheng Jiang
b8d5f65b9e libavfilter/dnn/dnn_backend_tf: Remove redundant av_freep() to avoid double free
Remove redundant av_freep() to avoid double free since task will be freed in dnn_free_model_tf() after the success of ff_queue_push_back().

Fixes: af052f9066 ("lavfi/dnn: fix mem leak in TF backend error handle")
Signed-off-by: Jiasheng Jiang <jiashengjiangcool@gmail.com>
2025-08-13 19:50:26 +08:00
Niklas Haas
5929d46f7b avfilter/vf_vignette: use AVFilterContext for logging 2025-08-12 09:01:39 +00:00
Niklas Haas
ec3c9ecaa7 avfilter/vf_tonemap: use AVFilterContext for logging 2025-08-12 09:01:39 +00:00
Niklas Haas
a75f673713 avfilter/vf_selectivecolor: use AVFilterContext for logging 2025-08-12 09:01:39 +00:00
Niklas Haas
2cdf4f08b4 avfilter/vf_scdet_vulkan: use AVFilterContext for logging 2025-08-12 09:01:39 +00:00
Niklas Haas
7751f261de avfilter/vf_scdet: use AVFilterContext for logging 2025-08-12 09:01:39 +00:00
Niklas Haas
dee56511b0 avfilter/vf_scale_vulkan: use AVFilterContext for logging 2025-08-12 09:01:39 +00:00
Niklas Haas
bd59c6651b avfilter/vf_photosensitivity: use AVFilterContext for logging 2025-08-12 09:01:39 +00:00
Niklas Haas
663a37f7f9 avfilter/vf_libvmaf: use AVFilterContext for logging 2025-08-12 09:01:39 +00:00
Niklas Haas
a45113c28a avfilter/vf_libplacebo: use AVFilterContext for logging 2025-08-12 09:01:39 +00:00
Niklas Haas
ea72804295 avfilter/vf_gblur_vulkan: use AVFilterContext for logging 2025-08-12 09:01:39 +00:00
Niklas Haas
d1d64c804e avfilter/vf_freezedetect: use AVFilterContext for logging 2025-08-12 09:01:39 +00:00
Niklas Haas
d276875c90 avfilter/vf_drawtext: use AVFilterContext for logging 2025-08-12 09:01:39 +00:00
Niklas Haas
029f501a95 avfilter/vf_drawbox: use AVFilterContext for logging 2025-08-12 09:01:39 +00:00
Niklas Haas
86387038f8 avfilter/vf_delogo: use AVFilterContext for logging 2025-08-12 09:01:39 +00:00
Niklas Haas
b02d6fc556 avfilter/vf_dctdnoiz: use AVFilterContext for logging 2025-08-12 09:01:39 +00:00
Niklas Haas
d84a21a023 avfilter/vf_curves: use AVFilterContext for logging 2025-08-12 09:01:39 +00:00
Niklas Haas
8c51a8b954 avfilter/vf_blackdetect_vulkan: use AVFilterContext for logging 2025-08-12 09:01:39 +00:00
Niklas Haas
0b7827cd10 avfilter/vf_blackdetect: log with correct filter ID
If we use the private BlackDetectContext for logging, the filter ID does
not get printed alongside the filter name. Using the parent AVFilterContext
makes this consistent with other filters.
2025-08-12 09:01:39 +00:00
Niklas Haas
a47ebee7df avfilter/f_bench: use AVFilterContext for logging 2025-08-12 09:01:39 +00:00
Niklas Haas
0913576225 avfilter/avf_aphasemeter: use AVFilterContext for logging 2025-08-12 09:01:39 +00:00
Niklas Haas
96f860853e avfilter/asrc_sine: use AVFilterContext for logging 2025-08-12 09:01:39 +00:00
Niklas Haas
dcd378ad04 avfilter/asrc_sinc: use AVFilterContext for logging 2025-08-12 09:01:39 +00:00
Niklas Haas
d360c212af avfilter/asrc_hilbert: use AVFilterContext for logging 2025-08-12 09:01:39 +00:00
Niklas Haas
2e8d3548e1 avfilter/asrc_afirsrc: use AVFilterContext for logging 2025-08-12 09:01:39 +00:00
Niklas Haas
4cc71fb806 avfilter/af_silencedetect: use AVFilterContext for logging 2025-08-12 09:01:39 +00:00
Niklas Haas
892c439525 avfilter/af_lv2: use AVFilterContext when logging 2025-08-12 09:01:39 +00:00
Niklas Haas
fb8f52d66c avfilter/af_afftdn: use AVFilterContext for logging 2025-08-12 09:01:39 +00:00
Niklas Haas
f610b55525 avfilter/vf_libplacebo: fix possible segfault when frame mixing
pl_frame_mix_current() will return NULL if all frames are in the future,
but when libplacebo is using a frame mixer with a radius greater than 1,
future frames are expected to already be partially renderered. Instead, use
pl_frame_mix_nearest(), which is guaranteed to give us a valid frame for any
nonempty frame mix.

Fixes: 3091bca3ed
2025-08-11 21:21:55 +00:00
Kacper Michajłow
1a1377c53d avfilter/stack_internal: fix checkheaders test
Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
2025-08-11 19:29:53 +00:00
Kacper Michajłow
a6380c35d6 avfilter/vf_blackdetect: add missing config.h include
For ARCH_X86.

Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
2025-08-11 19:29:53 +00:00
Kacper Michajłow
e6635ada64 avfilter/vf_colordetect: optimize C functions a bit
They are used to process tail, so it's still good to have them faster.
Even if AVX version are used.

GCC 14.2.0 | x86_64 (default config) | Before:

detect_alpha_8_full_c:                                3803.0 ( 1.00x)
detect_alpha_8_full_avx2:                              166.4 (22.86x)
detect_alpha_8_full_avx512icl:                         144.2 (26.37x)
detect_alpha_8_limited_c:                            10454.4 ( 1.00x)
detect_alpha_8_limited_avx2:                           616.5 (16.96x)
detect_alpha_8_limited_avx512icl:                      509.4 (20.52x)
detect_alpha_16_full_c:                               1903.0 ( 1.00x)
detect_alpha_16_full_avx2:                             172.4 (11.04x)
detect_alpha_16_full_avx512icl:                        163.4 (11.65x)
detect_alpha_16_limited_c:                            3703.6 ( 1.00x)
detect_alpha_16_limited_avx2:                          644.4 ( 5.75x)
detect_alpha_16_limited_avx512icl:                     558.0 ( 6.64x)
detect_range_8_c:                                     5855.9 ( 1.00x)
detect_range_8_avx2:                                   150.4 (38.94x)
detect_range_8_avx512icl:                              146.7 (39.91x)
detect_range_16_c:                                    2702.2 ( 1.00x)
detect_range_16_avx2:                                  256.7 (10.53x)
detect_range_16_avx512icl:                             116.8 (23.13x)

GCC 14.2.0 | x86_64 (default config) | After:

detect_alpha_8_full_c:                                 376.3 ( 1.00x)
detect_alpha_8_full_avx2:                              169.2 ( 2.22x)
detect_alpha_8_full_avx512icl:                         134.6 ( 2.80x)
detect_alpha_8_limited_c:                             6024.1 ( 1.00x)
detect_alpha_8_limited_avx2:                           641.8 ( 9.39x)
detect_alpha_8_limited_avx512icl:                      493.0 (12.22x)
detect_alpha_16_full_c:                                436.4 ( 1.00x)
detect_alpha_16_full_avx2:                             156.3 ( 2.79x)
detect_alpha_16_full_avx512icl:                        151.8 ( 2.87x)
detect_alpha_16_limited_c:                            3679.9 ( 1.00x)
detect_alpha_16_limited_avx2:                          642.0 ( 5.73x)
detect_alpha_16_limited_avx512icl:                     555.2 ( 6.63x)
detect_range_8_c:                                      655.2 ( 1.00x)
detect_range_8_avx2:                                   153.9 ( 4.26x)
detect_range_8_avx512icl:                              147.4 ( 4.45x)
detect_range_16_c:                                     743.3 ( 1.00x)
detect_range_16_avx2:                                  258.6 ( 2.87x)
detect_range_16_avx512icl:                             107.7 ( 6.90x)

Clang 19.1.7 | x86_64 (default config) | Before:

detect_alpha_8_full_c:                                7013.4 ( 1.00x)
detect_alpha_8_full_avx2:                              141.8 (49.46x)
detect_alpha_8_full_avx512icl:                         133.8 (52.40x)
detect_alpha_8_limited_c:                             7038.8 ( 1.00x)
detect_alpha_8_limited_avx2:                           605.0 (11.63x)
detect_alpha_8_limited_avx512icl:                      506.5 (13.90x)
detect_alpha_16_full_c:                               1799.5 ( 1.00x)
detect_alpha_16_full_avx2:                             143.0 (12.59x)
detect_alpha_16_full_avx512icl:                        127.5 (14.12x)
detect_alpha_16_limited_c:                            3499.6 ( 1.00x)
detect_alpha_16_limited_avx2:                          633.6 ( 5.52x)
detect_alpha_16_limited_avx512icl:                     551.9 ( 6.34x)
detect_range_8_c:                                     5253.6 ( 1.00x)
detect_range_8_avx2:                                   125.0 (42.01x)
detect_range_8_avx512icl:                              123.2 (42.65x)
detect_range_16_c:                                    3055.2 ( 1.00x)
detect_range_16_avx2:                                  230.0 (13.28x)
detect_range_16_avx512icl:                              95.9 (31.86x)

Clang 19.1.7 | x86_64 (default config) | After:

detect_alpha_8_full_c:                                 323.3 ( 1.00x)
detect_alpha_8_full_avx2:                              149.7 ( 2.16x)
detect_alpha_8_full_avx512icl:                         127.7 ( 2.53x)
detect_alpha_8_limited_c:                             5075.9 ( 1.00x)
detect_alpha_8_limited_avx2:                           625.4 ( 8.12x)
detect_alpha_8_limited_avx512icl:                      493.0 (10.30x)
detect_alpha_16_full_c:                                421.0 ( 1.00x)
detect_alpha_16_full_avx2:                             238.8 ( 1.76x)
detect_alpha_16_full_avx512icl:                        126.0 ( 3.34x)
detect_alpha_16_limited_c:                            3516.8 ( 1.00x)
detect_alpha_16_limited_avx2:                          624.7 ( 5.63x)
detect_alpha_16_limited_avx512icl:                     544.7 ( 6.46x)
detect_range_8_c:                                      609.1 ( 1.00x)
detect_range_8_avx2:                                   239.4 ( 2.54x)
detect_range_8_avx512icl:                               89.0 ( 6.84x)
detect_range_16_c:                                     463.9 ( 1.00x)
detect_range_16_avx2:                                  127.4 ( 3.64x)
detect_range_16_avx512icl:                              86.4 ( 5.37x)

Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
2025-08-11 17:39:23 +00:00
Michael Niedermayer
638b521c7b Bump versions for master after release/8.0
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-08-09 18:03:05 +02:00
Michael Niedermayer
7eaa0f799a Bump versions for release/8.0
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-08-09 17:30:39 +02:00
Vittorio Palmisano
13ce36fef9 libavfilter: Whisper audio filter
It adds a new audio filter for running audio transcriptions with the whisper model.
Documentation and examples are included into the patch.
2025-08-08 21:59:56 +02:00