Commit 205fdd4e authored by Diego Biurrun's avatar Diego Biurrun

ppc: Fix runtime CPU detection for apedsp, huffyuvdsp, svq1enc

parent f121dbd9
...@@ -24,6 +24,8 @@ ...@@ -24,6 +24,8 @@
#endif #endif
#include "libavutil/attributes.h" #include "libavutil/attributes.h"
#include "libavutil/cpu.h"
#include "libavutil/ppc/cpu.h"
#include "libavutil/ppc/types_altivec.h" #include "libavutil/ppc/types_altivec.h"
#include "libavcodec/apedsp.h" #include "libavcodec/apedsp.h"
...@@ -72,6 +74,9 @@ static int32_t scalarproduct_and_madd_int16_altivec(int16_t *v1, ...@@ -72,6 +74,9 @@ static int32_t scalarproduct_and_madd_int16_altivec(int16_t *v1,
av_cold void ff_apedsp_init_ppc(APEDSPContext *c) av_cold void ff_apedsp_init_ppc(APEDSPContext *c)
{ {
#if HAVE_ALTIVEC #if HAVE_ALTIVEC
if (!PPC_ALTIVEC(av_get_cpu_flags()))
return;
c->scalarproduct_and_madd_int16 = scalarproduct_and_madd_int16_altivec; c->scalarproduct_and_madd_int16 = scalarproduct_and_madd_int16_altivec;
#endif /* HAVE_ALTIVEC */ #endif /* HAVE_ALTIVEC */
} }
...@@ -26,6 +26,8 @@ ...@@ -26,6 +26,8 @@
#endif #endif
#include "libavutil/attributes.h" #include "libavutil/attributes.h"
#include "libavutil/cpu.h"
#include "libavutil/ppc/cpu.h"
#include "libavutil/ppc/types_altivec.h" #include "libavutil/ppc/types_altivec.h"
#include "libavutil/ppc/util_altivec.h" #include "libavutil/ppc/util_altivec.h"
#include "libavcodec/huffyuvdsp.h" #include "libavcodec/huffyuvdsp.h"
...@@ -52,6 +54,9 @@ static void add_bytes_altivec(uint8_t *dst, uint8_t *src, int w) ...@@ -52,6 +54,9 @@ static void add_bytes_altivec(uint8_t *dst, uint8_t *src, int w)
av_cold void ff_huffyuvdsp_init_ppc(HuffYUVDSPContext *c) av_cold void ff_huffyuvdsp_init_ppc(HuffYUVDSPContext *c)
{ {
#if HAVE_ALTIVEC #if HAVE_ALTIVEC
if (!PPC_ALTIVEC(av_get_cpu_flags()))
return;
c->add_bytes = add_bytes_altivec; c->add_bytes = add_bytes_altivec;
#endif /* HAVE_ALTIVEC */ #endif /* HAVE_ALTIVEC */
} }
...@@ -26,6 +26,8 @@ ...@@ -26,6 +26,8 @@
#endif #endif
#include "libavutil/attributes.h" #include "libavutil/attributes.h"
#include "libavutil/cpu.h"
#include "libavutil/ppc/cpu.h"
#include "libavutil/ppc/types_altivec.h" #include "libavutil/ppc/types_altivec.h"
#include "libavutil/ppc/util_altivec.h" #include "libavutil/ppc/util_altivec.h"
#include "libavcodec/svq1enc.h" #include "libavcodec/svq1enc.h"
...@@ -75,6 +77,9 @@ static int ssd_int8_vs_int16_altivec(const int8_t *pix1, const int16_t *pix2, ...@@ -75,6 +77,9 @@ static int ssd_int8_vs_int16_altivec(const int8_t *pix1, const int16_t *pix2,
av_cold void ff_svq1enc_init_ppc(SVQ1EncContext *c) av_cold void ff_svq1enc_init_ppc(SVQ1EncContext *c)
{ {
#if HAVE_ALTIVEC #if HAVE_ALTIVEC
if (!PPC_ALTIVEC(av_get_cpu_flags()))
return;
c->ssd_int8_vs_int16 = ssd_int8_vs_int16_altivec; c->ssd_int8_vs_int16 = ssd_int8_vs_int16_altivec;
#endif /* HAVE_ALTIVEC */ #endif /* HAVE_ALTIVEC */
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment