Commit c1bb7d83a7 for ffmpeg

commit c1bb7d83a7f15e7b0c3eec698177d858ef9d1bce
Author: Kacper Michajłow <kasper93@gmail.com>
Date:   Mon Oct 26 14:36:12 2026 +0100

    avcodec/ppc: check the CPU flags outside the AltiVec files

    The ff_*_init_ppc() functions run on every CPU to check whether AltiVec
    is available, so they must not be built with the AltiVec flags that the
    code next to them needs. Move each of them to an *_init.c file without
    AltiVec code, which calls an init function in the AltiVec file after
    the check, like the ARM code does for NEON. The fdctdsp one assigns the
    exported ff_fdct_altivec() directly.

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

diff --git a/libavcodec/ppc/Makefile b/libavcodec/ppc/Makefile
index e4e78e9117..2cbd060eb1 100644
--- a/libavcodec/ppc/Makefile
+++ b/libavcodec/ppc/Makefile
@@ -1,29 +1,29 @@
 # subsystems
-OBJS-$(CONFIG_AUDIODSP)                += ppc/audiodsp_altivec.o
+OBJS-$(CONFIG_AUDIODSP)                += ppc/audiodsp_init.o ppc/audiodsp_altivec.o
 OBJS-$(CONFIG_BLOCKDSP)                += ppc/blockdsp.o
-OBJS-$(CONFIG_FDCTDSP)                 += ppc/fdctdsp_altivec.o
-OBJS-$(CONFIG_H264CHROMA)              += ppc/h264chroma_altivec.o
-OBJS-$(CONFIG_H264DSP)                 += ppc/h264dsp_altivec.o ppc/hpeldsp_altivec.o
-OBJS-$(CONFIG_H264QPEL)                += ppc/h264qpel_altivec.o
-OBJS-$(CONFIG_HPELDSP)                 += ppc/hpeldsp_altivec.o
-OBJS-$(CONFIG_IDCTDSP)                 += ppc/idctdsp_altivec.o
-OBJS-$(CONFIG_LLVIDDSP)                += ppc/lossless_videodsp_altivec.o
-OBJS-$(CONFIG_ME_CMP)                  += ppc/me_cmp_altivec.o
-OBJS-$(CONFIG_MPEGAUDIODSP)            += ppc/mpegaudiodsp_altivec.o
-OBJS-$(CONFIG_MPEGVIDEO)               += ppc/mpegvideo_altivec.o
-OBJS-$(CONFIG_MPEGVIDEOENCDSP)         += ppc/mpegvideoencdsp_altivec.o
-OBJS-$(CONFIG_PIXBLOCKDSP)             += ppc/pixblockdsp_altivec.o
-OBJS-$(CONFIG_VC1DSP)                  += ppc/vc1dsp_altivec.o
+OBJS-$(CONFIG_FDCTDSP)                 += ppc/fdctdsp_init.o ppc/fdctdsp_altivec.o
+OBJS-$(CONFIG_H264CHROMA)              += ppc/h264chroma_init.o ppc/h264chroma_altivec.o
+OBJS-$(CONFIG_H264DSP)                 += ppc/h264dsp_init.o ppc/h264dsp_altivec.o ppc/hpeldsp_altivec.o
+OBJS-$(CONFIG_H264QPEL)                += ppc/h264qpel_init.o ppc/h264qpel_altivec.o
+OBJS-$(CONFIG_HPELDSP)                 += ppc/hpeldsp_init.o ppc/hpeldsp_altivec.o
+OBJS-$(CONFIG_IDCTDSP)                 += ppc/idctdsp_init.o ppc/idctdsp_altivec.o
+OBJS-$(CONFIG_LLVIDDSP)                += ppc/lossless_videodsp_init.o ppc/lossless_videodsp_altivec.o
+OBJS-$(CONFIG_ME_CMP)                  += ppc/me_cmp_init.o ppc/me_cmp_altivec.o
+OBJS-$(CONFIG_MPEGAUDIODSP)            += ppc/mpegaudiodsp_init.o ppc/mpegaudiodsp_altivec.o
+OBJS-$(CONFIG_MPEGVIDEO)               += ppc/mpegvideo_init.o ppc/mpegvideo_altivec.o
+OBJS-$(CONFIG_MPEGVIDEOENCDSP)         += ppc/mpegvideoencdsp_init.o ppc/mpegvideoencdsp_altivec.o
+OBJS-$(CONFIG_PIXBLOCKDSP)             += ppc/pixblockdsp_init.o ppc/pixblockdsp_altivec.o
+OBJS-$(CONFIG_VC1DSP)                  += ppc/vc1dsp_init.o ppc/vc1dsp_altivec.o
 OBJS-$(CONFIG_VIDEODSP)                += ppc/videodsp.o
-OBJS-$(CONFIG_VP3DSP)                  += ppc/vp3dsp_altivec.o
-OBJS-$(CONFIG_VP8DSP)                  += ppc/vp8dsp_altivec.o
+OBJS-$(CONFIG_VP3DSP)                  += ppc/vp3dsp_init.o ppc/vp3dsp_altivec.o
+OBJS-$(CONFIG_VP8DSP)                  += ppc/vp8dsp_init.o ppc/vp8dsp_altivec.o

 # decoders/encoders
-OBJS-$(CONFIG_HEVC_DECODER)            += ppc/hevcdsp_altivec.o
-OBJS-$(CONFIG_MPEG4_DECODER)           += ppc/mpeg4videodsp_altivec.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
+OBJS-$(CONFIG_HEVC_DECODER)            += ppc/hevcdsp_init.o ppc/hevcdsp_altivec.o
+OBJS-$(CONFIG_MPEG4_DECODER)           += ppc/mpeg4videodsp_init.o ppc/mpeg4videodsp_altivec.o
+OBJS-$(CONFIG_SVQ1_ENCODER)            += ppc/svq1enc_init.o ppc/svq1enc_altivec.o
+OBJS-$(CONFIG_VORBIS_DECODER)          += ppc/vorbisdsp_init.o ppc/vorbisdsp_altivec.o
+OBJS-$(CONFIG_VP7_DECODER)             += ppc/vp8dsp_init.o ppc/vp8dsp_altivec.o

 # AltiVec optimizations
 # subsystems
diff --git a/libavcodec/ppc/audiodsp_altivec.c b/libavcodec/ppc/audiodsp_altivec.c
index 2e374737bd..96128eb94a 100644
--- a/libavcodec/ppc/audiodsp_altivec.c
+++ b/libavcodec/ppc/audiodsp_altivec.c
@@ -26,12 +26,12 @@
 #include "config.h"

 #include "libavutil/attributes.h"
-#include "libavutil/cpu.h"
-#include "libavutil/ppc/cpu.h"
 #include "libavutil/ppc/util_altivec.h"

 #include "libavcodec/audiodsp.h"

