[FFmpeg-devel] [PATCH] avutil/x86/emms: Document the emms_c() vs alloc/free relation.

Michael Niedermayer michael at niedermayer.cc
Mon Oct 24 14:24:38 EEST 2016


On Mon, Oct 24, 2016 at 09:38:00AM +0200, wm4 wrote:
> On Sun, 23 Oct 2016 05:37:25 +0200
> Michael Niedermayer <michael at niedermayer.cc> wrote:
> 
> > Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
> > ---
> >  libavutil/x86/emms.h | 2 ++
> >  1 file changed, 2 insertions(+)
> > 
> > diff --git a/libavutil/x86/emms.h b/libavutil/x86/emms.h
> > index 6fda6e2..42c18e2 100644
> > --- a/libavutil/x86/emms.h
> > +++ b/libavutil/x86/emms.h
> > @@ -31,6 +31,8 @@ void avpriv_emms_yasm(void);
> >   * Empty mmx state.
> >   * this must be called between any dsp function and float/double code.
> >   * for example sin(); dsp->idct_put(); emms_c(); cos()
> > + * Note, *alloc() and *free() also use float code in some libc implementations
> > + * thus this also applies to them or any function using them.
> >   */
> >  static av_always_inline void emms_c(void)
> >  {
> 
> Overly specific and useless information. It's an implementation detail

If we place emms_c() so as to ensure that the FPU state is clean
before all calls to *alloc() and *free() (as is done in the posted
patchset) then we need to document this
so others working on the code are aware of it and wont mistakly break
it.

If/when a different or more complete solution is implemented then this
note needs to be adjusted accordingly.

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

Dictatorship: All citizens are under surveillance, all their steps and
actions recorded, for the politicians to enforce control.
Democracy: All politicians are under surveillance, all their steps and
actions recorded, for the citizens to enforce control.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20161024/8f9411cf/attachment.sig>


More information about the ffmpeg-devel mailing list