[FFmpeg-devel] [PATCH] simplify some mpc7 code

Reimar Döffinger Reimar.Doeffinger
Thu Jan 28 22:06:22 CET 2010


On Thu, Jan 28, 2010 at 10:05:23PM +0200, Kostya wrote:
> On Thu, Jan 28, 2010 at 09:01:09PM +0100, Reimar D?ffinger wrote:
> > Hm, I'd like to leave the inline away.
> > Reason:
> > Representative value with old code and av_always_inline:
> > 58404 dezicycles in a, 8192 runs, 0 skips
> > 
> > New code, without av_always_inline:
> > 55407 dezicycles in a, 8192 runs, 0 skips
> > 
> > I.e. not inlining is 5% faster (Intel Atom, gcc 4.4.1).
> > 
> > Notes: just "inline" or not makes no difference, but I don't
> > like using it when its likely enough to hurt.
> > I had to hack away the skips detection, because the run
> > time for the whole loop varies extremely.
> > Timings are for the whole "get scale indexes" loop.
> 
> I'm not against it.

Applied. Strangely gcc actually inlines the code completely in all cases,
it just creates somehow vastly worse code if av_always_inline is
used.
In addition, gcc is too stupid to realize that for
a = x - 7;
if (a == 8) don't use a
else use a
it doesn't have to do the subtraction before the compare.
But since it doesn't make a measurable speed difference for me
it might be better to leave it as-is anyway.



More information about the ffmpeg-devel mailing list