Le quintidi 5 fructidor, an CCXXIII, Ganesh Ajjanagadde a écrit :
> >> +    return abs((int) (t1 - t2)) + abs((int) ((c1 & 0x000000ff) - (c2 & 
> >> 0x000000ff))) +
> >> +        abs((int) (((c1 & 0x0000ff00) >> 8) - ((c2 & 0x0000ff00) >> 8))) +
> >> +        abs((int) (((c1 & 0x00ff0000) >> 16) - ((c2 & 0x00ff0000) >> 
> >> 16)));
> The cast idea is incorrect as stated, though your idea is sound:
> int is not guaranteed to be of 32 bits on all platforms.
> Casting a uint32_t to an int will be bad.

Look at the code itself: the numbers are all smaller than 768. The cast in
that case is completely reliable.

> I assume this is what you had in mind with your macro idea.

I had in mind just a local macro to make that precise part of the code more
readable.

Regards,

-- 
  Nicolas George

Attachment: signature.asc
Description: Digital signature

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel

Reply via email to