[FFmpeg-cvslog] r25120 - in trunk/libavutil: avutil.h common.h
thardin
subversion
Tue Sep 14 16:45:43 CEST 2010
Author: thardin
Date: Tue Sep 14 16:45:43 2010
New Revision: 25120
Log:
Add av_popcount() to libavutil/common.h and bump minor version
Modified:
trunk/libavutil/avutil.h
trunk/libavutil/common.h
Modified: trunk/libavutil/avutil.h
==============================================================================
--- trunk/libavutil/avutil.h Tue Sep 14 15:36:26 2010 (r25119)
+++ trunk/libavutil/avutil.h Tue Sep 14 16:45:43 2010 (r25120)
@@ -40,7 +40,7 @@
#define AV_VERSION(a, b, c) AV_VERSION_DOT(a, b, c)
#define LIBAVUTIL_VERSION_MAJOR 50
-#define LIBAVUTIL_VERSION_MINOR 26
+#define LIBAVUTIL_VERSION_MINOR 27
#define LIBAVUTIL_VERSION_MICRO 0
#define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \
Modified: trunk/libavutil/common.h
==============================================================================
--- trunk/libavutil/common.h Tue Sep 14 15:36:26 2010 (r25119)
+++ trunk/libavutil/common.h Tue Sep 14 16:45:43 2010 (r25120)
@@ -192,6 +192,20 @@ static inline av_const int av_ceil_log2_
return av_log2((x - 1) << 1);
}
+/**
+ * Count number of bits set to one in x
+ * @param x value to count bits of
+ * @return the number of bits set to one in x
+ */
+static inline av_const int av_popcount_c(uint32_t x)
+{
+ x -= (x >> 1) & 0x55555555;
+ x = (x & 0x33333333) + ((x >> 2) & 0x33333333);
+ x = (x + (x >> 4)) & 0x0F0F0F0F;
+ x += x >> 8;
+ return (x + (x >> 16)) & 0x3F;
+}
+
#define MKTAG(a,b,c,d) ((a) | ((b) << 8) | ((c) << 16) | ((d) << 24))
#define MKBETAG(a,b,c,d) ((d) | ((c) << 8) | ((b) << 16) | ((a) << 24))
@@ -351,3 +365,6 @@ static inline av_const int av_ceil_log2_
#ifndef av_clipf
# define av_clipf av_clipf_c
#endif
+#ifndef av_popcount
+# define av_popcount av_popcount_c
+#endif
More information about the ffmpeg-cvslog
mailing list