summaryrefslogtreecommitdiff
path: root/vp9/common
diff options
context:
space:
mode:
authorAlex Converse <aconverse@google.com>2014-02-03 12:12:01 -0800
committerAlex Converse <aconverse@google.com>2014-02-03 12:16:22 -0800
commitffd3d4834b5a0f081b3910428408cd6291465e6c (patch)
treee3fd336b0ba4ff3c1ab451e1c705c5f8a0bacfaf /vp9/common
parent41d3c989fdbe5406ca155206e271279473d5691f (diff)
downloadlibvpx-ffd3d4834b5a0f081b3910428408cd6291465e6c.tar
libvpx-ffd3d4834b5a0f081b3910428408cd6291465e6c.tar.gz
libvpx-ffd3d4834b5a0f081b3910428408cd6291465e6c.tar.bz2
libvpx-ffd3d4834b5a0f081b3910428408cd6291465e6c.zip
INLINE and reimplement get_unsigned_bits().
The new implementation disagrees when the argument is equal to 2**n but that is never called in practice and based on how it is used the new implementation is correct in that case. Change-Id: Ifbac4ad87d459fe6bd2fd0f400c0340f96617342
Diffstat (limited to 'vp9/common')
-rw-r--r--vp9/common/vp9_common.h13
1 files changed, 3 insertions, 10 deletions
diff --git a/vp9/common/vp9_common.h b/vp9/common/vp9_common.h
index 69964dae8..2dccb7031 100644
--- a/vp9/common/vp9_common.h
+++ b/vp9/common/vp9_common.h
@@ -18,6 +18,7 @@
#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" {
@@ -59,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