shithub: libvpx

Download patch

ref: be1b41673fcc1c0e00b5844a9a82b82008c449d2
parent: 282f36adc4d87539ef204cfc05049f50fed9734b
parent: ffd3d4834b5a0f081b3910428408cd6291465e6c
author: Alex Converse <[email protected]>
date: Mon Feb 3 11:26:33 EST 2014

Merge "INLINE and reimplement get_unsigned_bits()."

--- 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 @@
   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