diff options
| author | Tim Redfern <tim@eclectronics.org> | 2013-12-29 12:19:38 +0000 |
|---|---|---|
| committer | Tim Redfern <tim@eclectronics.org> | 2013-12-29 12:19:38 +0000 |
| commit | f7813a5324be39d13ab536c245d15dfc602a7849 (patch) | |
| tree | fad99148b88823d34a5df2f0a25881a002eb291b /ffmpeg/libavutil/ppc | |
| parent | b7a5a477b8ff4d4e3028b9dfb9a9df0a41463f92 (diff) | |
basic type mechanism working
Diffstat (limited to 'ffmpeg/libavutil/ppc')
| -rw-r--r-- | ffmpeg/libavutil/ppc/cpu.c | 1 | ||||
| -rw-r--r-- | ffmpeg/libavutil/ppc/float_dsp_altivec.h | 20 | ||||
| -rw-r--r-- | ffmpeg/libavutil/ppc/float_dsp_init.c | 10 | ||||
| -rw-r--r-- | ffmpeg/libavutil/ppc/timer.h | 5 | ||||
| -rw-r--r-- | ffmpeg/libavutil/ppc/util_altivec.h | 4 |
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 */ |
