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

Zuxy Meng zuxy.meng
Sat Aug 11 16:33:42 CEST 2007


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.

-- 
Zuxy
Beauty is truth,
While truth is beauty.
PGP KeyID: E8555ED6




More information about the ffmpeg-devel mailing list