diff --git a/libavcodec/Makefile b/libavcodec/Makefile index f1c5c032f0..80f2201c14 100644 --- a/libavcodec/Makefile +++ b/libavcodec/Makefile @@ -351,7 +351,8 @@ OBJS-$(TARGET_ALTIVEC) += ppc/dsputil_altivec.o \ ppc/fdct_altivec.o \ ppc/h264_altivec.o \ ppc/snow_altivec.o \ - ppc/vc1dsp_altivec.o + ppc/vc1dsp_altivec.o \ + ppc/float_altivec.o CFLAGS += $(CFLAGS-yes) OBJS += $(OBJS-yes) diff --git a/libavcodec/ppc/dsputil_ppc.c b/libavcodec/ppc/dsputil_ppc.c index 156d9c7ab4..f022153866 100644 --- a/libavcodec/ppc/dsputil_ppc.c +++ b/libavcodec/ppc/dsputil_ppc.c @@ -36,6 +36,7 @@ void dsputil_h264_init_ppc(DSPContext* c, AVCodecContext *avctx); void dsputil_init_altivec(DSPContext* c, AVCodecContext *avctx); void vc1dsp_init_altivec(DSPContext* c, AVCodecContext *avctx); void snow_init_altivec(DSPContext* c, AVCodecContext *avctx); +void float_init_altivec(DSPContext* c, AVCodecContext *avctx); #endif @@ -270,7 +271,7 @@ void dsputil_init_ppc(DSPContext* c, AVCodecContext *avctx) dsputil_init_altivec(c, avctx); snow_init_altivec(c, avctx); vc1dsp_init_altivec(c, avctx); - + float_init_altivec(c, avctx); c->gmc1 = gmc1_altivec; #ifdef CONFIG_ENCODERS diff --git a/libavcodec/ppc/float_altivec.c b/libavcodec/ppc/float_altivec.c new file mode 100644 index 0000000000..89d3ccb5f3 --- /dev/null +++ b/libavcodec/ppc/float_altivec.c @@ -0,0 +1,192 @@ +/* + * Copyright (c) 2006 Luca Barbato + * + * This library 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 of the License, or (at your option) any later version. + * + * This library 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 this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include "../dsputil.h" + +#include "gcc_fixes.h" + +#include "dsputil_altivec.h" + +static void vector_fmul_altivec(float *dst, const float *src, int len) +{ + int i; + vector float d0, d1, s, zero = (vector float)vec_splat_u32(0); + for(i=0; ivector_fmul = vector_fmul_altivec; + c->vector_fmul_reverse = vector_fmul_reverse_altivec; + c->vector_fmul_add_add = vector_fmul_add_add_altivec; + if(!(avctx->flags & CODEC_FLAG_BITEXACT)) + c->float_to_int16 = float_to_int16_altivec; +}