Rename MI_BLOCK_SIZE.* -> MAX_MIB_SIZE.* (MIB is for MI Block).
Rename MI_MASK.* -> MAX_MIB_MASK.*
There are no functional changes.
This is in preparation for coding the superblock size at the frame
level, which will require some of these constants to become variables.
The new names better reflect future semantics, and hence make the code
clearer.
Change-Id: Iee08d97554cf4cc16a5dc166a3ffd1ab91529992
#if CONFIG_VAR_TX
// TODO(jingning): This effectively assigned a separate entry for each
// 8x8 block. Apparently it takes much more space than needed.
- TX_SIZE inter_tx_size[MI_BLOCK_SIZE][MI_BLOCK_SIZE];
+ TX_SIZE inter_tx_size[MAX_MIB_SIZE][MAX_MIB_SIZE];
#endif
int8_t skip;
int8_t has_no_coeffs;
const YV12_BUFFER_CONFIG *cur_buf;
ENTROPY_CONTEXT *above_context[MAX_MB_PLANE];
- ENTROPY_CONTEXT left_context[MAX_MB_PLANE][2 * MI_BLOCK_SIZE];
+ ENTROPY_CONTEXT left_context[MAX_MB_PLANE][2 * MAX_MIB_SIZE];
PARTITION_CONTEXT *above_seg_context;
- PARTITION_CONTEXT left_seg_context[MI_BLOCK_SIZE];
+ PARTITION_CONTEXT left_seg_context[MAX_MIB_SIZE];
#if CONFIG_VAR_TX
TXFM_CONTEXT *above_txfm_context;
TXFM_CONTEXT *left_txfm_context;
- TXFM_CONTEXT left_txfm_context_buffer[MI_BLOCK_SIZE];
+ TXFM_CONTEXT left_txfm_context_buffer[MAX_MIB_SIZE];
TX_SIZE max_tx_size;
#if CONFIG_SUPERTX
#undef MAX_SB_SIZE
+// Pixels per max superblock size
#if CONFIG_EXT_PARTITION
# define MAX_SB_SIZE_LOG2 7
#else
# define MAX_SB_SIZE_LOG2 6
#endif // CONFIG_EXT_PARTITION
-
-#define MAX_SB_SIZE (1 << MAX_SB_SIZE_LOG2)
+#define MAX_SB_SIZE (1 << MAX_SB_SIZE_LOG2)
#define MAX_SB_SQUARE (MAX_SB_SIZE * MAX_SB_SIZE)
-#define MI_SIZE_LOG2 3
-#define MI_SIZE (1 << MI_SIZE_LOG2) // pixels per mi-unit
+// Pixels per Mode Info (MI) unit
+#define MI_SIZE_LOG2 3
+#define MI_SIZE (1 << MI_SIZE_LOG2)
-#define MI_BLOCK_SIZE_LOG2 (MAX_SB_SIZE_LOG2 - MI_SIZE_LOG2)
-#define MI_BLOCK_SIZE (1 << MI_BLOCK_SIZE_LOG2) // mi-units per max block
+// MI-units per max superblock (MI Block - MIB)
+#define MAX_MIB_SIZE_LOG2 (MAX_SB_SIZE_LOG2 - MI_SIZE_LOG2)
+#define MAX_MIB_SIZE (1 << MAX_MIB_SIZE_LOG2)
-#define MI_MASK (MI_BLOCK_SIZE - 1)
-#define MI_MASK_2 (MI_BLOCK_SIZE * 2 - 1)
+// Mask to extract MI offset within max MIB
+#define MAX_MIB_MASK (MAX_MIB_SIZE - 1)
+#define MAX_MIB_MASK_2 (MAX_MIB_SIZE * 2 - 1)
#if CONFIG_EXT_TILE
# define MAX_TILE_ROWS 1024
const int shift_32_uv[] = {0, 2, 8, 10};
const int shift_16_uv[] = {0, 1, 4, 5};
int i;
- const int max_rows = (mi_row + MI_BLOCK_SIZE > cm->mi_rows ?
- cm->mi_rows - mi_row : MI_BLOCK_SIZE);
- const int max_cols = (mi_col + MI_BLOCK_SIZE > cm->mi_cols ?
- cm->mi_cols - mi_col : MI_BLOCK_SIZE);
+ const int max_rows = (mi_row + MAX_MIB_SIZE > cm->mi_rows ?
+ cm->mi_rows - mi_row : MAX_MIB_SIZE);
+ const int max_cols = (mi_col + MAX_MIB_SIZE > cm->mi_cols ?
+ cm->mi_cols - mi_col : MAX_MIB_SIZE);
#if CONFIG_EXT_PARTITION
assert(0 && "Not yet updated");
#endif // CONFIG_EXT_PARTITION
lfm->above_uv[TX_4X4] &= ~above_border_uv;
// We do some special edge handling.
- if (mi_row + MI_BLOCK_SIZE > cm->mi_rows) {
+ if (mi_row + MAX_MIB_SIZE > cm->mi_rows) {
const uint64_t rows = cm->mi_rows - mi_row;
// Each pixel inside the border gets a 1,
const uint64_t mask_y =
- (((uint64_t) 1 << (rows << MI_BLOCK_SIZE_LOG2)) - 1);
+ (((uint64_t) 1 << (rows << MAX_MIB_SIZE_LOG2)) - 1);
const uint16_t mask_uv =
- (((uint16_t) 1 << (((rows + 1) >> 1) << (MI_BLOCK_SIZE_LOG2 - 1))) - 1);
+ (((uint16_t) 1 << (((rows + 1) >> 1) << (MAX_MIB_SIZE_LOG2 - 1))) - 1);
// Remove values completely outside our border.
for (i = 0; i < TX_32X32; i++) {
}
}
- if (mi_col + MI_BLOCK_SIZE > cm->mi_cols) {
+ if (mi_col + MAX_MIB_SIZE > cm->mi_cols) {
const uint64_t columns = cm->mi_cols - mi_col;
// Each pixel inside the border gets a 1, the multiply copies the border
const int row_step_stride = cm->mi_stride * row_step;
struct buf_2d *const dst = &plane->dst;
uint8_t* const dst0 = dst->buf;
- unsigned int mask_16x16[MI_BLOCK_SIZE] = {0};
- unsigned int mask_8x8[MI_BLOCK_SIZE] = {0};
- unsigned int mask_4x4[MI_BLOCK_SIZE] = {0};
- unsigned int mask_4x4_int[MI_BLOCK_SIZE] = {0};
- uint8_t lfl[MI_BLOCK_SIZE * MI_BLOCK_SIZE];
+ unsigned int mask_16x16[MAX_MIB_SIZE] = {0};
+ unsigned int mask_8x8[MAX_MIB_SIZE] = {0};
+ unsigned int mask_4x4[MAX_MIB_SIZE] = {0};
+ unsigned int mask_4x4_int[MAX_MIB_SIZE] = {0};
+ uint8_t lfl[MAX_MIB_SIZE * MAX_MIB_SIZE];
int r, c;
- for (r = 0; r < MI_BLOCK_SIZE && mi_row + r < cm->mi_rows; r += row_step) {
+ for (r = 0; r < MAX_MIB_SIZE && mi_row + r < cm->mi_rows; r += row_step) {
unsigned int mask_16x16_c = 0;
unsigned int mask_8x8_c = 0;
unsigned int mask_4x4_c = 0;
unsigned int border_mask;
// Determine the vertical edges that need filtering
- for (c = 0; c < MI_BLOCK_SIZE && mi_col + c < cm->mi_cols; c += col_step) {
+ for (c = 0; c < MAX_MIB_SIZE && mi_col + c < cm->mi_cols; c += col_step) {
const MODE_INFO *mi = mi_8x8[c];
const MB_MODE_INFO *mbmi = &mi[0].mbmi;
const BLOCK_SIZE sb_type = mbmi->sb_type;
int tx_size_mask = 0;
// Filter level can vary per MI
- if (!(lfl[(r << MI_BLOCK_SIZE_LOG2) + (c >> ss_x)] =
+ if (!(lfl[(r << MAX_MIB_SIZE_LOG2) + (c >> ss_x)] =
get_filter_level(&cm->lf_info, mbmi)))
continue;
tx_size_r = VPXMIN(tx_size,
cm->above_txfm_context[mi_col + c]);
tx_size_c = VPXMIN(tx_size,
- cm->left_txfm_context[(mi_row + r) & MI_MASK]);
+ cm->left_txfm_context[(mi_row + r) & MAX_MIB_MASK]);
cm->above_txfm_context[mi_col + c] = tx_size;
- cm->left_txfm_context[(mi_row + r) & MI_MASK] = tx_size;
+ cm->left_txfm_context[(mi_row + r) & MAX_MIB_MASK] = tx_size;
#endif
// Build masks based on the transform size of each block
mask_8x8_c & border_mask,
mask_4x4_c & border_mask,
mask_4x4_int[r],
- &cm->lf_info, &lfl[r << MI_BLOCK_SIZE_LOG2],
+ &cm->lf_info, &lfl[r << MAX_MIB_SIZE_LOG2],
(int)cm->bit_depth);
} else {
filter_selectively_vert(dst->buf, dst->stride,
mask_8x8_c & border_mask,
mask_4x4_c & border_mask,
mask_4x4_int[r],
- &cm->lf_info, &lfl[r << MI_BLOCK_SIZE_LOG2]);
+ &cm->lf_info, &lfl[r << MAX_MIB_SIZE_LOG2]);
}
#else
filter_selectively_vert(dst->buf, dst->stride,
mask_8x8_c & border_mask,
mask_4x4_c & border_mask,
mask_4x4_int[r],
- &cm->lf_info, &lfl[r << MI_BLOCK_SIZE_LOG2]);
+ &cm->lf_info, &lfl[r << MAX_MIB_SIZE_LOG2]);
#endif // CONFIG_VP9_HIGHBITDEPTH
dst->buf += 8 * dst->stride;
mi_8x8 += row_step_stride;
// Now do horizontal pass
dst->buf = dst0;
- for (r = 0; r < MI_BLOCK_SIZE && mi_row + r < cm->mi_rows; r += row_step) {
+ for (r = 0; r < MAX_MIB_SIZE && mi_row + r < cm->mi_rows; r += row_step) {
const int skip_border_4x4_r = ss_y && mi_row + r == cm->mi_rows - 1;
const unsigned int mask_4x4_int_r = skip_border_4x4_r ? 0 : mask_4x4_int[r];
mask_8x8_r,
mask_4x4_r,
mask_4x4_int_r,
- &cm->lf_info, &lfl[r << MI_BLOCK_SIZE_LOG2],
+ &cm->lf_info, &lfl[r << MAX_MIB_SIZE_LOG2],
(int)cm->bit_depth);
} else {
filter_selectively_horiz(dst->buf, dst->stride,
mask_8x8_r,
mask_4x4_r,
mask_4x4_int_r,
- &cm->lf_info, &lfl[r << MI_BLOCK_SIZE_LOG2]);
+ &cm->lf_info, &lfl[r << MAX_MIB_SIZE_LOG2]);
}
#else
filter_selectively_horiz(dst->buf, dst->stride,
mask_8x8_r,
mask_4x4_r,
mask_4x4_int_r,
- &cm->lf_info, &lfl[r << MI_BLOCK_SIZE_LOG2]);
+ &cm->lf_info, &lfl[r << MAX_MIB_SIZE_LOG2]);
#endif // CONFIG_VP9_HIGHBITDEPTH
dst->buf += 8 * dst->stride;
}
assert(plane->subsampling_x == 0 && plane->subsampling_y == 0);
// Vertical pass: do 2 rows at one time
- for (r = 0; r < MI_BLOCK_SIZE && mi_row + r < cm->mi_rows; r += 2) {
+ for (r = 0; r < MAX_MIB_SIZE && mi_row + r < cm->mi_rows; r += 2) {
unsigned int mask_16x16_l = mask_16x16 & 0xffff;
unsigned int mask_8x8_l = mask_8x8 & 0xffff;
unsigned int mask_4x4_l = mask_4x4 & 0xffff;
highbd_filter_selectively_vert_row2(
plane->subsampling_x, CONVERT_TO_SHORTPTR(dst->buf), dst->stride,
mask_16x16_l, mask_8x8_l, mask_4x4_l, mask_4x4_int_l, &cm->lf_info,
- &lfm->lfl_y[r << MI_BLOCK_SIZE_LOG2], (int)cm->bit_depth);
+ &lfm->lfl_y[r << MAX_MIB_SIZE_LOG2], (int)cm->bit_depth);
} else {
filter_selectively_vert_row2(
plane->subsampling_x, dst->buf, dst->stride, mask_16x16_l, mask_8x8_l,
mask_4x4_l, mask_4x4_int_l, &cm->lf_info,
- &lfm->lfl_y[r << MI_BLOCK_SIZE_LOG2]);
+ &lfm->lfl_y[r << MAX_MIB_SIZE_LOG2]);
}
#else
filter_selectively_vert_row2(
plane->subsampling_x, dst->buf, dst->stride, mask_16x16_l, mask_8x8_l,
mask_4x4_l, mask_4x4_int_l, &cm->lf_info,
- &lfm->lfl_y[r << MI_BLOCK_SIZE_LOG2]);
+ &lfm->lfl_y[r << MAX_MIB_SIZE_LOG2]);
#endif // CONFIG_VP9_HIGHBITDEPTH
dst->buf += 16 * dst->stride;
mask_16x16 >>= 16;
mask_4x4 = lfm->above_y[TX_4X4];
mask_4x4_int = lfm->int_4x4_y;
- for (r = 0; r < MI_BLOCK_SIZE && mi_row + r < cm->mi_rows; r++) {
+ for (r = 0; r < MAX_MIB_SIZE && mi_row + r < cm->mi_rows; r++) {
unsigned int mask_16x16_r;
unsigned int mask_8x8_r;
unsigned int mask_4x4_r;
highbd_filter_selectively_horiz(
CONVERT_TO_SHORTPTR(dst->buf), dst->stride, mask_16x16_r, mask_8x8_r,
mask_4x4_r, mask_4x4_int & 0xff, &cm->lf_info,
- &lfm->lfl_y[r << MI_BLOCK_SIZE_LOG2],
+ &lfm->lfl_y[r << MAX_MIB_SIZE_LOG2],
(int)cm->bit_depth);
} else {
filter_selectively_horiz(dst->buf, dst->stride, mask_16x16_r, mask_8x8_r,
mask_4x4_r, mask_4x4_int & 0xff, &cm->lf_info,
- &lfm->lfl_y[r << MI_BLOCK_SIZE_LOG2]);
+ &lfm->lfl_y[r << MAX_MIB_SIZE_LOG2]);
}
#else
filter_selectively_horiz(dst->buf, dst->stride, mask_16x16_r, mask_8x8_r,
mask_4x4_r, mask_4x4_int & 0xff, &cm->lf_info,
- &lfm->lfl_y[r << MI_BLOCK_SIZE_LOG2]);
+ &lfm->lfl_y[r << MAX_MIB_SIZE_LOG2]);
#endif // CONFIG_VP9_HIGHBITDEPTH
dst->buf += 8 * dst->stride;
assert(plane->subsampling_x == 1 && plane->subsampling_y == 1);
// Vertical pass: do 2 rows at one time
- for (r = 0; r < MI_BLOCK_SIZE && mi_row + r < cm->mi_rows; r += 4) {
+ for (r = 0; r < MAX_MIB_SIZE && mi_row + r < cm->mi_rows; r += 4) {
if (plane->plane_type == 1) {
- for (c = 0; c < (MI_BLOCK_SIZE >> 1); c++) {
+ for (c = 0; c < (MAX_MIB_SIZE >> 1); c++) {
lfm->lfl_uv[(r << 1) + c] =
- lfm->lfl_y[(r << MI_BLOCK_SIZE_LOG2) + (c << 1)];
+ lfm->lfl_y[(r << MAX_MIB_SIZE_LOG2) + (c << 1)];
lfm->lfl_uv[((r + 2) << 1) + c] =
- lfm->lfl_y[((r + 2) << MI_BLOCK_SIZE_LOG2) + (c << 1)];
+ lfm->lfl_y[((r + 2) << MAX_MIB_SIZE_LOG2) + (c << 1)];
}
}
mask_4x4 = lfm->above_uv[TX_4X4];
mask_4x4_int = lfm->above_int_4x4_uv;
- for (r = 0; r < MI_BLOCK_SIZE && mi_row + r < cm->mi_rows; r += 2) {
+ for (r = 0; r < MAX_MIB_SIZE && mi_row + r < cm->mi_rows; r += 2) {
const int skip_border_4x4_r = mi_row + r == cm->mi_rows - 1;
const unsigned int mask_4x4_int_r =
skip_border_4x4_r ? 0 : (mask_4x4_int & 0xf);
# if CONFIG_VAR_TX
memset(cm->above_txfm_context, TX_SIZES, cm->mi_cols);
# endif // CONFIG_VAR_TX
- for (mi_row = start; mi_row < stop; mi_row += MI_BLOCK_SIZE) {
+ for (mi_row = start; mi_row < stop; mi_row += MAX_MIB_SIZE) {
MODE_INFO **mi = cm->mi_grid_visible + mi_row * cm->mi_stride;
# if CONFIG_VAR_TX
- memset(cm->left_txfm_context, TX_SIZES, MI_BLOCK_SIZE);
+ memset(cm->left_txfm_context, TX_SIZES, MAX_MIB_SIZE);
# endif // CONFIG_VAR_TX
- for (mi_col = 0; mi_col < cm->mi_cols; mi_col += MI_BLOCK_SIZE) {
+ for (mi_col = 0; mi_col < cm->mi_cols; mi_col += MAX_MIB_SIZE) {
int plane;
vp10_setup_dst_planes(planes, frame_buffer, mi_row, mi_col);
else
path = LF_PATH_SLOW;
- for (mi_row = start; mi_row < stop; mi_row += MI_BLOCK_SIZE) {
+ for (mi_row = start; mi_row < stop; mi_row += MAX_MIB_SIZE) {
MODE_INFO **mi = cm->mi_grid_visible + mi_row * cm->mi_stride;
- for (mi_col = 0; mi_col < cm->mi_cols; mi_col += MI_BLOCK_SIZE) {
+ for (mi_col = 0; mi_col < cm->mi_cols; mi_col += MAX_MIB_SIZE) {
int plane;
vp10_setup_dst_planes(planes, frame_buffer, mi_row, mi_col);
uint16_t above_uv[TX_SIZES];
uint16_t left_int_4x4_uv;
uint16_t above_int_4x4_uv;
- uint8_t lfl_y[MI_BLOCK_SIZE * MI_BLOCK_SIZE];
- uint8_t lfl_uv[MI_BLOCK_SIZE / 2 * MI_BLOCK_SIZE / 2];
+ uint8_t lfl_y[MAX_MIB_SIZE * MAX_MIB_SIZE];
+ uint8_t lfl_uv[MAX_MIB_SIZE / 2 * MAX_MIB_SIZE / 2];
} LOOP_FILTER_MASK;
/* assorted loopfilter functions which get used elsewhere */
// Last decoded frame and will store the MFQE result.
YV12_BUFFER_CONFIG *dest = &cm->post_proc_buffer;
// Loop through each super block.
- for (mi_row = 0; mi_row < cm->mi_rows; mi_row += MI_BLOCK_SIZE) {
- for (mi_col = 0; mi_col < cm->mi_cols; mi_col += MI_BLOCK_SIZE) {
+ for (mi_row = 0; mi_row < cm->mi_rows; mi_row += MAX_MIB_SIZE) {
+ for (mi_col = 0; mi_col < cm->mi_cols; mi_col += MAX_MIB_SIZE) {
MODE_INFO *mi;
MODE_INFO *mi_local = cm->mi + (mi_row * cm->mi_stride + mi_col);
// Motion Info in last frame.
// For each 4x4 group of blocks, when the bottom right is decoded the blocks
// to the right have not been decoded therefore the bottom right does
// not have a top right
- while (bs < MI_BLOCK_SIZE) {
+ while (bs < MAX_MIB_SIZE) {
if (mi_col & bs) {
if ((mi_col & (2 * bs)) && (mi_row & (2 * bs))) {
has_tr = 0;
ENTROPY_CONTEXT *above_context[MAX_MB_PLANE];
#if CONFIG_VAR_TX
TXFM_CONTEXT *above_txfm_context;
- TXFM_CONTEXT left_txfm_context[MI_BLOCK_SIZE];
+ TXFM_CONTEXT left_txfm_context[MAX_MIB_SIZE];
#endif
int above_context_alloc_cols;
}
static INLINE int mi_cols_aligned_to_sb(int n_mis) {
- return ALIGN_POWER_OF_TWO(n_mis, MI_BLOCK_SIZE_LOG2);
+ return ALIGN_POWER_OF_TWO(n_mis, MAX_MIB_SIZE_LOG2);
}
static INLINE int frame_is_intra_only(const VP10_COMMON *const cm) {
static INLINE void set_skip_context(MACROBLOCKD *xd, int mi_row, int mi_col) {
const int above_idx = mi_col * 2;
- const int left_idx = (mi_row * 2) & MI_MASK_2;
+ const int left_idx = (mi_row * 2) & MAX_MIB_MASK_2;
int i;
for (i = 0; i < MAX_MB_PLANE; ++i) {
struct macroblockd_plane *const pd = &xd->plane[i];
static INLINE int calc_mi_size(int len) {
// len is in mi units.
- return len + MI_BLOCK_SIZE;
+ return len + MAX_MIB_SIZE;
}
static INLINE void set_mi_row_col(MACROBLOCKD *xd, const TileInfo *const tile,
BLOCK_SIZE subsize,
BLOCK_SIZE bsize) {
PARTITION_CONTEXT *const above_ctx = xd->above_seg_context + mi_col;
- PARTITION_CONTEXT *const left_ctx = xd->left_seg_context + (mi_row & MI_MASK);
+ PARTITION_CONTEXT *const left_ctx =
+ xd->left_seg_context + (mi_row & MAX_MIB_MASK);
#if CONFIG_EXT_PARTITION_TYPES
const int bw = num_8x8_blocks_wide_lookup[bsize];
int mi_row, int mi_col,
BLOCK_SIZE bsize) {
const PARTITION_CONTEXT *above_ctx = xd->above_seg_context + mi_col;
- const PARTITION_CONTEXT *left_ctx = xd->left_seg_context + (mi_row & MI_MASK);
+ const PARTITION_CONTEXT *left_ctx =
+ xd->left_seg_context + (mi_row & MAX_MIB_MASK);
const int bsl = mi_width_log2_lookup[bsize];
int above = (*above_ctx >> bsl) & 1 , left = (*left_ctx >> bsl) & 1;
if (x + step < w)
return 1;
- mi_row = (mi_row & MI_MASK) >> hl;
- mi_col = (mi_col & MI_MASK) >> wl;
+ mi_row = (mi_row & MAX_MIB_MASK) >> hl;
+ mi_col = (mi_col & MAX_MIB_MASK) >> wl;
// If top row of coding unit
if (mi_row == 0)
return 1;
// If rightmost column of coding unit
- if (((mi_col + 1) << wl) >= MI_BLOCK_SIZE)
+ if (((mi_col + 1) << wl) >= MAX_MIB_SIZE)
return 0;
- my_order =
- order[((mi_row + 0) << (MI_BLOCK_SIZE_LOG2 - wl)) + mi_col + 0];
- tr_order =
- order[((mi_row - 1) << (MI_BLOCK_SIZE_LOG2 - wl)) + mi_col + 1];
+ my_order = order[((mi_row + 0) << (MAX_MIB_SIZE_LOG2 - wl)) + mi_col + 0];
+ tr_order = order[((mi_row - 1) << (MAX_MIB_SIZE_LOG2 - wl)) + mi_col + 1];
return my_order > tr_order;
} else {
if (y + step < h)
return 1;
- mi_row = (mi_row & MI_MASK) >> hl;
- mi_col = (mi_col & MI_MASK) >> wl;
+ mi_row = (mi_row & MAX_MIB_MASK) >> hl;
+ mi_col = (mi_col & MAX_MIB_MASK) >> wl;
if (mi_col == 0)
- return (mi_row << (hl + !ss_y)) + y + step < (MI_BLOCK_SIZE << !ss_y);
+ return (mi_row << (hl + !ss_y)) + y + step < (MAX_MIB_SIZE << !ss_y);
- if (((mi_row + 1) << hl) >= MI_BLOCK_SIZE)
+ if (((mi_row + 1) << hl) >= MAX_MIB_SIZE)
return 0;
- my_order = order[((mi_row + 0) << (MI_BLOCK_SIZE_LOG2 - wl)) + mi_col + 0];
- bl_order = order[((mi_row + 1) << (MI_BLOCK_SIZE_LOG2 - wl)) + mi_col - 1];
+ my_order = order[((mi_row + 0) << (MAX_MIB_SIZE_LOG2 - wl)) + mi_col + 0];
+ bl_order = order[((mi_row + 1) << (MAX_MIB_SIZE_LOG2 - wl)) + mi_col - 1];
return bl_order < my_order;
}
int start, int stop, int y_only,
VP9LfSync *const lf_sync) {
const int num_planes = y_only ? 1 : MAX_MB_PLANE;
- const int sb_cols = mi_cols_aligned_to_sb(cm->mi_cols) >> MI_BLOCK_SIZE_LOG2;
+ const int sb_cols = mi_cols_aligned_to_sb(cm->mi_cols) >> MAX_MIB_SIZE_LOG2;
int mi_row, mi_col;
#if !CONFIG_EXT_PARTITION_TYPES
enum lf_path path;
#endif // CONFIG_EXT_PARTITION
for (mi_row = start; mi_row < stop;
- mi_row += lf_sync->num_workers * MI_BLOCK_SIZE) {
+ mi_row += lf_sync->num_workers * MAX_MIB_SIZE) {
MODE_INFO **const mi = cm->mi_grid_visible + mi_row * cm->mi_stride;
- for (mi_col = 0; mi_col < cm->mi_cols; mi_col += MI_BLOCK_SIZE) {
- const int r = mi_row >> MI_BLOCK_SIZE_LOG2;
- const int c = mi_col >> MI_BLOCK_SIZE_LOG2;
+ for (mi_col = 0; mi_col < cm->mi_cols; mi_col += MAX_MIB_SIZE) {
+ const int r = mi_row >> MAX_MIB_SIZE_LOG2;
+ const int c = mi_col >> MAX_MIB_SIZE_LOG2;
int plane;
sync_read(lf_sync, r, c);
VP9LfSync *lf_sync) {
const VPxWorkerInterface *const winterface = vpx_get_worker_interface();
// Number of superblock rows and cols
- const int sb_rows = mi_cols_aligned_to_sb(cm->mi_rows) >> MI_BLOCK_SIZE_LOG2;
+ const int sb_rows = mi_cols_aligned_to_sb(cm->mi_rows) >> MAX_MIB_SIZE_LOG2;
// Decoder may allocate more threads than number of tiles based on user's
// input.
const int tile_cols = cm->tile_cols;
// Loopfilter data
vp10_loop_filter_data_reset(lf_data, frame, cm, planes);
- lf_data->start = start + i * MI_BLOCK_SIZE;
+ lf_data->start = start + i * MAX_MIB_SIZE;
lf_data->stop = stop;
lf_data->y_only = y_only;
void vp10_get_tile_n_bits(int mi_cols,
int *min_log2_tile_cols, int *max_log2_tile_cols) {
- const int sb64_cols = mi_cols_aligned_to_sb(mi_cols) >> MI_BLOCK_SIZE_LOG2;
+ const int sb64_cols = mi_cols_aligned_to_sb(mi_cols) >> MAX_MIB_SIZE_LOG2;
*min_log2_tile_cols = get_min_log2_tile_cols(sb64_cols);
*max_log2_tile_cols = get_max_log2_tile_cols(sb64_cols);
assert(*min_log2_tile_cols <= *max_log2_tile_cols);
}
#if CONFIG_VAR_TX
xd->above_txfm_context = cm->above_txfm_context + mi_col;
- xd->left_txfm_context = xd->left_txfm_context_buffer + (mi_row & MI_MASK);
+ xd->left_txfm_context =
+ xd->left_txfm_context_buffer + (mi_row & MAX_MIB_MASK);
set_txfm_ctx(xd->left_txfm_context, xd->mi[0]->mbmi.tx_size, bh);
set_txfm_ctx(xd->above_txfm_context, xd->mi[0]->mbmi.tx_size, bw);
#endif
int mi_row, int mi_col,
int bsl) {
const PARTITION_CONTEXT *above_ctx = xd->above_seg_context + mi_col;
- const PARTITION_CONTEXT *left_ctx = xd->left_seg_context + (mi_row & MI_MASK);
+ const PARTITION_CONTEXT *left_ctx =
+ xd->left_seg_context + (mi_row & MAX_MIB_MASK);
int above = (*above_ctx >> bsl) & 1 , left = (*left_ctx >> bsl) & 1;
// assert(bsl >= 0);
BLOCK_SIZE subsize,
int bw) {
PARTITION_CONTEXT *const above_ctx = xd->above_seg_context + mi_col;
- PARTITION_CONTEXT *const left_ctx = xd->left_seg_context + (mi_row & MI_MASK);
+ PARTITION_CONTEXT *const left_ctx =
+ xd->left_seg_context + (mi_row & MAX_MIB_MASK);
// update the partition context at the end notes. set partition bits
// of block sizes larger than the current one to be one, and partition
cm->tile_width = vpx_rb_read_literal(rb, 6) + 1; // in [1, 64]
cm->tile_height = vpx_rb_read_literal(rb, 6) + 1; // in [1, 64]
- cm->tile_width = cm->tile_width << MI_BLOCK_SIZE_LOG2;
- cm->tile_height = cm->tile_height << MI_BLOCK_SIZE_LOG2;
+ cm->tile_width = cm->tile_width << MAX_MIB_SIZE_LOG2;
+ cm->tile_height = cm->tile_height << MAX_MIB_SIZE_LOG2;
cm->tile_width = VPXMIN(cm->tile_width, cm->mi_cols);
cm->tile_height = VPXMIN(cm->tile_height, cm->mi_rows);
vp10_zero_above_context(cm, tile_info.mi_col_start, tile_info.mi_col_end);
for (mi_row = tile_info.mi_row_start; mi_row < tile_info.mi_row_end;
- mi_row += MI_BLOCK_SIZE) {
+ mi_row += MAX_MIB_SIZE) {
int mi_col;
vp10_zero_left_context(&td->xd);
for (mi_col = tile_info.mi_col_start; mi_col < tile_info.mi_col_end;
- mi_col += MI_BLOCK_SIZE) {
+ mi_col += MAX_MIB_SIZE) {
decode_partition(pbi, &td->xd,
#if CONFIG_SUPERTX
0,
// Loopfilter one tile row.
if (cm->lf.filter_level && !cm->skip_loop_filter) {
LFWorkerData *const lf_data = (LFWorkerData*)pbi->lf_worker.data1;
- const int lf_start = VPXMAX(0, tile_info.mi_row_start - MI_BLOCK_SIZE);
- const int lf_end = tile_info.mi_row_end - MI_BLOCK_SIZE;
+ const int lf_start = VPXMAX(0, tile_info.mi_row_start - MAX_MIB_SIZE);
+ const int lf_end = tile_info.mi_row_end - MAX_MIB_SIZE;
// Delay the loopfilter if the first tile row is only
// a single superblock high.
// After loopfiltering, the last 7 row pixels in each superblock row may
// still be changed by the longest loopfilter of the next superblock row.
if (cm->frame_parallel_decode)
- vp10_frameworker_broadcast(pbi->cur_buf, mi_row << MI_BLOCK_SIZE_LOG2);
+ vp10_frameworker_broadcast(pbi->cur_buf, mi_row << MAX_MIB_SIZE_LOG2);
#endif // !CONFIG_VAR_TX
}
vp10_zero_above_context(&pbi->common, tile->mi_col_start, tile->mi_col_end);
for (mi_row = tile->mi_row_start; mi_row < tile->mi_row_end;
- mi_row += MI_BLOCK_SIZE) {
+ mi_row += MAX_MIB_SIZE) {
vp10_zero_left_context(&tile_data->xd);
for (mi_col = tile->mi_col_start; mi_col < tile->mi_col_end;
- mi_col += MI_BLOCK_SIZE) {
+ mi_col += MAX_MIB_SIZE) {
decode_partition(pbi, &tile_data->xd,
#if CONFIG_SUPERTX
0,
int ctx = txfm_partition_context(xd->above_txfm_context + tx_col,
xd->left_txfm_context + tx_row,
tx_size);
- TX_SIZE (*const inter_tx_size)[MI_BLOCK_SIZE] =
- (TX_SIZE (*)[MI_BLOCK_SIZE])&mbmi->inter_tx_size[tx_row][tx_col];
+ TX_SIZE (*const inter_tx_size)[MAX_MIB_SIZE] =
+ (TX_SIZE (*)[MAX_MIB_SIZE])&mbmi->inter_tx_size[tx_row][tx_col];
if (xd->mb_to_bottom_edge < 0)
max_blocks_high += xd->mb_to_bottom_edge >> 5;
static void fpm_sync(void *const data, int mi_row) {
VP10Decoder *const pbi = (VP10Decoder *)data;
vp10_frameworker_wait(pbi->frame_worker_owner, pbi->common.prev_frame,
- mi_row << MI_BLOCK_SIZE_LOG2);
+ mi_row << MAX_MIB_SIZE_LOG2);
}
static void read_inter_block_mode_info(VP10Decoder *const pbi,
#if CONFIG_VAR_TX
xd->above_txfm_context = cm->above_txfm_context + mi_col;
- xd->left_txfm_context = xd->left_txfm_context_buffer + (mi_row & MI_MASK);
+ xd->left_txfm_context =
+ xd->left_txfm_context_buffer + (mi_row & MAX_MIB_MASK);
if (bsize >= BLOCK_8X8 && cm->tx_mode == TX_MODE_SELECT &&
!mbmi->skip && inter_block) {
const TX_SIZE max_tx_size = max_txsize_lookup[bsize];
int i, block_count, bl_index, sb_rows, sb_cols, sbs_in_frame;
int xmis, ymis, x, y;
memset(seg_map, CR_SEGMENT_ID_BASE, cm->mi_rows * cm->mi_cols);
- sb_cols = (cm->mi_cols + MI_BLOCK_SIZE - 1) / MI_BLOCK_SIZE;
- sb_rows = (cm->mi_rows + MI_BLOCK_SIZE - 1) / MI_BLOCK_SIZE;
+ sb_cols = (cm->mi_cols + MAX_MIB_SIZE - 1) / MAX_MIB_SIZE;
+ sb_rows = (cm->mi_rows + MAX_MIB_SIZE - 1) / MAX_MIB_SIZE;
sbs_in_frame = sb_cols * sb_rows;
// Number of target blocks to get the q delta (segment 1).
block_count = cr->percent_refresh * cm->mi_rows * cm->mi_cols / 100;
// Get the mi_row/mi_col corresponding to superblock index i.
int sb_row_index = (i / sb_cols);
int sb_col_index = i - sb_row_index * sb_cols;
- int mi_row = sb_row_index * MI_BLOCK_SIZE;
- int mi_col = sb_col_index * MI_BLOCK_SIZE;
+ int mi_row = sb_row_index * MAX_MIB_SIZE;
+ int mi_col = sb_col_index * MAX_MIB_SIZE;
int qindex_thresh =
cpi->oxcf.content == VP9E_CONTENT_SCREEN
? vp10_get_qindex(&cm->seg, CR_SEGMENT_ID_BOOST2, cm->base_qindex)
} else {
#if CONFIG_VAR_TX
xd->above_txfm_context = cm->above_txfm_context + mi_col;
- xd->left_txfm_context = xd->left_txfm_context_buffer + (mi_row & MI_MASK);
+ xd->left_txfm_context =
+ xd->left_txfm_context_buffer + (mi_row & MAX_MIB_MASK);
#endif
pack_inter_mode_mvs(cpi, m,
#if CONFIG_SUPERTX
vp10_zero_above_context(cm, mi_col_start, mi_col_end);
- for (mi_row = mi_row_start; mi_row < mi_row_end; mi_row += MI_BLOCK_SIZE) {
+ for (mi_row = mi_row_start; mi_row < mi_row_end; mi_row += MAX_MIB_SIZE) {
vp10_zero_left_context(xd);
- for (mi_col = mi_col_start; mi_col < mi_col_end; mi_col += MI_BLOCK_SIZE) {
+ for (mi_col = mi_col_start; mi_col < mi_col_end; mi_col += MAX_MIB_SIZE) {
write_modes_sb_wrapper(cpi, tile, w, ans, tok, tok_end, 0,
mi_row, mi_col, BLOCK_LARGEST);
}
#if CONFIG_EXT_TILE
// TODO(geza.lore): Dependent on CU_SIZE
const int tile_width =
- mi_cols_aligned_to_sb(cm->tile_width) >> MI_BLOCK_SIZE_LOG2;
+ mi_cols_aligned_to_sb(cm->tile_width) >> MAX_MIB_SIZE_LOG2;
const int tile_height =
- mi_cols_aligned_to_sb(cm->tile_height) >> MI_BLOCK_SIZE_LOG2;
+ mi_cols_aligned_to_sb(cm->tile_height) >> MAX_MIB_SIZE_LOG2;
assert(tile_width > 0 && tile_width <= 64);
assert(tile_height > 0 && tile_height <= 64);
// Notes transform blocks where no coefficents are coded.
// Set during mode selection. Read during block encoding.
- uint8_t zcoeff_blk[TX_SIZES][MI_BLOCK_SIZE * MI_BLOCK_SIZE * 4];
+ uint8_t zcoeff_blk[TX_SIZES][MAX_MIB_SIZE * MAX_MIB_SIZE * 4];
#if CONFIG_VAR_TX
- uint8_t blk_skip[MAX_MB_PLANE][MI_BLOCK_SIZE * MI_BLOCK_SIZE * 4];
+ uint8_t blk_skip[MAX_MB_PLANE][MAX_MIB_SIZE * MAX_MIB_SIZE * 4];
#if CONFIG_REF_MV
- uint8_t blk_skip_drl[MAX_MB_PLANE][MI_BLOCK_SIZE * MI_BLOCK_SIZE * 4];
+ uint8_t blk_skip_drl[MAX_MB_PLANE][MAX_MIB_SIZE * MAX_MIB_SIZE * 4];
#endif
#endif
#if CONFIG_VAR_TX
xd->above_txfm_context = cm->above_txfm_context + mi_col;
- xd->left_txfm_context = xd->left_txfm_context_buffer + (mi_row & MI_MASK);
+ xd->left_txfm_context =
+ xd->left_txfm_context_buffer + (mi_row & MAX_MIB_MASK);
xd->max_tx_size = max_txsize_lookup[bsize];
#endif
}
typedef struct {
- ENTROPY_CONTEXT a[2 * MI_BLOCK_SIZE * MAX_MB_PLANE];
- ENTROPY_CONTEXT l[2 * MI_BLOCK_SIZE * MAX_MB_PLANE];
- PARTITION_CONTEXT sa[MI_BLOCK_SIZE];
- PARTITION_CONTEXT sl[MI_BLOCK_SIZE];
+ ENTROPY_CONTEXT a[2 * MAX_MIB_SIZE * MAX_MB_PLANE];
+ ENTROPY_CONTEXT l[2 * MAX_MIB_SIZE * MAX_MB_PLANE];
+ PARTITION_CONTEXT sa[MAX_MIB_SIZE];
+ PARTITION_CONTEXT sl[MAX_MIB_SIZE];
#if CONFIG_VAR_TX
TXFM_CONTEXT *p_ta;
TXFM_CONTEXT *p_tl;
- TXFM_CONTEXT ta[MI_BLOCK_SIZE];
- TXFM_CONTEXT tl[MI_BLOCK_SIZE];
+ TXFM_CONTEXT ta[MAX_MIB_SIZE];
+ TXFM_CONTEXT tl[MAX_MIB_SIZE];
#endif
} RD_SEARCH_MACROBLOCK_CONTEXT;
xd->plane[p].subsampling_x);
memcpy(
xd->left_context[p]
- + ((mi_row & MI_MASK) * 2 >> xd->plane[p].subsampling_y),
+ + ((mi_row & MAX_MIB_MASK) * 2 >> xd->plane[p].subsampling_y),
ctx->l + num_4x4_blocks_high * p,
(sizeof(ENTROPY_CONTEXT) * num_4x4_blocks_high) >>
xd->plane[p].subsampling_y);
}
memcpy(xd->above_seg_context + mi_col, ctx->sa,
sizeof(*xd->above_seg_context) * mi_width);
- memcpy(xd->left_seg_context + (mi_row & MI_MASK), ctx->sl,
+ memcpy(xd->left_seg_context + (mi_row & MAX_MIB_MASK), ctx->sl,
sizeof(xd->left_seg_context[0]) * mi_height);
#if CONFIG_VAR_TX
xd->above_txfm_context = ctx->p_ta;
memcpy(
ctx->l + num_4x4_blocks_high * p,
xd->left_context[p]
- + ((mi_row & MI_MASK) * 2 >> xd->plane[p].subsampling_y),
+ + ((mi_row & MAX_MIB_MASK) * 2 >> xd->plane[p].subsampling_y),
(sizeof(ENTROPY_CONTEXT) * num_4x4_blocks_high) >>
xd->plane[p].subsampling_y);
}
memcpy(ctx->sa, xd->above_seg_context + mi_col,
sizeof(*xd->above_seg_context) * mi_width);
- memcpy(ctx->sl, xd->left_seg_context + (mi_row & MI_MASK),
+ memcpy(ctx->sl, xd->left_seg_context + (mi_row & MAX_MIB_MASK),
sizeof(xd->left_seg_context[0]) * mi_height);
#if CONFIG_VAR_TX
memcpy(ctx->ta, xd->above_txfm_context,
BLOCK_SIZE bsize, MODE_INFO **mi_8x8) {
int bh = bh_in;
int r, c;
- for (r = 0; r < MI_BLOCK_SIZE; r += bh) {
+ for (r = 0; r < MAX_MIB_SIZE; r += bh) {
int bw = bw_in;
- for (c = 0; c < MI_BLOCK_SIZE; c += bw) {
+ for (c = 0; c < MAX_MIB_SIZE; c += bw) {
const int index = r * mis + c;
mi_8x8[index] = mi + index;
mi_8x8[index]->mbmi.sb_type = find_partition_size(bsize,
assert((row8x8_remaining > 0) && (col8x8_remaining > 0));
// Apply the requested partition size to the SB64 if it is all "in image"
- if ((col8x8_remaining >= MI_BLOCK_SIZE) &&
- (row8x8_remaining >= MI_BLOCK_SIZE)) {
- for (block_row = 0; block_row < MI_BLOCK_SIZE; block_row += bh) {
- for (block_col = 0; block_col < MI_BLOCK_SIZE; block_col += bw) {
+ if ((col8x8_remaining >= MAX_MIB_SIZE) &&
+ (row8x8_remaining >= MAX_MIB_SIZE)) {
+ for (block_row = 0; block_row < MAX_MIB_SIZE; block_row += bh) {
+ for (block_col = 0; block_col < MAX_MIB_SIZE; block_col += bw) {
int index = block_row * mis + block_col;
mi_8x8[index] = mi_upper_left + index;
mi_8x8[index]->mbmi.sb_type = bsize;
#if CONFIG_VAR_TX
xd->above_txfm_context = cm->above_txfm_context + mi_col;
- xd->left_txfm_context = xd->left_txfm_context_buffer + (mi_row & MI_MASK);
+ xd->left_txfm_context =
+ xd->left_txfm_context_buffer + (mi_row & MAX_MIB_MASK);
#endif
save_context(x, &x_ctx, mi_row, mi_col, bsize);
BLOCK_SIZE *min_block_size,
BLOCK_SIZE *max_block_size,
int bs_hist[BLOCK_SIZES]) {
- int sb_width_in_blocks = MI_BLOCK_SIZE;
- int sb_height_in_blocks = MI_BLOCK_SIZE;
+ int sb_width_in_blocks = MAX_MIB_SIZE;
+ int sb_height_in_blocks = MAX_MIB_SIZE;
int i, j;
int index = 0;
}
// Find the min and max partition sizes used in the left SB64
if (left_in_image) {
- MODE_INFO **left_sb64_mi = &mi[-MI_BLOCK_SIZE];
+ MODE_INFO **left_sb64_mi = &mi[-MAX_MIB_SIZE];
get_sb_partition_size_range(xd, left_sb64_mi, &min_size, &max_size,
bs_hist);
}
// Find the min and max partition sizes used in the above SB64.
if (above_in_image) {
- MODE_INFO **above_sb64_mi = &mi[-xd->mi_stride * MI_BLOCK_SIZE];
+ MODE_INFO **above_sb64_mi = &mi[-xd->mi_stride * MAX_MIB_SIZE];
get_sb_partition_size_range(xd, above_sb64_mi, &min_size, &max_size,
bs_hist);
}
#if CONFIG_VAR_TX
xd->above_txfm_context = cm->above_txfm_context + mi_col;
- xd->left_txfm_context = xd->left_txfm_context_buffer + (mi_row & MI_MASK);
+ xd->left_txfm_context =
+ xd->left_txfm_context_buffer + (mi_row & MAX_MIB_MASK);
#endif
save_context(x, &x_ctx, mi_row, mi_col, bsize);
// Code each SB in the row
for (mi_col = tile_info->mi_col_start; mi_col < tile_info->mi_col_end;
- mi_col += MI_BLOCK_SIZE) {
+ mi_col += MAX_MIB_SIZE) {
const struct segmentation *const seg = &cm->seg;
int dummy_rate;
int64_t dummy_dist;
td->mb.ex_search_count_ptr = &td->rd_counts.ex_search_count;
for (mi_row = tile_info->mi_row_start; mi_row < tile_info->mi_row_end;
- mi_row += MI_BLOCK_SIZE) {
+ mi_row += MAX_MIB_SIZE) {
encode_rd_sb_row(cpi, td, this_tile, mi_row, &tok);
}
int idx, idy;
xd->above_txfm_context = cm->above_txfm_context + mi_col;
- xd->left_txfm_context = xd->left_txfm_context_buffer + (mi_row & MI_MASK);
+ xd->left_txfm_context =
+ xd->left_txfm_context_buffer + (mi_row & MAX_MIB_MASK);
for (idy = 0; idy < mi_height; idy += bh)
for (idx = 0; idx < mi_width; idx += bh)
int idx, idy;
xd->above_txfm_context = cm->above_txfm_context + mi_col;
- xd->left_txfm_context = xd->left_txfm_context_buffer + (mi_row & MI_MASK);
+ xd->left_txfm_context =
+ xd->left_txfm_context_buffer + (mi_row & MAX_MIB_MASK);
for (idy = 0; idy < mi_height; idy += bh)
for (idx = 0; idx < mi_width; idx += bh)
sse_uv = 0;
for (plane = 1; plane < MAX_MB_PLANE; ++plane) {
#if CONFIG_VAR_TX
- ENTROPY_CONTEXT ctxa[2 * MI_BLOCK_SIZE];
- ENTROPY_CONTEXT ctxl[2 * MI_BLOCK_SIZE];
+ ENTROPY_CONTEXT ctxa[2 * MAX_MIB_SIZE];
+ ENTROPY_CONTEXT ctxl[2 * MAX_MIB_SIZE];
const struct macroblockd_plane *const pd = &xd->plane[plane];
int coeff_ctx = 1;
#endif // CONFIG_EXT_TX
for (tx_type = DCT_DCT; tx_type < TX_TYPES; ++tx_type) {
#if CONFIG_VAR_TX
- ENTROPY_CONTEXT ctxa[2 * MI_BLOCK_SIZE];
- ENTROPY_CONTEXT ctxl[2 * MI_BLOCK_SIZE];
+ ENTROPY_CONTEXT ctxa[2 * MAX_MIB_SIZE];
+ ENTROPY_CONTEXT ctxl[2 * MAX_MIB_SIZE];
const struct macroblockd_plane *const pd = &xd->plane[0];
int coeff_ctx = 1;
#endif // CONFIG_VAR_TX
#include "vp10/encoder/tokenize.h"
struct optimize_ctx {
- ENTROPY_CONTEXT ta[MAX_MB_PLANE][2 * MI_BLOCK_SIZE];
- ENTROPY_CONTEXT tl[MAX_MB_PLANE][2 * MI_BLOCK_SIZE];
+ ENTROPY_CONTEXT ta[MAX_MB_PLANE][2 * MAX_MIB_SIZE];
+ ENTROPY_CONTEXT tl[MAX_MB_PLANE][2 * MAX_MIB_SIZE];
};
void vp10_subtract_plane(MACROBLOCK *x, BLOCK_SIZE bsize, int plane) {
static void set_tile_limits(VP10_COMP *cpi) {
VP10_COMMON *const cm = &cpi->common;
#if CONFIG_EXT_TILE
- cm->tile_width = clamp(cpi->oxcf.tile_columns, 1, 64) << MI_BLOCK_SIZE_LOG2;
- cm->tile_height = clamp(cpi->oxcf.tile_rows, 1, 64) << MI_BLOCK_SIZE_LOG2;
+ cm->tile_width = clamp(cpi->oxcf.tile_columns, 1, 64) << MAX_MIB_SIZE_LOG2;
+ cm->tile_height = clamp(cpi->oxcf.tile_rows, 1, 64) << MAX_MIB_SIZE_LOG2;
cm->tile_width = VPXMIN(cm->tile_width, cm->mi_cols);
cm->tile_height = VPXMIN(cm->tile_height, cm->mi_rows);
void vp10_get_entropy_contexts(BLOCK_SIZE bsize, TX_SIZE tx_size,
const struct macroblockd_plane *pd,
- ENTROPY_CONTEXT t_above[2 * MI_BLOCK_SIZE],
- ENTROPY_CONTEXT t_left[2 * MI_BLOCK_SIZE]) {
+ ENTROPY_CONTEXT t_above[2 * MAX_MIB_SIZE],
+ ENTROPY_CONTEXT t_left[2 * MAX_MIB_SIZE]) {
const BLOCK_SIZE plane_bsize = get_plane_block_size(bsize, pd);
const int num_4x4_w = num_4x4_blocks_wide_lookup[plane_bsize];
const int num_4x4_h = num_4x4_blocks_high_lookup[plane_bsize];
void vp10_get_entropy_contexts(BLOCK_SIZE bsize, TX_SIZE tx_size,
const struct macroblockd_plane *pd,
- ENTROPY_CONTEXT t_above[2 * MI_BLOCK_SIZE],
- ENTROPY_CONTEXT t_left[2 * MI_BLOCK_SIZE]);
+ ENTROPY_CONTEXT t_above[2 * MAX_MIB_SIZE],
+ ENTROPY_CONTEXT t_left[2 * MAX_MIB_SIZE]);
void vp10_set_rd_speed_thresholds(struct VP10_COMP *cpi);
struct rdcost_block_args {
const VP10_COMP *cpi;
MACROBLOCK *x;
- ENTROPY_CONTEXT t_above[2 * MI_BLOCK_SIZE];
- ENTROPY_CONTEXT t_left[2 * MI_BLOCK_SIZE];
+ ENTROPY_CONTEXT t_above[2 * MAX_MIB_SIZE];
+ ENTROPY_CONTEXT t_left[2 * MAX_MIB_SIZE];
int this_rate;
int64_t this_dist;
int64_t this_sse;
struct macroblockd_plane *const pd = &xd->plane[plane];
const int tx_row = blk_row >> (1 - pd->subsampling_y);
const int tx_col = blk_col >> (1 - pd->subsampling_x);
- TX_SIZE (*const inter_tx_size)[MI_BLOCK_SIZE] =
- (TX_SIZE (*)[MI_BLOCK_SIZE])&mbmi->inter_tx_size[tx_row][tx_col];
+ TX_SIZE (*const inter_tx_size)[MAX_MIB_SIZE] =
+ (TX_SIZE (*)[MAX_MIB_SIZE])&mbmi->inter_tx_size[tx_row][tx_col];
int max_blocks_high = num_4x4_blocks_high_lookup[plane_bsize];
int max_blocks_wide = num_4x4_blocks_wide_lookup[plane_bsize];
int64_t this_rd = INT64_MAX;
int idx, idy;
int block = 0;
int step = 1 << (max_txsize_lookup[plane_bsize] * 2);
- ENTROPY_CONTEXT ctxa[2 * MI_BLOCK_SIZE];
- ENTROPY_CONTEXT ctxl[2 * MI_BLOCK_SIZE];
- TXFM_CONTEXT tx_above[MI_BLOCK_SIZE];
- TXFM_CONTEXT tx_left[MI_BLOCK_SIZE];
+ ENTROPY_CONTEXT ctxa[2 * MAX_MIB_SIZE];
+ ENTROPY_CONTEXT ctxl[2 * MAX_MIB_SIZE];
+ TXFM_CONTEXT tx_above[MAX_MIB_SIZE];
+ TXFM_CONTEXT tx_left[MAX_MIB_SIZE];
int pnrate = 0, pnskip = 1;
int64_t pndist = 0, pnsse = 0;
int64_t best_rd = INT64_MAX;
TX_TYPE tx_type, best_tx_type = DCT_DCT;
const int is_inter = is_inter_block(mbmi);
- TX_SIZE best_tx_size[MI_BLOCK_SIZE][MI_BLOCK_SIZE];
+ TX_SIZE best_tx_size[MAX_MIB_SIZE][MAX_MIB_SIZE];
TX_SIZE best_tx = TX_SIZES;
- uint8_t best_blk_skip[MI_BLOCK_SIZE * MI_BLOCK_SIZE * 4];
+ uint8_t best_blk_skip[MAX_MIB_SIZE * MAX_MIB_SIZE * 4];
const int n4 = 1 << (num_pels_log2_lookup[bsize] - 4);
int idx, idy;
int prune = 0;
int step = 1 << (max_txsize_lookup[plane_bsize] * 2);
int pnrate = 0, pnskip = 1;
int64_t pndist = 0, pnsse = 0;
- ENTROPY_CONTEXT ta[2 * MI_BLOCK_SIZE];
- ENTROPY_CONTEXT tl[2 * MI_BLOCK_SIZE];
+ ENTROPY_CONTEXT ta[2 * MAX_MIB_SIZE];
+ ENTROPY_CONTEXT tl[2 * MAX_MIB_SIZE];
vp10_get_entropy_contexts(bsize, TX_4X4, pd, ta, tl);
int best_rate_y, best_rate_uv;
#endif // CONFIG_SUPERTX
#if CONFIG_VAR_TX
- uint8_t best_blk_skip[MAX_MB_PLANE][MI_BLOCK_SIZE * MI_BLOCK_SIZE * 4];
+ uint8_t best_blk_skip[MAX_MB_PLANE][MAX_MIB_SIZE * MAX_MIB_SIZE * 4];
#endif // CONFIG_VAR_TX
int64_t best_distortion = INT64_MAX;
unsigned int best_pred_var = UINT_MAX;
// bars embedded in the stream.
int vp10_active_edge_sb(VP10_COMP *cpi,
int mi_row, int mi_col) {
- return vp10_active_h_edge(cpi, mi_row, MI_BLOCK_SIZE) ||
- vp10_active_v_edge(cpi, mi_col, MI_BLOCK_SIZE);
+ return vp10_active_h_edge(cpi, mi_row, MAX_MIB_SIZE) ||
+ vp10_active_v_edge(cpi, mi_col, MAX_MIB_SIZE);
}
static void restore_uv_color_map(VP10_COMP *cpi, MACROBLOCK *x) {
mi_ptr = cm->mi_grid_visible + tile_info.mi_row_start * cm->mi_stride +
tile_info.mi_col_start;
for (mi_row = tile_info.mi_row_start; mi_row < tile_info.mi_row_end;
- mi_row += MI_BLOCK_SIZE, mi_ptr += MI_BLOCK_SIZE * cm->mi_stride) {
+ mi_row += MAX_MIB_SIZE, mi_ptr += MAX_MIB_SIZE * cm->mi_stride) {
MODE_INFO **mi = mi_ptr;
for (mi_col = tile_info.mi_col_start; mi_col < tile_info.mi_col_end;
- mi_col += MI_BLOCK_SIZE, mi += MI_BLOCK_SIZE) {
+ mi_col += MAX_MIB_SIZE, mi += MAX_MIB_SIZE) {
count_segs_sb(cm, xd, &tile_info, mi, no_pred_segcounts,
temporal_predictor_count, t_unpred_seg_counts,
mi_row, mi_col, BLOCK_LARGEST);