Re[2]: [XviD-devel] qpel - problems I found

Michael Niedermayer xvid-devel@xvid.org
Sat, 12 Oct 2002 16:52:12 +0200


Hi

On Saturday 12 October 2002 16:41, Michael Niedermayer wrote:
> Hi
>
> On Saturday 12 October 2002 15:57, trbarry@trbarry.com wrote:
> > | particular, it turns out that (dx >> 1) on a negative value works
> > | correctly - ie divides by 2. So the difference is rounding. I don't
> > | know if the value should be rounded or not...
> >
> > I have vague memories that the result of (dx >> 1) on signed numbers
> > could be compiler dependent. But I don't remember where I read it.
>
> iso c standart IIRC (possibly in the other c standarts too)
>
> the problem IIRC is with negative numbers, for them the bit which is
> shifted in at the left is undefined so (-1)>>1 could be -1 or 0x7FFF or
ehh, i mean implementation dependant (i should have read the standart before 
hitting send, or at least read all unread messages first ;)

[...]

Michael