diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-07-18 22:27:46 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-07-18 22:34:48 +0200 |
commit | 204c4e953d895e15ab0908d715fd46181bf32add (patch) | |
tree | aebdffe23aa1133eeb1db55b810135ecdfe1c188 /libavcodec/ppc | |
parent | c66978e29ad9cae2c71da83857c6a3cec11bb9cb (diff) | |
parent | ffdd93a25e64db82c053577f415ea82c54fd5235 (diff) | |
download | ffmpeg-streaming-204c4e953d895e15ab0908d715fd46181bf32add.zip ffmpeg-streaming-204c4e953d895e15ab0908d715fd46181bf32add.tar.gz |
Merge remote-tracking branch 'qatar/master'
* qatar/master:
ppc: fix build with altivec disabled
vp3: move idct and loop filter pointers to new vp3dsp context
build: add CONFIG_VP3DSP, reduce repetition in OBJS lists
tscc2: do not add/subtract 128 bias during DCT
tscc2: fix typo in DCT
configure: clarify external library section of help output
configure: mark libfdk-aac as nonfree
configure: cosmetics: drop some unnecessary backslashes
os_support: K&R formatting cosmetics
Conflicts:
configure
libavcodec/vp3.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/ppc')
-rw-r--r-- | libavcodec/ppc/Makefile | 5 | ||||
-rw-r--r-- | libavcodec/ppc/dsputil_altivec.h | 4 | ||||
-rw-r--r-- | libavcodec/ppc/dsputil_ppc.c | 6 | ||||
-rw-r--r-- | libavcodec/ppc/vp3dsp_altivec.c | 42 |
4 files changed, 24 insertions, 33 deletions
diff --git a/libavcodec/ppc/Makefile b/libavcodec/ppc/Makefile index 31f4fb8..e5d1d39 100644 --- a/libavcodec/ppc/Makefile +++ b/libavcodec/ppc/Makefile @@ -1,14 +1,13 @@ OBJS += ppc/dsputil_ppc.o \ +OBJS-$(CONFIG_VP3DSP) += ppc/vp3dsp_altivec.o + FFT-OBJS-$(HAVE_GNU_AS) += ppc/fft_altivec_s.o ALTIVEC-OBJS-$(CONFIG_FFT) += ppc/fft_altivec.o \ $(FFT-OBJS-yes) ALTIVEC-OBJS-$(CONFIG_H264DSP) += ppc/h264_altivec.o ALTIVEC-OBJS-$(CONFIG_MPEGAUDIODSP) += ppc/mpegaudiodec_altivec.o ALTIVEC-OBJS-$(CONFIG_VC1_DECODER) += ppc/vc1dsp_altivec.o -ALTIVEC-OBJS-$(CONFIG_VP3_DECODER) += ppc/vp3dsp_altivec.o -ALTIVEC-OBJS-$(CONFIG_VP5_DECODER) += ppc/vp3dsp_altivec.o -ALTIVEC-OBJS-$(CONFIG_VP6_DECODER) += ppc/vp3dsp_altivec.o ALTIVEC-OBJS-$(CONFIG_VP8_DECODER) += ppc/vp8dsp_altivec.o ALTIVEC-OBJS += ppc/dsputil_altivec.o \ diff --git a/libavcodec/ppc/dsputil_altivec.h b/libavcodec/ppc/dsputil_altivec.h index 6c87782..0b5e404 100644 --- a/libavcodec/ppc/dsputil_altivec.h +++ b/libavcodec/ppc/dsputil_altivec.h @@ -36,10 +36,6 @@ void ff_gmc1_altivec(uint8_t *dst, uint8_t *src, int stride, int h, void ff_idct_put_altivec(uint8_t *dest, int line_size, int16_t *block); void ff_idct_add_altivec(uint8_t *dest, int line_size, int16_t *block); -void ff_vp3_idct_altivec(DCTELEM *block); -void ff_vp3_idct_put_altivec(uint8_t *dest, int line_size, DCTELEM *block); -void ff_vp3_idct_add_altivec(uint8_t *dest, int line_size, DCTELEM *block); - void ff_dsputil_h264_init_ppc(DSPContext* c, AVCodecContext *avctx); void ff_dsputil_init_altivec(DSPContext* c, AVCodecContext *avctx); diff --git a/libavcodec/ppc/dsputil_ppc.c b/libavcodec/ppc/dsputil_ppc.c index 195aa20..c6fdc8e 100644 --- a/libavcodec/ppc/dsputil_ppc.c +++ b/libavcodec/ppc/dsputil_ppc.c @@ -193,12 +193,6 @@ void ff_dsputil_init_ppc(DSPContext* c, AVCodecContext *avctx) c->idct_put = ff_idct_put_altivec; c->idct_add = ff_idct_add_altivec; c->idct_permutation_type = FF_TRANSPOSE_IDCT_PERM; - }else if((CONFIG_VP3_DECODER || CONFIG_VP5_DECODER || CONFIG_VP6_DECODER) && - avctx->idct_algo==FF_IDCT_VP3){ - c->idct_put = ff_vp3_idct_put_altivec; - c->idct_add = ff_vp3_idct_add_altivec; - c->idct = ff_vp3_idct_altivec; - c->idct_permutation_type = FF_TRANSPOSE_IDCT_PERM; } } diff --git a/libavcodec/ppc/vp3dsp_altivec.c b/libavcodec/ppc/vp3dsp_altivec.c index 950e5c7..ac00c93 100644 --- a/libavcodec/ppc/vp3dsp_altivec.c +++ b/libavcodec/ppc/vp3dsp_altivec.c @@ -18,6 +18,13 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ +#include "config.h" +#include "libavutil/attributes.h" +#include "libavutil/cpu.h" +#include "libavcodec/vp3dsp.h" + +#if HAVE_ALTIVEC + #include "libavutil/ppc/types_altivec.h" #include "libavutil/ppc/util_altivec.h" #include "libavcodec/dsputil.h" @@ -107,25 +114,7 @@ static inline vec_s16 M16(vec_s16 a, vec_s16 C) #define ADD8(a) vec_add(a, eight) #define SHIFT4(a) vec_sra(a, four) -void ff_vp3_idct_altivec(DCTELEM block[64]) -{ - IDCT_START - - IDCT_1D(NOP, NOP) - TRANSPOSE8(b0, b1, b2, b3, b4, b5, b6, b7); - IDCT_1D(ADD8, SHIFT4) - - vec_st(b0, 0x00, block); - vec_st(b1, 0x10, block); - vec_st(b2, 0x20, block); - vec_st(b3, 0x30, block); - vec_st(b4, 0x40, block); - vec_st(b5, 0x50, block); - vec_st(b6, 0x60, block); - vec_st(b7, 0x70, block); -} - -void ff_vp3_idct_put_altivec(uint8_t *dst, int stride, DCTELEM block[64]) +static void vp3_idct_put_altivec(uint8_t *dst, int stride, DCTELEM block[64]) { vec_u8 t; IDCT_START @@ -153,7 +142,7 @@ void ff_vp3_idct_put_altivec(uint8_t *dst, int stride, DCTELEM block[64]) PUT(b7) } -void ff_vp3_idct_add_altivec(uint8_t *dst, int stride, DCTELEM block[64]) +static void vp3_idct_add_altivec(uint8_t *dst, int stride, DCTELEM block[64]) { LOAD_ZERO; vec_u8 t, vdst; @@ -183,3 +172,16 @@ void ff_vp3_idct_add_altivec(uint8_t *dst, int stride, DCTELEM block[64]) ADD(b6) dst += stride; ADD(b7) } + +#endif /* HAVE_ALTIVEC */ + +av_cold void ff_vp3dsp_init_ppc(VP3DSPContext *c, int flags) +{ +#if HAVE_ALTIVEC + if (av_get_cpu_flags() & AV_CPU_FLAG_ALTIVEC) { + c->idct_put = vp3_idct_put_altivec; + c->idct_add = vp3_idct_add_altivec; + c->idct_perm = FF_TRANSPOSE_IDCT_PERM; + } +#endif +} |