[FFmpeg-devel] ff_idct_xvid_sse2-cannot-be-inline.patch

Michael Niedermayer michaelni
Tue Mar 9 16:28:45 CET 2010


On Tue, Mar 09, 2010 at 05:21:57AM -0500, Pavel Pavlov wrote:
> > > > >> On Mon, Mar 08, 2010 at 06:43:11PM -0500, Pavel Pavlov wrote:
> > > > >> > > > The function ff_idct_xvid_sse2 simply cannot be static
> > > > >> > > > because it's
> > > > >> > > referenced inside dsputil_mmx.c:
> > > > >> > > >   c->idct    = ff_idct_xvid_sse2;
> > > > >> > > > I have no idea how gcc could compile/link this kind of
> > code.
> > > > There
> > > > >> > > should have been a link error at least
> > > > >> > > > <ff_idct_xvid_sse2-cannot-be-inline.patch>
> > > > >> > >
> > > > >> > > It's C99 inline. C99 doesn't make inline functions static if
> > > > there's
> > > > >> > > a prototype, and there is one.
> > > > >> > >
> > > > >> >
> > > > >> >
> > > > >> > I don't know why I wrote static, if it's actually inline :)
> > > > Anyways,
> > > > >> > I'm getting a link error and I have to remove inline to fix
> > it.
> > > > >>
> > > > >> the function in question must be marked inline due to speed
> > > > >> reasons
> > > > >>
> > > > >
> > > > > In this case I think there should be static av_inline_always void
> > > > > ff_idct_xvid_sse2_static(short *block){ ...
> > > > > }
> > > > >
> > > > > void ff_idct_xvid_sse2(short *block){
> > > > >    ff_idct_xvid_sse2_static(block); }
> > > > >
> > > > > And the other two places should call ff_idct_xvid_sse2_static
> > > > > instead
> > > >
> > > > Yes, something like that is the correct solution.  A non-static
> > > > inline function should not produce an external definition.  That's
> > > > what the spec says.
> > > >
> > >
> > > See attached patch.
> > >
> > 
> > Content-Description: ff_idct_xvid_sse2-cannot-be-inline2.patch
> > >  idct_sse2_xvid.c |   11 ++++++++---
> > >  1 file changed, 8 insertions(+), 3 deletions(-)
> > > 351dfbd185085d074514f0fa772b0e89c5d2f1cd
> > > ff_idct_xvid_sse2-cannot-be-inline2.patch
> > > Index: libavcodec/x86/idct_sse2_xvid.c
> > > ===================================================================
> > > --- libavcodec/x86/idct_sse2_xvid.c	(revision 22368)
> > > +++ libavcodec/x86/idct_sse2_xvid.c	(working copy)
> > > @@ -340,7 +340,7 @@
> > >      "movdqa   %%xmm6, 4*16("dct")     \n\t" \
> > >      "movdqa   "SREG2", 7*16("dct")    \n\t"
> > >
> > > -inline void ff_idct_xvid_sse2(short *block)
> > > +static av_always_inline void idct_xvid_sse2(short *block)
> > >  {
> > >      __asm__ volatile(
> > >      "movq     "MANGLE(m127)", %%mm0
> > \n\t"
> > > @@ -382,14 +382,19 @@
> > >      : "%eax", "%ecx", "%edx", "%esi", "memory");  }
> > >
> > > +void ff_idct_xvid_sse2(short *block)
> > > +{
> > > +	idct_xvid_sse2(block);
> > 
> 
> Updated...

Content-Description: ff_idct_xvid_sse2-cannot-be-inline2.patch
>  idct_sse2_xvid.c |   11 ++++++++---
>  1 file changed, 8 insertions(+), 3 deletions(-)
> 9decd135925e52816a7be8c3f3fa3e75bb93c473  ff_idct_xvid_sse2-cannot-be-inline2.patch

ok

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

Republics decline into democracies and democracies degenerate into
despotisms. -- Aristotle
-------------- 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/20100309/86dfed7b/attachment.pgp>



More information about the ffmpeg-devel mailing list