+#include "audiodsp_altivec.h"
+
 #if HAVE_ALTIVEC

 static int32_t scalarproduct_int16_altivec(const int16_t *v1, const int16_t *v2,
@@ -83,19 +83,16 @@ static int32_t scalarproduct_int16_vsx(const int16_t *v1, const int16_t *v2, int

 #endif /* HAVE_VSX */

-av_cold void ff_audiodsp_init_ppc(AudioDSPContext *c)
+av_cold void ff_audiodsp_init_altivec(AudioDSPContext *c)
 {
 #if HAVE_ALTIVEC
-    if (!PPC_ALTIVEC(av_get_cpu_flags()))
-        return;
-
     c->scalarproduct_int16 = scalarproduct_int16_altivec;
 #endif /* HAVE_ALTIVEC */
+}

+av_cold void ff_audiodsp_init_vsx(AudioDSPContext *c)
+{
 #if HAVE_VSX
-    if (!PPC_VSX(av_get_cpu_flags()))
-        return;
-
     c->scalarproduct_int16 = scalarproduct_int16_vsx;
 #endif /* HAVE_VSX */
 }
diff --git a/libavcodec/ppc/audiodsp_altivec.h b/libavcodec/ppc/audiodsp_altivec.h
new file mode 100644
index 0000000000..e97c50142a
--- /dev/null
+++ b/libavcodec/ppc/audiodsp_altivec.h
@@ -0,0 +1,27 @@
+/*
+ * 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_AUDIODSP_ALTIVEC_H
+#define AVCODEC_PPC_AUDIODSP_ALTIVEC_H
+
+#include "libavcodec/audiodsp.h"
+
+void ff_audiodsp_init_altivec(AudioDSPContext *c);
+void ff_audiodsp_init_vsx(AudioDSPContext *c);
+
+#endif /* AVCODEC_PPC_AUDIODSP_ALTIVEC_H */
diff --git a/libavcodec/ppc/audiodsp_init.c b/libavcodec/ppc/audiodsp_init.c
new file mode 100644
index 0000000000..5de463128a
--- /dev/null
+++ b/libavcodec/ppc/audiodsp_init.c
@@ -0,0 +1,35 @@
+/*
+ * 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/attributes.h"
+#include "libavutil/cpu.h"
+#include "libavutil/ppc/cpu.h"
+
+#include "libavcodec/audiodsp.h"
+
+#include "audiodsp_altivec.h"
+
+av_cold void ff_audiodsp_init_ppc(AudioDSPContext *c)
+{
+    int cpu_flags = av_get_cpu_flags();
+
+    if (PPC_ALTIVEC(cpu_flags))
+        ff_audiodsp_init_altivec(c);
+    if (PPC_VSX(cpu_flags))
+        ff_audiodsp_init_vsx(c);
+}
diff --git a/libavcodec/ppc/fdctdsp_altivec.c b/libavcodec/ppc/fdctdsp_altivec.c
index ae3c1b18ff..a6dc177b73 100644
--- a/libavcodec/ppc/fdctdsp_altivec.c
+++ b/libavcodec/ppc/fdctdsp_altivec.c
@@ -21,8 +21,6 @@
 #include "config.h"

 #include "libavutil/attributes.h"
-#include "libavutil/cpu.h"
-#include "libavutil/ppc/cpu.h"
 #include "libavutil/ppc/util_altivec.h"

 #include "libavcodec/avcodec.h"
@@ -461,19 +459,3 @@ void ff_fdct_altivec(int16_t *block)
 }

 #endif /* HAVE_ALTIVEC */
-
-av_cold void ff_fdctdsp_init_ppc(FDCTDSPContext *c, AVCodecContext *avctx,
-                                 unsigned high_bit_depth)
-{
-#if HAVE_ALTIVEC
-    if (!PPC_ALTIVEC(av_get_cpu_flags()))
-        return;
-
-    if (!high_bit_depth) {
-        if (avctx->dct_algo == FF_DCT_AUTO ||
-            avctx->dct_algo == FF_DCT_ALTIVEC) {
-            c->fdct = ff_fdct_altivec;
-        }
-    }
-#endif /* HAVE_ALTIVEC */
-}
diff --git a/libavcodec/ppc/fdctdsp_init.c b/libavcodec/ppc/fdctdsp_init.c
new file mode 100644
index 0000000000..e9544112c1
--- /dev/null
+++ b/libavcodec/ppc/fdctdsp_init.c
@@ -0,0 +1,41 @@
+/*
+ * 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/attributes.h"
+#include "libavutil/cpu.h"
+#include "libavutil/ppc/cpu.h"
+
+#include "libavcodec/avcodec.h"
+#include "libavcodec/fdctdsp.h"
+
+#include "fdct.h"
+
+av_cold void ff_fdctdsp_init_ppc(FDCTDSPContext *c, AVCodecContext *avctx,
+                                 unsigned high_bit_depth)
+{
+    int cpu_flags = av_get_cpu_flags();
+
+    if (PPC_ALTIVEC(cpu_flags)) {
+        if (!high_bit_depth) {
+            if (avctx->dct_algo == FF_DCT_AUTO ||
+                avctx->dct_algo == FF_DCT_ALTIVEC) {
+                c->fdct = ff_fdct_altivec;
+            }
+        }
+    }
+}
diff --git a/libavcodec/ppc/h264chroma_altivec.c b/libavcodec/ppc/h264chroma_altivec.c
index bd0d213bdc..eda5dd2544 100644
--- a/libavcodec/ppc/h264chroma_altivec.c
+++ b/libavcodec/ppc/h264chroma_altivec.c
@@ -21,13 +21,13 @@
 #include "config.h"

 #include "libavutil/attributes.h"
-#include "libavutil/cpu.h"
 #include "libavutil/intreadwrite.h"
-#include "libavutil/ppc/cpu.h"
 #include "libavutil/ppc/util_altivec.h"

 #include "libavcodec/h264chroma.h"

+#include "h264chroma_altivec.h"
+
 #if HAVE_ALTIVEC
 #define PUT_OP_U8_ALTIVEC(d, s, dst) d = s
 #define AVG_OP_U8_ALTIVEC(d, s, dst) d = vec_avg(dst, s)
@@ -49,14 +49,11 @@
 #undef PREFIX_h264_chroma_mc8_num
 #endif /* HAVE_ALTIVEC */

-av_cold void ff_h264chroma_init_ppc(H264ChromaContext *c, int bit_depth)
+av_cold void ff_h264chroma_init_altivec(H264ChromaContext *c, int bit_depth)
 {
 #if HAVE_ALTIVEC
     const int high_bit_depth = bit_depth > 8;

-    if (!PPC_ALTIVEC(av_get_cpu_flags()))
-        return;
-
     if (!high_bit_depth) {
         c->put_h264_chroma_pixels_tab[0] = put_h264_chroma_mc8_altivec;
         c->avg_h264_chroma_pixels_tab[0] = avg_h264_chroma_mc8_altivec;
diff --git a/libavcodec/ppc/h264chroma_altivec.h b/libavcodec/ppc/h264chroma_altivec.h
new file mode 100644
index 0000000000..647f543919
--- /dev/null
+++ b/libavcodec/ppc/h264chroma_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_H264CHROMA_ALTIVEC_H
+#define AVCODEC_PPC_H264CHROMA_ALTIVEC_H
+
+#include "libavcodec/h264chroma.h"
+
+void ff_h264chroma_init_altivec(H264ChromaContext *c, int bit_depth);
+
+#endif /* AVCODEC_PPC_H264CHROMA_ALTIVEC_H */
diff --git a/libavcodec/ppc/h264chroma_init.c b/libavcodec/ppc/h264chroma_init.c
new file mode 100644
index 0000000000..0838f228ef
--- /dev/null
+++ b/libavcodec/ppc/h264chroma_init.c
@@ -0,0 +1,33 @@
+/*
+ * 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/attributes.h"
+#include "libavutil/cpu.h"
+#include "libavutil/ppc/cpu.h"
+
+#include "libavcodec/h264chroma.h"
+
+#include "h264chroma_altivec.h"
+
+av_cold void ff_h264chroma_init_ppc(H264ChromaContext *c, int bit_depth)
+{
+    int cpu_flags = av_get_cpu_flags();
+
+    if (PPC_ALTIVEC(cpu_flags))
+        ff_h264chroma_init_altivec(c, bit_depth);
+}
diff --git a/libavcodec/ppc/h264dsp_altivec.c b/libavcodec/ppc/h264dsp_altivec.c
index c558dafa0b..d997bfff6b 100644
--- a/libavcodec/ppc/h264dsp_altivec.c
+++ b/libavcodec/ppc/h264dsp_altivec.c
@@ -24,15 +24,15 @@
 #include <string.h>

 #include "libavutil/attributes.h"
-#include "libavutil/cpu.h"
 #include "libavutil/intreadwrite.h"
 #include "libavutil/mem_internal.h"
-#include "libavutil/ppc/cpu.h"
 #include "libavutil/ppc/util_altivec.h"

 #include "libavcodec/h264dec.h"
 #include "libavcodec/h264dsp.h"

+#include "h264dsp_altivec.h"
+
 #if HAVE_ALTIVEC

 /****************************************************************************
@@ -785,13 +785,10 @@ H264_WEIGHT(16)
 H264_WEIGHT( 8)
 #endif /* HAVE_ALTIVEC */

-av_cold void ff_h264dsp_init_ppc(H264DSPContext *c, const int bit_depth,
-                                 const int chroma_format_idc)
+av_cold void ff_h264dsp_init_altivec(H264DSPContext *c, const int bit_depth,
+                                     const int chroma_format_idc)
 {
 #if HAVE_ALTIVEC
-    if (!PPC_ALTIVEC(av_get_cpu_flags()))
-        return;
-
     if (bit_depth == 8) {
         c->idct_add = h264_idct_add_altivec;
         if (chroma_format_idc <= 1)
diff --git a/libavcodec/ppc/h264dsp_altivec.h b/libavcodec/ppc/h264dsp_altivec.h
new file mode 100644
index 0000000000..cb1eb7fa78
--- /dev/null
+++ b/libavcodec/ppc/h264dsp_altivec.h
@@ -0,0 +1,27 @@
+/*
+ * 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_H264DSP_ALTIVEC_H
+#define AVCODEC_PPC_H264DSP_ALTIVEC_H
+
+#include "libavcodec/h264dsp.h"
+
+void ff_h264dsp_init_altivec(H264DSPContext *c, const int bit_depth,
+                             const int chroma_format_idc);
+
+#endif /* AVCODEC_PPC_H264DSP_ALTIVEC_H */
diff --git a/libavcodec/ppc/h264dsp_init.c b/libavcodec/ppc/h264dsp_init.c
new file mode 100644
index 0000000000..52c66cf28d
--- /dev/null
+++ b/libavcodec/ppc/h264dsp_init.c
@@ -0,0 +1,34 @@
+/*
+ * 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/attributes.h"
+#include "libavutil/cpu.h"
+#include "libavutil/ppc/cpu.h"
+
+#include "libavcodec/h264dsp.h"
+
+#include "h264dsp_altivec.h"
+
+av_cold void ff_h264dsp_init_ppc(H264DSPContext *c, const int bit_depth,
+                                 const int chroma_format_idc)
+{
+    int cpu_flags = av_get_cpu_flags();
+
+    if (PPC_ALTIVEC(cpu_flags))
+        ff_h264dsp_init_altivec(c, bit_depth, chroma_format_idc);
+}
diff --git a/libavcodec/ppc/h264qpel_altivec.c b/libavcodec/ppc/h264qpel_altivec.c
index fe896c8453..d64e4036c1 100644
--- a/libavcodec/ppc/h264qpel_altivec.c
+++ b/libavcodec/ppc/h264qpel_altivec.c
@@ -21,14 +21,13 @@
 #include "config.h"

 #include "libavutil/attributes.h"
-#include "libavutil/cpu.h"
 #include "libavutil/intreadwrite.h"
 #include "libavutil/mem_internal.h"
-#include "libavutil/ppc/cpu.h"
 #include "libavutil/ppc/util_altivec.h"

 #include "libavcodec/h264qpel.h"

+#include "h264qpel_altivec.h"
 #include "hpeldsp_altivec.h"

 #if HAVE_ALTIVEC
@@ -280,14 +279,11 @@ H264_MC(put_, 16, altivec)
 H264_MC(avg_, 16, altivec)
 #endif /* HAVE_ALTIVEC */

-av_cold void ff_h264qpel_init_ppc(H264QpelContext *c, int bit_depth)
+av_cold void ff_h264qpel_init_altivec(H264QpelContext *c, int bit_depth)
 {
 #if HAVE_ALTIVEC
     const int high_bit_depth = bit_depth > 8;

-    if (!PPC_ALTIVEC(av_get_cpu_flags()))
-        return;
-
     if (!high_bit_depth) {
 #define dspfunc(PFX, IDX, NUM) \
         c->PFX ## _pixels_tab[IDX][ 0] = PFX ## NUM ## _mc00_altivec; \
diff --git a/libavcodec/ppc/h264qpel_altivec.h b/libavcodec/ppc/h264qpel_altivec.h
new file mode 100644
index 0000000000..66622ff65e
--- /dev/null
+++ b/libavcodec/ppc/h264qpel_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_H264QPEL_ALTIVEC_H
+#define AVCODEC_PPC_H264QPEL_ALTIVEC_H
+
+#include "libavcodec/h264qpel.h"
+
+void ff_h264qpel_init_altivec(H264QpelContext *c, int bit_depth);
+
+#endif /* AVCODEC_PPC_H264QPEL_ALTIVEC_H */
diff --git a/libavcodec/ppc/h264qpel_init.c b/libavcodec/ppc/h264qpel_init.c
new file mode 100644
index 0000000000..fb242146d5
--- /dev/null
+++ b/libavcodec/ppc/h264qpel_init.c
@@ -0,0 +1,33 @@
+/*
+ * 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/attributes.h"
+#include "libavutil/cpu.h"
+#include "libavutil/ppc/cpu.h"
+
+#include "libavcodec/h264qpel.h"
+
+#include "h264qpel_altivec.h"
+
+av_cold void ff_h264qpel_init_ppc(H264QpelContext *c, int bit_depth)
+{
+    int cpu_flags = av_get_cpu_flags();
+
+    if (PPC_ALTIVEC(cpu_flags))
+        ff_h264qpel_init_altivec(c, bit_depth);
+}
diff --git a/libavcodec/ppc/hevcdsp_altivec.c b/libavcodec/ppc/hevcdsp_altivec.c
index 7b032ef263..3840b4a8f2 100644
--- a/libavcodec/ppc/hevcdsp_altivec.c
+++ b/libavcodec/ppc/hevcdsp_altivec.c
@@ -22,12 +22,12 @@
 #include "config.h"

 #include "libavutil/attributes.h"
-#include "libavutil/cpu.h"
-#include "libavutil/ppc/cpu.h"
 #include "libavutil/ppc/util_altivec.h"

 #include "libavcodec/hevc/dsp.h"

+#include "hevcdsp_altivec.h"
+
 #if HAVE_ALTIVEC
 static const vec_s16 trans4[4] = {
     { 64,  64, 64,  64, 64,  64, 64,  64 },
@@ -107,12 +107,9 @@ static av_always_inline void scale(vec_s32 res[4], vec_s16 res_packed[2],
 #undef BIT_DEPTH
 #endif /* HAVE_ALTIVEC */

-av_cold void ff_hevc_dsp_init_ppc(HEVCDSPContext *c, const int bit_depth)
+av_cold void ff_hevc_dsp_init_altivec(HEVCDSPContext *c, const int bit_depth)
 {
 #if HAVE_ALTIVEC
-    if (!PPC_ALTIVEC(av_get_cpu_flags()))
-        return;
-
     if (bit_depth == 8)
         c->idct[0] = ff_hevc_idct_4x4_8_altivec;
     if (bit_depth == 10)
diff --git a/libavcodec/ppc/hevcdsp_altivec.h b/libavcodec/ppc/hevcdsp_altivec.h
new file mode 100644
index 0000000000..13328597eb
--- /dev/null
+++ b/libavcodec/ppc/hevcdsp_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_HEVCDSP_ALTIVEC_H
+#define AVCODEC_PPC_HEVCDSP_ALTIVEC_H
+
+#include "libavcodec/hevc/dsp.h"
+
+void ff_hevc_dsp_init_altivec(HEVCDSPContext *c, const int bit_depth);
+
+#endif /* AVCODEC_PPC_HEVCDSP_ALTIVEC_H */
diff --git a/libavcodec/ppc/hevcdsp_init.c b/libavcodec/ppc/hevcdsp_init.c
new file mode 100644
index 0000000000..cabef53942
--- /dev/null
+++ b/libavcodec/ppc/hevcdsp_init.c
@@ -0,0 +1,33 @@
+/*
+ * 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/attributes.h"
+#include "libavutil/cpu.h"
+#include "libavutil/ppc/cpu.h"
+
+#include "libavcodec/hevc/dsp.h"
+
+#include "hevcdsp_altivec.h"
+
+av_cold void ff_hevc_dsp_init_ppc(HEVCDSPContext *c, const int bit_depth)
+{
+    int cpu_flags = av_get_cpu_flags();
+
+    if (PPC_ALTIVEC(cpu_flags))
+        ff_hevc_dsp_init_altivec(c, bit_depth);
+}
diff --git a/libavcodec/ppc/hpeldsp_altivec.c b/libavcodec/ppc/hpeldsp_altivec.c
index d8cf7518d5..c8d43abc7c 100644
--- a/libavcodec/ppc/hpeldsp_altivec.c
+++ b/libavcodec/ppc/hpeldsp_altivec.c
@@ -23,8 +23,6 @@
 #include "config.h"

 #include "libavutil/attributes.h"
-#include "libavutil/cpu.h"
-#include "libavutil/ppc/cpu.h"
 #include "libavutil/ppc/util_altivec.h"

 #include "libavcodec/hpeldsp.h"
@@ -365,12 +363,9 @@ static void avg_pixels8_xy2_altivec(uint8_t *block, const uint8_t *pixels, ptrdi
 }
 #endif /* HAVE_ALTIVEC */

-av_cold void ff_hpeldsp_init_ppc(HpelDSPContext *c, int flags)
+av_cold void ff_hpeldsp_init_altivec(HpelDSPContext *c, int flags)
 {
 #if HAVE_ALTIVEC
-    if (!PPC_ALTIVEC(av_get_cpu_flags()))
-        return;
-
     c->avg_pixels_tab[0][0]        = ff_avg_pixels16_altivec;
     c->avg_pixels_tab[1][0]        = avg_pixels8_altivec;
     c->avg_pixels_tab[1][3]        = avg_pixels8_xy2_altivec;
diff --git a/libavcodec/ppc/hpeldsp_altivec.h b/libavcodec/ppc/hpeldsp_altivec.h
index 590809f539..d1aed1442c 100644
--- a/libavcodec/ppc/hpeldsp_altivec.h
+++ b/libavcodec/ppc/hpeldsp_altivec.h
@@ -26,9 +26,13 @@
 #include <stddef.h>
 #include <stdint.h>

+#include "libavcodec/hpeldsp.h"
+
 void ff_avg_pixels16_altivec(uint8_t *block, const uint8_t *pixels,
                              ptrdiff_t line_size, int h);
 void ff_put_pixels16_altivec(uint8_t *block, const uint8_t *pixels,
                              ptrdiff_t line_size, int h);

+void ff_hpeldsp_init_altivec(HpelDSPContext *c, int flags);
+
 #endif /* AVCODEC_PPC_HPELDSP_ALTIVEC_H */
diff --git a/libavcodec/ppc/hpeldsp_init.c b/libavcodec/ppc/hpeldsp_init.c
new file mode 100644
index 0000000000..6041d9140c
--- /dev/null
+++ b/libavcodec/ppc/hpeldsp_init.c
@@ -0,0 +1,33 @@
+/*
+ * 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/attributes.h"
+#include "libavutil/cpu.h"
+#include "libavutil/ppc/cpu.h"
+
+#include "libavcodec/hpeldsp.h"
+
+#include "hpeldsp_altivec.h"
+
+av_cold void ff_hpeldsp_init_ppc(HpelDSPContext *c, int flags)
+{
+    int cpu_flags = av_get_cpu_flags();
+
+    if (PPC_ALTIVEC(cpu_flags))
+        ff_hpeldsp_init_altivec(c, flags);
+}
diff --git a/libavcodec/ppc/idctdsp_altivec.c b/libavcodec/ppc/idctdsp_altivec.c
index a7acbc5ead..6cae37b94b 100644
--- a/libavcodec/ppc/idctdsp_altivec.c
+++ b/libavcodec/ppc/idctdsp_altivec.c
@@ -36,13 +36,13 @@
 #include <string.h>

 #include "libavutil/attributes.h"
-#include "libavutil/cpu.h"
-#include "libavutil/ppc/cpu.h"
 #include "libavutil/ppc/util_altivec.h"

 #include "libavcodec/avcodec.h"
 #include "libavcodec/idctdsp.h"

+#include "idctdsp_altivec.h"
+
 #if HAVE_ALTIVEC

 #define IDCT_HALF                                       \
@@ -253,13 +253,10 @@ static void idct_add_altivec(uint8_t *dest, ptrdiff_t stride, int16_t *blk)

 #endif /* HAVE_ALTIVEC */

-av_cold void ff_idctdsp_init_ppc(IDCTDSPContext *c, AVCodecContext *avctx,
-                                 unsigned high_bit_depth)
+av_cold void ff_idctdsp_init_altivec(IDCTDSPContext *c, AVCodecContext *avctx,
+                                     unsigned high_bit_depth)
 {
 #if HAVE_ALTIVEC
-    if (!PPC_ALTIVEC(av_get_cpu_flags()))
-        return;
-
     if (!high_bit_depth && avctx->lowres == 0) {
         if ((avctx->idct_algo == FF_IDCT_AUTO && !(avctx->flags & AV_CODEC_FLAG_BITEXACT)) ||
             (avctx->idct_algo == FF_IDCT_ALTIVEC)) {
diff --git a/libavcodec/ppc/idctdsp_altivec.h b/libavcodec/ppc/idctdsp_altivec.h
new file mode 100644
index 0000000000..0a461adb97
--- /dev/null
+++ b/libavcodec/ppc/idctdsp_altivec.h
@@ -0,0 +1,28 @@
+/*
+ * 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_IDCTDSP_ALTIVEC_H
+#define AVCODEC_PPC_IDCTDSP_ALTIVEC_H
+
+#include "libavcodec/avcodec.h"
+#include "libavcodec/idctdsp.h"
+
+void ff_idctdsp_init_altivec(IDCTDSPContext *c, AVCodecContext *avctx,
+                             unsigned high_bit_depth);
+
+#endif /* AVCODEC_PPC_IDCTDSP_ALTIVEC_H */
diff --git a/libavcodec/ppc/idctdsp_init.c b/libavcodec/ppc/idctdsp_init.c
new file mode 100644
index 0000000000..e9a9de5652
--- /dev/null
+++ b/libavcodec/ppc/idctdsp_init.c
@@ -0,0 +1,34 @@
+/*
+ * 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/attributes.h"
+#include "libavutil/cpu.h"
+#include "libavutil/ppc/cpu.h"
+
+#include "libavcodec/idctdsp.h"
+
+#include "idctdsp_altivec.h"
+
+av_cold void ff_idctdsp_init_ppc(IDCTDSPContext *c, AVCodecContext *avctx,
+                                 unsigned high_bit_depth)
+{
+    int cpu_flags = av_get_cpu_flags();
+
+    if (PPC_ALTIVEC(cpu_flags))
+        ff_idctdsp_init_altivec(c, avctx, high_bit_depth);
+}
diff --git a/libavcodec/ppc/lossless_videodsp_altivec.c b/libavcodec/ppc/lossless_videodsp_altivec.c
index 980f85b166..98e8fe8d16 100644
--- a/libavcodec/ppc/lossless_videodsp_altivec.c
+++ b/libavcodec/ppc/lossless_videodsp_altivec.c
@@ -23,12 +23,12 @@
 #include "config.h"

 #include "libavutil/attributes.h"
-#include "libavutil/cpu.h"
-#include "libavutil/ppc/cpu.h"
 #include "libavutil/ppc/util_altivec.h"

 #include "libavcodec/lossless_videodsp.h"

+#include "lossless_videodsp_altivec.h"
+
 #if HAVE_ALTIVEC
 static void add_bytes_altivec(uint8_t *dst, uint8_t *src, ptrdiff_t w)
 {
@@ -48,12 +48,9 @@ static void add_bytes_altivec(uint8_t *dst, uint8_t *src, ptrdiff_t w)
 }
 #endif /* HAVE_ALTIVEC */

-av_cold void ff_llviddsp_init_ppc(LLVidDSPContext *c)
+av_cold void ff_llviddsp_init_altivec(LLVidDSPContext *c)
 {
 #if HAVE_ALTIVEC
-    if (!PPC_ALTIVEC(av_get_cpu_flags()))
-        return;
-
     c->add_bytes = add_bytes_altivec;
 #endif /* HAVE_ALTIVEC */
 }
diff --git a/libavcodec/ppc/lossless_videodsp_altivec.h b/libavcodec/ppc/lossless_videodsp_altivec.h
new file mode 100644
index 0000000000..cd18e52ea2
--- /dev/null
+++ b/libavcodec/ppc/lossless_videodsp_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_LOSSLESS_VIDEODSP_ALTIVEC_H
+#define AVCODEC_PPC_LOSSLESS_VIDEODSP_ALTIVEC_H
+
+#include "libavcodec/lossless_videodsp.h"
+
+void ff_llviddsp_init_altivec(LLVidDSPContext *c);
+
+#endif /* AVCODEC_PPC_LOSSLESS_VIDEODSP_ALTIVEC_H */
diff --git a/libavcodec/ppc/lossless_videodsp_init.c b/libavcodec/ppc/lossless_videodsp_init.c
new file mode 100644
index 0000000000..d40cb07910
--- /dev/null
+++ b/libavcodec/ppc/lossless_videodsp_init.c
@@ -0,0 +1,33 @@
+/*
+ * 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/attributes.h"
+#include "libavutil/cpu.h"
+#include "libavutil/ppc/cpu.h"
+
+#include "libavcodec/lossless_videodsp.h"
+
+#include "lossless_videodsp_altivec.h"
+
+av_cold void ff_llviddsp_init_ppc(LLVidDSPContext *c)
+{
+    int cpu_flags = av_get_cpu_flags();
+
+    if (PPC_ALTIVEC(cpu_flags))
+        ff_llviddsp_init_altivec(c);
+}
diff --git a/libavcodec/ppc/me_cmp_altivec.c b/libavcodec/ppc/me_cmp_altivec.c
index 764e30da2a..ce053e97ce 100644
--- a/libavcodec/ppc/me_cmp_altivec.c
+++ b/libavcodec/ppc/me_cmp_altivec.c
@@ -23,14 +23,14 @@
 #include "config.h"

 #include "libavutil/attributes.h"
-#include "libavutil/cpu.h"
-#include "libavutil/ppc/cpu.h"
 #include "libavutil/ppc/util_altivec.h"

 #include "libavcodec/avcodec.h"
 #include "libavcodec/mpegvideo.h"
 #include "libavcodec/me_cmp.h"

+#include "me_cmp_altivec.h"
+
 #if HAVE_ALTIVEC

 #if HAVE_BIGENDIAN
@@ -723,12 +723,9 @@ static int hadamard8_diff16_altivec(MPVEncContext *s, const uint8_t *dst,
 }
 #endif /* HAVE_ALTIVEC */

-av_cold void ff_me_cmp_init_ppc(MECmpContext *c, AVCodecContext *avctx)
+av_cold void ff_me_cmp_init_altivec(MECmpContext *c, AVCodecContext *avctx)
 {
 #if HAVE_ALTIVEC
-    if (!PPC_ALTIVEC(av_get_cpu_flags()))
-        return;
-
     c->pix_abs[0][1] = sad16_x2_altivec;
     c->pix_abs[0][2] = sad16_y2_altivec;
     c->pix_abs[0][3] = sad16_xy2_altivec;
diff --git a/libavcodec/ppc/me_cmp_altivec.h b/libavcodec/ppc/me_cmp_altivec.h
new file mode 100644
index 0000000000..ec2b0b56d4
--- /dev/null
+++ b/libavcodec/ppc/me_cmp_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_ME_CMP_ALTIVEC_H
+#define AVCODEC_PPC_ME_CMP_ALTIVEC_H
+
+#include "libavcodec/me_cmp.h"
+
+void ff_me_cmp_init_altivec(MECmpContext *c, AVCodecContext *avctx);
+
+#endif /* AVCODEC_PPC_ME_CMP_ALTIVEC_H */
diff --git a/libavcodec/ppc/me_cmp_init.c b/libavcodec/ppc/me_cmp_init.c
new file mode 100644
index 0000000000..97904f2421
--- /dev/null
+++ b/libavcodec/ppc/me_cmp_init.c
@@ -0,0 +1,33 @@
+/*
+ * 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/attributes.h"
+#include "libavutil/cpu.h"
+#include "libavutil/ppc/cpu.h"
+
+#include "libavcodec/me_cmp.h"
+
+#include "me_cmp_altivec.h"
+
+av_cold void ff_me_cmp_init_ppc(MECmpContext *c, AVCodecContext *avctx)
+{
+    int cpu_flags = av_get_cpu_flags();
+
+    if (PPC_ALTIVEC(cpu_flags))
+        ff_me_cmp_init_altivec(c, avctx);
+}
diff --git a/libavcodec/ppc/mpeg4videodsp_altivec.c b/libavcodec/ppc/mpeg4videodsp_altivec.c
index 79e19ab6eb..45416b73f2 100644
--- a/libavcodec/ppc/mpeg4videodsp_altivec.c
+++ b/libavcodec/ppc/mpeg4videodsp_altivec.c
@@ -21,13 +21,13 @@
  */

 #include "libavutil/attributes.h"
-#include "libavutil/cpu.h"
 #include "libavutil/mem_internal.h"
-#include "libavutil/ppc/cpu.h"
 #include "libavutil/ppc/util_altivec.h"

 #include "libavcodec/mpeg4videodsp.h"

+#include "mpeg4videodsp_altivec.h"
+
 #if HAVE_ALTIVEC
 /* AltiVec-enhanced gmc1. ATM this code assumes stride is a multiple of 8
  * to preserve proper dst alignment. */
@@ -128,12 +128,9 @@ static void gmc1_altivec(uint8_t *dst /* align 8 */, const uint8_t *src /* align
 }
 #endif /* HAVE_ALTIVEC */

-av_cold void ff_mpeg4videodsp_init_ppc(Mpeg4VideoDSPContext *c)
+av_cold void ff_mpeg4videodsp_init_altivec(Mpeg4VideoDSPContext *c)
 {
 #if HAVE_ALTIVEC
-    if (!PPC_ALTIVEC(av_get_cpu_flags()))
-        return;
-
     c->gmc1 = gmc1_altivec;
 #endif /* HAVE_ALTIVEC */
 }
diff --git a/libavcodec/ppc/mpeg4videodsp_altivec.h b/libavcodec/ppc/mpeg4videodsp_altivec.h
new file mode 100644
index 0000000000..95a2f0c069
--- /dev/null
+++ b/libavcodec/ppc/mpeg4videodsp_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_MPEG4VIDEODSP_ALTIVEC_H
+#define AVCODEC_PPC_MPEG4VIDEODSP_ALTIVEC_H
+
+#include "libavcodec/mpeg4videodsp.h"
+
+void ff_mpeg4videodsp_init_altivec(Mpeg4VideoDSPContext *c);
+
+#endif /* AVCODEC_PPC_MPEG4VIDEODSP_ALTIVEC_H */
diff --git a/libavcodec/ppc/mpeg4videodsp_init.c b/libavcodec/ppc/mpeg4videodsp_init.c
new file mode 100644
index 0000000000..232b4fdc27
--- /dev/null
+++ b/libavcodec/ppc/mpeg4videodsp_init.c
@@ -0,0 +1,33 @@
+/*
+ * 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/attributes.h"
+#include "libavutil/cpu.h"
+#include "libavutil/ppc/cpu.h"
+
+#include "libavcodec/mpeg4videodsp.h"
+
+#include "mpeg4videodsp_altivec.h"
+
+av_cold void ff_mpeg4videodsp_init_ppc(Mpeg4VideoDSPContext *c)
+{
+    int cpu_flags = av_get_cpu_flags();
+
+    if (PPC_ALTIVEC(cpu_flags))
+        ff_mpeg4videodsp_init_altivec(c);
+}
diff --git a/libavcodec/ppc/mpegaudiodsp_altivec.c b/libavcodec/ppc/mpegaudiodsp_altivec.c
index b065203c4e..638cdc05a1 100644
--- a/libavcodec/ppc/mpegaudiodsp_altivec.c
+++ b/libavcodec/ppc/mpegaudiodsp_altivec.c
@@ -23,13 +23,13 @@

 #include "config.h"
 #include "libavutil/attributes.h"
-#include "libavutil/cpu.h"
 #include "libavutil/internal.h"
 #include "libavutil/mem_internal.h"
-#include "libavutil/ppc/cpu.h"
 #include "libavutil/ppc/util_altivec.h"
 #include "libavcodec/mpegaudiodsp.h"

+#include "mpegaudiodsp_altivec.h"
+
 #if HAVE_ALTIVEC

 #define MACS(rt, ra, rb) rt+=(ra)*(rb)
@@ -133,12 +133,9 @@ static void apply_window_mp3(float *in, float *win, int *unused, float *out,

 #endif /* HAVE_ALTIVEC */

-av_cold void ff_mpadsp_init_ppc(MPADSPContext *s)
+av_cold void ff_mpadsp_init_altivec(MPADSPContext *s)
 {
 #if HAVE_ALTIVEC
-    if (!PPC_ALTIVEC(av_get_cpu_flags()))
-        return;
-
     s->apply_window_float = apply_window_mp3;
 #endif /* HAVE_ALTIVEC */
 }
diff --git a/libavcodec/ppc/mpegaudiodsp_altivec.h b/libavcodec/ppc/mpegaudiodsp_altivec.h
new file mode 100644
index 0000000000..1afc5ccd05
--- /dev/null
+++ b/libavcodec/ppc/mpegaudiodsp_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_MPEGAUDIODSP_ALTIVEC_H
+#define AVCODEC_PPC_MPEGAUDIODSP_ALTIVEC_H
+
+#include "libavcodec/mpegaudiodsp.h"
+
+void ff_mpadsp_init_altivec(MPADSPContext *s);
+
+#endif /* AVCODEC_PPC_MPEGAUDIODSP_ALTIVEC_H */
diff --git a/libavcodec/ppc/mpegaudiodsp_init.c b/libavcodec/ppc/mpegaudiodsp_init.c
new file mode 100644
index 0000000000..4cdb251758
--- /dev/null
+++ b/libavcodec/ppc/mpegaudiodsp_init.c
@@ -0,0 +1,33 @@
+/*
+ * 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/attributes.h"
+#include "libavutil/cpu.h"
+#include "libavutil/ppc/cpu.h"
+
+#include "libavcodec/mpegaudiodsp.h"
+
+#include "mpegaudiodsp_altivec.h"
+
+av_cold void ff_mpadsp_init_ppc(MPADSPContext *s)
+{
+    int cpu_flags = av_get_cpu_flags();
+
+    if (PPC_ALTIVEC(cpu_flags))
+        ff_mpadsp_init_altivec(s);
+}
diff --git a/libavcodec/ppc/mpegvideo_altivec.c b/libavcodec/ppc/mpegvideo_altivec.c
index 71894e760b..72b50e5107 100644
--- a/libavcodec/ppc/mpegvideo_altivec.c
+++ b/libavcodec/ppc/mpegvideo_altivec.c
@@ -28,14 +28,14 @@

 #include "libavutil/attributes.h"
 #include "libavutil/avassert.h"
-#include "libavutil/cpu.h"
 #include "libavutil/mem_internal.h"
-#include "libavutil/ppc/cpu.h"
 #include "libavutil/ppc/util_altivec.h"

 #include "libavcodec/mpegvideo.h"
 #include "libavcodec/mpegvideo_unquantize.h"

+#include "mpegvideo_altivec.h"
+
 #if HAVE_ALTIVEC

 /* AltiVec version of dct_unquantize_h263
@@ -99,12 +99,9 @@ static void dct_unquantize_h263_inter_altivec(const MPVContext *s,
 }
 #endif /* HAVE_ALTIVEC */

-av_cold void ff_mpv_unquantize_init_ppc(MPVUnquantDSPContext *s, int bitexact)
+av_cold void ff_mpv_unquantize_init_altivec(MPVUnquantDSPContext *s, int bitexact)
 {
 #if HAVE_ALTIVEC
-    if (!PPC_ALTIVEC(av_get_cpu_flags()))
-        return;
-
     s->dct_unquantize_h263_intra = dct_unquantize_h263_intra_altivec;
     s->dct_unquantize_h263_inter = dct_unquantize_h263_inter_altivec;
 #endif /* HAVE_ALTIVEC */
diff --git a/libavcodec/ppc/mpegvideo_altivec.h b/libavcodec/ppc/mpegvideo_altivec.h
new file mode 100644
index 0000000000..11d0eab218
--- /dev/null
+++ b/libavcodec/ppc/mpegvideo_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_MPEGVIDEO_ALTIVEC_H
+#define AVCODEC_PPC_MPEGVIDEO_ALTIVEC_H
+
+#include "libavcodec/mpegvideo_unquantize.h"
+
+void ff_mpv_unquantize_init_altivec(MPVUnquantDSPContext *s, int bitexact);
+
+#endif /* AVCODEC_PPC_MPEGVIDEO_ALTIVEC_H */
diff --git a/libavcodec/ppc/mpegvideo_init.c b/libavcodec/ppc/mpegvideo_init.c
new file mode 100644
index 0000000000..2ed9eb142e
--- /dev/null
+++ b/libavcodec/ppc/mpegvideo_init.c
@@ -0,0 +1,33 @@
+/*
+ * 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/attributes.h"
+#include "libavutil/cpu.h"
+#include "libavutil/ppc/cpu.h"
+
+#include "libavcodec/mpegvideo_unquantize.h"
+
+#include "mpegvideo_altivec.h"
+
+av_cold void ff_mpv_unquantize_init_ppc(MPVUnquantDSPContext *s, int bitexact)
+{
+    int cpu_flags = av_get_cpu_flags();
+
+    if (PPC_ALTIVEC(cpu_flags))
+        ff_mpv_unquantize_init_altivec(s, bitexact);
+}
diff --git a/libavcodec/ppc/mpegvideoencdsp_altivec.c b/libavcodec/ppc/mpegvideoencdsp_altivec.c
index bd0c7fb15d..bd351c0985 100644
--- a/libavcodec/ppc/mpegvideoencdsp_altivec.c
+++ b/libavcodec/ppc/mpegvideoencdsp_altivec.c
@@ -21,12 +21,12 @@
 #include <stdint.h>

 #include "libavutil/attributes.h"
-#include "libavutil/cpu.h"
-#include "libavutil/ppc/cpu.h"
 #include "libavutil/ppc/util_altivec.h"

 #include "libavcodec/mpegvideoencdsp.h"

+#include "mpegvideoencdsp_altivec.h"
+
 #if HAVE_ALTIVEC

 #if HAVE_VSX
@@ -148,13 +148,10 @@ static int pix_sum_altivec(const uint8_t *pix, ptrdiff_t line_size)

 #endif /* HAVE_ALTIVEC */

-av_cold void ff_mpegvideoencdsp_init_ppc(MpegvideoEncDSPContext *c,
-                                         AVCodecContext *avctx)
+av_cold void ff_mpegvideoencdsp_init_altivec(MpegvideoEncDSPContext *c,
+                                             AVCodecContext *avctx)
 {
 #if HAVE_ALTIVEC
-    if (!PPC_ALTIVEC(av_get_cpu_flags()))
-        return;
-
     c->pix_norm1 = pix_norm1_altivec;
     c->pix_sum   = pix_sum_altivec;
 #endif /* HAVE_ALTIVEC */
diff --git a/libavcodec/ppc/mpegvideoencdsp_altivec.h b/libavcodec/ppc/mpegvideoencdsp_altivec.h
new file mode 100644
index 0000000000..4eb866e5c6
--- /dev/null
+++ b/libavcodec/ppc/mpegvideoencdsp_altivec.h
@@ -0,0 +1,27 @@
+/*
+ * 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_MPEGVIDEOENCDSP_ALTIVEC_H
+#define AVCODEC_PPC_MPEGVIDEOENCDSP_ALTIVEC_H
+
+#include "libavcodec/mpegvideoencdsp.h"
+
+void ff_mpegvideoencdsp_init_altivec(MpegvideoEncDSPContext *c,
+                                     AVCodecContext *avctx);
+
+#endif /* AVCODEC_PPC_MPEGVIDEOENCDSP_ALTIVEC_H */
diff --git a/libavcodec/ppc/mpegvideoencdsp_init.c b/libavcodec/ppc/mpegvideoencdsp_init.c
new file mode 100644
index 0000000000..08fa97c0b9
--- /dev/null
+++ b/libavcodec/ppc/mpegvideoencdsp_init.c
@@ -0,0 +1,34 @@
+/*
+ * 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/attributes.h"
+#include "libavutil/cpu.h"
+#include "libavutil/ppc/cpu.h"
+
+#include "libavcodec/mpegvideoencdsp.h"
+
+#include "mpegvideoencdsp_altivec.h"
+
+av_cold void ff_mpegvideoencdsp_init_ppc(MpegvideoEncDSPContext *c,
+                                         AVCodecContext *avctx)
+{
+    int cpu_flags = av_get_cpu_flags();
+
+    if (PPC_ALTIVEC(cpu_flags))
+        ff_mpegvideoencdsp_init_altivec(c, avctx);
+}
diff --git a/libavcodec/ppc/pixblockdsp_altivec.c b/libavcodec/ppc/pixblockdsp_altivec.c
index 75287b1e85..6ff6b10961 100644
--- a/libavcodec/ppc/pixblockdsp_altivec.c
+++ b/libavcodec/ppc/pixblockdsp_altivec.c
@@ -23,12 +23,12 @@
 #include "config.h"

 #include "libavutil/attributes.h"
-#include "libavutil/cpu.h"
-#include "libavutil/ppc/cpu.h"
 #include "libavutil/ppc/util_altivec.h"

 #include "libavcodec/pixblockdsp.h"

+#include "pixblockdsp_altivec.h"
+
 #if HAVE_ALTIVEC

 #if HAVE_VSX
@@ -261,24 +261,22 @@ static void diff_pixels_vsx(int16_t *restrict block, const uint8_t *s1,
 }
 #endif /* HAVE_VSX */

-av_cold void ff_pixblockdsp_init_ppc(PixblockDSPContext *c,
-                                     unsigned high_bit_depth)
+av_cold void ff_pixblockdsp_init_altivec(PixblockDSPContext *c,
+                                         unsigned high_bit_depth)
 {
 #if HAVE_ALTIVEC
-    if (!PPC_ALTIVEC(av_get_cpu_flags()))
-        return;
-
     c->diff_pixels = diff_pixels_altivec;

     if (!high_bit_depth) {
         c->get_pixels = get_pixels_altivec;
     }
 #endif /* HAVE_ALTIVEC */
+}

+av_cold void ff_pixblockdsp_init_vsx(PixblockDSPContext *c,
+                                     unsigned high_bit_depth)
+{
 #if HAVE_VSX
-    if (!PPC_VSX(av_get_cpu_flags()))
-        return;
-
     c->diff_pixels = diff_pixels_vsx;

     if (!high_bit_depth)
diff --git a/libavcodec/ppc/pixblockdsp_altivec.h b/libavcodec/ppc/pixblockdsp_altivec.h
new file mode 100644
index 0000000000..5717ab6a08
--- /dev/null
+++ b/libavcodec/ppc/pixblockdsp_altivec.h
@@ -0,0 +1,29 @@
+/*
+ * 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_PIXBLOCKDSP_ALTIVEC_H
+#define AVCODEC_PPC_PIXBLOCKDSP_ALTIVEC_H
+
+#include "libavcodec/pixblockdsp.h"
+
+void ff_pixblockdsp_init_altivec(PixblockDSPContext *c,
+                                 unsigned high_bit_depth);
+void ff_pixblockdsp_init_vsx(PixblockDSPContext *c,
+                             unsigned high_bit_depth);
+
+#endif /* AVCODEC_PPC_PIXBLOCKDSP_ALTIVEC_H */
diff --git a/libavcodec/ppc/pixblockdsp_init.c b/libavcodec/ppc/pixblockdsp_init.c
new file mode 100644
index 0000000000..c87c96dd1a
--- /dev/null
+++ b/libavcodec/ppc/pixblockdsp_init.c
@@ -0,0 +1,36 @@
+/*
+ * 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/attributes.h"
+#include "libavutil/cpu.h"
+#include "libavutil/ppc/cpu.h"
+
+#include "libavcodec/pixblockdsp.h"
+
+#include "pixblockdsp_altivec.h"
+
+av_cold void ff_pixblockdsp_init_ppc(PixblockDSPContext *c,
+                                     unsigned high_bit_depth)
+{
+    int cpu_flags = av_get_cpu_flags();
+
+    if (PPC_ALTIVEC(cpu_flags))
+        ff_pixblockdsp_init_altivec(c, high_bit_depth);
+    if (PPC_VSX(cpu_flags))
+        ff_pixblockdsp_init_vsx(c, high_bit_depth);
+}
diff --git a/libavcodec/ppc/svq1enc_altivec.c b/libavcodec/ppc/svq1enc_altivec.c
index 78c79a68dc..c7a4314fb9 100644
--- a/libavcodec/ppc/svq1enc_altivec.c
+++ b/libavcodec/ppc/svq1enc_altivec.c
@@ -23,12 +23,12 @@
 #include <stdint.h>

 #include "libavutil/attributes.h"
-#include "libavutil/cpu.h"
-#include "libavutil/ppc/cpu.h"
 #include "libavutil/ppc/util_altivec.h"

 #include "libavcodec/svq1encdsp.h"

+#include "svq1enc_altivec.h"
+
 #if HAVE_ALTIVEC && HAVE_BIGENDIAN
 static int ssd_int8_vs_int16_altivec(const int8_t *pix1, const int16_t *pix2,
                                      intptr_t size)
@@ -71,12 +71,9 @@ static int ssd_int8_vs_int16_altivec(const int8_t *pix1, const int16_t *pix2,
 }
 #endif /* HAVE_ALTIVEC && HAVE_BIGENDIAN */

-av_cold void ff_svq1enc_init_ppc(SVQ1EncDSPContext *c)
+av_cold void ff_svq1enc_init_altivec(SVQ1EncDSPContext *c)
 {
 #if HAVE_ALTIVEC && HAVE_BIGENDIAN
-    if (!PPC_ALTIVEC(av_get_cpu_flags()))
-        return;
-
     c->ssd_int8_vs_int16 = ssd_int8_vs_int16_altivec;
 #endif /* HAVE_ALTIVEC && HAVE_BIGENDIAN */
 }
diff --git a/libavcodec/ppc/svq1enc_altivec.h b/libavcodec/ppc/svq1enc_altivec.h
new file mode 100644
index 0000000000..f9588eaca7
--- /dev/null
+++ b/libavcodec/ppc/svq1enc_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_SVQ1ENC_ALTIVEC_H
+#define AVCODEC_PPC_SVQ1ENC_ALTIVEC_H
+
+#include "libavcodec/svq1encdsp.h"
+
+void ff_svq1enc_init_altivec(SVQ1EncDSPContext *c);
+
+#endif /* AVCODEC_PPC_SVQ1ENC_ALTIVEC_H */
diff --git a/libavcodec/ppc/svq1enc_init.c b/libavcodec/ppc/svq1enc_init.c
new file mode 100644
index 0000000000..26bbdcda29
--- /dev/null
+++ b/libavcodec/ppc/svq1enc_init.c
@@ -0,0 +1,33 @@
+/*
+ * 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/attributes.h"
+#include "libavutil/cpu.h"
+#include "libavutil/ppc/cpu.h"
+
+#include "libavcodec/svq1encdsp.h"
+
+#include "svq1enc_altivec.h"
+
+av_cold void ff_svq1enc_init_ppc(SVQ1EncDSPContext *c)
+{
+    int cpu_flags = av_get_cpu_flags();
+
+    if (PPC_ALTIVEC(cpu_flags))
+        ff_svq1enc_init_altivec(c);
+}
diff --git a/libavcodec/ppc/vc1dsp_altivec.c b/libavcodec/ppc/vc1dsp_altivec.c
index dd0473664e..a319bd217d 100644
--- a/libavcodec/ppc/vc1dsp_altivec.c
+++ b/libavcodec/ppc/vc1dsp_altivec.c
@@ -22,12 +22,12 @@
 #include "config.h"

 #include "libavutil/attributes.h"
-#include "libavutil/cpu.h"
-#include "libavutil/ppc/cpu.h"
 #include "libavutil/ppc/util_altivec.h"

 #include "libavcodec/vc1dsp.h"

+#include "vc1dsp_altivec.h"
+
 #if HAVE_ALTIVEC

 // main steps of 8x8 transform
@@ -353,12 +353,9 @@ static void vc1_inv_trans_8x4_altivec(uint8_t *dest, ptrdiff_t stride,

 #endif /* HAVE_ALTIVEC */

-av_cold void ff_vc1dsp_init_ppc(VC1DSPContext *dsp)
+av_cold void ff_vc1dsp_init_altivec(VC1DSPContext *dsp)
 {
 #if HAVE_ALTIVEC
-    if (!PPC_ALTIVEC(av_get_cpu_flags()))
-        return;
-
     dsp->vc1_inv_trans_8x8 = vc1_inv_trans_8x8_altivec;
     dsp->vc1_inv_trans_8x4 = vc1_inv_trans_8x4_altivec;
     dsp->put_no_rnd_vc1_chroma_pixels_tab[0] = put_no_rnd_vc1_chroma_mc8_altivec;
diff --git a/libavcodec/ppc/vc1dsp_altivec.h b/libavcodec/ppc/vc1dsp_altivec.h
new file mode 100644
index 0000000000..abe957121e
--- /dev/null
+++ b/libavcodec/ppc/vc1dsp_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_VC1DSP_ALTIVEC_H
+#define AVCODEC_PPC_VC1DSP_ALTIVEC_H
+
+#include "libavcodec/vc1dsp.h"
+
+void ff_vc1dsp_init_altivec(VC1DSPContext *dsp);
+
+#endif /* AVCODEC_PPC_VC1DSP_ALTIVEC_H */
diff --git a/libavcodec/ppc/vc1dsp_init.c b/libavcodec/ppc/vc1dsp_init.c
new file mode 100644
index 0000000000..f7e88ad18f
--- /dev/null
+++ b/libavcodec/ppc/vc1dsp_init.c
@@ -0,0 +1,33 @@
+/*
+ * 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/attributes.h"
+#include "libavutil/cpu.h"
+#include "libavutil/ppc/cpu.h"
+
+#include "libavcodec/vc1dsp.h"
+
+#include "vc1dsp_altivec.h"
+
+av_cold void ff_vc1dsp_init_ppc(VC1DSPContext *dsp)
+{
+    int cpu_flags = av_get_cpu_flags();
+
+    if (PPC_ALTIVEC(cpu_flags))
+        ff_vc1dsp_init_altivec(dsp);
+}
diff --git a/libavcodec/ppc/vorbisdsp_altivec.c b/libavcodec/ppc/vorbisdsp_altivec.c
index 8f301705e9..59745fb4b4 100644
--- a/libavcodec/ppc/vorbisdsp_altivec.c
+++ b/libavcodec/ppc/vorbisdsp_altivec.c
@@ -21,12 +21,12 @@
 #include "config.h"

 #include "libavutil/attributes.h"
-#include "libavutil/cpu.h"
-#include "libavutil/ppc/cpu.h"
 #include "libavutil/ppc/util_altivec.h"

 #include "libavcodec/vorbisdsp.h"

+#include "vorbisdsp_altivec.h"
+
 #if HAVE_ALTIVEC
 static void vorbis_inverse_coupling_altivec(float *mag, float *ang,
                                             ptrdiff_t blocksize)
@@ -52,12 +52,9 @@ static void vorbis_inverse_coupling_altivec(float *mag, float *ang,
 }
 #endif /* HAVE_ALTIVEC */

-av_cold void ff_vorbisdsp_init_ppc(VorbisDSPContext *c)
+av_cold void ff_vorbisdsp_init_altivec(VorbisDSPContext *c)
 {
 #if HAVE_ALTIVEC
-    if (!PPC_ALTIVEC(av_get_cpu_flags()))
-        return;
-
     c->vorbis_inverse_coupling = vorbis_inverse_coupling_altivec;
 #endif /* HAVE_ALTIVEC */
 }
diff --git a/libavcodec/ppc/vorbisdsp_altivec.h b/libavcodec/ppc/vorbisdsp_altivec.h
new file mode 100644
index 0000000000..ae1f592c30
--- /dev/null
+++ b/libavcodec/ppc/vorbisdsp_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_VORBISDSP_ALTIVEC_H
+#define AVCODEC_PPC_VORBISDSP_ALTIVEC_H
+
+#include "libavcodec/vorbisdsp.h"
+
+void ff_vorbisdsp_init_altivec(VorbisDSPContext *c);
+
+#endif /* AVCODEC_PPC_VORBISDSP_ALTIVEC_H */
diff --git a/libavcodec/ppc/vorbisdsp_init.c b/libavcodec/ppc/vorbisdsp_init.c
new file mode 100644
index 0000000000..a876af4488
--- /dev/null
+++ b/libavcodec/ppc/vorbisdsp_init.c
@@ -0,0 +1,33 @@
+/*
+ * 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/attributes.h"
+#include "libavutil/cpu.h"
+#include "libavutil/ppc/cpu.h"
+
+#include "libavcodec/vorbisdsp.h"
+
+#include "vorbisdsp_altivec.h"
+
+av_cold void ff_vorbisdsp_init_ppc(VorbisDSPContext *c)
+{
+    int cpu_flags = av_get_cpu_flags();
+
+    if (PPC_ALTIVEC(cpu_flags))
+        ff_vorbisdsp_init_altivec(c);
+}
diff --git a/libavcodec/ppc/vp3dsp_altivec.c b/libavcodec/ppc/vp3dsp_altivec.c
index 30551a1a20..16d6310315 100644
--- a/libavcodec/ppc/vp3dsp_altivec.c
+++ b/libavcodec/ppc/vp3dsp_altivec.c
@@ -23,12 +23,12 @@
 #include "config.h"

 #include "libavutil/attributes.h"
-#include "libavutil/cpu.h"
-#include "libavutil/ppc/cpu.h"
 #include "libavutil/ppc/util_altivec.h"

 #include "libavcodec/vp3dsp.h"

+#include "vp3dsp_altivec.h"
+
 #if HAVE_ALTIVEC

 static const vec_s16 constants =
@@ -192,12 +192,9 @@ static void vp3_idct_add_altivec(uint8_t *dst, ptrdiff_t stride, int16_t block[6

 #endif /* HAVE_ALTIVEC */

-av_cold void ff_vp3dsp_init_ppc(VP3DSPContext *c)
+av_cold void ff_vp3dsp_init_altivec(VP3DSPContext *c)
 {
 #if HAVE_ALTIVEC
-    if (!PPC_ALTIVEC(av_get_cpu_flags()))
-        return;
-
     c->idct_put = vp3_idct_put_altivec;
     c->idct_add = vp3_idct_add_altivec;
 #endif
diff --git a/libavcodec/ppc/vp3dsp_altivec.h b/libavcodec/ppc/vp3dsp_altivec.h
new file mode 100644
index 0000000000..c396c613c5
--- /dev/null
+++ b/libavcodec/ppc/vp3dsp_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_VP3DSP_ALTIVEC_H
+#define AVCODEC_PPC_VP3DSP_ALTIVEC_H
+
+#include "libavcodec/vp3dsp.h"
+
+void ff_vp3dsp_init_altivec(VP3DSPContext *c);
+
+#endif /* AVCODEC_PPC_VP3DSP_ALTIVEC_H */
diff --git a/libavcodec/ppc/vp3dsp_init.c b/libavcodec/ppc/vp3dsp_init.c
new file mode 100644
index 0000000000..b5c4a00a4f
--- /dev/null
+++ b/libavcodec/ppc/vp3dsp_init.c
@@ -0,0 +1,33 @@
+/*
+ * 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/attributes.h"
+#include "libavutil/cpu.h"
+#include "libavutil/ppc/cpu.h"
+
+#include "libavcodec/vp3dsp.h"
+
+#include "vp3dsp_altivec.h"
+
+av_cold void ff_vp3dsp_init_ppc(VP3DSPContext *c)
+{
+    int cpu_flags = av_get_cpu_flags();
+
+    if (PPC_ALTIVEC(cpu_flags))
+        ff_vp3dsp_init_altivec(c);
+}
diff --git a/libavcodec/ppc/vp8dsp_altivec.c b/libavcodec/ppc/vp8dsp_altivec.c
index 2898868ba9..f925722db8 100644
--- a/libavcodec/ppc/vp8dsp_altivec.c
+++ b/libavcodec/ppc/vp8dsp_altivec.c
@@ -23,14 +23,13 @@
 #include "config.h"

 #include "libavutil/attributes.h"
-#include "libavutil/cpu.h"
 #include "libavutil/mem_internal.h"
-#include "libavutil/ppc/cpu.h"
 #include "libavutil/ppc/util_altivec.h"

 #include "libavcodec/vp8dsp.h"

 #include "hpeldsp_altivec.h"
+#include "vp8dsp_altivec.h"

 #if HAVE_ALTIVEC
 #define REPT4(...) { __VA_ARGS__, __VA_ARGS__, __VA_ARGS__, __VA_ARGS__ }
@@ -329,12 +328,9 @@ static void put_vp8_pixels16_altivec(uint8_t *dst, ptrdiff_t dstride, const uint
 #endif /* HAVE_ALTIVEC */


-av_cold void ff_vp78dsp_init_ppc(VP8DSPContext *c)
+av_cold void ff_vp78dsp_init_altivec(VP8DSPContext *c)
 {
 #if HAVE_ALTIVEC
-    if (!PPC_ALTIVEC(av_get_cpu_flags()))
-        return;
-
     c->put_vp8_epel_pixels_tab[0][0][0] = put_vp8_pixels16_altivec;
     c->put_vp8_epel_pixels_tab[0][0][2] = put_vp8_epel16_h6_altivec;
     c->put_vp8_epel_pixels_tab[0][2][0] = put_vp8_epel16_v6_altivec;
diff --git a/libavcodec/ppc/vp8dsp_altivec.h b/libavcodec/ppc/vp8dsp_altivec.h
new file mode 100644
index 0000000000..e14a297347
--- /dev/null
+++ b/libavcodec/ppc/vp8dsp_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_VP8DSP_ALTIVEC_H
+#define AVCODEC_PPC_VP8DSP_ALTIVEC_H
+
+#include "libavcodec/vp8dsp.h"
+
+void ff_vp78dsp_init_altivec(VP8DSPContext *c);
+
+#endif /* AVCODEC_PPC_VP8DSP_ALTIVEC_H */
diff --git a/libavcodec/ppc/vp8dsp_init.c b/libavcodec/ppc/vp8dsp_init.c
new file mode 100644
index 0000000000..b9b92a5ea7
--- /dev/null
+++ b/libavcodec/ppc/vp8dsp_init.c
@@ -0,0 +1,33 @@
+/*
+ * 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/attributes.h"
+#include "libavutil/cpu.h"
+#include "libavutil/ppc/cpu.h"
+
+#include "libavcodec/vp8dsp.h"
+
+#include "vp8dsp_altivec.h"
+
+av_cold void ff_vp78dsp_init_ppc(VP8DSPContext *c)
+{
+    int cpu_flags = av_get_cpu_flags();
+
+    if (PPC_ALTIVEC(cpu_flags))
+        ff_vp78dsp_init_altivec(c);
+}