[XviD-devel] Decoder performance
Christoph Lampert
chl at math.uni-bonn.de
Sun Aug 10 17:10:19 CEST 2003
On Sun, 10 Aug 2003, Edouard Gomez wrote:
> Oh, i had a nicer solution than the ? operator for that (on the
> paper). Completely branchless.
>
> #define IS_SET_FLAG(a, flag) \
> (!!((a)&(flag)))
Yes, '!!' is the usual way to make an arithmetic value in to a logical
"true" or "false".
But if I remember correctly, "true" and "false" are not necessarily equal
to 1 and 0 on all machines, they might be -1 and 0 or just anything
and 0. So !! is just helpful to compare truthness by '==', but not by
doing calculations with the result (even though it works on all compilers
I know of...)
gruel
More information about the XviD-devel
mailing list