[MPlayer-dev-eng] [PATCH] use int_fast32_t in postproc/*

Rich Felker dalias at aerifal.cx
Mon Oct 10 21:23:02 CEST 2005


On Mon, Oct 10, 2005 at 01:44:07PM +0200, Reimar Döffinger wrote:
> Hi,
> On Wed, Oct 05, 2005 at 11:50:51AM -0500, Zoltan Hidvegi wrote:
> > Cool, I'm all for changing everything to long.  But when you change
> 
> Any objections? It would be nice if as many people as possible could
> test it, just in case I missed something important.
> Otherwise I will apply probably tomorrow.
> Btw.: If you have a x86 64 bit system, the main problem with the old
> code was that mplayer -vo xv mf://*.png crashed. Just that you know what
> to look out for.
> 
> > from unsigned to signed, watch out for divide and modulo by constant
> > power of 2.  It's nice to write n/2, which is optimized to a shift if
> > n is unsigned, but for signed n, C has this stupid round towards 0
> > rule, which requires a bunch of extra instructions.  Scanning your
> 
> But if speed is an issue, things like n/2 should never be used, since it
> relies on the compiler to optimize it into a shift instruction.
> 
> > patch, there are a few places where this happens (end = s + size/2
> > like stuff), but it seems that all of those are outside of any loops,
> > so happen only once per frame, so it's not really an issue.  Once can
> > argue that size/2 is more readable than (size>>1), so it may be better
> > to leave it.
> 
> I guess it is not neccessary to change it, but even if, it should be
> done in a seperate patch anyway IMHO.

IMO you should use unsigned, since the original code was unsigned.
Size/byte count variables should always be unsigned, though they're
often not; only offset-type ones should be signed (so width, height
are unsigned quantities while stride is signed).

Rich




More information about the MPlayer-dev-eng mailing list