[Ffmpeg-devel] [patch] Snow - add_yblock x86 asm

Aurelien Jacobs aurel
Sun Apr 10 17:50:37 CEST 2005


On Sun, 10 Apr 2005 00:58:46 -0400
Yartrebo <yartrebo at earthlink.net> wrote:

> On Sat, 2005-04-09 at 16:40 +0200, Michael Niedermayer wrote: 
> > 
> > On Saturday 09 April 2005 16:05, Yartrebo wrote:
> > >
> > [...]
> > > > > +#define add_yblock_bw_8_obmc_16_mmx \
> > > > > +        pxor_r2r(mm7, mm7);\
> > > > > +        pcmpeqd_r2r(mm4, mm4);\
> > > > > +        pslld_i2r(31, mm4);\
> > > >
> > > > please dont mix mmx.h with asm() style
> > > >
> > > > > +             "movq (%%esi), %%xmm0;       \n\t"\
> > > > > +             "movl 12(%%eax), %%edx;      \n\t"\
> > > >
> > > > i dont think this will work on x86-64
> > >
> > > Unfortunately, none of my pointer code will work on x86-64. To be
> > > honest, I thought that mplayer assumed that int == * == int32_t ==
> > > 4 in a lot of places and that mplayer would be forever 32 bit.
> > >
> > > Would you have any suggestions as to how to make code run in both
> > > 32 bit and 64 bit modes without much or any loss of performance?
> > 
> > please see the x86-64 patch, which should explain the problem better
> > http://www1.mplayerhq.hu/cgi-bin/cvsweb.cgi/ffmpeg/libavcodec/i386/dsputil_mmx.c.diff?r1=1.87&r2=1.88&cvsroot=FFMpeg
> > 
> fixed, hopefully. I need someone with an AMD-64 machine to test it.

Ok, I tested that patch on AMD64.

But first I tested snow encoding with a fresh ffmpeg checkout.
The result is that it simply crashes :-( (see the attached debug log)
As the crash happened in an inline function, I tried to add a
#define always_inline
to ease the debugging. The result was no more crashes !! So I don't
investigated further to find what causes this crash.
So finally, with no inlines, I was able to do a snow encoding, but
when playing the resulting file, every 12th frames, I get one solid
grey frame ! (tested with several different input format)
I have no idea what causes this.

So now, finally I tested this snow optimisation patch on AMD64.
It compiles and run as well as the original snow (I mean, with
always_inline disabled). So the patch seems to be amd64 compliant :-)

I haven't done any benchmark as the results would be meaningless since
I disabled inlines.

If you want me to do more tests, just let me know.

Aurel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: snow_amd64_crash.log
Type: application/octet-stream
Size: 7848 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20050410/39c69c29/attachment.obj>



More information about the ffmpeg-devel mailing list