[FFmpeg-devel] [PATCH] avfilter/vf_blackdetect: add AVX2 SIMD version

Niklas Haas ffmpeg at haasn.xyz
Wed Jul 16 11:19:36 EEST 2025


On Thu, 10 Jul 2025 17:10:42 +0200 Niklas Haas <ffmpeg at haasn.xyz> wrote:
> From: Niklas Haas <git at haasn.dev>
>
> Requested by a user. Even with autovectorization enabled, the compiler
> performs a quite poor job of optimizing this function, due to not being
> able to take advantage of the pmaxub + pcmpeqb trick for counting the number
> of pixels less than or equal-to a threshold.
>
> blackdetect8_c:                                       4627.2 ( 1.00x)
> blackdetect8_avx2:                                     163.9 (28.24x)
> blackdetect16_c:                                      2474.9 ( 1.00x)
> blackdetect16_avx2:                                    155.9 (15.88x)

Merging soon.


More information about the ffmpeg-devel mailing list