Commit 6001fb05 authored by Zoe Liu's avatar Zoe Liu

Use split and horz/vert to predict horzA/B/vertA/B

In rd_pick_partition(), the first one or two blocks for the partition
types HORZ_A, HORZ_B, VERT_A, and VERT_B may be already evaluated,
during the evaluation of SPLIT, HORZ, and VERT. This patch saves the
RD pick mode results and tries to reuse them to remove the duplicate
RD mode evaluation operations.

This patch should not incur any coding performance loss.

Testing on a few lowres frames: when CFL is off, this patch obtains
>10% encoder speedup.

Change-Id: I932e233bc93873de62a88230254df44494236dde
parent 54cd8d76
......@@ -212,3 +212,37 @@ void av1_free_pc_tree(ThreadData *td, const int num_planes) {
aom_free(td->pc_tree);
td->pc_tree = NULL;
}
#if CONFIG_EXT_PARTITION_TYPES
void av1_copy_tree_context(PICK_MODE_CONTEXT *dst_ctx,
PICK_MODE_CONTEXT *src_ctx) {
dst_ctx->mic = src_ctx->mic;
dst_ctx->mbmi_ext = src_ctx->mbmi_ext;
dst_ctx->num_4x4_blk = src_ctx->num_4x4_blk;
dst_ctx->skip = src_ctx->skip;
dst_ctx->skippable = src_ctx->skippable;
dst_ctx->best_mode_index = src_ctx->best_mode_index;
for (int i = 0; i < MAX_MB_PLANE; ++i) {
memcpy(dst_ctx->blk_skip[i], src_ctx->blk_skip[i],
sizeof(uint8_t) * src_ctx->num_4x4_blk);
}
dst_ctx->hybrid_pred_diff = src_ctx->hybrid_pred_diff;
dst_ctx->comp_pred_diff = src_ctx->comp_pred_diff;
dst_ctx->single_pred_diff = src_ctx->single_pred_diff;
dst_ctx->rate = src_ctx->rate;
dst_ctx->dist = src_ctx->dist;
dst_ctx->rdcost = src_ctx->rdcost;
dst_ctx->rd_mode_is_ready = src_ctx->rd_mode_is_ready;
memcpy(dst_ctx->pred_mv, src_ctx->pred_mv, sizeof(MV) * TOTAL_REFS_PER_FRAME);
dst_ctx->pred_interp_filter = src_ctx->pred_interp_filter;
#if CONFIG_EXT_PARTITION
dst_ctx->partition = src_ctx->partition;
#endif // CONFIG_EXT_PARTITION
}
#endif // CONFIG_EXT_PARTITION_TYPES
......@@ -52,6 +52,9 @@ typedef struct {
// scope of refactoring.
int rate;
int64_t dist;
int64_t rdcost;
int rd_mode_is_ready; // Flag to indicate whether rd pick mode decision has
// been made.
// motion vector cache for adaptive motion search control in partition
// search loop
......@@ -82,6 +85,10 @@ typedef struct PC_TREE {
void av1_setup_pc_tree(struct AV1Common *cm, struct ThreadData *td);
void av1_free_pc_tree(struct ThreadData *td, const int num_planes);
#if CONFIG_EXT_PARTITION_TYPES
void av1_copy_tree_context(PICK_MODE_CONTEXT *dst_ctx,
PICK_MODE_CONTEXT *src_ctx);
#endif // CONFIG_EXT_PARTITON_TYPES
#ifdef __cplusplus
} // extern "C"
......
This diff is collapsed.
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