[FFmpeg-cvslog] r12165 - trunk/libavcodec/dsputil.c

Måns Rullgård mans
Fri Feb 22 01:03:53 CET 2008


Rich Felker <dalias at aerifal.cx> writes:

> On Fri, Feb 22, 2008 at 01:31:30AM +0200, Uoti Urpala wrote:
>> On Thu, 2008-02-21 at 21:20 +0000, M?ns Rullg?rd wrote:
>> > > static const unsigned long pb_7f = -1UL/255 * 0x7f;
>> > 
>> > This assumes two's complement signed numbers.  Using ~0UL avoids this
>> > assumption.
>> 
>> No it does not. The only operation done to signed numbers is converting
>> 255 and 0x7f to unsigned long, and the result of that does not depend on
>> representation.
>
> Indeed, thanks for pointing this out, Uoti. -1UL has type unsigned
> long and its value is perfectly well specified and equal to ULONG_MAX.

I stand corrected.

-- 
M?ns Rullg?rd
mans at mansr.com




More information about the ffmpeg-cvslog mailing list