[FFmpeg-devel] [PATCH v8 13/18] swscale/ops_backend: add reference backend basend on C templates

Andreas Rheinhardt andreas.rheinhardt at outlook.com
Sun Jul 13 23:14:44 EEST 2025


Niklas Haas:
> From: Niklas Haas <git at haasn.dev>
> 
> This will serve as a reference for the SIMD backends to come. That said,
> with auto-vectorization enabled, the performance of this is not atrocious.
> It easily beats the old C code and sometimes even the old SIMD.
> 
> In theory, we can dramatically speed it up by using GCC vectors instead of
> arrays, but the performance gains from this are too dependent on exact GCC
> versions and flags, so it practice it's not a substitute for a SIMD
> implementation.
> ---
> diff --git a/libswscale/ops.c b/libswscale/ops.c
> index c4f03531eb..2d8f9e6084 100644
> --- a/libswscale/ops.c
> +++ b/libswscale/ops.c
> @@ -27,7 +27,10 @@
>  #include "ops.h"
>  #include "ops_internal.h"
>  
> +extern SwsOpBackend backend_c;

Why are this and the other backends not const?

> +
>  const SwsOpBackend * const ff_sws_op_backends[] = {
> +    &backend_c,
>      NULL
>  };
>  


More information about the ffmpeg-devel mailing list