[XviD-devel] Decoder performance

Radek Czyz syskin at ihug.com.au
Mon Aug 11 19:51:59 CEST 2003


Hi,

Edouard wrote:

> #define IS_SET_FLAG(a, flag) \
>  (!!((a)&(flag)))

> It 'returns':
>  - 1 for (a & flag) != 0
>  - 0 for (a & flag) == 0

Since we know that's a one-bit flag, we can also do
(a & flag) >> (log2(flag))

where log2(flag) is the bit position

Of course that stops making any difference at this level :)


Radek



More information about the XviD-devel mailing list