[Ffmpeg-devel] [RFC] AltiVec optimizations, try 2

Luca Barbato lu_zero
Tue Aug 1 10:04:45 CEST 2006


Kostya wrote:
> Here is my second attempt of writing optimized code. 
> Please test how it works on your Macs (my rough test show ~6% speedup).
> If there are no objections I'll commit it tomorrow.
> 
> 
> ------------------------------------------------------------------------
> 
> diff -ru --exclude .svn ffmpeg/libavcodec/Makefile ffmpeg-vc1/libavcodec/Makefile

svn diff ?

> diff -ru --exclude .svn ffmpeg/libavcodec/ppc/dsputil_ppc.c ffmpeg-vc1/libavcodec/ppc/dsputil_ppc.c
> --- ffmpeg/libavcodec/ppc/dsputil_ppc.c	2006-07-27 18:22:09.000000000 +0300
> +++ ffmpeg-vc1/libavcodec/ppc/dsputil_ppc.c	2006-07-31 11:51:04.000000000 +0300
> @@ -251,6 +251,10 @@
>  
>  void dsputil_h264_init_ppc(DSPContext* c, AVCodecContext *avctx);
>  
> +#ifdef HAVE_ALTIVEC
> +void vc1dsp_init_altivec(DSPContext* c, AVCodecContext *avctx);
> +#endif
> +

I think we should reorder the init code to be more rational, I'll do
something about it soonish

> +/* constants used in transform */
> +static const vector int vec_64 = (vector int)64;
> +static const vector int vec_7 = (vector int)7;
> +static const vector int vec_5 = (vector int)5;
> +static const vector int vec_4 = (vector int)4;
> +static const vector int vec_3 = (vector int)3;
> +static const vector int vec_2 = (vector int)2;
> +static const vector int vec_1 = (vector int)1;

define it with the vec_splat_s32(value) and
vec_sl(vec_splat_s32(4),vec_splat(4)) for 64

Not sure about that many pack and unpack, Michael maybe has already a
recipe to avoid some of them.

lu

-- 

Luca Barbato

Gentoo/linux Gentoo/PPC
http://dev.gentoo.org/~lu_zero





More information about the ffmpeg-devel mailing list