#include <stdio.h>
#include <sys/stat.h>
+#include "config.h"
+
#ifdef HAVE_STDINT_H
#include <stdint.h>
#else
#define WORD_SIZE sizeof(void*)
+#define asm __asm__
+
#if !defined(_WIN64) && !defined(__LP64__)
#if defined(__INTEL_COMPILER)
#define BROKEN_STACK_ALIGNMENT /* define it if stack is not mod16 */
#if defined(__GNUC__) && (__GNUC__ > 3 || __GNUC__ == 3 && __GNUC_MINOR__ > 3)
#define x264_clz(x) __builtin_clz(x)
+#define x264_ctz(x) __builtin_ctz(x)
#else
static int ALWAYS_INLINE x264_clz( uint32_t x )
{
x >>= y^4;
return z + lut[x];
}
+
+static int ALWAYS_INLINE x264_ctz( uint32_t x )
+{
+ static uint8_t lut[16] = {4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0};
+ int y, z = (((x & 0xffff) - 1) >> 27) & 16;
+ x >>= z;
+ z += y = (((x & 0xff) - 1) >> 28) & 8;
+ x >>= y;
+ z += y = (((x & 0xf) - 1) >> 29) & 4;
+ x >>= y;
+ return z + lut[x&0xf];
+}
#endif
#ifdef USE_REAL_PTHREAD