[Ffmpeg-devel] Re: [Ffmpeg-cvslog] r7570 - trunk/libavutil/fifo.c

Michael Niedermayer michaelni
Thu Jan 18 00:31:48 CET 2007


Hi

On Wed, Jan 17, 2007 at 01:32:28PM -0800, Roman Shaposhnik wrote:
> On Wed, 2007-01-17 at 20:46 +0100, michael wrote:
> >  /**
> > @@ -111,7 +98,11 @@
> >          return -1;
> >      while (buf_size > 0) {
> >          int len = FFMIN(f->end - f->rptr, buf_size);
> > -        func(dest, f->rptr, len);
> > +        if(func) func(dest, f->rptr, len);
> > +        else{
> > +            memcpy(dest, f->rptr, len);
> > +            dest = (uint8_t*)dest + len;
> > +        }
> >          f->rptr += len;
> >          if (f->rptr >= f->end)
> >              f->rptr = f->buffer;
> 
>   I'm just wondering whether this will make any noticeable
> performance impact because of an extra call. Or am I splitting
> hairs here ?

hmm the extra call av_fifo_read -> av_fifo_generic_read happens just if
gcc doesnt inline the function
the extra if() also should disapear for av_fifo_read() if its inlined
and the body of the while loop will be executed just once normally
and rarely twice, but never more often then twice

do you know of any specific places in libav* where there are so many
calls to av_fifo_*read() that this could matter?

[...]


-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

I count him braver who overcomes his desires than him who conquers his
enemies for the hardest victory is over self. -- Aristotle
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20070118/60a499b7/attachment.pgp>



More information about the ffmpeg-devel mailing list