Commit 815526b2e5 for ffmpeg

commit 815526b2e5d39d86162da6f89ce8d519f84e3591
Author: Kacper Michajłow <kasper93@gmail.com>
Date:   Mon Oct 26 07:27:06 2026 +0100

    avcodec/ppc/blockdsp: move the AltiVec clear_block to its own file

    The dcbz functions and the init run on every CPU. Move the AltiVec
    clear_block to blockdsp_altivec.c, like libavutil/ppc/float_dsp, so
    blockdsp.c holds no AltiVec code and can be built without the AltiVec
    flags.

    Signed-off-by: Kacper Michajłow <kasper93@gmail.com>

diff --git a/libavcodec/ppc/Makefile b/libavcodec/ppc/Makefile
index 06df54089a..1970bd4942 100644
--- a/libavcodec/ppc/Makefile
+++ b/libavcodec/ppc/Makefile
@@ -24,3 +24,7 @@ OBJS-$(CONFIG_MPEG4_DECODER)           += ppc/mpeg4videodsp.o
 OBJS-$(CONFIG_SVQ1_ENCODER)            += ppc/svq1enc_altivec.o
 OBJS-$(CONFIG_VORBIS_DECODER)          += ppc/vorbisdsp_altivec.o
 OBJS-$(CONFIG_VP7_DECODER)             += ppc/vp8dsp_altivec.o
+
+# AltiVec optimizations
+# subsystems
+ALTIVEC-OBJS-$(CONFIG_BLOCKDSP)        += ppc/blockdsp_altivec.o
diff --git a/libavcodec/ppc/blockdsp.c b/libavcodec/ppc/blockdsp.c
index d89b77e088..917690995b 100644
--- a/libavcodec/ppc/blockdsp.c
+++ b/libavcodec/ppc/blockdsp.c
@@ -28,9 +28,9 @@
 #include "libavutil/cpu.h"
 #include "libavutil/mem.h"
 #include "libavutil/ppc/cpu.h"
-#include "libavutil/ppc/util_altivec.h"

 #include "libavcodec/blockdsp.h"
+#include "blockdsp_altivec.h"

 /* ***** WARNING ***** WARNING ***** WARNING ***** */
 /*
@@ -127,21 +127,6 @@ static long check_dcbzl_effect(void)
     return count;
 }

-#if HAVE_ALTIVEC
-static void clear_block_altivec(int16_t *block)
-{
-    LOAD_ZERO;
-    vec_st(zero_s16v,   0, block);
-    vec_st(zero_s16v,  16, block);
-    vec_st(zero_s16v,  32, block);
-    vec_st(zero_s16v,  48, block);
-    vec_st(zero_s16v,  64, block);
-    vec_st(zero_s16v,  80, block);
-    vec_st(zero_s16v,  96, block);
-    vec_st(zero_s16v, 112, block);
-}
-#endif /* HAVE_ALTIVEC */
-
 av_cold void ff_blockdsp_init_ppc(BlockDSPContext *c)
 {
     // common optimizations whether AltiVec is available or not
@@ -160,6 +145,6 @@ av_cold void ff_blockdsp_init_ppc(BlockDSPContext *c)
     if (!PPC_ALTIVEC(av_get_cpu_flags()))
         return;

-    c->clear_block = clear_block_altivec;
+    c->clear_block = ff_clear_block_altivec;
 #endif /* HAVE_ALTIVEC */
 }
diff --git a/libavcodec/ppc/blockdsp_altivec.c b/libavcodec/ppc/blockdsp_altivec.c
new file mode 100644
index 0000000000..34531da975
--- /dev/null
+++ b/libavcodec/ppc/blockdsp_altivec.c
@@ -0,0 +1,38 @@
+/*
+ * Copyright (c) 2002 Brian Foley
+ * Copyright (c) 2002 Dieter Shirley
+ * Copyright (c) 2003-2004 Romain Dolbeau <romain@dolbeau.org>
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include "libavutil/ppc/util_altivec.h"
+
+#include "blockdsp_altivec.h"
+
+void ff_clear_block_altivec(int16_t *block)
+{
+    LOAD_ZERO;
+    vec_st(zero_s16v,   0, block);
+    vec_st(zero_s16v,  16, block);
+    vec_st(zero_s16v,  32, block);
+    vec_st(zero_s16v,  48, block);
+    vec_st(zero_s16v,  64, block);
+    vec_st(zero_s16v,  80, block);
+    vec_st(zero_s16v,  96, block);
+    vec_st(zero_s16v, 112, block);
+}
diff --git a/libavcodec/ppc/blockdsp_altivec.h b/libavcodec/ppc/blockdsp_altivec.h
new file mode 100644
index 0000000000..47f64c2054
--- /dev/null
+++ b/libavcodec/ppc/blockdsp_altivec.h
@@ -0,0 +1,26 @@
+/*
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef AVCODEC_PPC_BLOCKDSP_ALTIVEC_H
+#define AVCODEC_PPC_BLOCKDSP_ALTIVEC_H
+
+#include <stdint.h>
+
+void ff_clear_block_altivec(int16_t *block);
+
+#endif /* AVCODEC_PPC_BLOCKDSP_ALTIVEC_H */