From 40ae02c247c99ce863f1fd4e21192dfbdc08aecb Mon Sep 17 00:00:00 2001 From: James Zern Date: Thu, 22 Aug 2013 14:45:24 -0700 Subject: [PATCH] rename LOG2_* defines to *_LOG2 gets rid of a mix of styles Change-Id: I3591d312157bc6f53a25438bf047765c671fd8a8 --- vp9/common/vp9_alloccommon.c | 12 ++++++------ vp9/common/vp9_enums.h | 8 ++++---- vp9/common/vp9_onyxc_int.h | 2 +- vp9/common/vp9_tile_common.c | 2 +- vp9/encoder/vp9_encodeframe.c | 8 ++++---- 5 files changed, 16 insertions(+), 16 deletions(-) diff --git a/vp9/common/vp9_alloccommon.c b/vp9/common/vp9_alloccommon.c index c0121626e..b68a052f7 100644 --- a/vp9/common/vp9_alloccommon.c +++ b/vp9/common/vp9_alloccommon.c @@ -74,8 +74,8 @@ static void set_mb_mi(VP9_COMMON *cm, int aligned_width, int aligned_height) { cm->mb_rows = (aligned_height + 8) >> 4; cm->MBs = cm->mb_rows * cm->mb_cols; - cm->mi_cols = aligned_width >> LOG2_MI_SIZE; - cm->mi_rows = aligned_height >> LOG2_MI_SIZE; + cm->mi_cols = aligned_width >> MI_SIZE_LOG2; + cm->mi_rows = aligned_height >> MI_SIZE_LOG2; cm->mode_info_stride = cm->mi_cols + MI_BLOCK_SIZE; } @@ -96,8 +96,8 @@ static void setup_mi(VP9_COMMON *cm) { int vp9_alloc_frame_buffers(VP9_COMMON *oci, int width, int height) { int i, mi_cols; - const int aligned_width = ALIGN_POWER_OF_TWO(width, LOG2_MI_SIZE); - const int aligned_height = ALIGN_POWER_OF_TWO(height, LOG2_MI_SIZE); + const int aligned_width = ALIGN_POWER_OF_TWO(width, MI_SIZE_LOG2); + const int aligned_height = ALIGN_POWER_OF_TWO(height, MI_SIZE_LOG2); const int ss_x = oci->subsampling_x; const int ss_y = oci->subsampling_y; int mi_size; @@ -192,8 +192,8 @@ void vp9_initialize_common() { void vp9_update_frame_size(VP9_COMMON *cm) { int i, mi_cols; - const int aligned_width = ALIGN_POWER_OF_TWO(cm->width, LOG2_MI_SIZE); - const int aligned_height = ALIGN_POWER_OF_TWO(cm->height, LOG2_MI_SIZE); + const int aligned_width = ALIGN_POWER_OF_TWO(cm->width, MI_SIZE_LOG2); + const int aligned_height = ALIGN_POWER_OF_TWO(cm->height, MI_SIZE_LOG2); set_mb_mi(cm, aligned_width, aligned_height); setup_mi(cm); diff --git a/vp9/common/vp9_enums.h b/vp9/common/vp9_enums.h index 2720386aa..ef9398d4d 100644 --- a/vp9/common/vp9_enums.h +++ b/vp9/common/vp9_enums.h @@ -13,12 +13,12 @@ #include "./vpx_config.h" -#define LOG2_MI_SIZE 3 -#define LOG2_MI_BLOCK_SIZE (6 - LOG2_MI_SIZE) // 64 = 2^6 +#define MI_SIZE_LOG2 3 +#define MI_BLOCK_SIZE_LOG2 (6 - MI_SIZE_LOG2) // 64 = 2^6 #define MAX_BLOCK_SIZE (1 << 6) // max block size in pixel -#define MI_SIZE (1 << LOG2_MI_SIZE) // pixels per mi-unit -#define MI_BLOCK_SIZE (1 << LOG2_MI_BLOCK_SIZE) // mi-units per max block +#define MI_SIZE (1 << MI_SIZE_LOG2) // pixels per mi-unit +#define MI_BLOCK_SIZE (1 << MI_BLOCK_SIZE_LOG2) // mi-units per max block #define MI_MASK (MI_BLOCK_SIZE - 1) diff --git a/vp9/common/vp9_onyxc_int.h b/vp9/common/vp9_onyxc_int.h index 1693817ef..5f3f0cc7c 100644 --- a/vp9/common/vp9_onyxc_int.h +++ b/vp9/common/vp9_onyxc_int.h @@ -234,7 +234,7 @@ static void ref_cnt_fb(int *buf, int *idx, int new_idx) { } static int mi_cols_aligned_to_sb(int n_mis) { - return ALIGN_POWER_OF_TWO(n_mis, LOG2_MI_BLOCK_SIZE); + return ALIGN_POWER_OF_TWO(n_mis, MI_BLOCK_SIZE_LOG2); } static INLINE void set_skip_context(VP9_COMMON *cm, MACROBLOCKD *xd, diff --git a/vp9/common/vp9_tile_common.c b/vp9/common/vp9_tile_common.c index a72d2ab94..1791c1a8f 100644 --- a/vp9/common/vp9_tile_common.c +++ b/vp9/common/vp9_tile_common.c @@ -14,7 +14,7 @@ #define MAX_TILE_WIDTH_B64 64 static int to_sbs(n_mis) { - return mi_cols_aligned_to_sb(n_mis) >> LOG2_MI_BLOCK_SIZE; + return mi_cols_aligned_to_sb(n_mis) >> MI_BLOCK_SIZE_LOG2; } static void vp9_get_tile_offsets(int *min_tile_off, int *max_tile_off, diff --git a/vp9/encoder/vp9_encodeframe.c b/vp9/encoder/vp9_encodeframe.c index 802cf3795..8efd2f416 100644 --- a/vp9/encoder/vp9_encodeframe.c +++ b/vp9/encoder/vp9_encodeframe.c @@ -374,8 +374,8 @@ static void update_state(VP9_COMP *cpi, PICK_MODE_CONTEXT *ctx, // when the mode was picked for it for (y = 0; y < mi_height; y++) for (x_idx = 0; x_idx < mi_width; x_idx++) - if ((xd->mb_to_right_edge >> (3 + LOG2_MI_SIZE)) + mi_width > x_idx - && (xd->mb_to_bottom_edge >> (3 + LOG2_MI_SIZE)) + mi_height > y) + if ((xd->mb_to_right_edge >> (3 + MI_SIZE_LOG2)) + mi_width > x_idx + && (xd->mb_to_bottom_edge >> (3 + MI_SIZE_LOG2)) + mi_height > y) xd->mode_info_context[x_idx + y * mis] = *mi; // FIXME(rbultje) I'm pretty sure this should go to the end of this block @@ -449,8 +449,8 @@ static void update_state(VP9_COMP *cpi, PICK_MODE_CONTEXT *ctx, int i, j; for (j = 0; j < mi_height; ++j) for (i = 0; i < mi_width; ++i) - if ((xd->mb_to_right_edge >> (3 + LOG2_MI_SIZE)) + mi_width > i - && (xd->mb_to_bottom_edge >> (3 + LOG2_MI_SIZE)) + mi_height > j) + if ((xd->mb_to_right_edge >> (3 + MI_SIZE_LOG2)) + mi_width > i + && (xd->mb_to_bottom_edge >> (3 + MI_SIZE_LOG2)) + mi_height > j) xd->mode_info_context[mis * j + i].mbmi = *mbmi; }