AV1 RT: Limit RT RDO TX types to DCT only 5-6% speed up on Speed6 on lowres with 0.5% BDRate loss 1.4% Max BDRate loss No impact on other speeds Change-Id: I0aa260b563d19dbcbe58dc088c1578efccefdc7d
diff --git a/av1/encoder/speed_features.c b/av1/encoder/speed_features.c index 0024c66..6035876 100644 --- a/av1/encoder/speed_features.c +++ b/av1/encoder/speed_features.c
@@ -813,6 +813,7 @@ sf->tx_sf.tx_type_search.prune_mode = PRUNE_2D_MORE; sf->tx_sf.use_inter_txb_hash = 0; + sf->tx_sf.refine_fast_tx_search_results = 0; sf->rd_sf.optimize_coefficients = NO_TRELLIS_OPT; sf->rd_sf.simple_model_rd_from_var = 1; @@ -1042,6 +1043,7 @@ tx_sf->adaptive_txb_search_level = 0; tx_sf->use_intra_txb_hash = 0; tx_sf->use_inter_txb_hash = 1; + tx_sf->refine_fast_tx_search_results = 1; } static AOM_INLINE void init_rd_sf(RD_CALC_SPEED_FEATURES *rd_sf,
diff --git a/av1/encoder/speed_features.h b/av1/encoder/speed_features.h index e45c18c..acb1e35 100644 --- a/av1/encoder/speed_features.h +++ b/av1/encoder/speed_features.h
@@ -766,6 +766,9 @@ // Use hash table to store inter txb transform search results // to avoid repeated search on the same residue signal. int use_inter_txb_hash; + + // Refine TX type after fast TX search. + int refine_fast_tx_search_results; } TX_SPEED_FEATURES; typedef struct RD_CALC_SPEED_FEATURES {
diff --git a/av1/encoder/tx_search.c b/av1/encoder/tx_search.c index ee85454..d6a0fdc 100644 --- a/av1/encoder/tx_search.c +++ b/av1/encoder/tx_search.c
@@ -3154,7 +3154,7 @@ // If fast_tx_search is true, only DCT and 1D DCT were tested in // select_inter_block_yrd() above. Do a better search for tx type with // tx sizes already decided. - if (fast_tx_search) { + if (fast_tx_search && cpi->sf.tx_sf.refine_fast_tx_search_results) { if (!inter_block_yrd(cpi, x, rd_stats, bsize, ref_best_rd, FTXS_NONE)) return INT64_MAX; }
diff --git a/test/rt_end_to_end_test.cc b/test/rt_end_to_end_test.cc index 1de22f0..124a719 100644 --- a/test/rt_end_to_end_test.cc +++ b/test/rt_end_to_end_test.cc
@@ -32,11 +32,11 @@ std::unordered_map<std::string, std::unordered_map<int, std::unordered_map<int, double>>> kPsnrThreshold = { { "park_joy_90p_8_420.y4m", - { { 6, { { 0, 35.4 }, { 3, 36.2 } } }, + { { 6, { { 0, 35.3 }, { 3, 36.2 } } }, { 7, { { 0, 34.9 }, { 3, 35.8 } } }, { 8, { { 0, 35.0 }, { 3, 35.8 } } } } }, { "paris_352_288_30.y4m", - { { 6, { { 0, 36.2 }, { 3, 36.7 } } }, + { { 6, { { 0, 36.1 }, { 3, 36.6 } } }, { 7, { { 0, 35.5 }, { 3, 36.0 } } }, { 8, { { 0, 36.0 }, { 3, 36.5 } } } } }, { "niklas_1280_720_30.y4m",