summaryrefslogtreecommitdiff
path: root/ffmpeg/libavutil/ppc
diff options
context:
space:
mode:
Diffstat (limited to 'ffmpeg/libavutil/ppc')
-rw-r--r--ffmpeg/libavutil/ppc/cpu.c1
-rw-r--r--ffmpeg/libavutil/ppc/float_dsp_altivec.h20
-rw-r--r--ffmpeg/libavutil/ppc/float_dsp_init.c10
-rw-r--r--ffmpeg/libavutil/ppc/timer.h5
-rw-r--r--ffmpeg/libavutil/ppc/util_altivec.h4
5 files changed, 22 insertions, 18 deletions
diff --git a/ffmpeg/libavutil/ppc/cpu.c b/ffmpeg/libavutil/ppc/cpu.c
index 20837da..d51e3fa 100644
--- a/ffmpeg/libavutil/ppc/cpu.c
+++ b/ffmpeg/libavutil/ppc/cpu.c
@@ -29,6 +29,7 @@
#endif /* __APPLE__ */
#include "libavutil/cpu.h"
+#include "libavutil/cpu_internal.h"
#include "config.h"
/**
diff --git a/ffmpeg/libavutil/ppc/float_dsp_altivec.h b/ffmpeg/libavutil/ppc/float_dsp_altivec.h
index b262a83..e1d530a 100644
--- a/ffmpeg/libavutil/ppc/float_dsp_altivec.h
+++ b/ffmpeg/libavutil/ppc/float_dsp_altivec.h
@@ -21,18 +21,18 @@
#ifndef AVUTIL_PPC_FLOAT_DSP_ALTIVEC_H
#define AVUTIL_PPC_FLOAT_DSP_ALTIVEC_H
-extern void ff_vector_fmul_altivec(float *dst, const float *src0,
- const float *src1, int len);
+void ff_vector_fmul_altivec(float *dst, const float *src0,
+ const float *src1, int len);
-extern void ff_vector_fmul_window_altivec(float *dst, const float *src0,
- const float *src1, const float *win,
- int len);
+void ff_vector_fmul_window_altivec(float *dst, const float *src0,
+ const float *src1, const float *win,
+ int len);
-extern void ff_vector_fmul_add_altivec(float *dst, const float *src0,
- const float *src1, const float *src2,
- int len);
+void ff_vector_fmul_add_altivec(float *dst, const float *src0,
+ const float *src1, const float *src2,
+ int len);
-extern void ff_vector_fmul_reverse_altivec(float *dst, const float *src0,
- const float *src1, int len);
+void ff_vector_fmul_reverse_altivec(float *dst, const float *src0,
+ const float *src1, int len);
#endif /* AVUTIL_PPC_FLOAT_DSP_ALTIVEC_H */
diff --git a/ffmpeg/libavutil/ppc/float_dsp_init.c b/ffmpeg/libavutil/ppc/float_dsp_init.c
index d9ca53e..9dd2072 100644
--- a/ffmpeg/libavutil/ppc/float_dsp_init.c
+++ b/ffmpeg/libavutil/ppc/float_dsp_init.c
@@ -19,16 +19,15 @@
*/
#include "config.h"
+#include "libavutil/attributes.h"
#include "libavutil/cpu.h"
#include "libavutil/float_dsp.h"
+#include "libavutil/ppc/cpu.h"
#include "float_dsp_altivec.h"
-void ff_float_dsp_init_ppc(AVFloatDSPContext *fdsp, int bit_exact)
+av_cold void ff_float_dsp_init_ppc(AVFloatDSPContext *fdsp, int bit_exact)
{
-#if HAVE_ALTIVEC
- int mm_flags = av_get_cpu_flags();
-
- if (!(mm_flags & AV_CPU_FLAG_ALTIVEC))
+ if (!PPC_ALTIVEC(av_get_cpu_flags()))
return;
fdsp->vector_fmul = ff_vector_fmul_altivec;
@@ -38,5 +37,4 @@ void ff_float_dsp_init_ppc(AVFloatDSPContext *fdsp, int bit_exact)
if (!bit_exact) {
fdsp->vector_fmul_window = ff_vector_fmul_window_altivec;
}
-#endif
}
diff --git a/ffmpeg/libavutil/ppc/timer.h b/ffmpeg/libavutil/ppc/timer.h
index 155fc01..b28e624 100644
--- a/ffmpeg/libavutil/ppc/timer.h
+++ b/ffmpeg/libavutil/ppc/timer.h
@@ -23,6 +23,8 @@
#include <stdint.h>
+#include "config.h"
+
#define AV_READ_TIME read_time
static inline uint64_t read_time(void)
@@ -31,12 +33,11 @@ static inline uint64_t read_time(void)
/* from section 2.2.1 of the 32-bit PowerPC PEM */
__asm__ volatile(
- "1:\n"
"mftbu %2\n"
"mftb %0\n"
"mftbu %1\n"
"cmpw %2,%1\n"
- "bne 1b\n"
+ "bne $-0x10\n"
: "=r"(tbl), "=r"(tbu), "=r"(temp)
:
: "cc");
diff --git a/ffmpeg/libavutil/ppc/util_altivec.h b/ffmpeg/libavutil/ppc/util_altivec.h
index 7fe3150..fbf6d85 100644
--- a/ffmpeg/libavutil/ppc/util_altivec.h
+++ b/ffmpeg/libavutil/ppc/util_altivec.h
@@ -34,6 +34,8 @@
#include "types_altivec.h"
+#if HAVE_ALTIVEC
+
// used to build registers permutation vectors (vcprm)
// the 's' are for words in the _s_econd vector
#define WORD_0 0x00,0x01,0x02,0x03
@@ -115,4 +117,6 @@ static inline vec_u8 load_with_perm_vec(int offset, uint8_t *src, vec_u8 perm_ve
return vec_perm(a, b, perm_vec);
}
+#endif /* HAVE_ALTIVEC */
+
#endif /* AVUTIL_PPC_UTIL_ALTIVEC_H */