mi_row < tile->mi_row_end && mi_col < tile->mi_col_end;
}
-static int is_right_available(BLOCK_SIZE bsize, int mi_row, int mi_col) {
+static int is_right_available(BLOCK_SIZE bsize,
+#if CONFIG_EXT_PARTITION
+ PARTITION_TYPE partition,
+#endif
+ int mi_row, int mi_col) {
int depth, max_depth = 4 - MIN(b_width_log2_lookup[bsize],
b_height_log2_lookup[bsize]);
int block[4] = {0};
if (block[max_depth] > 0)
return 0;
} else {
+#if CONFIG_EXT_PARTITION
+ if (block[max_depth] == 0)
+ return 1;
+ if (block[max_depth] == 2)
+ return partition != PARTITION_VERT_A;
+#else
if (block[max_depth] == 0 || block[max_depth] == 2)
return 1;
+#endif
else if (block[max_depth] == 3)
return 0;
}
int vp9_construct_ref_inter_list(VP9_COMMON *cm, MACROBLOCKD *xd,
const TileInfo *const tile,
- BLOCK_SIZE bsize, int mi_row, int mi_col,
+ BLOCK_SIZE bsize,
+#if CONFIG_EXT_PARTITION
+ PARTITION_TYPE partition,
+#endif
+ int mi_row, int mi_col,
MB_MODE_INFO *ref_list[18]) {
int bw = 4 << b_width_log2_lookup[bsize];
int bh = 4 << b_height_log2_lookup[bsize];
row_offset = row_offset_cand[i];
col_offset = col_offset_cand[i];
if ((col_offset < (bw / 8) ||
- (col_offset == (bw / 8) && is_right_available(bsize, mi_row, mi_col)))
+ (col_offset == (bw / 8) && is_right_available(bsize,
+#if CONFIG_EXT_PARTITION
+ partition,
+#endif
+ mi_row, mi_col)))
&& check_inside(tile, mi_row + row_offset, mi_col + col_offset)) {
mi_offset = row_offset * cm->mi_stride + col_offset;
ref_mbmi = &xd->mi[mi_offset].src_mi->mbmi;
#if CONFIG_COPY_MODE
int vp9_construct_ref_inter_list(VP9_COMMON *cm, MACROBLOCKD *xd,
const TileInfo *const tile,
- BLOCK_SIZE bsize, int mi_row, int mi_col,
+ BLOCK_SIZE bsize,
+#if CONFIG_EXT_PARTITION
+ PARTITION_TYPE partition,
+#endif
+ int mi_row, int mi_col,
MB_MODE_INFO *ref_list[18]);
#endif // CONFIG_COPY_MODE
const TileInfo *const tile,
#if CONFIG_SUPERTX
int supertx_enabled,
+#endif
+#if CONFIG_COPY_MODE
+#if CONFIG_EXT_PARTITION
+ PARTITION_TYPE partition,
+#endif
#endif
int mi_row, int mi_col,
vp9_reader *r, BLOCK_SIZE bsize) {
} else {
mbmi = set_offsets(cm, xd, tile, bsize, mi_row, mi_col);
}
- vp9_read_mode_info(cm, xd, tile, supertx_enabled, mi_row, mi_col, r);
+ vp9_read_mode_info(cm, xd, tile, supertx_enabled,
+#if CONFIG_COPY_MODE
+#if CONFIG_EXT_PARTITION
+ partition,
+#endif
+#endif
+ mi_row, mi_col, r);
#else
MB_MODE_INFO *mbmi = set_offsets(cm, xd, tile, bsize, mi_row, mi_col);
- vp9_read_mode_info(cm, xd, tile, mi_row, mi_col, r);
+ vp9_read_mode_info(cm, xd, tile,
+#if CONFIG_COPY_MODE
+#if CONFIG_EXT_PARTITION
+ partition,
+#endif
+#endif
+ mi_row, mi_col, r);
#endif // CONFIG_SUPERTX
#if CONFIG_TX_SKIP
q_idx = vp9_get_qindex(&cm->seg, mbmi->segment_id, cm->base_qindex);
decode_block(cm, xd, tile,
#if CONFIG_SUPERTX
supertx_enabled,
+#endif
+#if CONFIG_COPY_MODE
+#if CONFIG_EXT_PARTITION
+ partition,
+#endif
#endif
mi_row, mi_col, r, subsize);
} else {
decode_block(cm, xd, tile,
#if CONFIG_SUPERTX
supertx_enabled,
+#endif
+#if CONFIG_COPY_MODE
+#if CONFIG_EXT_PARTITION
+ partition,
+#endif
#endif
mi_row, mi_col, r, subsize);
break;
decode_block(cm, xd, tile,
#if CONFIG_SUPERTX
supertx_enabled,
+#endif
+#if CONFIG_COPY_MODE
+#if CONFIG_EXT_PARTITION
+ partition,
+#endif
#endif
mi_row, mi_col, r, subsize);
if (mi_row + hbs < cm->mi_rows)
decode_block(cm, xd, tile,
#if CONFIG_SUPERTX
supertx_enabled,
+#endif
+#if CONFIG_COPY_MODE
+#if CONFIG_EXT_PARTITION
+ partition,
+#endif
#endif
mi_row + hbs, mi_col, r, subsize);
break;
decode_block(cm, xd, tile,
#if CONFIG_SUPERTX
supertx_enabled,
+#endif
+#if CONFIG_COPY_MODE
+#if CONFIG_EXT_PARTITION
+ partition,
+#endif
#endif
mi_row, mi_col, r, subsize);
if (mi_col + hbs < cm->mi_cols)
decode_block(cm, xd, tile,
#if CONFIG_SUPERTX
supertx_enabled,
+#endif
+#if CONFIG_COPY_MODE
+#if CONFIG_EXT_PARTITION
+ partition,
+#endif
#endif
mi_row, mi_col + hbs, r, subsize);
break;
decode_block(cm, xd, tile,
#if CONFIG_SUPERTX
supertx_enabled,
+#endif
+#if CONFIG_COPY_MODE
+#if CONFIG_EXT_PARTITION
+ partition,
+#endif
#endif
mi_row, mi_col, r, bsize2);
decode_block(cm, xd, tile,
#if CONFIG_SUPERTX
supertx_enabled,
+#endif
+#if CONFIG_COPY_MODE
+#if CONFIG_EXT_PARTITION
+ partition,
+#endif
#endif
mi_row, mi_col + hbs, r, bsize2);
decode_block(cm, xd, tile,
#if CONFIG_SUPERTX
supertx_enabled,
+#endif
+#if CONFIG_COPY_MODE
+#if CONFIG_EXT_PARTITION
+ partition,
+#endif
#endif
mi_row + hbs, mi_col, r, subsize);
break;
decode_block(cm, xd, tile,
#if CONFIG_SUPERTX
supertx_enabled,
+#endif
+#if CONFIG_COPY_MODE
+#if CONFIG_EXT_PARTITION
+ partition,
+#endif
#endif
mi_row, mi_col, r, subsize);
decode_block(cm, xd, tile,
#if CONFIG_SUPERTX
supertx_enabled,
+#endif
+#if CONFIG_COPY_MODE
+#if CONFIG_EXT_PARTITION
+ partition,
+#endif
#endif
mi_row + hbs, mi_col, r, bsize2);
decode_block(cm, xd, tile,
#if CONFIG_SUPERTX
supertx_enabled,
+#endif
+#if CONFIG_COPY_MODE
+#if CONFIG_EXT_PARTITION
+ partition,
+#endif
#endif
mi_row + hbs, mi_col + hbs, r, bsize2);
break;
decode_block(cm, xd, tile,
#if CONFIG_SUPERTX
supertx_enabled,
+#endif
+#if CONFIG_COPY_MODE
+#if CONFIG_EXT_PARTITION
+ partition,
+#endif
#endif
mi_row, mi_col, r, bsize2);
decode_block(cm, xd, tile,
#if CONFIG_SUPERTX
supertx_enabled,
+#endif
+#if CONFIG_COPY_MODE
+#if CONFIG_EXT_PARTITION
+ partition,
+#endif
#endif
mi_row + hbs, mi_col, r, bsize2);
decode_block(cm, xd, tile,
#if CONFIG_SUPERTX
supertx_enabled,
+#endif
+#if CONFIG_COPY_MODE
+#if CONFIG_EXT_PARTITION
+ partition,
+#endif
#endif
mi_row, mi_col + hbs, r, subsize);
break;
decode_block(cm, xd, tile,
#if CONFIG_SUPERTX
supertx_enabled,
+#endif
+#if CONFIG_COPY_MODE
+#if CONFIG_EXT_PARTITION
+ partition,
+#endif
#endif
mi_row, mi_col, r, subsize);
decode_block(cm, xd, tile,
#if CONFIG_SUPERTX
supertx_enabled,
+#endif
+#if CONFIG_COPY_MODE
+#if CONFIG_EXT_PARTITION
+ partition,
+#endif
#endif
mi_row, mi_col + hbs, r, bsize2);
decode_block(cm, xd, tile,
#if CONFIG_SUPERTX
supertx_enabled,
+#endif
+#if CONFIG_COPY_MODE
+#if CONFIG_EXT_PARTITION
+ partition,
+#endif
#endif
mi_row + hbs, mi_col + hbs, r, bsize2);
break;
const TileInfo *const tile,
#if CONFIG_SUPERTX
int supertx_enabled,
+#endif
+#if CONFIG_COPY_MODE
+#if CONFIG_EXT_PARTITION
+ PARTITION_TYPE partition,
+#endif
#endif
int mi_row, int mi_col, vp9_reader *r) {
MODE_INFO *const mi = xd->mi[0].src_mi;
#if CONFIG_COPY_MODE
if (mbmi->sb_type >= BLOCK_8X8)
num_candidate = vp9_construct_ref_inter_list(
- cm, xd, tile, mbmi->sb_type, mi_row, mi_col, inter_ref_list);
+ cm, xd, tile, mbmi->sb_type,
+#if CONFIG_EXT_PARTITION
+ partition,
+#endif
+ mi_row, mi_col, inter_ref_list);
if (mbmi->sb_type >= BLOCK_8X8 && num_candidate > 0) {
int ctx = vp9_get_copy_mode_context(xd);
int is_copy = vp9_read(r, cm->fc.copy_noref_prob[ctx][mbmi->sb_type]);
const TileInfo *const tile,
#if CONFIG_SUPERTX
int supertx_enabled,
+#endif
+#if CONFIG_COPY_MODE
+#if CONFIG_EXT_PARTITION
+ PARTITION_TYPE partition,
+#endif
#endif
int mi_row, int mi_col, vp9_reader *r) {
if (frame_is_intra_only(cm))
read_inter_frame_mode_info(cm, xd, tile,
#if CONFIG_SUPERTX
supertx_enabled,
+#endif
+#if CONFIG_COPY_MODE
+#if CONFIG_EXT_PARTITION
+ partition,
+#endif
#endif
mi_row, mi_col, r);
}
const struct TileInfo *const tile,
#if CONFIG_SUPERTX
int supertx_enabled,
+#endif
+#if CONFIG_COPY_MODE
+#if CONFIG_EXT_PARTITION
+ PARTITION_TYPE partition,
+#endif
#endif
int mi_row, int mi_col, vp9_reader *r);
};
static void alloc_mode_context(VP9_COMMON *cm, int num_4x4_blk,
+#if CONFIG_EXT_PARTITION
+ PARTITION_TYPE partition,
+#endif
PICK_MODE_CONTEXT *ctx) {
const int num_blk = (num_4x4_blk < 4 ? 4 : num_4x4_blk);
const int num_pix = num_blk << 4;
int i, k;
ctx->num_4x4_blk = num_blk;
-
+#if CONFIG_EXT_PARTITION
+ ctx->partition = partition;
+#endif
CHECK_MEM_ERROR(cm, ctx->zcoeff_blk,
vpx_calloc(num_4x4_blk, sizeof(uint8_t)));
for (i = 0; i < MAX_MB_PLANE; ++i) {
static void alloc_tree_contexts(VP9_COMMON *cm, PC_TREE *tree,
int num_4x4_blk) {
+#if CONFIG_EXT_PARTITION
+ alloc_mode_context(cm, num_4x4_blk, PARTITION_NONE, &tree->none);
+ alloc_mode_context(cm, num_4x4_blk/2, PARTITION_HORZ, &tree->horizontal[0]);
+ alloc_mode_context(cm, num_4x4_blk/2, PARTITION_VERT, &tree->vertical[0]);
+ alloc_mode_context(cm, num_4x4_blk/2, PARTITION_VERT, &tree->horizontal[1]);
+ alloc_mode_context(cm, num_4x4_blk/2, PARTITION_VERT, &tree->vertical[1]);
+
+ alloc_mode_context(cm, num_4x4_blk/4, PARTITION_HORZ_A,
+ &tree->horizontala[0]);
+ alloc_mode_context(cm, num_4x4_blk/4, PARTITION_HORZ_A,
+ &tree->horizontala[1]);
+ alloc_mode_context(cm, num_4x4_blk/2, PARTITION_HORZ_A,
+ &tree->horizontala[2]);
+ alloc_mode_context(cm, num_4x4_blk/2, PARTITION_HORZ_B,
+ &tree->horizontalb[0]);
+ alloc_mode_context(cm, num_4x4_blk/4, PARTITION_HORZ_B,
+ &tree->horizontalb[1]);
+ alloc_mode_context(cm, num_4x4_blk/4, PARTITION_HORZ_B,
+ &tree->horizontalb[2]);
+ alloc_mode_context(cm, num_4x4_blk/4, PARTITION_VERT_A, &tree->verticala[0]);
+ alloc_mode_context(cm, num_4x4_blk/4, PARTITION_VERT_A, &tree->verticala[1]);
+ alloc_mode_context(cm, num_4x4_blk/2, PARTITION_VERT_A, &tree->verticala[2]);
+ alloc_mode_context(cm, num_4x4_blk/2, PARTITION_VERT_B, &tree->verticalb[0]);
+ alloc_mode_context(cm, num_4x4_blk/4, PARTITION_VERT_B, &tree->verticalb[1]);
+ alloc_mode_context(cm, num_4x4_blk/4, PARTITION_VERT_B, &tree->verticalb[2]);
+#else
alloc_mode_context(cm, num_4x4_blk, &tree->none);
alloc_mode_context(cm, num_4x4_blk/2, &tree->horizontal[0]);
alloc_mode_context(cm, num_4x4_blk/2, &tree->vertical[0]);
* Figure out a better way to do this. */
alloc_mode_context(cm, num_4x4_blk/2, &tree->horizontal[1]);
alloc_mode_context(cm, num_4x4_blk/2, &tree->vertical[1]);
-
-#if CONFIG_EXT_PARTITION
- alloc_mode_context(cm, num_4x4_blk/4, &tree->horizontala[0]);
- alloc_mode_context(cm, num_4x4_blk/4, &tree->horizontala[1]);
- alloc_mode_context(cm, num_4x4_blk/2, &tree->horizontala[2]);
- alloc_mode_context(cm, num_4x4_blk/2, &tree->horizontalb[0]);
- alloc_mode_context(cm, num_4x4_blk/4, &tree->horizontalb[1]);
- alloc_mode_context(cm, num_4x4_blk/4, &tree->horizontalb[2]);
- alloc_mode_context(cm, num_4x4_blk/4, &tree->verticala[0]);
- alloc_mode_context(cm, num_4x4_blk/4, &tree->verticala[1]);
- alloc_mode_context(cm, num_4x4_blk/2, &tree->verticala[2]);
- alloc_mode_context(cm, num_4x4_blk/2, &tree->verticalb[0]);
- alloc_mode_context(cm, num_4x4_blk/4, &tree->verticalb[1]);
- alloc_mode_context(cm, num_4x4_blk/4, &tree->verticalb[2]);
#endif
}
// 4x4 blocks smaller than 8x8 but in the same 8x8 block share the same
// context so we only need to allocate 1 for each 8x8 block.
+#if CONFIG_EXT_PARTITION
+ for (i = 0; i < leaf_nodes; ++i)
+ alloc_mode_context(cm, 1, PARTITION_NONE, &cpi->leaf_tree[i]);
+#else
for (i = 0; i < leaf_nodes; ++i)
alloc_mode_context(cm, 1, &cpi->leaf_tree[i]);
-
+#endif
// Sets up all the leaf nodes in the tree.
for (pc_tree_index = 0; pc_tree_index < leaf_nodes; ++pc_tree_index) {
PC_TREE *const tree = &cpi->pc_tree[pc_tree_index];
// search loop
MV pred_mv[MAX_REF_FRAMES];
INTERP_FILTER pred_interp_filter;
+#if CONFIG_EXT_PARTITION
+ PARTITION_TYPE partition;
+#endif
} PICK_MODE_CONTEXT;
typedef struct PC_TREE {
vp9_rd_pick_inter_mode_sb(cpi, x, tile, mi_row, mi_col, rd_cost,
#if CONFIG_SUPERTX
totalrate_nocoef,
+#endif
+#if CONFIG_COPY_MODE
+#if CONFIG_EXT_PARTITION
+ ctx->partition,
+#endif
#endif
bsize, ctx, best_rd);
}
RD_COST *rd_cost,
#if CONFIG_SUPERTX
int *returnrate_nocoef,
+#endif
+#if CONFIG_COPY_MODE
+#if CONFIG_EXT_PARTITION
+ PARTITION_TYPE partition,
+#endif
#endif
BLOCK_SIZE bsize,
PICK_MODE_CONTEXT *ctx,
&comp_mode_p);
#if CONFIG_COPY_MODE
inter_ref_count =
- vp9_construct_ref_inter_list(cm, xd, tile, bsize, mi_row, mi_col,
- inter_ref_list);
+ vp9_construct_ref_inter_list(cm, xd, tile, bsize,
+#if CONFIG_EXT_PARTITION
+ partition,
+#endif
+ mi_row, mi_col, inter_ref_list);
mbmi->inter_ref_count = inter_ref_count;
#endif // CONFIG_COPY_MODE
#if CONFIG_SUPERTX
int *returnrate_nocoef,
#endif
+#if CONFIG_COPY_MODE
+#if CONFIG_EXT_PARTITION
+ PARTITION_TYPE partition,
+#endif
+#endif
+
BLOCK_SIZE bsize, PICK_MODE_CONTEXT *ctx,
int64_t best_rd_so_far);