[FFmpeg-devel] [PATCH v2 3/3] avfilter/vf_colordetect: add x86 SIMD implementation

Niklas Haas ffmpeg at haasn.xyz
Thu Jul 17 12:37:55 EEST 2025


On Wed, 16 Jul 2025 22:06:28 +0200 Henrik Gramner via ffmpeg-devel <ffmpeg-devel at ffmpeg.org> wrote:
> On Wed, Jul 16, 2025 at 6:26 PM Niklas Haas <ffmpeg at haasn.xyz> wrote:
> > +cglobal detect_range%1, 6, 7, 5, data, stride, width, height, mpeg_min, mpeg_max, x
> > +    movd xm0, mpeg_mind
> > +    movd xm1, mpeg_maxd
> > +    vpbroadcast%1 m0, xm0
> > +    vpbroadcast%1 m1, xm1
>
> You could perhaps also do something like the following to shave off a
> few instructions:
>
> cglobal detect_range%1, 4, 7, 5, data, stride, width, height,
> mpeg_min, mpeg_max, x
> %if UNIX64 && notcpuflag(avx512)
>     movd xm0, mpeg_mind
>     movd xm1, mpeg_maxd
>     vpbroadcast%1 m0, xm0
>     vpbroadcast%1 m1, xm1
> %else
>     vpbroadcast%1 m0, mpeg_minm
>     vpbroadcast%1 m0, mpeg_maxm
> %endif

Broadcasting directly from an address works on AVX2 as well, no? Why the
conditional here?

> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request at ffmpeg.org with subject "unsubscribe".


More information about the ffmpeg-devel mailing list