From 241807f32d88b672fc8bdd95cb91debc93bde8e1 Mon Sep 17 00:00:00 2001 From: Luca Barbato Date: Mon, 14 Aug 2006 22:55:11 +0000 Subject: altivec float optimizations Originally committed as revision 5999 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavcodec/ppc/dsputil_ppc.c | 3 +- libavcodec/ppc/float_altivec.c | 192 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 194 insertions(+), 1 deletion(-) create mode 100644 libavcodec/ppc/float_altivec.c (limited to 'libavcodec/ppc') 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; +} -- cgit v1.2.3