Commit 0c7eb10d authored by Alexander Bokov's avatar Alexander Bokov Committed by Hui Su

Improving the model for pruning the TX type search

Introduces two new TX type pruning modes that provide better
speed-quality trade-off compared to the existing ones. A shallow
neural network with one hidden layer trained separately for each
block size is used as a prediction model. The new modes differ in
thresholds applied to the output of the neural net, so that they
prune different number of TX types on average.

Owing to relatively low quality loss PRUNE_2D_ACCURATE is used
by default, regardless of speed settings. Starting with speed
setting of 3 we switch to PRUNE_2D_FAST mode to get better
speed-up.

Evaluation results:
----------------------------------------------------------
Prune mode | Avg. speed-up | Quality loss | Quality loss
           |(high bitrates)|   (lowres)   |   (midres)
----------------------------------------------------------
PRUNE_ONE  |     18.7%     |    0.396%    |    0.308%
----------------------------------------------------------
PRUNE_TWO  |     27.2%     |    0.439%    |    0.389%
----------------------------------------------------------
PRUNE_2D_  |     18.8%     |    0.032%    |    0.063%
ACCURATE   |               |              |
----------------------------------------------------------
PRUNE_2D_  |     33.3%     |    0.504%    |     ---
FAST       |               |              |

Change-Id: Ibd59f52eef493a499e529d824edad267daa65f9d
parent 0b34a79f
......@@ -173,4 +173,8 @@ ifeq ($(CONFIG_GLOBAL_MOTION),yes)
AV1_CX_SRCS-$(HAVE_SSE4_1) += encoder/x86/corner_match_sse4.c
endif
ifeq ($(CONFIG_EXT_TX),yes)
AV1_CX_SRCS-yes += encoder/tx_prune_model_weights.h
endif
AV1_CX_SRCS-yes := $(filter-out $(AV1_CX_SRCS_REMOVE-yes),$(AV1_CX_SRCS-yes))
This diff is collapsed.
......@@ -192,7 +192,7 @@ static void set_good_speed_features_framesize_independent(AV1_COMP *cpi,
sf->tx_size_search_breakout = 1;
sf->partition_search_breakout_rate_thr = 80;
sf->tx_type_search.prune_mode = PRUNE_ONE;
// Use transform domain distortion.
// Note var-tx expt always uses pixel domain distortion.
sf->use_transform_domain_distortion = 1;
......@@ -215,7 +215,7 @@ static void set_good_speed_features_framesize_independent(AV1_COMP *cpi,
sf->use_upsampled_references = 0;
sf->adaptive_rd_thresh = 2;
#if CONFIG_EXT_TX
sf->tx_type_search.prune_mode = PRUNE_TWO;
sf->tx_type_search.prune_mode = PRUNE_2D_FAST;
#endif
#if CONFIG_GLOBAL_MOTION
sf->gm_search_type = GM_DISABLE_SEARCH;
......@@ -392,7 +392,11 @@ void av1_set_speed_features_framesize_independent(AV1_COMP *cpi) {
sf->cb_partition_search = 0;
sf->alt_ref_search_fp = 0;
sf->partition_search_type = SEARCH_PARTITION;
#if CONFIG_EXT_TX
sf->tx_type_search.prune_mode = PRUNE_2D_ACCURATE;
#else
sf->tx_type_search.prune_mode = NO_PRUNE;
#endif // CONFIG_EXT_TX
sf->tx_type_search.use_skip_flag_prediction = 1;
sf->tx_type_search.fast_intra_tx_type_search = 0;
sf->tx_type_search.fast_inter_tx_type_search = 0;
......
......@@ -193,6 +193,11 @@ typedef enum {
#if CONFIG_EXT_TX
// eliminates two tx types in each direction
PRUNE_TWO = 2,
// adaptively prunes the least perspective tx types out of all 16
// (tuned to provide negligible quality loss)
PRUNE_2D_ACCURATE = 3,
// similar, but applies much more aggressive pruning to get better speed-up
PRUNE_2D_FAST = 4,
#endif
} TX_TYPE_PRUNE_MODE;
......
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