]> granicus.if.org Git - libvpx/commitdiff
mi_width_log2 & mi_height_log2
authorJim Bankoski <jimbankoski@google.com>
Wed, 10 Jul 2013 14:26:08 +0000 (07:26 -0700)
committerJim Bankoski <jimbankoski@google.com>
Wed, 10 Jul 2013 14:26:08 +0000 (07:26 -0700)
converted to lookup to avoid unnecessary code

Change-Id: I2ee6a01f06984cc2c4ba74b3fffd215318f749d2

vp9/common/vp9_blockd.h
vp9/common/vp9_common_data.c
vp9/common/vp9_common_data.h

index 8c5827663dfa48703a856b9c7b7d7e19e6ffc7d7..7c7ae6db886dc7c533a6aebcbf3ce1967ebd5347 100644 (file)
@@ -149,20 +149,11 @@ static INLINE int b_height_log2(BLOCK_SIZE_TYPE sb_type) {
 }
 
 static INLINE int mi_width_log2(BLOCK_SIZE_TYPE sb_type) {
-  int a = b_width_log2(sb_type) - 1;
-  // align 4x4 block to mode_info
-  if (a < 0)
-    a = 0;
-  assert(a >= 0);
-  return a;
+  return mi_width_log2_lookup[sb_type];
 }
 
 static INLINE int mi_height_log2(BLOCK_SIZE_TYPE sb_type) {
-  int a = b_height_log2(sb_type) - 1;
-  if (a < 0)
-    a = 0;
-  assert(a >= 0);
-  return a;
+  return mi_height_log2_lookup[sb_type];
 }
 
 typedef struct {
index feb107e137fbbab533db51bf3ea3df43a75cab18..57e3d2f582161d7c1a2d8d89beb66e40b31d56f7 100644 (file)
@@ -15,3 +15,8 @@ const int b_width_log2_lookup[BLOCK_SIZE_TYPES] =
   {0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4};
 const int b_height_log2_lookup[BLOCK_SIZE_TYPES] =
   {0, 1, 0, 1, 2, 1, 2, 3, 2, 3, 4, 3, 4};
+// Log 2 conversion lookup tables for modeinfo width and height
+const int mi_width_log2_lookup[BLOCK_SIZE_TYPES] =
+  {0, 0, 0, 0, 0, 1, 1, 1, 2, 2, 2, 3, 3};
+const int mi_height_log2_lookup[BLOCK_SIZE_TYPES] =
+  {0, 0, 0, 0, 1, 0, 1, 2, 1, 2, 3, 2, 3};
index f080fddc7733d1c4c095414aa2b8556cc9123ac3..7f9f904337738620e5d55bfd8c84624563ef8f52 100644 (file)
@@ -15,5 +15,7 @@
 
 extern const int b_width_log2_lookup[BLOCK_SIZE_TYPES];
 extern const int b_height_log2_lookup[BLOCK_SIZE_TYPES];
+extern const int mi_width_log2_lookup[BLOCK_SIZE_TYPES];
+extern const int mi_height_log2_lookup[BLOCK_SIZE_TYPES];
 
 #endif    // VP9_COMMON_VP9_COMMON_DATA_H