]> granicus.if.org Git - libvpx/commitdiff
Reduce transform options for ext-tx experiment
authorDebargha Mukherjee <debargha@google.com>
Wed, 18 Nov 2015 19:56:50 +0000 (11:56 -0800)
committerDebargha Mukherjee <debargha@google.com>
Mon, 23 Nov 2015 20:58:48 +0000 (12:58 -0800)
Reduces the transform optons for INTRA as well as INTER when
transform size is 16x16 to not use any of the DSTs.
Thus, a total of 10 options are used for 16x16, while 4x4
and 8x8 still uses 17 options.

derflr/hevchd actually improves a little, while hevcmr drops
a little.

About 10% speed improvement.

Change-Id: I920a182231e052cdd622f8bb67085c16c572cb1e

vp10/common/blockd.h
vp10/common/entropymode.c
vp10/common/enums.h
vp10/common/thread_common.c
vp10/decoder/decodeframe.c
vp10/encoder/bitstream.c
vp10/encoder/rd.c

index bb943970ed5f5b54be1e3b40aef62ad9a355dad4..cabaed7a1fb291cf0f0a23bc1f8c514864b2d5d7 100644 (file)
@@ -280,7 +280,7 @@ static const int num_ext_tx_set_inter[EXT_TX_SETS_INTER] = {
   1, 17, 10, 2
 };
 static const int num_ext_tx_set_intra[EXT_TX_SETS_INTRA] = {
-  1, 17,
+  1, 17, 10
 };
 
 #define USE_IDTX_FOR_32X32 0
@@ -293,7 +293,7 @@ static INLINE int get_ext_tx_set(TX_SIZE tx_size, BLOCK_SIZE bs,
 #else
   if (tx_size == TX_32X32) return 0;
 #endif
-  return 1;
+  return tx_size == TX_16X16 ? 2 : 1;
 }
 
 static INLINE int get_ext_tx_types(TX_SIZE tx_size, BLOCK_SIZE bs,
@@ -302,23 +302,27 @@ static INLINE int get_ext_tx_types(TX_SIZE tx_size, BLOCK_SIZE bs,
   return is_inter ? num_ext_tx_set_inter[set] : num_ext_tx_set_intra[set];
 }
 
-static const int use_intra_ext_tx_for_tx[EXT_TX_SETS_INTRA][TX_SIZES] = {
+static const int use_intra_ext_tx_for_txsize[EXT_TX_SETS_INTRA][TX_SIZES] = {
   { 0, 0, 0, 0, },  // unused
-  { 1, 1, 1, 0, },
+  { 1, 1, 0, 0, },
+  { 0, 0, 1, 0, },
 };
 
-static const int use_inter_ext_tx_for_tx[EXT_TX_SETS_INTER][TX_SIZES] = {
+static const int use_inter_ext_tx_for_txsize[EXT_TX_SETS_INTER][TX_SIZES] = {
   { 0, 0, 0, 0, },  // unused
-  { 1, 1, 1, 0, },
-  { 0, 0, 0, 0, },
+  { 1, 1, 0, 0, },
+  { 0, 0, 1, 0, },
   { 0, 0, 0, USE_IDTX_FOR_32X32, },
 };
 
+// Transform types used in each intra set
 static const int ext_tx_used_intra[EXT_TX_SETS_INTRA][TX_TYPES] = {
   { 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, },
   { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, },
+  { 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, },
 };
 
+// Transform types used in each inter set
 static const int ext_tx_used_inter[EXT_TX_SETS_INTER][TX_TYPES] = {
   { 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, },
   { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, },
index 9142d6a803406d9f844567c7a30cc4e3e682f748..aa4b7fedf07d93b8a05d5f9709eb969f0d60330c 100644 (file)
@@ -818,6 +818,16 @@ const vpx_tree_index vp10_ext_tx_intra_tree[EXT_TX_SETS_INTRA]
     28, 30,
     -ADST_ADST, -FLIPADST_FLIPADST,
     -ADST_FLIPADST, -FLIPADST_ADST,
+  }, {
+    -IDTX, 2,
+    -DCT_DCT, 4,
+    6, 12,
+    8, 10,
+    -ADST_DCT, -DCT_ADST,
+    -FLIPADST_DCT, -DCT_FLIPADST,
+    14, 16,
+    -ADST_ADST, -FLIPADST_FLIPADST,
+    -ADST_FLIPADST, -FLIPADST_ADST
   }
 };
 
@@ -1041,7 +1051,95 @@ default_intra_ext_tx_prob[EXT_TX_SETS_INTRA][EXT_TX_SIZES]
         154,  95, 152, 112, 105, 191, 242, 111, },
 #endif
     },
