This will allow for easier implementation of Altivec functions in libraries other than libavcodec.
Unified · Split
| @@ -24,9 +24,9 @@ · 23 unmodified lines | |||
| 24 | #if HAVE_ALTIVEC_H | 24 | #if HAVE_ALTIVEC_H |
| 25 | #include <altivec.h> | 25 | #include <altivec.h> |
| 26 | #endif | 26 | #endif |
| 27 | #include "libavutil/ppc/types_altivec.h" | ||
| 28 | #include "libavutil/ppc/util_altivec.h" | ||
| 27 | #include "libavcodec/dsputil.h" | 29 | #include "libavcodec/dsputil.h" |
| 28 | #include "util_altivec.h" | ||
| 29 | #include "types_altivec.h" | ||
| 30 | #include "dsputil_altivec.h" | 30 | #include "dsputil_altivec.h" |
| 31 | 31 | ||
| 32 | static int sad16_x2_altivec(void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h) | 32 | static int sad16_x2_altivec(void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h) |
| @@ -19,9 +19,10 @@ · 18 unmodified lines | |||
| 19 | * License along with Libav; if not, write to the Free Software | 19 | * License along with Libav; if not, write to the Free Software |
| 20 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | 20 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
| 21 | */ | 21 | */ |
| 22 | |||
| 23 | #include "libavutil/ppc/types_altivec.h" | ||
| 24 | #include "libavutil/ppc/util_altivec.h" | ||
| 22 | #include "libavcodec/fft.h" | 25 | #include "libavcodec/fft.h" |
| 23 | #include "util_altivec.h" | ||
| 24 | #include "types_altivec.h" | ||
| 25 | 26 | ||
| 26 | /** | 27 | /** |
| 27 | * Do a complex FFT with the parameters defined in ff_fft_init(). The | 28 | * Do a complex FFT with the parameters defined in ff_fft_init(). The |
| @@ -18,10 +18,10 @@ · 17 unmodified lines | |||
| 18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | 18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
| 19 | */ | 19 | */ |
| 20 | 20 | ||
| 21 | #include "libavutil/ppc/util_altivec.h" | ||
| 21 | #include "libavcodec/dsputil.h" | 22 | #include "libavcodec/dsputil.h" |
| 22 | 23 | ||
| 23 | #include "dsputil_altivec.h" | 24 | #include "dsputil_altivec.h" |
| 24 | #include "util_altivec.h" | ||
| 25 | 25 | ||
| 26 | static void vector_fmul_altivec(float *dst, const float *src0, const float *src1, int len) | 26 | static void vector_fmul_altivec(float *dst, const float *src0, const float *src1, int len) |
| 27 | { | 27 | { |
| @@ -20,8 +20,8 @@ · 19 unmodified lines | |||
| 20 | 20 | ||
| 21 | #include "libavcodec/fmtconvert.h" | 21 | #include "libavcodec/fmtconvert.h" |
| 22 | 22 | ||
| 23 | #include "libavutil/ppc/util_altivec.h" | ||
| 23 | #include "dsputil_altivec.h" | 24 | #include "dsputil_altivec.h" |
| 24 | #include "util_altivec.h" | ||
| 25 | 25 | ||
| 26 | static void int32_to_float_fmul_scalar_altivec(float *dst, const int *src, float mul, int len) | 26 | static void int32_to_float_fmul_scalar_altivec(float *dst, const int *src, float mul, int len) |
| 27 | { | 27 | { |
| @@ -20,9 +20,9 @@ · 19 unmodified lines | |||
| 20 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | 20 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
| 21 | */ | 21 | */ |
| 22 | 22 | ||
| 23 | #include "libavutil/ppc/types_altivec.h" | ||
| 24 | #include "libavutil/ppc/util_altivec.h" | ||
| 23 | #include "libavcodec/dsputil.h" | 25 | #include "libavcodec/dsputil.h" |
| 24 | #include "util_altivec.h" | ||
| 25 | #include "types_altivec.h" | ||
| 26 | #include "dsputil_altivec.h" | 26 | #include "dsputil_altivec.h" |
| 27 | 27 | ||
| 28 | /* | 28 | /* |
| @@ -19,13 +19,13 @@ · 18 unmodified lines | |||
| 19 | */ | 19 | */ |
| 20 | 20 | ||
| 21 | #include "libavutil/cpu.h" | 21 | #include "libavutil/cpu.h" |
| 22 | #include "libavutil/ppc/types_altivec.h" | ||
| 23 | #include "libavutil/ppc/util_altivec.h" | ||
| 22 | #include "libavcodec/dsputil.h" | 24 | #include "libavcodec/dsputil.h" |
| 23 | #include "libavcodec/h264data.h" | 25 | #include "libavcodec/h264data.h" |
| 24 | #include "libavcodec/h264dsp.h" | 26 | #include "libavcodec/h264dsp.h" |
| 25 | 27 | ||
| 26 | #include "dsputil_altivec.h" | 28 | #include "dsputil_altivec.h" |
| 27 | #include "util_altivec.h" | ||
| 28 | #include "types_altivec.h" | ||
| 29 | 29 | ||
| 30 | #define PUT_OP_U8_ALTIVEC(d, s, dst) d = s | 30 | #define PUT_OP_U8_ALTIVEC(d, s, dst) d = s |
| 31 | #define AVG_OP_U8_ALTIVEC(d, s, dst) d = vec_avg(dst, s) | 31 | #define AVG_OP_U8_ALTIVEC(d, s, dst) d = vec_avg(dst, s) |
| @@ -41,8 +41,8 @@ · 40 unmodified lines | |||
| 41 | #if HAVE_ALTIVEC_H | 41 | #if HAVE_ALTIVEC_H |
| 42 | #include <altivec.h> | 42 | #include <altivec.h> |
| 43 | #endif | 43 | #endif |
| 44 | #include "libavutil/ppc/types_altivec.h" | ||
| 44 | #include "libavcodec/dsputil.h" | 45 | #include "libavcodec/dsputil.h" |
| 45 | #include "types_altivec.h" | ||
| 46 | #include "dsputil_altivec.h" | 46 | #include "dsputil_altivec.h" |
| 47 | 47 | ||
| 48 | #define IDCT_HALF \ | 48 | #define IDCT_HALF \ |
| @@ -28,12 +28,11 @@ · 27 unmodified lines | |||
| 28 | #include <altivec.h> | 28 | #include <altivec.h> |
| 29 | #endif | 29 | #endif |
| 30 | 30 | ||
| 31 | #include "libavutil/ppc/types_altivec.h" | ||
| 31 | #include "libavcodec/dsputil.h" | 32 | #include "libavcodec/dsputil.h" |
| 32 | 33 | ||
| 33 | #include "dsputil_altivec.h" | 34 | #include "dsputil_altivec.h" |
| 34 | 35 | ||
| 35 | #include "types_altivec.h" | ||
| 36 | |||
| 37 | static int ssd_int8_vs_int16_altivec(const int8_t *pix1, const int16_t *pix2, | 36 | static int ssd_int8_vs_int16_altivec(const int8_t *pix1, const int16_t *pix2, |
| 38 | int size) { | 37 | int size) { |
| 39 | int i, size16; | 38 | int i, size16; |
| @@ -20,7 +20,7 @@ · 19 unmodified lines | |||
| 20 | */ | 20 | */ |
| 21 | 21 | ||
| 22 | #include "dsputil_altivec.h" | 22 | #include "dsputil_altivec.h" |
| 23 | #include "util_altivec.h" | 23 | #include "libavutil/ppc/util_altivec.h" |
| 24 | #include "libavcodec/dsputil.h" | 24 | #include "libavcodec/dsputil.h" |
| 25 | #include "libavcodec/mpegaudiodsp.h" | 25 | #include "libavcodec/mpegaudiodsp.h" |
| 26 | 26 | ||
| @@ -23,12 +23,13 @@ · 22 unmodified lines | |||
| 23 | 23 | ||
| 24 | #include <stdlib.h> | 24 | #include <stdlib.h> |
| 25 | #include <stdio.h> | 25 | #include <stdio.h> |
| 26 | |||
| 26 | #include "libavutil/cpu.h" | 27 | #include "libavutil/cpu.h" |
| 28 | #include "libavutil/ppc/types_altivec.h" | ||
| 29 | #include "libavutil/ppc/util_altivec.h" | ||
| 27 | #include "libavcodec/dsputil.h" | 30 | #include "libavcodec/dsputil.h" |
| 28 | #include "libavcodec/mpegvideo.h" | 31 | #include "libavcodec/mpegvideo.h" |
| 29 | 32 | ||
| 30 | #include "util_altivec.h" | ||
| 31 | #include "types_altivec.h" | ||
| 32 | #include "dsputil_altivec.h" | 33 | #include "dsputil_altivec.h" |
| 33 | 34 | ||
| 34 | /* AltiVec version of dct_unquantize_h263 | 35 | /* AltiVec version of dct_unquantize_h263 |
| @@ -19,12 +19,11 @@ · 18 unmodified lines | |||
| 19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | 19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
| 20 | */ | 20 | */ |
| 21 | 21 | ||
| 22 | #include "libavutil/ppc/types_altivec.h" | ||
| 23 | #include "libavutil/ppc/util_altivec.h" | ||
| 22 | #include "libavcodec/dsputil.h" | 24 | #include "libavcodec/dsputil.h" |
| 23 | #include "libavcodec/vc1dsp.h" | 25 | #include "libavcodec/vc1dsp.h" |
| 24 | 26 | ||
| 25 | #include "util_altivec.h" | ||
| 26 | #include "dsputil_altivec.h" | ||
| 27 | |||
| 28 | // main steps of 8x8 transform | 27 | // main steps of 8x8 transform |
| 29 | #define STEP8(s0, s1, s2, s3, s4, s5, s6, s7, vec_rnd) \ | 28 | #define STEP8(s0, s1, s2, s3, s4, s5, s6, s7, vec_rnd) \ |
| 30 | do { \ | 29 | do { \ |
| @@ -18,9 +18,9 @@ · 17 unmodified lines | |||
| 18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | 18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
| 19 | */ | 19 | */ |
| 20 | 20 | ||
| 21 | #include "libavutil/ppc/types_altivec.h" | ||
| 22 | #include "libavutil/ppc/util_altivec.h" | ||
| 21 | #include "libavcodec/dsputil.h" | 23 | #include "libavcodec/dsputil.h" |
| 22 | #include "util_altivec.h" | ||
| 23 | #include "types_altivec.h" | ||
| 24 | #include "dsputil_altivec.h" | 24 | #include "dsputil_altivec.h" |
| 25 | 25 | ||
| 26 | static const vec_s16 constants = | 26 | static const vec_s16 constants = |
| @@ -21,10 +21,10 @@ · 20 unmodified lines | |||
| 21 | */ | 21 | */ |
| 22 | 22 | ||
| 23 | #include "libavutil/cpu.h" | 23 | #include "libavutil/cpu.h" |
| 24 | #include "libavutil/ppc/types_altivec.h" | ||
| 25 | #include "libavutil/ppc/util_altivec.h" | ||
| 24 | #include "libavcodec/vp8dsp.h" | 26 | #include "libavcodec/vp8dsp.h" |
| 25 | #include "dsputil_altivec.h" | 27 | #include "dsputil_altivec.h" |
| 26 | #include "types_altivec.h" | ||
| 27 | #include "util_altivec.h" | ||
| 28 | 28 | ||
| 29 | #define REPT4(...) { __VA_ARGS__, __VA_ARGS__, __VA_ARGS__, __VA_ARGS__ } | 29 | #define REPT4(...) { __VA_ARGS__, __VA_ARGS__, __VA_ARGS__, __VA_ARGS__ } |
| 30 | 30 | ||
| @@ -18,8 +18,8 @@ · 17 unmodified lines | |||
| 18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | 18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
| 19 | */ | 19 | */ |
| 20 | 20 | ||
| 21 | #ifndef AVCODEC_PPC_TYPES_ALTIVEC_H | 21 | #ifndef AVUTIL_PPC_TYPES_ALTIVEC_H |
| 22 | #define AVCODEC_PPC_TYPES_ALTIVEC_H | 22 | #define AVUTIL_PPC_TYPES_ALTIVEC_H |
| 23 | 23 | ||
| 24 | /*********************************************************************** | 24 | /*********************************************************************** |
| 25 | * Vector types | 25 | * Vector types |
| @@ -44,4 +44,4 @@ · 18 unmodified lines | |||
| 44 | #define zero_u32v (vec_u32) zerov | 44 | #define zero_u32v (vec_u32) zerov |
| 45 | #define zero_s32v (vec_s32) zerov | 45 | #define zero_s32v (vec_s32) zerov |
| 46 | 46 | ||
| 47 | #endif /* AVCODEC_PPC_TYPES_ALTIVEC_H */ | 47 | #endif /* AVUTIL_PPC_TYPES_ALTIVEC_H */ |
| @@ -21,8 +21,8 @@ · 20 unmodified lines | |||
| 21 | * Contains misc utility macros and inline functions | 21 | * Contains misc utility macros and inline functions |
| 22 | */ | 22 | */ |
| 23 | 23 | ||
| 24 | #ifndef AVCODEC_PPC_UTIL_ALTIVEC_H | 24 | #ifndef AVUTIL_PPC_UTIL_ALTIVEC_H |
| 25 | #define AVCODEC_PPC_UTIL_ALTIVEC_H | 25 | #define AVUTIL_PPC_UTIL_ALTIVEC_H |
| 26 | 26 | ||
| 27 | #include <stdint.h> | 27 | #include <stdint.h> |
| 28 | 28 | ||
| @@ -115,4 +115,4 @@ static inline vec_u8 load_with_perm_vec(int offset, uint8_t *src, vec_u8 perm_ve · 86 unmodified lines | |||
| 115 | return vec_perm(a, b, perm_vec); | 115 | return vec_perm(a, b, perm_vec); |
| 116 | } | 116 | } |
| 117 | 117 | ||
| 118 | #endif /* AVCODEC_PPC_UTIL_ALTIVEC_H */ | 118 | #endif /* AVUTIL_PPC_UTIL_ALTIVEC_H */ |