diff options
author | Diego Biurrun <diego@biurrun.de> | 2014-01-16 17:30:19 +0100 |
---|---|---|
committer | Diego Biurrun <diego@biurrun.de> | 2014-06-22 06:20:15 -0700 |
commit | 9a9e2f1c8aa4539a261625145e5c1f46a8106ac2 (patch) | |
tree | 8df94d9ee621e07b5e5f9aad954cc68d92105e88 /libavcodec/ppc | |
parent | ca1e36a8e4cd416142487071dbca734567bdaddf (diff) | |
download | ffmpeg-9a9e2f1c8aa4539a261625145e5c1f46a8106ac2.tar.gz |
dsputil: Split audio operations off into a separate context
Diffstat (limited to 'libavcodec/ppc')
-rw-r--r-- | libavcodec/ppc/Makefile | 2 | ||||
-rw-r--r-- | libavcodec/ppc/audiodsp.c (renamed from libavcodec/ppc/int_altivec.c) | 18 | ||||
-rw-r--r-- | libavcodec/ppc/dsputil_altivec.h | 1 | ||||
-rw-r--r-- | libavcodec/ppc/dsputil_ppc.c | 2 |
4 files changed, 16 insertions, 7 deletions
diff --git a/libavcodec/ppc/Makefile b/libavcodec/ppc/Makefile index bd78f8e728..8a4a789037 100644 --- a/libavcodec/ppc/Makefile +++ b/libavcodec/ppc/Makefile @@ -1,5 +1,6 @@ OBJS += ppc/fmtconvert_altivec.o \ +OBJS-$(CONFIG_AUDIODSP) += ppc/audiodsp.o OBJS-$(CONFIG_BLOCKDSP) += ppc/blockdsp.o OBJS-$(CONFIG_DSPUTIL) += ppc/dsputil_ppc.o OBJS-$(CONFIG_FFT) += ppc/fft_altivec.o @@ -24,7 +25,6 @@ ALTIVEC-OBJS-$(CONFIG_DSPUTIL) += ppc/dsputil_altivec.o \ ppc/fdct_altivec.o \ ppc/gmc_altivec.o \ ppc/idct_altivec.o \ - ppc/int_altivec.o \ FFT-OBJS-$(HAVE_GNU_AS) += ppc/fft_altivec_s.o ALTIVEC-OBJS-$(CONFIG_FFT) += $(FFT-OBJS-yes) diff --git a/libavcodec/ppc/int_altivec.c b/libavcodec/ppc/audiodsp.c index d76d34a5b1..36506ce902 100644 --- a/libavcodec/ppc/int_altivec.c +++ b/libavcodec/ppc/audiodsp.c @@ -20,7 +20,7 @@ /** * @file - * miscellaneous integer operations + * miscellaneous audio operations */ #include "config.h" @@ -29,10 +29,13 @@ #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/dsputil.h" -#include "dsputil_altivec.h" +#include "libavcodec/audiodsp.h" + +#if HAVE_ALTIVEC static int32_t scalarproduct_int16_altivec(const int16_t *v1, const int16_t *v2, int order) @@ -56,7 +59,14 @@ static int32_t scalarproduct_int16_altivec(const int16_t *v1, const int16_t *v2, return ires; } -av_cold void ff_int_init_altivec(DSPContext *c, AVCodecContext *avctx) +#endif /* HAVE_ALTIVEC */ + +av_cold void ff_audiodsp_init_ppc(AudioDSPContext *c) { +#if HAVE_ALTIVEC + if (!PPC_ALTIVEC(av_get_cpu_flags())) + return; + c->scalarproduct_int16 = scalarproduct_int16_altivec; +#endif /* HAVE_ALTIVEC */ } diff --git a/libavcodec/ppc/dsputil_altivec.h b/libavcodec/ppc/dsputil_altivec.h index 7833b4b0e3..2ad4910bb0 100644 --- a/libavcodec/ppc/dsputil_altivec.h +++ b/libavcodec/ppc/dsputil_altivec.h @@ -35,6 +35,5 @@ void ff_idct_add_altivec(uint8_t *dest, int line_size, int16_t *block); void ff_dsputil_init_altivec(DSPContext *c, AVCodecContext *avctx, unsigned high_bit_depth); -void ff_int_init_altivec(DSPContext *c, AVCodecContext *avctx); #endif /* AVCODEC_PPC_DSPUTIL_ALTIVEC_H */ diff --git a/libavcodec/ppc/dsputil_ppc.c b/libavcodec/ppc/dsputil_ppc.c index b92fbf0a2c..fb1ee4a940 100644 --- a/libavcodec/ppc/dsputil_ppc.c +++ b/libavcodec/ppc/dsputil_ppc.c @@ -34,7 +34,7 @@ av_cold void ff_dsputil_init_ppc(DSPContext *c, AVCodecContext *avctx, { if (PPC_ALTIVEC(av_get_cpu_flags())) { ff_dsputil_init_altivec(c, avctx, high_bit_depth); - ff_int_init_altivec(c, avctx); + c->gmc1 = ff_gmc1_altivec; if (!high_bit_depth) { |