Commit 118167a4 authored by Hui Su's avatar Hui Su Committed by Gerrit Code Review
Browse files

Merge "Add a speed feature for inter tx type search" into nextgenv2

parents 60b52a13 f523d7b5
......@@ -183,6 +183,8 @@ struct macroblock {
// use default transform and skip transform type search for intra modes
int use_default_intra_tx_type;
// use default transform and skip transform type search for inter modes
int use_default_inter_tx_type;
};
#ifdef __cplusplus
......
......@@ -1579,6 +1579,9 @@ static int64_t choose_tx_size_fix_type(VP10_COMP *cpi,
if (!is_inter && x->use_default_intra_tx_type &&
tx_type != get_default_tx_type(0, xd, 0, n))
continue;
if (is_inter && x->use_default_inter_tx_type &&
tx_type != get_default_tx_type(0, xd, 0, n))
continue;
if (max_tx_size == TX_32X32 && n == TX_4X4)
continue;
#if CONFIG_EXT_TX
......@@ -1688,6 +1691,9 @@ static void choose_largest_tx_size(VP10_COMP *cpi, MACROBLOCK *x,
!xd->lossless[mbmi->segment_id]) {
for (tx_type = 0; tx_type < TX_TYPES; ++tx_type) {
if (is_inter) {
if (x->use_default_inter_tx_type &&
tx_type != get_default_tx_type(0, xd, 0, mbmi->tx_size))
continue;
if (!ext_tx_used_inter[ext_tx_set][tx_type])
continue;
if (cpi->sf.tx_type_search.prune_mode > NO_PRUNE) {
......@@ -1749,6 +1755,9 @@ static void choose_largest_tx_size(VP10_COMP *cpi, MACROBLOCK *x,
if (!is_inter && x->use_default_intra_tx_type &&
tx_type != get_default_tx_type(0, xd, 0, mbmi->tx_size))
continue;
if (is_inter && x->use_default_inter_tx_type &&
tx_type != get_default_tx_type(0, xd, 0, mbmi->tx_size))
continue;
mbmi->tx_type = tx_type;
txfm_rd_in_plane(x,
cpi,
......@@ -8627,6 +8636,10 @@ void vp10_rd_pick_inter_mode_sb(VP10_COMP *cpi,
x->use_default_intra_tx_type = 1;
else
x->use_default_intra_tx_type = 0;
if (cpi->sf.tx_type_search.fast_inter_tx_type_search)
x->use_default_inter_tx_type = 1;
else
x->use_default_inter_tx_type = 0;
for (midx = 0; midx <= FINAL_MODE_SEARCH; ++midx) {
int mode_index;
......@@ -8649,10 +8662,15 @@ void vp10_rd_pick_inter_mode_sb(VP10_COMP *cpi,
#endif
if (midx == FINAL_MODE_SEARCH) {
if (!is_inter_mode(best_mbmode.mode) && best_mode_index >= 0 &&
if (best_mode_index < 0)
break;
mode_index = best_mode_index;
if (!is_inter_mode(best_mbmode.mode) &&
x->use_default_intra_tx_type == 1) {
mode_index = best_mode_index;
x->use_default_intra_tx_type = 0;
} else if (is_inter_mode(best_mbmode.mode) &&
x->use_default_inter_tx_type == 1) {
x->use_default_inter_tx_type = 0;
} else {
break;
}
......
......@@ -161,6 +161,7 @@ static void set_good_speed_feature(VP10_COMP *cpi, VP10_COMMON *cm,
sf->partition_search_breakout_rate_thr = 80;
sf->tx_type_search.prune_mode = PRUNE_ONE;
sf->tx_type_search.fast_intra_tx_type_search = 1;
sf->tx_type_search.fast_inter_tx_type_search = 1;
// Use transform domain distortion.
// Note var-tx expt always uses pixel domain distortion.
sf->use_transform_domain_distortion = 1;
......@@ -499,6 +500,7 @@ void vp10_set_speed_features_framesize_independent(VP10_COMP *cpi) {
sf->partition_search_type = SEARCH_PARTITION;
sf->tx_type_search.prune_mode = NO_PRUNE;
sf->tx_type_search.fast_intra_tx_type_search = 0;
sf->tx_type_search.fast_inter_tx_type_search = 0;
sf->less_rectangular_check = 0;
sf->use_square_partition_only = 0;
sf->auto_min_max_partition_size = NOT_IN_USE;
......
......@@ -195,6 +195,7 @@ typedef enum {
typedef struct {
TX_TYPE_PRUNE_MODE prune_mode;
int fast_intra_tx_type_search;
int fast_inter_tx_type_search;
} TX_TYPE_SEARCH;
typedef enum {
......
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