summaryrefslogtreecommitdiffstats
path: root/libvpx/vp9/common/vp9_common.h
diff options
context:
space:
mode:
Diffstat (limited to 'libvpx/vp9/common/vp9_common.h')
-rw-r--r--libvpx/vp9/common/vp9_common.h21
1 files changed, 11 insertions, 10 deletions
diff --git a/libvpx/vp9/common/vp9_common.h b/libvpx/vp9/common/vp9_common.h
index 36d1cdf..2dccb70 100644
--- a/libvpx/vp9/common/vp9_common.h
+++ b/libvpx/vp9/common/vp9_common.h
@@ -18,6 +18,11 @@
#include "./vpx_config.h"
#include "vpx_mem/vpx_mem.h"
#include "vpx/vpx_integer.h"
+#include "vp9/common/vp9_systemdependent.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
#define MIN(x, y) (((x) < (y)) ? (x) : (y))
#define MAX(x, y) (((x) > (y)) ? (x) : (y))
@@ -55,16 +60,8 @@ static INLINE double fclamp(double value, double low, double high) {
return value < low ? low : (value > high ? high : value);
}
-static int get_unsigned_bits(unsigned int num_values) {
- int cat = 0;
- if (num_values <= 1)
- return 0;
- num_values--;
- while (num_values > 0) {
- cat++;
- num_values >>= 1;
- }
- return cat;
+static INLINE int get_unsigned_bits(unsigned int num_values) {
+ return num_values > 0 ? get_msb(num_values) + 1 : 0;
}
#if CONFIG_DEBUG
@@ -91,4 +88,8 @@ static int get_unsigned_bits(unsigned int num_values) {
#define VP9_FRAME_MARKER 0x2
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
#endif // VP9_COMMON_VP9_COMMON_H_