-  }
+  }, {
+    {
+      {   8, 176, 128, 128, 128, 128, 128, 128,
+        128, 128, 128, 128, 128, 128, 128, 128, },
+      {  10,  28, 176, 192, 208, 128, 128, 128,
+        128, 128, 128, 128, 128, 128, 128, 128, },
+      {  10,  28, 176, 192,  48, 128, 128, 128,
+        128, 128, 128, 128, 128, 128, 128, 128, },
+      {   9, 160, 128, 128, 128, 128, 128, 128,
+        128, 128, 128, 128, 128, 128, 128, 128, },
+      {   8,  28,  96, 128, 128, 128, 160, 192,
+        128, 128, 128, 128, 128, 128, 128, 128, },
+      {   7,  28, 160, 176, 192, 128, 128, 128,
+        128, 128, 128, 128, 128, 128, 128, 128, },
+      {   7,  20, 160, 176,  64, 128, 128, 128,
+        128, 128, 128, 128, 128, 128, 128, 128, },
+      {  10,  23, 160, 176,  64, 128, 128, 128,
+        128, 128, 128, 128, 128, 128, 128, 128, },
+      {   8,  29, 160, 176, 192, 128, 128, 128,
+        128, 128, 128, 128, 128, 128, 128, 128, },
+      {   3,  20,  96, 128, 128, 128, 160, 192,
+        128, 128, 128, 128, 128, 128, 128, 128, },
+    }, {
+      {   2, 176, 128, 128, 128, 128, 128, 128,
+        128, 128, 128, 128, 128, 128, 128, 128, },
+      {   4,  28, 176, 192, 208, 128, 128, 128,
+        128, 128, 128, 128, 128, 128, 128, 128, },
+      {   4,  28, 176, 192,  48, 128, 128, 128,
+        128, 128, 128, 128, 128, 128, 128, 128, },
+      {   8, 160, 128, 128, 128, 128, 128, 128,
+        128, 128, 128, 128, 128, 128, 128, 128, },
+      {   2,  28,  96, 128, 128, 128, 160, 192,
+        128, 128, 128, 128, 128, 128, 128, 128, },
+      {   3,  28, 160, 176, 192, 128, 128, 128,
+        128, 128, 128, 128, 128, 128, 128, 128, },
+      {   3,  26, 160, 176,  64, 128, 128, 128,
+        128, 128, 128, 128, 128, 128, 128, 128, },
+      {   9,  24, 160, 176,  64, 128, 128, 128,
+        128, 128, 128, 128, 128, 128, 128, 128, },
+      {   5,  24, 160, 176, 192, 128, 128, 128,
+        128, 128, 128, 128, 128, 128, 128, 128, },
+      {   2,  25,  96, 128, 128, 128, 160, 192,
+        128, 128, 128, 128, 128, 128, 128, 128, },
+    }, {
+      {   2, 176, 128, 128, 128, 128, 128, 128,
+        128, 128, 128, 128, 128, 128, 128, 128, },
+      {   1,  28, 176, 192, 208, 128, 128, 128,
+        128, 128, 128, 128, 128, 128, 128, 128, },
+      {   1,  28, 176, 192,  48, 128, 128, 128,
+        128, 128, 128, 128, 128, 128, 128, 128, },
+      {   4, 160, 128, 128, 128, 128, 128, 128,
+        128, 128, 128, 128, 128, 128, 128, 128, },
+      {   2,  28,  96, 128, 128, 128, 160, 192,
+        128, 128, 128, 128, 128, 128, 128, 128, },
+      {   2,  28, 160, 176, 192, 128, 128, 128,
+        128, 128, 128, 128, 128, 128, 128, 128, },
+      {   3,  29, 160, 176,  64, 128, 128, 128,
+        128, 128, 128, 128, 128, 128, 128, 128, },
+      {   4,  27, 160, 176,  64, 128, 128, 128,
+        128, 128, 128, 128, 128, 128, 128, 128, },
+      {   2,  34, 160, 176, 192, 128, 128, 128,
+        128, 128, 128, 128, 128, 128, 128, 128, },
+      {   1,  25,  96, 128, 128, 128, 160, 192,
+        128, 128, 128, 128, 128, 128, 128, 128, },
+#if EXT_TX_SIZES == 4
+    }, {
+      {   2, 176, 128, 128, 128, 128, 128, 128,
+        128, 128, 128, 128, 128, 128, 128, 128, },
+      {   1,  12, 160, 176, 192, 128, 128, 128,
+        128, 128, 128, 128, 128, 128, 128, 128, },
+      {   1,  17, 160, 176,  64, 128, 128, 128,
+        128, 128, 128, 128, 128, 128, 128, 128, },
+      {   4,  41, 128, 128, 128, 128, 128, 128,
+        128, 128, 128, 128, 128, 128, 128, 128, },
+      {   2,  17,  96, 128, 128, 128, 160, 192,
+        128, 128, 128, 128, 128, 128, 128, 128, },
+      {   2,  14, 160, 176, 192, 128, 128, 128,
+        128, 128, 128, 128, 128, 128, 128, 128, },
+      {   3,  19, 160, 176,  64, 128, 128, 128,
+        128, 128, 128, 128, 128, 128, 128, 128, },
+      {   4,  27, 160, 176,  64, 128, 128, 128,
+        128, 128, 128, 128, 128, 128, 128, 128, },
+      {   2,  34, 160, 176, 192, 128, 128, 128,
+        128, 128, 128, 128, 128, 128, 128, 128, },
+      {   1,  15,  96, 128, 128, 128, 160, 192,
+        128, 128, 128, 128, 128, 128, 128, 128, },
+#endif
+    },
+  },
 };
 #endif  // CONFIG_EXT_TX
 
