[FFmpeg-devel] Stack variables alignment check in libavcodec/dsputil.c

Michael Niedermayer michaelni
Sat Aug 11 22:11:06 CEST 2007


Hi

On Sat, Aug 11, 2007 at 10:33:42PM +0800, Zuxy Meng wrote:
> Hi,
> 
> 2007/8/2, Michael Niedermayer <michaelni at gmx.at>:
> > Hi
> >
> > On Thu, Aug 02, 2007 at 02:56:13AM +0300, Uoti Urpala wrote:
> > > On Thu, 2007-08-02 at 01:29 +0200, Reimar D?ffinger wrote:
> > > > My impression so far is that it is one of
> > > > 1) pre-4 gcc. Seems reasonable to ask for something newer then, for
> > > > AltiVec it is need too after all (IIRC).
> > > > 2) The calling function (not gcc compiled or old gcc compiled) not
> > > > having the stack aligned sufficiently. Here the solution seems out of
> > > > our scope beyond adding it to the FAQ. We might in addition see if we
> > > > can provide a wrapper function to align the stack suitably.
> > >
> > > As I mentioned earlier on -cvslog: if externally visible functions were
> > > marked then FFmpeg could set the gcc 4.2+ function parameter
> > > force_align_arg_pointer for them on win32.
> >
> > in case anyone is curious
> > avcodec_encode/decode_*
> > and
> > everything that is passed to AVCodecContext.execute()
> > might be all that needs the stack realign attribute
> 
> If the whole project is built with gcc, then only those functions that
> are passed to execute() need this attribute.
> 
> This attribute requires an additional general register so we'd better
> use it conservatively.

avcodec_encode/decode_* are just small wraper functions and a register less
doesnt matter
and for execute i actually would suggest to make pthread.c and co
do the stack alignment so that no changes to functions which are passed
to execute() are needed that practically means adding the attribute to 
worker() in pthread.c

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

I know you won't believe me, but the highest form of Human Excellence is
to question oneself and others. -- Socrates
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20070811/acd87d5e/attachment.pgp>



More information about the ffmpeg-devel mailing list