[Ffmpeg-devel] [PATCH] put_mpeg4_qpel16_h_lowpass altivec implementation

Guillaume POIRIER gpoirier
Mon Nov 20 01:01:37 CET 2006


Hi,

Brian Foley a ?crit :
> Hi there,
> 
> please find attached a first cut at some Altivec acceleration for the
> mpeg4_qpel functions. To get things started, I've translated
> put_mpeg4_qpel16_h_lowpass from the C version, as it was the most CPU
> intensive function that showed up when playing some 720p Xvid.
> 
> A clip that benchmarked at 11.6s before now takes 9.0s on my 1.8GHz
> G5 iMac, and that 720p Xvid no longer drops frames in the places it
> used to before.
> 
> It should be a safe enough patch to apply, as I've tested it fairly
> carefully with a large set of random inputs, focussing on things that
> could cause overflow/rounding errors. As far as I can tell, it gives
> exactly the same outputs as the C version in every case.

Tested on OSX 10.4.x, with apple's gcc4.0.1
Works beautifully. Thanks for the good job.

I've just tested it with gcc3.4 on Linux, and here's the error that gcc 
reports:

gcc -I"/home/guillaume/ffmpeg"/libswscale   -DHAVE_AV_CONFIG_H 
-D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_ISOC9X_SOURCE 
-I"/home/guillaume/ffmpeg" -I"/home/guillaume/ffmpeg" 
-I"/home/guillaume/ffmpeg"/libavutil -fomit-frame-pointer -mcpu=970 
-mpowerpc-gfxopt -mpowerpc64 -maltivec -mabi=altivec -g 
-Wdeclaration-after-statement -Wall -Wno-switch -Wdisabled-optimization 
-Wpointer-arith -Wredundant-decls -O3  -c -o ppc/dsputil_altivec.o 
ppc/dsputil_altivec.c
ppc/dsputil_altivec.c: In function `put_pixels16_l2_altivec':
ppc/dsputil_altivec.c:1581: warning: cast from pointer to integer of 
different size
ppc/dsputil_altivec.c: In function `put_mpeg4_qpel16_h_lowpass_altivec':
ppc/dsputil_altivec.c:1638: error: invalid initializer
ppc/dsputil_altivec.c:1672: error: incompatible types in assignment
ppc/dsputil_altivec.c:1672: error: incompatible types in assignment
ppc/dsputil_altivec.c:1673: error: incompatible types in assignment
ppc/dsputil_altivec.c:1673: error: incompatible types in assignment

It would be good if you could fix this. If you can't then I'll fix it 
before committing.

Lucas, what do you think about it?

> Other obvious candidates to Altivec-ify are put_mpeg4_qpel16_v_lowpass,
> all the avg_mpeg4 equivalents, and the mpeg4_qpel8 variants. I'll try
> to get around to doing some of those soon if someone doesn't beat me to
> it :)

Well, there's also some work to do on h264 decoding too... there's 
plenty of things to do, I doubt we will step on each other's toes ;-P

Guillaume




More information about the ffmpeg-devel mailing list