# HG changeset patch # User lu_zero # Date 1155596111 0 # Node ID 49082584828ad7072b3292bf765000f9db48c413 # Parent 28574f57a0fc9430626902e386af504cc882cfca altivec float optimizations diff -r 28574f57a0fc -r 49082584828a Makefile --- a/Makefile Mon Aug 14 18:17:14 2006 +0000 +++ b/Makefile Mon Aug 14 22:55:11 2006 +0000 @@ -351,7 +351,8 @@ 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 -r 28574f57a0fc -r 49082584828a ppc/dsputil_ppc.c --- a/ppc/dsputil_ppc.c Mon Aug 14 18:17:14 2006 +0000 +++ b/ppc/dsputil_ppc.c Mon Aug 14 22:55:11 2006 +0000 @@ -36,6 +36,7 @@ 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 @@ 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 -r 28574f57a0fc -r 49082584828a ppc/float_altivec.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ppc/float_altivec.c Mon Aug 14 22:55:11 2006 +0000 @@ -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; +}