@@ -1179,7 +1277,7 @@ void vp10_adapt_intra_frame_probs(VP10_COMMON *cm) {
   for (i = TX_4X4; i < EXT_TX_SIZES; ++i) {
     int s;
     for (s = 1; s < EXT_TX_SETS_INTER; ++s) {
-      if (use_inter_ext_tx_for_tx[s][i]) {
+      if (use_inter_ext_tx_for_txsize[s][i]) {
         vpx_tree_merge_probs(vp10_ext_tx_inter_tree[s],
                              pre_fc->inter_ext_tx_prob[s][i],
                              counts->inter_ext_tx[s][i],
@@ -1187,7 +1285,7 @@ void vp10_adapt_intra_frame_probs(VP10_COMMON *cm) {
       }
     }
     for (s = 1; s < EXT_TX_SETS_INTRA; ++s) {
-      if (use_intra_ext_tx_for_tx[s][i]) {
+      if (use_intra_ext_tx_for_txsize[s][i]) {
         int j;
         for (j = 0; j < INTRA_MODES; ++j)
           vpx_tree_merge_probs(vp10_ext_tx_intra_tree[s],
index 3f9395eecb1150a07599c1a074940ab8e12c5e31..c5ccf334faaa7e8b08dfc4295a4ec1abbdfa72c7 100644 (file)
@@ -115,10 +115,7 @@ typedef enum {
 #if CONFIG_EXT_TX
 #define EXT_TX_SIZES       3  // number of sizes that use extended transforms
 #define EXT_TX_SETS_INTER  4  // Sets of transform selections for INTER
-#define EXT_TX_SETS_INTRA  2  // Sets of transform selections for INTRA
-
-#define TX_TYPES_10    10
-#define TX_TYPES_2      2
+#define EXT_TX_SETS_INTRA  3  // Sets of transform selections for INTRA
 #endif  // CONFIG_EXT_TX
 
 typedef enum {
index 55b3537e81c8682fc0198d841a1116c0264c3cdf..a034bd4af6960ad4f3a6d6e3505ced06741dff91 100644 (file)
@@ -445,13 +445,13 @@ void vp10_accumulate_frame_counts(VP10_COMMON *cm, FRAME_COUNTS *counts,
   for (i = 0; i < EXT_TX_SIZES; i++) {
     int s, k;
     for (s = 1; s < EXT_TX_SETS_INTER; ++s) {
-      if (use_inter_ext_tx_for_tx[s][i]) {
+      if (use_inter_ext_tx_for_txsize[s][i]) {
         for (k = 0; k < TX_TYPES; k++)
           cm->counts.inter_ext_tx[s][i][k] += counts->inter_ext_tx[s][i][k];
       }
     }
     for (s = 1; s < EXT_TX_SETS_INTRA; ++s) {
-      if (use_intra_ext_tx_for_tx[s][i]) {
+      if (use_intra_ext_tx_for_txsize[s][i]) {
         int j;
         for (j = 0; j < INTRA_MODES; ++j)
           for (k = 0; k < TX_TYPES; k++)
index 531be1ffe7fa4c33192449badacbd8c7db627c85..460fc045268b57c77e90998814569e1127ad2fa1 100644 (file)
@@ -2155,7 +2155,7 @@ static void read_ext_tx_probs(FRAME_CONTEXT *fc, vpx_reader *r) {
   for (s = 1; s < EXT_TX_SETS_INTER; ++s) {
     if (vpx_read(r, GROUP_DIFF_UPDATE_PROB)) {
       for (i = TX_4X4; i < EXT_TX_SIZES; ++i) {
-        if (!use_inter_ext_tx_for_tx[s][i]) continue;
+        if (!use_inter_ext_tx_for_txsize[s][i]) continue;
         for (j = 0; j < num_ext_tx_set_inter[s] - 1; ++j)
           vp10_diff_update_prob(r, &fc->inter_ext_tx_prob[s][i][j]);
       }
@@ -2165,7 +2165,7 @@ static void read_ext_tx_probs(FRAME_CONTEXT *fc, vpx_reader *r) {
   for (s = 1; s < EXT_TX_SETS_INTRA; ++s) {
     if (vpx_read(r, GROUP_DIFF_UPDATE_PROB)) {
       for (i = TX_4X4; i < EXT_TX_SIZES; ++i) {
-        if (!use_intra_ext_tx_for_tx[s][i]) continue;
+        if (!use_intra_ext_tx_for_txsize[s][i]) continue;
         for (j = 0; j < INTRA_MODES; ++j)
           for (k = 0; k < num_ext_tx_set_intra[s] - 1; ++k)
             vp10_diff_update_prob(r, &fc->intra_ext_tx_prob[s][i][j][k]);
index a80e5bd563bfa92778b328c2742fbe8a8f4186c6..43f9c9079502ee65050ee419dae88e0f50be67e6 100644 (file)
@@ -253,7 +253,7 @@ static void update_ext_tx_probs(VP10_COMMON *cm, vpx_writer *w) {
     int savings = 0;
     int do_update = 0;
     for (i = TX_4X4; i < EXT_TX_SIZES; ++i) {
-      if (!use_inter_ext_tx_for_tx[s][i]) continue;
+      if (!use_inter_ext_tx_for_txsize[s][i]) continue;
       savings += prob_diff_update_savings(
           vp10_ext_tx_inter_tree[s], cm->fc->inter_ext_tx_prob[s][i],
           cm->counts.inter_ext_tx[s][i], num_ext_tx_set_inter[s]);
@@ -262,7 +262,7 @@ static void update_ext_tx_probs(VP10_COMMON *cm, vpx_writer *w) {
     vpx_write(w, do_update, GROUP_DIFF_UPDATE_PROB);
     if (do_update) {
       for (i = TX_4X4; i < EXT_TX_SIZES; ++i) {
-        if (!use_inter_ext_tx_for_tx[s][i]) continue;
+        if (!use_inter_ext_tx_for_txsize[s][i]) continue;
         prob_diff_update(vp10_ext_tx_inter_tree[s],
                          cm->fc->inter_ext_tx_prob[s][i],
                          cm->counts.inter_ext_tx[s][i],
@@ -275,7 +275,7 @@ static void update_ext_tx_probs(VP10_COMMON *cm, vpx_writer *w) {
     int savings = 0;
     int do_update = 0;
     for (i = TX_4X4; i < EXT_TX_SIZES; ++i) {
-      if (!use_intra_ext_tx_for_tx[s][i]) continue;
+      if (!use_intra_ext_tx_for_txsize[s][i]) continue;
       for (j = 0; j < INTRA_MODES; ++j)
         savings += prob_diff_update_savings(
             vp10_ext_tx_intra_tree[s], cm->fc->intra_ext_tx_prob[s][i][j],
@@ -285,7 +285,7 @@ static void update_ext_tx_probs(VP10_COMMON *cm, vpx_writer *w) {
     vpx_write(w, do_update, GROUP_DIFF_UPDATE_PROB);
     if (do_update) {
       for (i = TX_4X4; i < EXT_TX_SIZES; ++i) {
-        if (!use_intra_ext_tx_for_tx[s][i]) continue;
+        if (!use_intra_ext_tx_for_txsize[s][i]) continue;
         for (j = 0; j < INTRA_MODES; ++j)
           prob_diff_update(vp10_ext_tx_intra_tree[s],
                            cm->fc->intra_ext_tx_prob[s][i][j],
index cb322524a8e7d5ba47babbc561aa3c36b140317f..26511aceb5a0185e9304d1318c2df92a660a3bac 100644 (file)
@@ -106,14 +106,14 @@ static void fill_mode_costs(VP10_COMP *cpi) {
   for (i = TX_4X4; i < EXT_TX_SIZES; ++i) {
     int s;
     for (s = 1; s < EXT_TX_SETS_INTER; ++s) {
-      if (use_inter_ext_tx_for_tx[s][i]) {
+      if (use_inter_ext_tx_for_txsize[s][i]) {
         vp10_cost_tokens(cpi->inter_tx_type_costs[s][i],
                          fc->inter_ext_tx_prob[s][i],
                          vp10_ext_tx_inter_tree[s]);
       }
     }
     for (s = 1; s < EXT_TX_SETS_INTRA; ++s) {
-      if (use_intra_ext_tx_for_tx[s][i]) {
+      if (use_intra_ext_tx_for_txsize[s][i]) {
         for (j = 0; j < INTRA_MODES; ++j)
           vp10_cost_tokens(cpi->intra_tx_type_costs[s][i][j],
                            fc->intra_ext_tx_prob[s][i][j],