diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2014-07-08 03:12:10 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-07-08 03:19:06 +0200 |
commit | 14e2406de7d211d50fcce0059c90103bdaa947aa (patch) | |
tree | 10e20cd60b4f4bc91d14957b9565871cdd0381c3 /libavcodec/ppc | |
parent | 5c7bf354dc0c8bea6e7af21c0bc2edad92974274 (diff) | |
parent | a9aee08d900f686e966c64afec5d88a7d9d130a3 (diff) | |
download | ffmpeg-14e2406de7d211d50fcce0059c90103bdaa947aa.tar.gz |
Merge commit 'a9aee08d900f686e966c64afec5d88a7d9d130a3'
* commit 'a9aee08d900f686e966c64afec5d88a7d9d130a3':
dsputil: Split off FDCT bits into their own context
Conflicts:
configure
libavcodec/Makefile
libavcodec/asvenc.c
libavcodec/dnxhdenc.c
libavcodec/dsputil.c
libavcodec/mpegvideo.h
libavcodec/mpegvideo_enc.c
libavcodec/x86/Makefile
libavcodec/x86/dsputilenc_mmx.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/ppc')
-rw-r--r-- | libavcodec/ppc/Makefile | 2 | ||||
-rw-r--r-- | libavcodec/ppc/dsputil_altivec.h | 2 | ||||
-rw-r--r-- | libavcodec/ppc/dsputil_ppc.c | 9 | ||||
-rw-r--r-- | libavcodec/ppc/fdctdsp.c (renamed from libavcodec/ppc/fdct_altivec.c) | 27 | ||||
-rw-r--r-- | libavcodec/ppc/fdctdsp.h | 26 |
5 files changed, 52 insertions, 14 deletions
diff --git a/libavcodec/ppc/Makefile b/libavcodec/ppc/Makefile index c357dafbac..8f0f0ff308 100644 --- a/libavcodec/ppc/Makefile +++ b/libavcodec/ppc/Makefile @@ -9,6 +9,7 @@ OBJS-$(CONFIG_H264DSP) += ppc/h264dsp.o ppc/hpeldsp_altivec.o OBJS-$(CONFIG_H264QPEL) += ppc/h264qpel.o OBJS-$(CONFIG_HPELDSP) += ppc/hpeldsp_altivec.o OBJS-$(CONFIG_HUFFYUVDSP) += ppc/huffyuvdsp_altivec.o +OBJS-$(CONFIG_FDCTDSP) += ppc/fdctdsp.o OBJS-$(CONFIG_IDCTDSP) += ppc/idctdsp.o OBJS-$(CONFIG_MPEGAUDIODSP) += ppc/mpegaudiodsp_altivec.o OBJS-$(CONFIG_MPEGVIDEO) += ppc/mpegvideo_altivec.o \ @@ -25,7 +26,6 @@ OBJS-$(CONFIG_VP7_DECODER) += ppc/vp8dsp_altivec.o OBJS-$(CONFIG_VP8_DECODER) += ppc/vp8dsp_altivec.o ALTIVEC-OBJS-$(CONFIG_DSPUTIL) += ppc/dsputil_altivec.o \ - ppc/fdct_altivec.o \ FFT-OBJS-$(HAVE_GNU_AS) += ppc/fft_altivec_s.o FFT-OBJS-$(HAVE_VSX) += ppc/fft_vsx.o diff --git a/libavcodec/ppc/dsputil_altivec.h b/libavcodec/ppc/dsputil_altivec.h index aa90d348b6..d4a97af479 100644 --- a/libavcodec/ppc/dsputil_altivec.h +++ b/libavcodec/ppc/dsputil_altivec.h @@ -27,8 +27,6 @@ #include "libavcodec/dsputil.h" -void ff_fdct_altivec(int16_t *block); - void ff_dsputil_init_altivec(DSPContext *c, AVCodecContext *avctx, unsigned high_bit_depth); diff --git a/libavcodec/ppc/dsputil_ppc.c b/libavcodec/ppc/dsputil_ppc.c index e0db9d484d..720aafba80 100644 --- a/libavcodec/ppc/dsputil_ppc.c +++ b/libavcodec/ppc/dsputil_ppc.c @@ -35,14 +35,5 @@ av_cold void ff_dsputil_init_ppc(DSPContext *c, AVCodecContext *avctx, int mm_flags = av_get_cpu_flags(); if (PPC_ALTIVEC(mm_flags)) { ff_dsputil_init_altivec(c, avctx, high_bit_depth); - - if (!high_bit_depth) { -#if CONFIG_ENCODERS - if (avctx->dct_algo == FF_DCT_AUTO || - avctx->dct_algo == FF_DCT_ALTIVEC) { - c->fdct = ff_fdct_altivec; - } -#endif //CONFIG_ENCODERS - } } } diff --git a/libavcodec/ppc/fdct_altivec.c b/libavcodec/ppc/fdctdsp.c index e6f36497ac..561e469ab8 100644 --- a/libavcodec/ppc/fdct_altivec.c +++ b/libavcodec/ppc/fdctdsp.c @@ -23,8 +23,13 @@ #include <altivec.h> #endif -#include "libavutil/common.h" -#include "dsputil_altivec.h" +#include "libavutil/attributes.h" +#include "libavutil/cpu.h" +#include "libavutil/ppc/cpu.h" +#include "libavcodec/fdctdsp.h" +#include "fdctdsp.h" + +#if HAVE_ALTIVEC #define vs16(v) ((vector signed short) (v)) #define vs32(v) ((vector signed int) (v)) @@ -454,3 +459,21 @@ void ff_fdct_altivec(int16_t *block) #undef CTS /* }}} */ } + +#endif /* HAVE_ALTIVEC */ + +av_cold void ff_fdctdsp_init_ppc(FDCTDSPContext *c, AVCodecContext *avctx, + unsigned high_bit_depth) +{ +#if HAVE_ALTIVEC + if (!PPC_ALTIVEC(av_get_cpu_flags())) + return; + + if (!high_bit_depth) { + if (avctx->dct_algo == FF_DCT_AUTO || + avctx->dct_algo == FF_DCT_ALTIVEC) { + c->fdct = ff_fdct_altivec; + } + } +#endif /* HAVE_ALTIVEC */ +} diff --git a/libavcodec/ppc/fdctdsp.h b/libavcodec/ppc/fdctdsp.h new file mode 100644 index 0000000000..89be76846f --- /dev/null +++ b/libavcodec/ppc/fdctdsp.h @@ -0,0 +1,26 @@ +/* + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef AVCODEC_PPC_FDCTDSP_H +#define AVCODEC_PPC_FDCTDSP_H + +#include <stdint.h> + +void ff_fdct_altivec(int16_t *block); + +#endif /* AVCODEC_PPC_FDCTDSP_H */ |