Commit c58ccc31 authored by Jingning Han's avatar Jingning Han Committed by Yaowu Xu

Add partition search speed feature

Use simple rate-distortion search route for the first pass coding
block partition.

Change-Id: Iaaec3e1af83f46f625d3de8361eddd79a2bc6cef
parent a5847e89
......@@ -169,6 +169,8 @@ struct macroblock {
// to select transform kernel.
int rd_model;
int cb_partition_scan;
// Also save RD info on the TX size search level for square TX sizes.
TX_SIZE_RD_RECORD
tx_size_rd_record_8X8[(MAX_MIB_SIZE >> 1) * (MAX_MIB_SIZE >> 1)];
......
......@@ -3660,9 +3660,11 @@ static void encode_rd_sb_row(AV1_COMP *cpi, ThreadData *td,
if (cpi->sf.two_pass_partition_search &&
mi_row + mi_size_high[cm->sb_size] < cm->mi_rows &&
mi_col + mi_size_wide[cm->sb_size] < cm->mi_cols) {
x->cb_partition_scan = 1;
rd_pick_sqr_partition(cpi, td, tile_data, tp, mi_row, mi_col,
cm->sb_size, &dummy_rdc, INT64_MAX, pc_root,
NULL);
x->cb_partition_scan = 0;
x->source_variance = UINT_MAX;
if (sf->adaptive_pred_interp_filter) {
......
......@@ -1824,7 +1824,9 @@ static int64_t search_txk_type(const AV1_COMP *cpi, MACROBLOCK *x, int plane,
int rate_cost = 0;
const int is_inter = is_inter_block(mbmi);
TX_TYPE txk_start = DCT_DCT;
TX_TYPE txk_end = x->rd_model == LOW_TXFM_RD ? DCT_DCT : TX_TYPES - 1;
TX_TYPE txk_end = (x->rd_model == LOW_TXFM_RD || x->cb_partition_scan)
? DCT_DCT
: TX_TYPES - 1;
TX_TYPE best_tx_type = txk_start;
int64_t best_rd = INT64_MAX;
uint8_t best_txb_ctx = 0;
......@@ -2346,6 +2348,8 @@ static int skip_txfm_search(const AV1_COMP *cpi, MACROBLOCK *x, BLOCK_SIZE bs,
const MB_MODE_INFO *const mbmi = &xd->mi[0]->mbmi;
const int is_inter = is_inter_block(mbmi);
if (x->cb_partition_scan && tx_type != DCT_DCT) return 1;
if (mbmi->ref_mv_idx > 0 && tx_type != DCT_DCT) return 1;
if (!is_inter && x->use_default_intra_tx_type &&
tx_type != get_default_tx_type(0, xd, tx_size))
......
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