(though x264 never generates such inputs)
static int ALWAYS_INLINE x264_clz( uint32_t x )
{
static uint8_t lut[16] = {4,3,2,2,1,1,1,1,0,0,0,0,0,0,0,0};
static int ALWAYS_INLINE x264_clz( uint32_t x )
{
static uint8_t lut[16] = {4,3,2,2,1,1,1,1,0,0,0,0,0,0,0,0};
- int y, z = ((x - 0x10000) >> 27) & 16;
+ int y, z = (((x >> 16) - 1) >> 27) & 16;
x >>= z^16;
z += y = ((x - 0x100) >> 28) & 8;
x >>= y^8;
x >>= z^16;
z += y = ((x - 0x100) >> 28) & 8;
x >>= y^8;