Commit 40ae02c2 authored by James Zern's avatar James Zern
Browse files

rename LOG2_* defines to *_LOG2

gets rid of a mix of styles

Change-Id: I3591d312157bc6f53a25438bf047765c671fd8a8
parent 8adc20ce
......@@ -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);
......
......@@ -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)
......
......@@ -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,
......
......@@ -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,
......
......@@ -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;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment