Commit 47ff145f60 for ffmpeg

commit 47ff145f60959f3bed336ef2763916fb45db8d5a
Author: Niklas Haas <git@haasn.dev>
Date:   Thu Oct 29 12:45:22 2026 +0100

    swscale: compile ops code unconditionally

    The ops backends remain disabled by default at runtime, and are only
    auto-selected with SWS_UNSTABLE (or explicitly via the backends option).

    The SPIR-V backend still depends on CONFIG_UNSTABLE.

    The main motivating reason here is the fact that the test framework itself
    wants to depend on formats only properly introduced by the new unstable
    ops code. It also means we can start preferring the ops path for format
    conversions that are wholly unsupported otherwise.

    Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
    Signed-off-by: Niklas Haas <git@haasn.dev>

diff --git a/libswscale/Makefile b/libswscale/Makefile
index 86e2666f8e..ddbafd4e6b 100644
--- a/libswscale/Makefile
+++ b/libswscale/Makefile
@@ -28,7 +28,7 @@ OBJS = alphablend.o                                     \
        yuv2rgb.o                                        \
        vscale.o                                         \

-OBJS-$(CONFIG_UNSTABLE) +=                              \
+OBJS +=                                                 \
        ops.o                                            \
        ops_chain.o                                      \
        ops_dispatch.o                                   \
diff --git a/libswscale/aarch64/Makefile b/libswscale/aarch64/Makefile
index 8fdcf000cc..734ad32479 100644
--- a/libswscale/aarch64/Makefile
+++ b/libswscale/aarch64/Makefile
@@ -11,8 +11,8 @@ NEON-OBJS   += aarch64/hscale.o                 \
                aarch64/xyz2rgb_neon.o           \
                aarch64/yuv2rgb_neon.o           \

-NEON-OBJS-$(CONFIG_UNSTABLE) += aarch64/ops.o
-NEON-OBJS-$(CONFIG_UNSTABLE) += aarch64/ops_neon.gen.o
+NEON-OBJS   += aarch64/ops.o                    \
+               aarch64/ops_neon.gen.o           \

 $(SUBDIR)aarch64/ops_neon.gen.S: $(SUBDIR)aarch64/ops_static$(HOSTEXESUF)
 	$(M)$< > $@.tmp
diff --git a/libswscale/format.c b/libswscale/format.c
index f0a2670a96..fbe2d813f9 100644
--- a/libswscale/format.c
+++ b/libswscale/format.c
@@ -21,6 +21,7 @@
 #include "libavutil/attributes.h"
 #include "libavutil/avassert.h"
 #include "libavutil/hdr_dynamic_metadata.h"
+#include "libavutil/hwcontext.h"
 #include "libavutil/mastering_display_metadata.h"
 #include "libavutil/refstruct.h"

@@ -29,10 +30,6 @@
 #include "ops_internal.h"
 #include "config_components.h"

-#if CONFIG_UNSTABLE
-#include "libavutil/hwcontext.h"
-#endif
-
 #define RET(x)                                                                 \
     do {                                                                       \
         int _ret = (x);                                                        \
@@ -350,7 +347,6 @@ SwsFormat ff_fmt_from_frame(const AVFrame *frame, int field)
     enum AVPixelFormat format = frame->format;
     enum AVPixelFormat hw_format = AV_PIX_FMT_NONE;

-#if CONFIG_UNSTABLE
     const AVPixFmtDescriptor *hw_desc = av_pix_fmt_desc_get(frame->format);
     av_assert0(hw_desc);

@@ -361,7 +357,6 @@ SwsFormat ff_fmt_from_frame(const AVFrame *frame, int field)
         hw_format = frame->format;
         format = hwfc->sw_format;
     }
-#endif

     const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(format);

@@ -743,8 +738,6 @@ void ff_sws_frame_from_avframe(SwsFrame *dst, const AVFrame *src)
     }
 }

-#if CONFIG_UNSTABLE
-
 /**
  * Returns the underlying descriptor for fake formats like PAL8 whose
  * descriptors alone do not fully describe the pixel data.
@@ -1851,12 +1844,3 @@ fail:
     ff_sws_op_list_free(&ops);
     return ret;
 }
-
-#else /* !CONFIG_UNSTABLE */
-
-static int test_format_ops(enum AVPixelFormat format, int output)
-{
-    return 0;
-}
-
-#endif
diff --git a/libswscale/graph.c b/libswscale/graph.c
index e9ee32052a..f4ae0f5871 100644
--- a/libswscale/graph.c
+++ b/libswscale/graph.c
@@ -698,7 +698,6 @@ static int add_ops_convert_pass(SwsGraph *graph, const SwsFormat *src,
                                 const SwsFormat *dst, const SwsLut3D *lut3d,
                                 SwsPass *input, SwsPass **output)
 {
-#if CONFIG_UNSTABLE
     SwsContext *ctx = graph->ctx;

     /* Preemptively skip the ops list generation if the backend was
@@ -723,9 +722,6 @@ static int add_ops_convert_pass(SwsGraph *graph, const SwsFormat *src,

     const int flags = SWS_OP_FLAG_OPTIMIZE | SWS_OP_FLAG_SPLIT_MEMCPY;
     return ff_sws_compile_pass(graph, NULL, &ops, flags, input, output);
-#else
-    return AVERROR(ENOTSUP);
-#endif
 }

 static bool prefer_ops_backend(SwsContext *ctx, const SwsFormat *src, const SwsFormat *dst)
diff --git a/libswscale/x86/Makefile b/libswscale/x86/Makefile
index 552eea5cb5..89b1bea091 100644
--- a/libswscale/x86/Makefile
+++ b/libswscale/x86/Makefile
@@ -20,7 +20,7 @@ X86ASM-OBJS                     += x86/input.o                          \
                                    x86/yuv2yuvX.o                       \

 ifdef ARCH_X86_64
-X86ASM-OBJS-$(CONFIG_UNSTABLE)  += x86/ops_common.o                     \
+X86ASM-OBJS                     += x86/ops_common.o                     \
                                    x86/ops_int.o                        \
                                    x86/ops_float.o                      \
                                    x86/ops.o