[Ffmpeg-devel] [PATCH] lowres chroma bug

Michael Niedermayer michaelni
Thu Feb 8 04:26:10 CET 2007


Hi

On Wed, Feb 07, 2007 at 03:51:22PM -0800, Trent Piepho wrote:
> On Wed, 7 Feb 2007, Michael Niedermayer wrote:
> > > Instead of hardcoding the scratch register, it's better to let gcc choose a
> > > register.  Like this:
> >
> > last time i compared hardcoded registers with gcc-choosen ones, the later
> > where slower (that was in cabac.h in case you want to proof me wrong, id
> > be happy if we could get rid of the hardcoded registers there ...)
> 
> It going to depend a lot on how the code is used.  If your asm will only
> appear in one place, ie. it's neither a macro nor an inlined function nor
> in a unrolled loop, etc., the you could just let gcc pick a register and
> then go back and hardcode that same register.  That should generate the
> exact same code.  

i agree, it should but iam not so sure if it really does if you need
additional dummy variables for the gcc choosen register case ...


> So assuming you pick a good register, you will do no
> worse than gcc.
> 
> The advantage comes when the code is a macro or inlined in multiple places.
> With a hard coded register, the same register must be used each time.  If
> you let gcc choose, it can pick different registers depending on the
> context.  In this case, no matter what register you pick, you may do worse
> than letting gcc pick.

in theory yes, in practice i dont have that much faith in gccs ability to
select registers better then doing random assignment, and forcing
input operands to be always in the same register compared to random ones
can avoid some instrucions


> 
> Like the inlined put_bits() function in bitstream.h, I think you would get
> better code if the eax wasn't hardcoded.

well benchmark it and send a patch if its faster


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

No human being will ever know the Truth, for even if they happen to say it
by chance, they would not even known they had done so. -- Xenophanes
-------------- 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/20070208/974b7fb5/attachment.pgp>



More information about the ffmpeg-devel mailing list