int pl;
const int idx = check_bsize_coverage(bs, cm->mi_rows, cm->mi_cols,
mi_row, mi_col);
- pl = partition_plane_context(cm->above_seg_context, cm->left_seg_context,
+ pl = partition_plane_context(cpi->above_seg_context, cpi->left_seg_context,
mi_row, mi_col, bsize);
// encode the partition information
if (idx == 0)
// update partition context
if (bsize >= BLOCK_8X8 &&
(bsize == BLOCK_8X8 || partition != PARTITION_SPLIT))
- update_partition_context(cm->above_seg_context, cm->left_seg_context,
+ update_partition_context(cpi->above_seg_context, cpi->left_seg_context,
mi_row, mi_col, subsize, bsize);
}
for (mi_row = cm->cur_tile_mi_row_start; mi_row < cm->cur_tile_mi_row_end;
mi_row += 8, mi_8x8 += 8 * mis) {
m_8x8 = mi_8x8;
- vp9_zero(cm->left_seg_context);
+ vp9_zero(cpi->left_seg_context);
for (mi_col = cm->cur_tile_mi_col_start; mi_col < cm->cur_tile_mi_col_end;
mi_col += MI_BLOCK_SIZE, m_8x8 += MI_BLOCK_SIZE) {
write_modes_sb(cpi, m_8x8, bc, tok, tok_end, mi_row, mi_col,
const int tile_cols = 1 << cm->log2_tile_cols;
const int tile_rows = 1 << cm->log2_tile_rows;
- vpx_memset(cm->above_seg_context, 0, sizeof(PARTITION_CONTEXT) *
+ vpx_memset(cpi->above_seg_context, 0, sizeof(*cpi->above_seg_context) *
mi_cols_aligned_to_sb(cm->mi_cols));
tok[0][0] = cpi->tok;
(sizeof(ENTROPY_CONTEXT) * num_4x4_blocks_high) >>
xd->plane[p].subsampling_y);
}
- vpx_memcpy(cm->above_seg_context + mi_col, sa,
- sizeof(PARTITION_CONTEXT) * mi_width);
- vpx_memcpy(cm->left_seg_context + (mi_row & MI_MASK), sl,
- sizeof(PARTITION_CONTEXT) * mi_height);
+ vpx_memcpy(cpi->above_seg_context + mi_col, sa,
+ sizeof(*cpi->above_seg_context) * mi_width);
+ vpx_memcpy(cpi->left_seg_context + (mi_row & MI_MASK), sl,
+ sizeof(cpi->left_seg_context[0]) * mi_height);
}
static void save_context(VP9_COMP *cpi, int mi_row, int mi_col,
ENTROPY_CONTEXT a[16 * MAX_MB_PLANE],
(sizeof(ENTROPY_CONTEXT) * num_4x4_blocks_high) >>
xd->plane[p].subsampling_y);
}
- vpx_memcpy(sa, cm->above_seg_context + mi_col,
- sizeof(PARTITION_CONTEXT) * mi_width);
- vpx_memcpy(sl, cm->left_seg_context + (mi_row & MI_MASK),
- sizeof(PARTITION_CONTEXT) * mi_height);
+ vpx_memcpy(sa, cpi->above_seg_context + mi_col,
+ sizeof(*cpi->above_seg_context) * mi_width);
+ vpx_memcpy(sl, cpi->left_seg_context + (mi_row & MI_MASK),
+ sizeof(cpi->left_seg_context[0]) * mi_height);
}
static void encode_b(VP9_COMP *cpi, TOKENEXTRA **tp, int mi_row, int mi_col,
c1 = BLOCK_4X4;
if (bsize >= BLOCK_8X8) {
- pl = partition_plane_context(cm->above_seg_context, cm->left_seg_context,
+ pl = partition_plane_context(cpi->above_seg_context, cpi->left_seg_context,
mi_row, mi_col, bsize);
c1 = *(get_sb_partitioning(x, bsize));
}
}
if (partition != PARTITION_SPLIT || bsize == BLOCK_8X8)
- update_partition_context(cm->above_seg_context, cm->left_seg_context,
+ update_partition_context(cpi->above_seg_context, cpi->left_seg_context,
mi_row, mi_col, c1, bsize);
}
pick_sb_modes(cpi, mi_row, mi_col, &none_rate, &none_dist, bsize,
get_block_context(x, bsize), INT64_MAX);
- pl = partition_plane_context(cm->above_seg_context, cm->left_seg_context,
+ pl = partition_plane_context(cpi->above_seg_context,
+ cpi->left_seg_context,
mi_row, mi_col, bsize);
none_rate += x->partition_cost[pl][PARTITION_NONE];
assert(0);
}
- pl = partition_plane_context(cm->above_seg_context, cm->left_seg_context,
+ pl = partition_plane_context(cpi->above_seg_context, cpi->left_seg_context,
mi_row, mi_col, bsize);
if (last_part_rate < INT_MAX)
last_part_rate += x->partition_cost[pl][partition];
split_rate += rt;
split_dist += dt;
- pl = partition_plane_context(cm->above_seg_context, cm->left_seg_context,
+ pl = partition_plane_context(cpi->above_seg_context,
+ cpi->left_seg_context,
mi_row + y_idx, mi_col + x_idx, bsize);
split_rate += x->partition_cost[pl][PARTITION_NONE];
}
- pl = partition_plane_context(cm->above_seg_context, cm->left_seg_context,
+ pl = partition_plane_context(cpi->above_seg_context, cpi->left_seg_context,
mi_row, mi_col, bsize);
if (split_rate < INT_MAX) {
split_rate += x->partition_cost[pl][PARTITION_SPLIT];
get_block_context(x, bsize), best_rd);
if (this_rate != INT_MAX) {
if (bsize >= BLOCK_8X8) {
- pl = partition_plane_context(cm->above_seg_context,
- cm->left_seg_context,
+ pl = partition_plane_context(cpi->above_seg_context,
+ cpi->left_seg_context,
mi_row, mi_col, bsize);
this_rate += x->partition_cost[pl][PARTITION_NONE];
}
}
}
if (sum_rd < best_rd && i == 4) {
- pl = partition_plane_context(cm->above_seg_context, cm->left_seg_context,
+ pl = partition_plane_context(cpi->above_seg_context,
+ cpi->left_seg_context,
mi_row, mi_col, bsize);
sum_rate += x->partition_cost[pl][PARTITION_SPLIT];
sum_rd = RDCOST(x->rdmult, x->rddiv, sum_rate, sum_dist);
}
}
if (sum_rd < best_rd) {
- pl = partition_plane_context(cm->above_seg_context, cm->left_seg_context,
+ pl = partition_plane_context(cpi->above_seg_context,
+ cpi->left_seg_context,
mi_row, mi_col, bsize);
sum_rate += x->partition_cost[pl][PARTITION_HORZ];
sum_rd = RDCOST(x->rdmult, x->rddiv, sum_rate, sum_dist);
}
}
if (sum_rd < best_rd) {
- pl = partition_plane_context(cm->above_seg_context, cm->left_seg_context,
+ pl = partition_plane_context(cpi->above_seg_context,
+ cpi->left_seg_context,
mi_row, mi_col, bsize);
sum_rate += x->partition_cost[pl][PARTITION_VERT];
sum_rd = RDCOST(x->rdmult, x->rddiv, sum_rate, sum_dist);
cpi->set_ref_frame_mask = 1;
pick_sb_modes(cpi, mi_row, mi_col, &r, &d, BLOCK_64X64,
get_block_context(x, BLOCK_64X64), INT64_MAX);
- pl = partition_plane_context(cm->above_seg_context, cm->left_seg_context,
+ pl = partition_plane_context(cpi->above_seg_context, cpi->left_seg_context,
mi_row, mi_col, BLOCK_64X64);
r += x->partition_cost[pl][PARTITION_NONE];
// Initialize the left context for the new SB row
vpx_memset(&cm->left_context, 0, sizeof(cm->left_context));
- vpx_memset(cm->left_seg_context, 0, sizeof(cm->left_seg_context));
+ vpx_memset(cpi->left_seg_context, 0, sizeof(cpi->left_seg_context));
// Code each SB in the row
for (mi_col = cm->cur_tile_mi_col_start; mi_col < cm->cur_tile_mi_col_end;
// are allocated as part of the same buffer.
vpx_memset(cm->above_context[0], 0,
sizeof(ENTROPY_CONTEXT) * 2 * MAX_MB_PLANE * aligned_mi_cols);
- vpx_memset(cm->above_seg_context, 0,
- sizeof(PARTITION_CONTEXT) * aligned_mi_cols);
+ vpx_memset(cpi->above_seg_context, 0,
+ sizeof(*cpi->above_seg_context) * aligned_mi_cols);
}
static void switch_lossless_mode(VP9_COMP *cpi, int lossless) {