[Ffmpeg-devel] privatizing FifoBuffer into libavutil -- take II

Roman Shaposhnick rvs
Thu Sep 21 03:16:31 CEST 2006


On Wed, 2006-09-20 at 11:07 +0200, Michael Niedermayer wrote:
> >   Amazingly enough IT IS! In fact almost 2x times faster. Michael, how
> > did you know ? Your version even contains the dreaded 'if' but it is
> > still faster. 'idiv' is pretty inexpensive on Xeon so the only possible
> > explanation I could come up with would be -- your code reduces register
> > pressure as well. 
> % is slow, if() is only slow if the "truthness" is unpredictable which
> i guessed isnt the case here
> a if(1) or a if((i++)&1) or such are very fast on modern cpus

  Yeap. Seems to be the case. I used to be pretty scared of if()'s but
it seems that I have to reevaluate my attitude towards them.


More information about the ffmpeg-devel mailing list