[FFmpeg-devel] [PATCH 1/3] Indeo 5 decoder: common functions
Mon Jan 18 11:12:22 CET 2010
On Mon, Jan 18, 2010 at 10:55:10AM +0100, Maxim wrote:
> Kostya schrieb:
> >>> #define IVI_TOSIGNED(val) (((val) & 1) ? ((val) + 1) >> 1 : -(((val) + 1) >> 1))
> >> I'm sure this kind of code is already in other decoders.
> >> However the + 1 in the part after : sure is useless.
> >> Also I strongly suggest to make this a static inline function.
> >> And bit magic to do it should be
> >> ((sign_extend(val & 1, 1) ^ val) >> 1) + 1
> >> I think the +1 is necessary, but I can't say for sure since my request
> >> to document it when it was added was just ignored.
> > I've left it as is for now
> Let us incorporate the following simplification if there is no problem
> with it:
> #define IVI_TOSIGNED(val) (-(((val) >> 1) ^ -((val) & 1));
No problems, changed locally.
More information about the ffmpeg-devel