Commit 3e8cceb3 authored by Debargha Mukherjee's avatar Debargha Mukherjee

Speed up of DST and the search in ext_tx

Adds an early termination to the ext_tx search, and also
implements the DST transforms more efficiently.

About 4 times faster with the ext-tx experiment.

There is a 0.09% drop in performance on derflr from 1.735% to
1.648%, but worth it with the speedup achieved.

Change-Id: I2ede9d69c557f25e0a76cd5d701cc0e36e825c7c
parent 7c514e2d
......@@ -242,13 +242,13 @@ static TX_TYPE ext_tx_to_txtype[EXT_TX_TYPES] = {
FLIPADST_FLIPADST,
ADST_FLIPADST,
FLIPADST_ADST,
DST_DST,
DST_DCT,
DCT_DST,
DST_ADST,
ADST_DST,
DST_FLIPADST,
FLIPADST_DST,
DST_DST,
};
#endif // CONFIG_EXT_TX
......
......@@ -317,17 +317,17 @@ static const vpx_prob default_switchable_interp_prob[SWITCHABLE_FILTER_CONTEXTS]
#if CONFIG_EXT_TX
const vpx_tree_index vp10_ext_tx_tree[TREE_SIZE(EXT_TX_TYPES)] = {
-NORM, 2,
-ALT9, 4,
-ALT15, 4,
6, 16,
8, 10,
-ALT10, -ALT11,
-ALT9, -ALT10,
12, 14,
-ALT1, -ALT2,
-ALT4, -ALT5,
18, 24,
20, 22,
-ALT12, -ALT13,
-ALT14, -ALT15,
-ALT11, -ALT12,
-ALT13, -ALT14,
26, 28,
-ALT3, -ALT6,
-ALT7, -ALT8
......
......@@ -100,13 +100,13 @@ typedef enum {
FLIPADST_FLIPADST = 6,
ADST_FLIPADST = 7,
FLIPADST_ADST = 8,
DST_DST = 9,
DST_DCT = 10,
DCT_DST = 11,
DST_ADST = 12,
ADST_DST = 13,
DST_FLIPADST = 14,
FLIPADST_DST = 15,
DST_DCT = 9,
DCT_DST = 10,
DST_ADST = 11,
ADST_DST = 12,
DST_FLIPADST = 13,
FLIPADST_DST = 14,
DST_DST = 15,
#endif // CONFIG_EXT_TX
TX_TYPES,
} TX_TYPE;
......
This diff is collapsed.
This diff is collapsed.
......@@ -640,7 +640,6 @@ static void choose_tx_size_from_rd(VP10_COMP *cpi, MACROBLOCK *x,
int start_tx_type, end_tx_type;
#endif // CONFIG_EXT_TX
const vpx_prob *tx_probs = get_tx_probs2(max_tx_size, xd, &cm->fc->tx_probs);
assert(skip_prob > 0);
s0 = vp10_cost_bit(skip_prob, 0);
......@@ -675,8 +674,14 @@ static void choose_tx_size_from_rd(VP10_COMP *cpi, MACROBLOCK *x,
int r_tx_size = 0;
#if CONFIG_EXT_TX
if (mbmi->ext_txfrm >= GET_EXT_TX_TYPES(n))
continue;
if (is_inter_block(mbmi)) {
if (mbmi->ext_txfrm >= GET_EXT_TX_TYPES(n)) {
continue;
} else if (mbmi->ext_txfrm >= ALT11 && best_tx_type == NORM) {
// Terminate if the best so far is still NORM
break;
}
}
#endif // CONFIG_EXT_TX
for (m = 0; m <= n - (n == (int) max_tx_size); ++m) {
......@@ -725,8 +730,8 @@ static void choose_tx_size_from_rd(VP10_COMP *cpi, MACROBLOCK *x,
last_rd = rd;
#if CONFIG_EXT_TX
if (rd < (is_inter_block(mbmi) &&
(best_tx_type == NORM) ? ext_tx_th : 1) * best_rd) {
if (rd < (is_inter_block(mbmi) && best_tx_type == NORM ? ext_tx_th : 1) *
best_rd) {
#else
if (rd < best_rd) {
#endif // CONFIG_EXT_TX
......@@ -747,7 +752,7 @@ static void choose_tx_size_from_rd(VP10_COMP *cpi, MACROBLOCK *x,
mbmi->tx_size = best_tx;
#if CONFIG_EXT_TX
mbmi->ext_txfrm = best_tx_type;
mbmi->ext_txfrm = best_tx_type > -1 ? best_tx_type : NORM;
txfm_rd_in_plane(x, &r, &d, &s,
&sse, ref_best_rd, 0, bs, best_tx,
cpi->sf.use_fast_coef_costing);
......
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