]> git.sesse.net Git - ffmpeg/blobdiff - libavutil/intmath.h
x86/float_dsp: zero extend len from ff_butterflies_float_sse implicitly
[ffmpeg] / libavutil / intmath.h
index 20167230dfb69236ec9c51aeb0f01e428e016351..9573109e9d1b910496cc280815883a011e96feb2 100644 (file)
@@ -96,6 +96,9 @@ static av_always_inline av_const int ff_log2_16bit_c(unsigned int v)
 #ifndef ff_ctzll
 #define ff_ctzll(v) __builtin_ctzll(v)
 #endif
+#ifndef ff_clz
+#define ff_clz(v) __builtin_clz(v)
+#endif
 #endif
 #endif
 
@@ -135,6 +138,27 @@ static av_always_inline av_const int ff_ctzll_c(long long v)
 }
 #endif
 
+#ifndef ff_clz
+#define ff_clz ff_clz_c
+static av_always_inline av_const unsigned ff_clz_c(unsigned x)
+{
+    unsigned i = sizeof(x) * 8;
+
+    while (x) {
+        x >>= 1;
+        i--;
+    }
+
+    return i;
+}
+#endif
+
+#if AV_GCC_VERSION_AT_LEAST(3,4)
+#ifndef av_parity
+#define av_parity __builtin_parity
+#endif
+#endif
+
 /**
  * @}
  */