aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-06-11 02:21:21 +0200
committerMichael Niedermayer <michaelni@gmx.at>2014-06-11 02:22:53 +0200
commit26be0e31fc486d81fcdf750ce895c6a5612be5ac (patch)
tree328748004dca2125f732ca4541f7b7517386ecfd
parentaff0912da551ed93e8e37ae3e4f2d18cc79cdb36 (diff)
parent205fdd4ea5e1264946917a26fde01e137a485f5a (diff)
downloadffmpeg-26be0e31fc486d81fcdf750ce895c6a5612be5ac.tar.gz
Merge commit '205fdd4ea5e1264946917a26fde01e137a485f5a'
* commit '205fdd4ea5e1264946917a26fde01e137a485f5a': ppc: Fix runtime CPU detection for apedsp, huffyuvdsp, svq1enc Merged-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavcodec/ppc/huffyuvdsp_altivec.c5
-rw-r--r--libavcodec/ppc/lossless_audiodsp_altivec.c5
-rw-r--r--libavcodec/ppc/svq1enc_altivec.c5
3 files changed, 15 insertions, 0 deletions
diff --git a/libavcodec/ppc/huffyuvdsp_altivec.c b/libavcodec/ppc/huffyuvdsp_altivec.c
index 0052daeb64..6701524e4a 100644
--- a/libavcodec/ppc/huffyuvdsp_altivec.c
+++ b/libavcodec/ppc/huffyuvdsp_altivec.c
@@ -26,6 +26,8 @@
#endif
#include "libavutil/attributes.h"
+#include "libavutil/cpu.h"
+#include "libavutil/ppc/cpu.h"
#include "libavutil/ppc/types_altivec.h"
#include "libavutil/ppc/util_altivec.h"
#include "libavcodec/huffyuvdsp.h"
@@ -52,6 +54,9 @@ static void add_bytes_altivec(uint8_t *dst, uint8_t *src, intptr_t w)
av_cold void ff_huffyuvdsp_init_ppc(HuffYUVDSPContext *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_audiodsp_altivec.c b/libavcodec/ppc/lossless_audiodsp_altivec.c
index ee9be1832c..1ebb0f4aa3 100644
--- a/libavcodec/ppc/lossless_audiodsp_altivec.c
+++ b/libavcodec/ppc/lossless_audiodsp_altivec.c
@@ -24,6 +24,8 @@
#endif
#include "libavutil/attributes.h"
+#include "libavutil/cpu.h"
+#include "libavutil/ppc/cpu.h"
#include "libavutil/ppc/types_altivec.h"
#include "libavcodec/lossless_audiodsp.h"
@@ -72,6 +74,9 @@ static int32_t scalarproduct_and_madd_int16_altivec(int16_t *v1,
av_cold void ff_llauddsp_init_ppc(LLAudDSPContext *c)
{
#if HAVE_ALTIVEC
+ if (!PPC_ALTIVEC(av_get_cpu_flags()))
+ return;
+
c->scalarproduct_and_madd_int16 = scalarproduct_and_madd_int16_altivec;
#endif /* HAVE_ALTIVEC */
}
diff --git a/libavcodec/ppc/svq1enc_altivec.c b/libavcodec/ppc/svq1enc_altivec.c
index c2a53fb956..4e25e253f6 100644
--- a/libavcodec/ppc/svq1enc_altivec.c
+++ b/libavcodec/ppc/svq1enc_altivec.c
@@ -26,6 +26,8 @@
#endif
#include "libavutil/attributes.h"
+#include "libavutil/cpu.h"
+#include "libavutil/ppc/cpu.h"
#include "libavutil/ppc/types_altivec.h"
#include "libavutil/ppc/util_altivec.h"
#include "libavcodec/svq1enc.h"
@@ -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)
{
#if HAVE_ALTIVEC
+ if (!PPC_ALTIVEC(av_get_cpu_flags()))
+ return;
+
c->ssd_int8_vs_int16 = ssd_int8_vs_int16_altivec;
#endif /* HAVE_ALTIVEC */
}