CONFIG_IST_INTER_MULTISET

Enable multiset inter secondary transform (2 sets)
diff --git a/av1/common/common_data.h b/av1/common/common_data.h
index 2f5bf92..27e8476 100644
--- a/av1/common/common_data.h
+++ b/av1/common/common_data.h
@@ -1158,9 +1158,15 @@
 
 #if CONFIG_IST_ANY_SET
 // IST 4x4 kernel
+#if CONFIG_IST_INTER_MULTISET
+static const int16_t
+    ist_4x4_kernel[IST_SET_SIZE + 1][STX_TYPES - 1][IST_4x4_HEIGHT][IST_4x4_WIDTH] =
+#else
 static const int16_t
     ist_4x4_kernel[IST_SET_SIZE][STX_TYPES -
-                                 1][IST_4x4_HEIGHT][IST_4x4_WIDTH] = {
+                                 1][IST_4x4_HEIGHT][IST_4x4_WIDTH] = 
+#endif
+{
       {
           //  0
 #if CONFIG_IST_REDUCE_RETRAIN // 4x4 mode 0 type 1
@@ -2164,13 +2170,55 @@
                 -1 },
           },
       },
+#if CONFIG_IST_INTER_MULTISET
+    {
+      // 14 (inter ist kernel)
+      {
+          { 109, -21, -19, -14, -41, -18, -1, 18, 20, -4, 7, 20, 8, -9, -9, -6 },
+          { 15, 57, 61, -23, -44, -10, -2, -49, -49, -1, 11, 26, 6, 19, 24, -7 },
+          { 51, -23, -18, 21, 69, 22, -5, -42, -59, -10, -8, -21, -11, 19, 30, 6 },
+          { 31, 29, 70, -5, 24, -8, -5, 26, 17, -9, -35, -65, -22, -23, -23, 32 },
+          { 11, 84, -68, -34, 19, -2, -12, -27, 30, 21, 7, -21, -12, 8, -10, 6 },
+          { 15, 33, 27, 19, 51, 51, -11, 12, 16, -16, 28, 58, 8, -29, -33, -42 },
+          { 4, 10, 6, 76, 9, -62, -2, -49, 39, -1, -33, 8, 31, 10, -12, -18 },
+          { 6, 21, 9, -11, 42, -38, 26, 61, 5, 38, -15, 27, 10, 17, 71, -16 },
+      },
+      {
+          { 80, 60, 60, 17, 46, 12, 1, -1, 0, 1, -8, -11, -5, 0, 0, 1 },
+          { -59, 5, 17, 46, 55, 27, 5, 40, 64, 14, 11, 9, 6, -10, -20, -6 },
+          { 28, -38, 37, 52, -40, -47, 4, -25, 40, 32, 28, 36, 18, 18, 15, -7 },
+          { 63, -18, -49, -30, -1, 31, 15, 60, 31, -4, 23, 46, 16, -5, 3, -12 },
+          { -39, 60, 40, -23, -40, 26, 18, 16, -28, 5, 34, 53, 19, 16, 29, -7 },
+          { -2, 60, -59, -7, 14, -22, -27, -43, 34, 34, 41, 10, -37, -4, 20, 5 },
+          { -13, -17, 17, -44, 62, -56, -14, 6, 8, -34, -16, 40, 6, 33, 43, 20 },
+          { 2, -5, -36, 36, 26, 25, 44, -6, -25, 23, 9, -30, 41, 48, 53, 40 },
+      },
+      {
+          { 101, -25, 24, -25, 49, -14, 6, -26, 20, -3, -10, 17, -3, -12, 9, 1 },
+          { 15, 56, -53, -9, 46, -13, -3, 44, -52, 3, -19, 44, -18, 10, -15, 16 },
+          { 68, 9, -3, 14, -53, 9, -4, 47, -24, -6, 23, -51, 17, 37, -30, -10 },
+          { -1, 81, 71, 51, 32, -11, -4, -5, 10, -8, 5, -22, -4, -9, -4, -10 },
+          { -20, -50, 73, -1, 26, 33, 5, 42, -34, -5, -9, 28, -3, 31, -35, 19 },
+          { 0, 33, -4, -44, 14, 87, -2, 32, 47, -9, -28, -10, 28, 0, 22, -10 },
+          { 25, -3, -5, 68, -41, 33, -20, 14, 34, 0, -6, 57, -37, -9, 22, 37 },
+          { -11, -25, -29, 36, 50, -27, -12, 37, 67, 18, 26, 1, 19, 45, -14, -26 },
+      },
+    },
+#endif
     };
 
 
 // IST 8x8 kernel
+#if CONFIG_IST_INTER_MULTISET
+static const int16_t
+    ist_8x8_kernel
+        [IST_SET_SIZE + 1][STX_TYPES - 1][IST_8x8_HEIGHT][IST_8x8_WIDTH] =
+#else
 static const int16_t
     ist_8x8_kernel[IST_SET_SIZE][STX_TYPES - 1][IST_8x8_HEIGHT]
-                  [IST_8x8_WIDTH] = {
+                  [IST_8x8_WIDTH] =
+#endif
+{
                     {
                         //  0
 #if CONFIG_IST_REDUCE_RETRAIN // 8x8 mode 0 type 1
@@ -11764,6 +11812,514 @@
                               -7, 13,  -4, 0,  2,  -2,  1,   2,   0 },
                         },
                     },
+#if CONFIG_IST_INTER_MULTISET
+                  {
+                      // 14 (inter ist kernel)
+                      {
+                          { 86, 2,  3,  -29, -58, -21, -1, -4, -7, -1, -6,  23,  46,
+                            15, -5, 0,  0,   8,   9,   2,  -1, -3, 3,  -12, -24, -4,
+                            3,  -3, 1,  1,   1,   -6,  -7, -2, 1,  -1, 1,   -1,  4,
+                            9,  0,  -2, 1,   0,   0,   4,  4,  -1, 1,  -1,  0,   -3,
+                            1,  -1, 1,  -1,  -1,  0,   0,  0,  0,  0,  0,   0 },
+                          { 2,  -32, -40, -1, -8,  1,   1,  50,  64, 4,  0,  8,   13,
+                            4,  -1,  3,   -1, -43, -55, -9, 5,   0,  0,  -9, -14, -4,
+                            1,  -1,  2,   0,  -4,  21,  30, 4,   -2, 2,  0,  0,   6,
+                            10, 3,   -1,  1,  -2,  2,   -6, -10, 0,  -1, 0,  -2,  -5,
+                            -1, -1,  -2,  -1, 2,   -1,  1,  1,   0,  0,  -1, 0 },
+                          { 69,  -1, -7, -10, 8,  -12, -3, 3,   6,  -2, 4,  -26, -52,
+                            -11, -1, -1, 2,   -9, -11, -1, 1,   -3, -2, 37, 58,  18,
+                            -3,  -2, 1,  0,   0,  11,  14, 3,   -1, 0,  0,  1,   -21,
+                            -35, -6, 4,  0,   0,  0,   -7, -10, -3, 0,  -1, 7,   12,
+                            0,   -2, -1, 3,   5,  0,   -1, -3,  1,  0,  -1, 1 },
+                          { 3,   65,  -55, -25, 14, 12,  -18, -35, 18, 22, 3,   29, -8,
+                            -23, 2,   -10, 17,  24, -16, -22, 7,   4,  -7, -27, 2,  20,
+                            -1,  -1,  -2,  6,   -6, -13, 13,  11,  -5, 3,  -4,  5,  19,
+                            -1,  -14, 2,   1,   -2, 0,   7,   -4,  -3, 3,  -1,  -9, 1,
+                            6,   -3,  1,   -2,  2,  -1,  2,   -2,  -1, 0,  -1,  0 },
+                          { 3,  42, 56, 5,  -2,  -1,  -11, -26, -25, -18, -3, -6,  4,
+                            -1, -1, -2, 1,  -23, -35, -2,  1,   -1,  2,   -4, -11, -5,
+                            0,  -2, -1, -2, 4,   43,  54,  14,  -4,  -1,  1,  1,   9,
+                            19, 7,  0,  1,  2,   1,   -24, -34, -6,  5,   0,  -6,  -12,
+                            -4, 1,  -3, 5,  11,  0,   2,   4,   1,   -1,  -1, -2 },
+                          { 54,  -26, -6, 24, 55, 22, 0,  -1, -9, -5, -13, -19, -30,
+                            -31, -3,  1,  0,  1,  10, 4,  -3, -2, -2, -27, -31, -5,
+                            -2,  -3,  0,  -1, 1,  -1, -7, -5, 3,  -1, -3,  4,   34,
+                            46,  13,  -1, 0,  2,  0,  3,  7,  4,  -1, 3,   -15, -20,
+                            -4,  4,   -1, -1, -3, -2, 2,  6,  -1, 1,  2,   -1 },
+                          { 8,  13, -11, 54, -1,  -37, 0,   -23, 22,  13, -8, -44, 6,
+                            32, 1,  -5,  12, 30,  -18, -28, 5,   -4,  6,  27, -13, -34,
+                            1,  3,  -1,  4,  -13, -31, 9,   23,  -3,  -1, 2,  -1,  -11,
+                            13, 17, -4,  -1, -3,  5,   20,  -3,  -13, 1,  -1, 5,   -5,
+                            -5, 4,  1,   -9, 1,   4,   -1,  0,   0,   2,  -1, 0 },
+                          { 6,  70, 30, -6,  -2,  3,   -4,  37,  14, 11, 2, -17, -11,
+                            -4, -7, -1, -28, -40, -16, -16, -5,  -1, 1,  8, -2,  -4,
+                            1,  -1, -4, -3,  6,   -9,  -36, -17, -1, -3, 0, 1,   1,
+                            11, 10, 2,  0,   0,   1,   25,  44,  16, -4, 2, 1,   -5,
+                            -4, 1,  3,  -9,  -19, -3,  -2,  1,   0,  1,  4, 0 },
+                          { 2,   3,   -18, 43, -57, 77, 6,  -3, -12, 18, -15, -10, -3,
+                            -24, -25, 3,   -9, 3,   1,  -9, 1,  -7,  20, 18,  -1,  20,
+                            18,  -7,  -4,  2,  12,  4,  3,  11, 2,   0,  5,   -15, -14,
+                            6,   -4,  -8,  6,  0,   -7, -4, -2, -7,  -1, 5,   8,   -7,
+                            0,   1,   2,   0,  -1,  2,  -3, 3,  0,   0,  1,   0 },
+                          { -1,  -36, 68, 6,  -16, 1,   16,  -13, 28, 10, -12, 19,  -15,
+                            -18, 3,   3,  -1, 12,  -24, -39, -4,  4,  -5, -23, 15,  28,
+                            0,   0,   1,  -3, -11, -26, 1,   24,  5,  -5, -1,  10,  24,
+                            -10, -21, 0,  1,  -2,  3,   22,  10,  -7, 0,  -4,  -11, 8,
+                            13,  -2,  3,  -9, -7,  1,   4,   -4,  -4, 2,  2,   2 },
+                          { 25,  2,   6,   25,  48,  36,  6,   -2,  -16, 9,  3,
+                            28,  25,  21,  -13, -4,  -11, -13, -12, -18, -6, 0,
+                            -20, -18, -19, -28, -11, 0,   -1,  0,   8,   3,  6,
+                            11,  5,   -2,  -3,  -3,  -31, -41, -11, 0,   -5, 0,
+                            -1,  7,   6,   -1,  -1,  1,   30,  42,  12,  -2, 2,
+                            -2,  -2,  3,   -8,  -15, 0,   0,   0,   3 },
+                          { -2,  4,   -15, 6,   -9, -26, 57,  6,  -21, 62,  9,
+                            6,   -21, 19,  5,   -5, -34, -9,  16, -20, -10, 0,
+                            -17, -15, 7,   -6,  -3, 3,   -5,  5,  31,  18,  -2,
+                            15,  7,   -4,  1,   20, 17,  6,   7,  6,   -1,  1,
+                            -21, -22, -11, -16, -2, -9,  -12, -5, -6,  -3,  6,
+                            8,   6,   4,   2,   1,  2,   -1,  0,  0 },
+                          { 2,   8,   -12, 67, -6,  -42, -35, 0,   -5, 2,  -29, 5,  9,
+                            2,   10,  2,   14, -18, 7,   3,   -10, -1, 2,  -15, 5,  28,
+                            8,   4,   2,   -2, 10,  25,  -10, -19, 7,  2,  -1,  7,  17,
+                            -16, -36, -16, 2,  1,   -9,  -16, 15,  22, -3, -2,  -9, 11,
+                            21,  2,   4,   11, -10, -11, 3,   -4,  -6, -4, 3,   1 },
+                          { 6,  25, -2,  30,  -12, 6,  68, -26, 43,  -51, -15, 18, -15,
+                            3,  11, -22, -10, -16, 16, 30, 15,  2,   -3,  -10, 0,  -7,
+                            -7, -3, -5,  8,   -4,  -7, -5, -24, -16, 6,   -3,  2,  2,
+                            -8, -2, 5,   4,   -4,  6,  1,  -11, 2,   5,   0,   0,  5,
+                            2,  -5, -3,  2,   10,  3,  0,  -1,  1,   1,   -5,  1 },
+                          { 7,  26,  30, 9,  7,   10,  -9,  58,  24,  28, -4,  -8, 3,
+                            -2, -7,  -3, 12, 31,  17,  16,  -11, -2,  -2, -11, -8, 2,
+                            1,  0,   0,  -9, -26, -23, -8,  -17, -6,  -1, 1,   2,  2,
+                            -5, -12, -5, -1, -4,  -3,  -29, -45, -18, -6, 1,   3,  7,
+                            9,  3,   1,  26, 36,  13,  2,   -1,  0,   -5, -10, -2 },
+                          { 3,   -12, 15, 8,  -26, 26,  -22, -35, 24, 38,  23, 15, -28,
+                            16,  19,  3,  38, -4,  -5,  7,   -21, -6, -22, -1, 1,  -31,
+                            -13, -7,  4,  -5, -11, 10,  -10, -32, -1, -1,  4,  11, -2,
+                            3,   26,  15, 1,  0,   -2,  -19, 10,  34, 8,   -3, 8,  1,
+                            -15, -5,  1,  15, -3,  -16, -4,  1,   6,  -5,  0,  -1 },
+                          { -1,  -6,  16,  -19, 27, -20, 8,   -41, 54, 17, -6, -11, 30,
+                            -38, -23, 3,   -10, -2, 20,  -15, -8,  -1, 7,  16, -14, 12,
+                            16,  5,   1,   7,   22, 20,  -14, -4,  -2, 0,  1,  -20, -23,
+                            6,   4,   -11, 0,   -7, -27, -25, 0,   6,  2,  15, 22,  -1,
+                            -5,  2,   10,  14,  2,  -2,  -9,  4,   3,  -4, 0,  -2 },
+                          { -4,  1,   -5, -6, -21, -3, -6,  8,   -5,  0,  -17, -32, 13,
+                            -58, 68,  2,  0,  -7,  13, -16, 12,  1,   11, -21, 3,   -35,
+                            -20, -15, 1,  -3, 8,   2,  4,   4,   2,   -3, 4,   5,   2,
+                            -5,  13,  19, 8,  3,   -3, -3,  -2,  -10, -3, 8,   21,  31,
+                            13,  -3,  1,  -1, 2,   6,  -12, -19, -7,  0,  -1,  4 },
+                          { 14,  1,   6,   21, 20, 19, 8,   -1, 4,   5,  53, -2,  50,
+                            -4,  54,  -6,  -6, -2, 1,  -11, 7,  -21, 6,  6,  26,  10,
+                            -10, -13, 1,   -2, 1,  -3, -5,  -5, -5,  -4, 1,  -11, -7,
+                            -11, -17, -11, 3,  0,  -2, 0,   0,  1,   0,  -7, -30, -39,
+                            -11, 0,   1,   0,  1,  1,  20,  30, 6,   1,  1,  -7 },
+                          { -1,  -3,  -1,  13,  -18, -3,  -11, -3, 7,  -20, 66,
+                            -41, 9,   -13, -35, 4,   -19, 20,  -7, 11, 23,  -14,
+                            -33, -40, 8,   2,   21,  8,   3,   7,  13, 5,   1,
+                            -9,  -15, -1,  11,  31,  14,  -7,  6,  -7, 1,   -6,
+                            -7,  1,   2,   2,   8,   -8,  9,   18, 4,  3,   2,
+                            -7,  -2,  0,   -8,  -12, 1,   3,   0,  2 },
+                          { 2,   0,  1,  -22, 5,  38,  -16, -9, 25, -17, -32, -31, 8,
+                            51,  -2, 13, -24, 27, 2,   -14, 12, 12, 26,  -6,  20,  -17,
+                            -25, 2,  0,  6,   19, 21,  -13, -2, -2, -1,  -4,  11,  21,
+                            -5,  -9, 7,  -6,  -7, -22, -18, 4,  5,  2,   -20, -27, 5,
+                            12,  0,  11, 9,   -5, -3,  14,  -7, -9, -3,  1,   4 },
+                          { -2, 3,   -3,  -26, 1,   12,  52,  0,  -12, 3,  16, -51, 8,
+                            13, -6,  -24, 64,  -18, -1,  -12, -7, 0,   10, -1, -19, 12,
+                            3,  -3,  -3,  -12, -12, 1,   2,   0,  13,  -3, 5,  0,   11,
+                            -4, -23, -14, 1,   4,   2,   -9,  8,  14,  1,  -1, -1,  12,
+                            27, 17,  4,   6,   -12, -19, 0,   -6, -11, -4, 7,  -1 },
+                          { -1,  -11, 2,   -8,  3,  -6,  8,  -18, -13, 43, -4, -17, 0,
+                            -1,  14,  -15, -32, 17, -56, 57, -7,  -9,  27, 2,  -19, 15,
+                            -20, 1,   1,   17,  10, -6,  -3, -23, -25, -1, -1, -14, 3,
+                            -4,  -15, 2,   2,   -6, 8,   10, 3,   11,  15, 11, 4,   10,
+                            20,  6,   -6,  -7,  7,  3,   -1, -5,  -10, 4,  -6, 1 },
+                          { 5,  11, 15, 7,   5,   -6,  11, 18, 13,  21,  8,   16,  -19,
+                            10, 8,  33, 26,  22,  14,  22, 59, -3,  21,  -14, -9,  4,
+                            -3, 0,  -4, -13, 6,   25,  10, 7,  -14, -16, -8,  -16, -17,
+                            2,  -2, -1, -3,  -2,  -17, -3, 2,  -10, -2,  12,  7,   0,
+                            0,  -1, -5, -34, -42, -13, -3, -1, -3,  15,  24,  2 },
+                          { 1,  10,  -13, 5,   2,  -8,  39,  0,   -15, -11, -5,
+                            3,  10,  -18, -4,  66, -13, 31,  -36, -7,  -16, -7,
+                            10, -12, 16,  -10, 6,  6,   -16, -18, -50, 24,  -22,
+                            -1, 9,   4,   -1,  1,  -9,  1,   4,   0,   -4,  13,
+                            12, -13, 7,   19,  7,  3,   4,   -1,  -3,  -2,  5,
+                            17, 2,   -12, 0,   1,  4,   -9,  -4,  0 },
+                          { -1, -14, 1,  1,  5,   -7,  2,   -6,  -26, 21,  -12, 6,  10,
+                            -4, -27, -7, 7,  -24, -4,  -37, 68,  12,  20,  -8,  24, -10,
+                            7,  7,   3,  -4, -8,  -20, 1,   -50, -22, -16, -8,  -4, -3,
+                            8,  3,   5,  1,  5,   9,   1,   -10, 17,  20,  -2,  -4, -1,
+                            -5, -5,  4,  15, 21,  2,   3,   -4,  1,   -6,  -9,  1 },
+                          { 1,   2,   -1, -5,  6,  10,  -2,  -27, 13,  36,  -14,
+                            -17, 26,  -3, -13, 48, 0,   -47, 29,  38,  -11, 6,
+                            -10, 3,   24, -17, 12, 4,   -10, -10, -17, -12, 14,
+                            7,   -13, 1,  -1,  13, 16,  -2,  -8,  -9,  -4,  13,
+                            20,  17,  -8, -14, -5, -18, -14, 4,   9,   5,   -17,
+                            -22, -3,  12, 8,   -5, -5,  11,  2,   3 },
+                          { 1,   5,   7,   8,   10,  1,   19, 23,  -3, 8,  -27, 6,  38,
+                            -26, -20, -35, 28,  30,  -17, 26, -20, 16, -6, -1,  50, -23,
+                            10,  9,   3,   11,  23,  -2,  19, -6,  9,  3,  -2,  7,  2,
+                            6,   14,  15,  2,   -14, -5,  -5, 13,  8,  1,  -13, -8, -4,
+                            -20, -12, -4,  -16, -21, -20, 1,  -4,  4,  5,  8,   3 },
+                          { -2, 0,   0,  7,   -6,  -11, -8,  -3, 9,   0,   29,
+                            1,  -11, 1,  -31, -10, -2,  -13, 24, -4,  -31, -29,
+                            65, -46, 22, -13, -29, 19,  0,   20, -10, 1,   16,
+                            1,  26,  2,  -12, -17, -18, 9,   1,  15,  0,   -2,
+                            10, 8,   1,  -2,  -9,  10,  -1,  0,  9,   -6,  -9,
+                            -4, 3,   -2, 10,  1,   -9,  -2,  -5, 0 },
+                          { 2,   0,   -1, -3,  6,   0,   -2,  -8,  -2, -15, 12,
+                            11,  -14, 13, 16,  15,  20,  -12, -27, 12, -18, -2,
+                            33,  -20, 17, -20, 58,  -14, -5,  -27, 48, -33, -19,
+                            8,   -8,  -3, -9,  0,   -11, 16,  -13, -3, -11, -6,
+                            -11, -13, 1,  -17, 5,   1,   3,   -2,  2,  2,   15,
+                            11,  8,   20, -11, -10, -4,  0,   -5,  6 },
+                          { 0,   -1, 3,   -14, 7,   11, 0,   0,   4,  9,  -25, -16, -2,
+                            32,  37, -11, -21, 9,   13, -7,  -2,  -6, -5, -33, 14,  22,
+                            49,  -8, -6,  28,  -21, 7,  29,  -25, 23, 0,  7,   16,  -30,
+                            20,  -3, -23, -12, 3,   8,  13,  2,   7,  2,  7,   21,  -5,
+                            -11, 2,  -13, -8,  -3,  -9, -21, -1,  10, -2, -5,  2 },
+                          { -8,  -2,  -3,  -14, -12, -9,  0,  0,   -2, -4,  -28,
+                            -11, -18, -11, -18, 11,  3,   5,  -6,  -1, 3,   -25,
+                            -37, -21, -1,  -39, -17, -23, 1,  -1,  21, -11, 11,
+                            -13, 5,   -2,  12,  -4,  -30, -2, -45, -9, 5,   -5,
+                            0,   -3,  8,   -3,  3,   11,  0,  -17, 13, 18,  1,
+                            -3,  -2,  1,   30,  49,  19,  3,  -1,  -21 },
+                      },
+                      {
+                          { 99, -21, 21, -27, 33,  -23, 2,  -29, 32, -7, -4, -7, 12,
+                            -5, -3,  1,  1,   -20, 23,  -5, -2,  -3, -2, 4,  -4, 4,
+                            -1, -1,  0,  0,   -2,  -6,  8,  0,   -1, -1, 0,  -1, 4,
+                            -4, 2,   1,  -1,  -1,  -1,  0,  1,   1,  1,  0,  1,  -1,
+                            0,  1,   -1, 1,   0,   0,   0,  0,   -1, 0,  1,  -1 },
+                          { 12,  43, -48, -15, 46, -9,  -8, 34, -34, 10, 0,   -30, 56,
+                            -22, -3, -2,  0,   3,  -2,  -1, 2,  1,   -2, -20, 36,  -12,
+                            -4,  0,  -1,  2,   4,  -12, 15, -6, -2,  1,  -1,  -3,  -3,
+                            11,  -1, -2,  -1,  1,  1,   -8, 10, -3,  -1, -1,  2,   0,
+                            2,   0,  0,   -2,  2,  0,   1,  -2, 1,   0,  0,   -1 },
+                          { 71, -5, -13, 7,  -40, 6,   1,   32, -42, 2,  -4, 13, -22,
+                            15, -5, 0,   -4, 40,  -48, 13,  1,  -1,  3,  -7, 8,  -3,
+                            1,  -3, 0,   -1, 0,   20,  -25, 4,  1,   -1, 2,  2,  -11,
+                            15, -7, 1,   0,  1,   2,   2,   -3, -1,  1,  -1, -5, 8,
+                            -2, -1, 1,   -2, 1,   -1,  -1,  2,  0,   -1, 1,  0 },
+                          { 6,   70, 70, 40, 4,  -38, -17, 4,  -8, -22, -16, 26, 2,
+                            -26, 4,  -5, -3, 5,  -5,  -1,  -5, -4, -6,  17,  7,  -17,
+                            2,   1,  -2, -1, 4,  -1,  -4,  7,  -3, -2,  0,   1,  4,
+                            5,   -7, -1, 1,  2,  3,   -3,  -1, 5,  0,   2,   0,  2,
+                            -1,  -3, 1,  -2, -1, 1,   0,   0,  0,  -1,  0,   0 },
+                          { -7, -42, 64, -6,  -6, 49, -11, 27,  18, -11, -2,  -14, 27,
+                            -2, -9,  3,  -25, 22, 1,  -7,  -4,  0,  -2,  -23, 42,  -23,
+                            2,  -1,  2,  -2,  -5, -2, 19,  -11, 0,  -2,  0,   -5,  -7,
+                            23, -12, 1,  1,   0,  3,  -10, 18,  -6, -2,  -3,  3,   4,
+                            -1, -1,  1,  -5,  6,  0,  2,   -1,  1,  -1,  1,   -1 },
+                          { 9,   54, -10, -47, -5,  38, -19, 39,  31, -24, 9,  -1,  -22,
+                            13,  -8, -4,  -16, 21,  25, -35, 1,   0,  -4,  21, -23, 7,
+                            3,   -2, -1,  -1,  -10, 23, 5,   -14, -2, 1,   -1, -7,  17,
+                            -11, -5, 4,   1,   -3,  -2, 15,  -5,  1,  -2,  -2, 6,   0,
+                            -6,  1,  2,   3,   -4,  2,  1,   1,   -2, -1,  -1, 1 },
+                          { 23,  -5, -29, 70,  27,  52,  -35, 14, 20, 32, -6, 23, -21,
+                            -17, -9, 4,   -16, -15, 7,   11,  -4, -5, -5, 13, -8, -15,
+                            3,   -2, 2,   3,   -3,  -19, 14,  6,  -4, -1, -3, -2, 13,
+                            -9,  -3, 1,   0,   0,   0,   -8,  4,  7,  -1, 3,  7,  -8,
+                            3,   0,  -1,  -2,  -1,  5,   1,   -3, 1,  0,  -1, -1 },
+                          { -17, -5, 5, -3, 84,  8,   0,   -14, 22, 3,   -4, 0,   -10,
+                            4,   -3, 1, -8, 27,  -36, 6,   -1,  -2, -10, 2,  -3,  9,
+                            -7,  -1, 2, 0,  -13, 38,  -42, 17,  -2, -1,  -3, 3,   -14,
+                            23,  -9, 1, -2, -2,  -1,  14,  -15, 2,  1,   2,  -13, 21,
+                            -7,  0,  2, -2, 2,   -3,  -3,  7,   -2, -2,  2,  1 },
+                          { -11, -42, -34, -19, -9, -35, -6,  25,  22, -28, 5,  49, 19,
+                            -39, 1,   9,   -3,  6,  -4,  -10, 10,  2,  -14, 40, 10, -34,
+                            8,   3,   1,   1,   5,  -2,  -14, 6,   3,  2,   -2, -6, 18,
+                            11,  -23, 2,   1,   -1, 10,  -9,  -12, 10, -2,  1,  2,  6,
+                            -8,  -3,  4,   -7,  -3, 4,   -1,  2,   1,  -2,  -1, 1 },
+                          { 5,   22,  -33, 30, -10, 13, 45,  -22, 25, -43, -26, 28, 9,
+                            41,  -11, -9,  8,  -10, 21, -8,  5,   1,  -17, -6,  27, 3,
+                            -12, -2,  -3,  2,  -11, 4,  7,   2,   -8, 2,   -1,  -4, -16,
+                            37,  -12, -5,  -1, 1,   -2, -11, 19,  -6, -2,  -5,  -4, 15,
+                            -1,  -2,  0,   -9, 17,  -4, 3,   0,   3,  -3,  5,   -2 },
+                          { 1,   -24, 20, 16, 28,  21, 45, 40,  -41, -31, -19, 12,  35,
+                            17,  -12, -4, 4,  -9,  1,  2,  2,   0,   -17, 26,  -26, 20,
+                            -16, -2,  -2, -3, 5,   -2, -5, -5,  3,   3,   -1,  -12, 24,
+                            -29, 20,  -9, -3, 5,   -6, 13, -13, 6,   -6,  -1,  8,   -8,
+                            6,   1,   -5, 10, -10, 5,  -1, 1,   -1,  2,   -3,  2 },
+                          { 1,   10, 0, -38, -2,  56,  -36, -39, -32, -44, -18, 6,   0,
+                            -10, 9,  5, 12,  -24, -8,  18,  11,  5,   -11, 4,   6,   -3,
+                            12,  -4, 1, 1,   21,  -24, -20, 31,  0,   3,   2,   -2,  -9,
+                            0,   6,  3, 0,   2,   10,  -17, -13, 17,  -1,  5,   -13, -1,
+                            9,   -2, 1, -6,  -3,  2,   -5,  0,   4,   -1,  -1,  -1 },
+                          { -1,  -28, -17, 31, 9,  -16, -40, -27, -34, -36, -34,
+                            -40, -14, 8,   26, 3,  1,   45,  34,  -25, -4,  3,
+                            -2,  19,  7,   -5, 6,  0,   4,   0,   -5,  15,  12,
+                            -15, 5,   4,   2,  -7, 10,  -2,  -1,  2,   -1,  -2,
+                            -3,  11,  1,   -7, -2, -5,  5,   2,   -4,  2,   1,
+                            4,   -1,  -1,  1,  3,  -3,  1,   -1,  1 },
+                          { -12, -4,  5,  -38, 23,  -24, -10, -1,  -28, 11,  -20,
+                            33,  -25, 32, -24, 4,   -37, 21,  11,  41,  -3,  6,
+                            -5,  18,  -8, 8,   -6,  2,   1,   6,   -12, -18, 29,
+                            6,   -7,  0,  -2,  5,   -2,  -1,  -11, 10,  -1,  1,
+                            -2,  -28, 38, -6,  -4,  -1,  12,  -13, 1,   1,   -2,
+                            -10, 13,  1,  7,   -13, 3,   1,   1,   -3 },
+                          { -2,  2,   -7,  5,   -35, -9,  -36, -1, 18,  11, -26,
+                            -2,  62,  12,  -15, 1,   -27, 5,   27, 41,  -6, 2,
+                            1,   -6,  -10, 10,  -5,  4,   2,   3,  -29, 24, -18,
+                            33,  -12, -1,  2,   4,   -8,  -10, 9,  -3,  1,  -2,
+                            -17, 22,  -18, 15,  -5,  7,   -7,  3,  -4,  5,  -3,
+                            8,   -3,  2,   -5,  2,   -5,  0,   1,  1 },
+                          { 5,   12,  11,  -7, 0,  25, 18,  -35, -21, 50, 32, 17,  29,
+                            30,  27,  -14, 17, 31, 30, 4,   0,   -2,  0,  29, 4,   -39,
+                            -5,  -5,  -2,  -7, 2,  -5, -15, -1,  4,   -2, -2, -13, 21,
+                            2,   -25, 1,   -1, -3, 0,  -1,  -12, 7,   -2, -6, 10,  9,
+                            -14, -1,  4,   -5, -1, 5,  3,   4,   -3,  -4, 1,  0 },
+                          { 0,   -5,  3,  -11, 7,   -5,  -12, 44,  29,  15,  -31,
+                            14,  -3,  16, 68,  -11, 47,  19,  11,  15,  -15, 3,
+                            -15, -2,  -2, 10,  3,   -10, -1,  -21, 17,  -20, 2,
+                            7,   -15, -1, -1,  4,   -23, -1,  18,  -10, -1,  -4,
+                            0,   -2,  9,  -1,  -7,  2,   -15, 3,   12,  -6,  -3,
+                            5,   10,  -8, -2,  0,   4,   2,   4,   0 },
+                          { -1,  10,  -6, -8, -9, 9,  54,  1,   22,  2,  -49, -52, -19,
+                            -25, -10, -1, 0,  15, -2, 26,  -34, 4,   17, 26,  8,   -33,
+                            7,   -2,  -2, 1,  2,  -7, -16, 21,  -14, 2,  0,   9,   14,
+                            -11, -8,  8,  1,  -4, 9,  -8,  1,   4,   -3, 6,   13,  -15,
+                            1,   3,   3,  0,  -6, 5,  1,   -5,  -1,  2,  -5,  0 },
+                          { -3,  -6,  11,  -14, -13, 2,  -5,  11, -23, 45,  -26,
+                            -8,  -20, -19, -31, 7,   19, -28, 18, -28, -18, -2,
+                            -22, 40,  30,  35,  -14, -2, 1,   2,  -4,  -1,  6,
+                            9,   -2,  0,   1,   -8,  -2, 32,  -5, -3,  -2,  5,
+                            -15, 13,  -10, 11,  -6,  -2, -15, 31, -13, -1,  1,
+                            -4,  6,   -3,  -5,  12,  -3, -6,  7,  2 },
+                          { -2, -4,  5,  14,  8,   -26, -13, 34,  5,  -7, 19, -39, -13,
+                            63, -17, 3,  -8,  -18, 14,  -14, 9,   -6, 6,  3,  -5,  -24,
+                            -3, 6,   2,  3,   14,  -35, -24, 24,  3,  0,  1,  -1,  -13,
+                            12, -3,  10, -3,  1,   15,  -20, -24, 29, -8, 1,  -9,  6,
+                            2,  4,   9,  -16, -7,  11,  -8,  0,   4,  -6, 0,  0 },
+                          { 1,   -4,  4,  -3,  10,  5,  18, 22,  -28, -4, -11, 6,   -17,
+                            -21, 13,  4,  -12, -32, 52, 27, 10,  13,  12, -26, -37, -33,
+                            20,  0,   -1, 1,   5,   19, -8, -26, -1,  4,  3,   12,  -24,
+                            23,  -25, 15, 1,   1,   -3, 17, -8,  -10, -2, 7,   -17, 21,
+                            -15, 5,   3,  1,   5,   -9, -4, 8,   -6,  -2, 5,   2 },
+                          { 1,   -1,  2,   8,  8,  3,   0,   8,   3,  -24, 41, 7,  -20,
+                            -23, -38, 13,  41, 38, 47,  39,  10,  -1, 30,  0,  32, 19,
+                            -24, -5,  0,   0,  -2, -14, -16, -4,  -2, 2,   -4, 12, -11,
+                            -9,  13,  -11, 0,  -1, -7,  -1,  -11, -3, -3,  3,  -3, -1,
+                            2,   -6,  -5,  4,  -3, -1,  -1,  3,   -2, 2,   -1, 1 },
+                          { -5, 3,   -3, -11, 10,  -4, -6,  -10, -1, 15, -36, 42, 2,
+                            26, -32, 35, 11,  5,   3,  -28, -33, -7, 19, -27, 18, -22,
+                            22, -5,  -2, 1,   17,  -8, -6,  -21, 6,  5,  -7,  8,  -9,
+                            -3, 8,   8,  -7,  -5,  8,  23,  -29, -8, 4,  -5,  10, -17,
+                            17, -8,  2,  25,  -30, 1,  -4,  3,   1,  6,  -9,  5 },
+                          { 2,   10, 6,  4,   -6, -3,  18,  -5,  12, 27,  -21, -9,  -1,
+                            -10, -5, 36, -12, 26, 11,  -2,  70,  24, -41, -2,  3,   9,
+                            26,  -2, -5, 12,  -7, -16, -25, -24, 10, -7,  13,  -24, -3,
+                            -7,  18, 7,  -5,  -7, 3,   -12, -4,  -1, -1,  -3,  -13, -5,
+                            21,  0,  3,  -3,  0,  1,   -9,  -4,  10, 3,   0,   -1 },
+                          { 2,   5,   2,   12,  1,   3,  9,   6,   -4,  -11, 26, -8, 17,
+                            9,   12,  71,  15,  -1,  -3, 9,   -28, -18, -4,  11, -3, 33,
+                            56,  -14, -10, -2,  -18, 6,  14,  15,  -8,  -1,  -5, 2,  0,
+                            -12, -32, 19,  -16, -2,  10, -14, 6,   -6,  -4,  2,  -7, 7,
+                            -12, 7,   6,   -6,  4,   -4, -3,  6,   0,   0,   2,  2 },
+                          { -3,  3,   3,  1,  -6, -1,  -34, -2,  17,  -3, -14, -19, 17,
+                            15,  -35, 13, 51, -9, -26, 33,  -1,  11,  -3, 9,   -36, -10,
+                            -14, 3,   1,  1,  16, -2,  -11, -49, -6,  0,  4,   -23, 20,
+                            20,  -10, 1,  -2, 1,  7,   -6,  14,  -21, 8,  -9,  16,  12,
+                            -17, 3,   5,  -5, 8,  -11, 8,   4,   -2,  -5, 2,   0 },
+                          { -2, -1,  3,  -4, 5,   -11, -3, 7,   3,   -3,  4,   -5,  -29,
+                            16, 6,   -6, 17, -20, -2,  37, 23,  5,   -35, -30, 39,  -3,
+                            13, 2,   -5, -8, 4,   32,  26, 8,   -21, -7,  5,   -13, 41,
+                            1,  -22, 2,  -3, 0,   -8,  15, -25, 24,  -11, -11, 26,  -13,
+                            -1, -1,  -9, 16, -16, 14,  7,  1,   -6,  6,   -7,  5 },
+                          { 0,   3,   5,  -4, 5,   4,   -7, 13, 5,  0,  -26, 3,  -1,
+                            15,  32,  13, 10, -30, -18, 2,  40, 12, 58, 23,  29, 4,
+                            -19, -15, 2,  4,  -50, -8,  -4, -7, 29, 3,  -1,  5,  -7,
+                            -12, -21, 11, -2, 7,   -11, 8,  -7, -6, 14, -6,  12, -10,
+                            -12, 7,   0,  -3, -5,  0,   10, -3, -8, -3, -4,  0 },
+                          { 0,   -6,  6,   -2,  0,   2,  -1, 1,   -12, 4,  -8,
+                            4,   1,   -13, -17, 11,  49, 16, 1,   -39, 12, 14,
+                            -21, -37, -35, -24, -27, -9, -1, 3,   -43, -1, 12,
+                            36,  -17, -3,  0,   24,  1,  -8, -16, 16,  6,  6,
+                            -3,  -5,  -5,  7,   -7,  15, 8,  -15, 0,   10, 6,
+                            -14, 13,  -2,  11,  -20, 2,  -1, 0,   -7 },
+                          { 0,  -7,  5,   6,   5,  3,  -8,  8,   -3, 15, -15, 5,  13,
+                            -1, -17, -32, 16,  -5, 20, -18, 21,  4,  32, 3,   5,  34,
+                            37, 18,  -5,  -10, 34, 45, -24, 9,   -2, 2,  -11, 9,  2,
+                            -4, -21, -4,  -3,  -9, 14, -27, 8,   2,  -1, -3,  13, -31,
+                            8,  -1,  15,  -24, 15, -8, 15,  -20, 9,  -1, 0,   -6 },
+                          { 0,   1,   -1,  5,   2,  1,   2,   -6,  7,   2, 2,  -8,  9,
+                            10,  -33, -18, 8,   11, -18, 2,   33,  27,  3, 32, -4,  -17,
+                            22,  -21, -1,  -38, 24, 5,   57,  20,  10,  2, 13, 20,  -29,
+                            -16, -11, -3,  3,   -5, 3,   12,  -15, -19, 6, 14, -21, 15,
+                            -2,  -2,  -10, 17,  -3, -7,  -13, 7,   -8,  3, 4,  1 },
+                          { -2,  2,   -3,  0,   -2,  -1,  7,   -5,  7,   1,   -29,
+                            5,   4,   -13, 2,   -10, -9,  27,  0,   2,   5,   -11,
+                            22,  -36, -23, 41,  -8,  -19, 1,   -20, 7,   -26, 21,
+                            -10, 23,  -6,  -1,  3,   29,  14,  -29, -10, 2,   -2,
+                            16,  -25, -24, 31,  5,   3,   -5,  25,  -13, 2,   9,
+                            -11, -20, 28,  -10, 17,  -11, -15, -2,  2 },
+                      },
+                      {
+                          { 109, -25, -33, -26, -13, -31, 4,  19, 15, 6, -5, 2, 9,
+                            2,   -4,  1,   0,   -4,  -6,  1,  1,  -3, 0, 2,  0, 1,
+                            1,   -2,  1,   1,   -1,  0,   -1, 0,  0,  1, 1,  1, 0,
+                            0,   -1,  0,   0,   -1,  1,   0,  0,  0,  0, 0,  0, 1,
+                            0,   0,   0,   0,   0,   0,   -1, 0,  0,  0, 0,  0 },
+                          { 21, 56, 57, -38, -43, -21, -18, -38, -37, -14, 3,  20,  35,
+                            18, -1, -4, 1,   13,  10,  -2,  -5,  1,   3,   -5, -12, -2,
+                            3,  0,  0,  -1,  2,   0,   2,   5,   0,   -2,  1,  -1,  -1,
+                            0,  -1, 0,  2,   0,   0,   -1,  -1,  -1,  1,   0,  0,   0,
+                            0,  -1, 0,  1,   0,   0,   0,   0,   0,   0,   0,  0 },
+                          { 46,  15, 8,  35, 61, 14, -14, -36, -50, -21, -10, -24, -38,
+                            -22, -6, -2, 4,  26, 29, 10,  1,   -3,  -6,  3,   9,   3,
+                            -4,  -1, 0,  1,  3,  -2, -5,  1,   2,   0,   -2,  2,   3,
+                            1,   2,  0,  -2, 1,  -1, -1,  -1,  -1,  0,   0,   0,   1,
+                            0,   0,  0,  0,  0,  0,  0,   0,   1,   0,   0,   0 },
+                          { -7, 86, -69, 30, -11, -29, -22, 21, -10, 24, -9, -10, -3,
+                            9,  2,  -6,  5,  4,   -9,  -5,  7,  -2,  1,  9,  1,   -3,
+                            1,  1,  -2,  2,  0,   -1,  2,   -6, -4,  1,  1,  1,   0,
+                            0,  0,  0,   0,  1,   0,   0,   0,  1,   -1, -1, 0,   0,
+                            0,  0,  0,   -1, 0,   0,   0,   0,  0,   1,  -1, -1 },
+                          { 9,   38, 63, -9,  9,   -28, 12,  31, 37, 1,  -8, -38, -41,
+                            -24, -3, -4, -16, -28, -24, -12, -6, -1, 4,  22, 31,  14,
+                            -1,  2,  -2, -4,  -2,  6,   4,   -4, -5, -2, 2,  5,   0,
+                            -4,  2,  3,  0,   -1,  2,   1,   2,  2,  0,  -1, -1,  0,
+                            -1,  1,  0,  0,   0,   0,   0,   0,  0,  0,  1,  0 },
+                          { -5, -26, 18, 73, -35, -62, 22, 19, -14, -46, -11, -1, 3,
+                            19, 12,  3,  -5, -1,  20,  19, 3,  -6,  1,   7,   -3, -9,
+                            3,  3,   0,  -2, -1,  1,   -9, -6, 2,   1,   2,   5,  0,
+                            0,  -1,  -4, 1,  0,   1,   -1, 0,  -1,  -2,  0,   0,  0,
+                            0,  0,   0,  0,  -1,  0,   1,  0,  0,   -1,  -1,  0 },
+                          { 30, 16,  8,  45, -53, 78,  -21, 4,  28, -28, -3, 11, -25,
+                            13, -20, -4, -1, -17, -10, -8,  1,  -7, 5,   -7, -9, -3,
+                            4,  -6,  1,  1,  -1,  7,   8,   0,  -1, 2,   2,  -3, -2,
+                            2,  1,   0,  1,  0,   1,   1,   -1, 3,  -1,  0,  2,  -1,
+                            0,  0,   0,  0,  0,   0,   0,   0,  -1, 0,   0,  0 },
+                          { 13,  14, 16, 31,  63,  -6,  -2,  10, 5,  -12, 5,   22,  47,
+                            11,  4,  -2, -15, -34, -41, -22, -6, -3, -13, -28, -36, -24,
+                            -10, 0,  0,  -1,  3,   19,  24,  10, -1, 0,   -4,  -2,  1,
+                            6,   2,  -4, -4,  1,   2,   0,   -2, 2,  2,   2,   1,   2,
+                            2,   0,  1,  -1,  0,   0,   1,   1,  1,  0,   0,   0 },
+                          { -2,  18,  -5, -26, 3,  19, 28,  75,  -50, -29, 22,  41, -15,
+                            -25, -11, -5, -23, -5, 11, 16,  2,   2,   -8,  -20, -4, 14,
+                            2,   -2,  -2, -4,  6,  1,  -12, -10, 6,   2,   -4,  1,  6,
+                            0,   -4,  4,  1,   3,  1,  0,   3,   -3,  -5,  2,   0,  1,
+                            0,   -2,  0,  0,   0,  2,  1,   0,   0,   0,   0,   0 },
+                          { 8,  -17, 35, 19,  -9, 21,  -4,  35, -41, 78, -51, -6,  8,
+                            11, -1,  3,  -12, 18, -19, 10,  -7, -1,  6,  8,   -16, -12,
+                            -2, -1,  2,  -5,  5,  -8,  -10, -9, 0,   -8, 2,   -1,  2,
+                            10, 3,   -1, -1,  1,  -3,  -3,  4,  0,   1,  -1,  1,   -2,
+                            3,  1,   0,  2,   -1, 1,   0,   1,  -1,  -1, 1,   0 },
+                          { 3,  24,  15, -2, 15,  2,   7,   19,  59, 3,   -6,  -13, 13,
+                            -1, -11, -1, 9,  32,  51,  15,  4,   0,  -12, -36, -36, -21,
+                            -5, -2,  0,  -2, -17, -30, -35, -19, -9, 0,   0,   4,   16,
+                            22, 9,   1,  -1, -4,  -2,  3,   2,   -3, -5,  2,   1,   0,
+                            1,  2,   0,  1,  2,   2,   -1,  -1,  0,  0,   0,   0 },
+                          { 7,   21,  -11, 14, -11, 12, 100, -41, -6, 22, -16, -2, 15,
+                            -19, -21, -17, 4,  -32, 7,  -3,  0,   -1, 3,  -5,  0,  1,
+                            7,   -3,  -6,  4,  4,   -3, -5,  8,   -2, -1, 2,   -4, 2,
+                            5,   -1,  -1,  2,  2,   -2, 1,   -2,  -5, 2,  1,   3,  -1,
+                            1,   -1,  0,   0,  1,   -1, 0,   1,   0,  0,  1,   0 },
+                          { 1,   -5,  11, 29, -12, -27, -5,  -8,  13, 25,  6,   60, -23,
+                            -57, -6,  6,  23, 37,  -16, -34, -10, -4, -13, -21, -5, 21,
+                            14,  3,   1,  -1, -11, -14, 11,  19,  3,  -2,  -5,  5,  14,
+                            1,   -11, 0,  3,  -3,  0,   3,   -6,  -7, 2,   5,   -1, 0,
+                            0,   -3,  1,  0,  1,   -1,  -1,  0,   0,  0,   -1,  0 },
+                          { 8,   6,  6,  3,   17, -6,  21,  -9,  7,  30, 29, 39,  -54,
+                            74,  21, -3, -16, -6, 23,  -22, -16, -3, -7, 10, -12, 7,
+                            -15, -1, -3, 1,   3,  -14, -12, 0,   2,  -1, -6, 2,   -13,
+                            -17, -6, 2,  -5,  1,  -4,  6,   10,  0,  0,  -2, -1,  4,
+                            -2,  -2, 1,  1,   -1, 2,   1,   0,   2,  0,  1,  1 },
+                          { 3,  -6, 0,  6,  -19, 1,  15,  17,  -22, 9,  66,  -60, -3,
+                            4,  -6, 1,  8,  24,  -5, -30, -41, -6,  11, -25, -6,  -25,
+                            -6, -1, -1, -2, -5,  -3, 16,  31,  15,  2,  3,   0,   0,
+                            10, 19, 5,  1,  0,   0,  0,   -4,  -8,  -2, 2,   3,   -3,
+                            -3, 4,  2,  1,  0,   -1, 0,   0,   -1,  0,  0,   -1 },
+                          { 10,  6,   7,  26, 13,  19,  1,   12,  6,  -1, 29, 8,   58,
+                            -6,  -3,  -3, -1, 19,  -1,  -18, -17, -2, 13, 29, 48,  12,
+                            6,   0,   -1, -3, -15, -30, -37, -17, -1, 1,  -1, -19, -27,
+                            -32, -15, -8, 0,  -2,  5,   15,  19,  8,  3,  -2, 2,   1,
+                            -3,  -3,  2,  2,  0,   1,   0,   2,   0,  0,  0,  0 },
+                          { -7, 2,  -3,  -19, 14,  3,   29, 18,  -3,  -40, -40,
+                            4,  -8, 28,  -33, 4,   33,  44, -25, -37, 16,  7,
+                            13, 39, -20, -4,  -11, 1,   -2, -7,  -21, -13, 11,
+                            16, 6,  3,   -1,  -8,  -15, 3,  7,   3,   -4,  -2,
+                            9,  7,  -9,  -8,  2,   -1,  4,  1,   -1,  3,   2,
+                            -2, -1, -3,  1,   0,   0,   0,  0,   0 },
+                          { 7,   8,   -5,  -8,  -8, 18, 16,  1, 6,  -14, -19, 8,  -5,
+                            -29, 98,  -17, -15, 20, 2,  -23, 4, 6,  17,  9,   3,  -47,
+                            -5,  -10, -2,  3,   1,  2,  -1,  5, 5,  3,   -3,  -5, -1,
+                            2,   3,   6,   2,   -2, 0,  4,   1, -3, 0,   3,   -2, -2,
+                            1,   1,   2,   0,   0,  0,  0,   1, -1, 0,   -1,  1 },
+                          { 7,   9,  14, 2,   2,  5,   14,  2,   -1,  9,   33, 15, -11,
+                            2,   15, 3,  72,  -1, -37, 61,  13,  -9,  -20, 11, 11, -38,
+                            -15, -3, -2, -13, -9, 2,   -4,  -9,  -11, -2,  0,  1,  -7,
+                            -13, 3,  8,  -1,  1,  3,   -11, -14, 3,   1,   -1, 6,  8,
+                            -3,  -1, -2, 1,   0,  -5,  0,   0,   1,   1,   1,  0 },
+                          { 1,  5,  -4,  2,   -2, 3,   21,  -18, 15, -8,  12,  -11, -2,
+                            19, 3,  -16, -53, 64, -57, 35,  12,  -2, -18, -14, 0,   22,
+                            14, 0,  -1,  10,  -1, 25,  -19, 6,   -7, -1,  1,   10,  8,
+                            -4, -7, -8,  -3,  -6, 2,   0,   2,   -6, 7,   -2,  -5,  -3,
+                            2,  1,  0,   -3,  2,  0,   0,   1,   1,  1,   -1,  1 },
+                          { -3,  -2,  -5, 1,   -1, -13, -5,  -16, 8,  4,  27, 20,  -12,
+                            -34, -35, 4,  -32, 6,  -2,  12,  -16, 3,  31, 55, -43, -39,
+                            -1,  4,   2,  8,   10, 23,  -15, -21, -6, 0,  -4, -19, -10,
+                            7,   24,  10, 2,   -1, -4,  -5,  12,  12, 5,  8,  11,  -6,
+                            -10, 2,   0,  1,   -1, -2,  -1,  -1,  -2, 0,  -1, 0 },
+                          { 3,   9,   9,  7,  6,  6,   8,   20,  22,  19,  3,  5,   16,
+                            -2,  -4,  8,  -9, 27, 46,  17,  16,  -9,  8,   11, 6,   5,
+                            -1,  -2,  -3, 3,  15, 41,  49,  26,  7,   -1,  -3, -16, -31,
+                            -30, -15, -9, -1, -4, -16, -27, -32, -22, -10, 5,  13,  10,
+                            5,   0,   -4, 0,  -2, -2,  1,   2,   1,   1,   1,  -1 },
+                          { 2,  -8, 9,  2,   -8, 1,  1,   -4,  -12, 14,  31, -10, 5,
+                            -6, -6, 3,  -17, 0,  5,  -40, 93,  -39, -25, 12, -1,  -14,
+                            -2, 4,  -2, 0,   -3, -7, 8,   -29, 5,   -8,  7,  15,  7,
+                            0,  9,  3,  0,   3,  2,  9,   -1,  -2,  -1,  -1, 4,   1,
+                            -6, -1, 1,  -3,  -1, 2,  -1,  1,   1,   0,   0,  0 },
+                          { 6,  -2, 7,   6,  7,  2,  4,  5,   -4,  2,  24, -17, 0,
+                            -2, 30, -27, 27, -3, -4, 5,  18,  6,   53, 3,  -55, 55,
+                            28, -1, 0,   -8, 0,  -9, 18, -28, -21, -7, -4, -9,  2,
+                            -7, -4, -17, -5, 1,  4,  -3, -6,  7,   7,  4,  -10, -14,
+                            1,  6,  -1,  2,  5,  -1, 0,  2,   -3,  2,  0,  0 },
+                          { 3,   10,  -3, 2,   1,   0,  12, -10, -4,  1,  0,   3,  -5,
+                            0,   11,  96, -16, -1,  -8, 6,  13,  -6,  46, -30, 7,  11,
+                            -17, -13, -9, -6,  -38, 4,  -2, -8,  -12, 0,  -2,  -2, -16,
+                            10,  2,   7,  2,   4,   1,  -3, 2,   7,   6,  3,   -1, -2,
+                            4,   -2,  0,  -1,  -1,  0,  0,  0,   -2,  1,  0,   0 },
+                          { -2, -8,  3,   -1, 7,  -13, -2,  1,   0,   3,  -3,  15, -11,
+                            13, -23, -39, 14, 14, -2,  -19, 17,  3,   56, -49, 43, -26,
+                            -7, 8,   4,   0,  30, 27,  -12, -23, -22, -4, -5,  9,  -21,
+                            19, -8,  4,   0,  -3, -9,  -4,  -5,  12,  8,  -4,  -2, -1,
+                            6,  -3,  3,   4,  2,  -3,  1,   -4,  -1,  0,  1,   0 },
+                          { 0,   1,  -2, -1, -7, 7,   13,  2,   0,  -6,  -6, -10, 10,
+                            -4,  7,  24, 28, 16, 3,   -35, -26, -6, -23, 7,  -14, 21,
+                            -33, -7, -4, 1,  28, 54,  -16, -47, -2, 6,   8,  21,  26,
+                            -24, -2, -4, 5,  -5, -21, -18, 8,   16, 6,   -7, -9,  8,
+                            10,  2,  6,  8,  -6, -10, 2,   -1,  -1, -1,  0,  -1 },
+                          { 3,   4,   0,  -3,  13,  8,  7,   4,   0,  2,  6,   8,   1,
+                            20,  2,   20, 7,   2,   12, -11, -14, 6,  -7, 19,  18,  -22,
+                            87,  14,  -5, -19, -23, 31, 5,   -17, 3,  -2, 4,   17,  21,
+                            31,  -14, -4, -11, 5,   -5, -13, -10, -4, 0,  -10, -12, -21,
+                            -14, 0,   2,  9,   3,   -1, -4,  -1,  2,  0,  2,   1 },
+                          { 3,   2,  1,   10, 6,  7,   2,   2,   7,   1,  11,  23,  21,
+                            8,   5,  -10, -5, 6,  4,   11,  -6,  -12, 19, 29,  27,  28,
+                            -43, -4, 0,   7,  4,  -11, 16,  4,   -4,  6,  2,   21,  36,
+                            46,  42, 11,  3,  -2, -5,  -19, -21, -17, -9, -16, -28, -25,
+                            -22, -8, 1,   4,  11, 6,   1,   2,   -2,  1,  -2,  1 },
+                          { 7,   -1, 5,  13, -7, 0,  1,   4,   -2,  6,   16, -3,  1,
+                            4,   0,  12, -1, 1,  5,  -13, 29,  100, -24, 1,  10,  3,
+                            -11, 3,  -5, -4, 7,  8,  -6,  8,   -18, -22, -4, -41, 15,
+                            6,   14, 4,  4,  0,  -4, -4,  -11, 6,   14,  -3, -9,  -3,
+                            -4,  -2, 2,  -1, 0,  0,  1,   -2,  0,   0,   1,  0 },
+                          { -1,  -6, -5,  -1,  -6,  0,  6,  -4,  -6,  0,   -8, 2,  -1,
+                            -3,  -6, -24, -21, 11,  10, 2,  -26, 14,  -20, -9, 8,  -8,
+                            -11, -2, 2,   -6,  -51, -7, 63, -47, -44, -2,  14, 13, -13,
+                            -18, 13, 14,  4,   5,   14, 0,  5,   8,   12,  -5, 4,  13,
+                            0,   -3, -7,  7,   14,  -1, -2, -5,  1,   2,   -1, 0 },
+                          { -1,  -1,  2,   2,   0,   -6,  -4, -3,  1,   9,  -8,
+                            2,   0,   3,   8,   -27, 11,  -3, 4,   2,   3,  -4,
+                            -12, -16, 4,   28,  -1,  -12, 1,  -8,  -43, 45, -12,
+                            -19, 61,  4,   -13, -31, -29, 15, 45,  13,  3,  9,
+                            -2,  14,  5,   3,   -2,  15,  7,  -11, -13, -8, -1,
+                            3,   -7,  -11, -3,  4,   5,   -4, 1,   1 },
+                      },
+                  },
+#endif
                   };
 #else   // CONFIG_IST_ANY_SET
 // IST 4x4 kernel
diff --git a/av1/common/entropy.c b/av1/common/entropy.c
index 1c6f289..dc0edfbd 100644
--- a/av1/common/entropy.c
+++ b/av1/common/entropy.c
@@ -469,6 +469,9 @@
 #else
   RESET_CDF_COUNTER(fc->stx_set_cdf, IST_DIR_SIZE);
 #endif  // CONFIG_INTRA_TX_IST_PARSE
+#if CONFIG_IST_INTER_MULTISET
+  RESET_CDF_COUNTER(fc->inter_stx_set_cdf, 2);
+#endif
 #endif  // CONFIG_IST_SET_FLAG
   for (int p = 0; p < NUM_MV_PREC_MPP_CONTEXT; ++p) {
     RESET_CDF_COUNTER(fc->pb_mv_mpp_flag_cdf[p], 2);
diff --git a/av1/common/entropymode.c b/av1/common/entropymode.c
index 5dab057..7b93ead 100644
--- a/av1/common/entropymode.c
+++ b/av1/common/entropymode.c
@@ -7584,6 +7584,12 @@
       { AOM_CDF7(4, 8, 12, 16, 20, 24), 0 },
     };
 #endif  // CONFIG_IST_ANY_SET
+#if CONFIG_IST_INTER_MULTISET
+static const aom_cdf_prob default_inter_stx_set_cdf[CDF_SIZE(2)] = {
+  AOM_CDF2(16384),
+  75,
+};
+#endif
 #endif  // CONFIG_IST_SET_FLAG
 #else
 #if CONFIG_IST_ANY_SET
@@ -8087,6 +8093,9 @@
 #else
   av1_copy(fc->stx_set_cdf, default_stx_set_cdf);
 #endif  // CONFIG_INTRA_TX_IST_PARSE
+#if CONFIG_IST_INTER_MULTISET
+  av1_copy(fc->inter_stx_set_cdf, default_inter_stx_set_cdf);
+#endif
 #endif  // CONFIG_IST_SET_FLAG
   av1_copy(fc->pb_mv_precision_cdf, default_pb_mv_precision_cdf);
   av1_copy(fc->pb_mv_mpp_flag_cdf, default_pb_mv_most_probable_precision_cdf);
diff --git a/av1/common/entropymode.h b/av1/common/entropymode.h
index 33c6d43..3cf8251 100644
--- a/av1/common/entropymode.h
+++ b/av1/common/entropymode.h
@@ -554,6 +554,9 @@
 #else
   aom_cdf_prob stx_set_cdf[IST_DIR_SIZE][CDF_SIZE(IST_DIR_SIZE)];
 #endif  // CONFIG_INTRA_TX_IST_PARSE
+#if CONFIG_IST_INTER_MULTISET
+  aom_cdf_prob inter_stx_set_cdf[CDF_SIZE(2)];
+#endif
 #endif  // CONFIG_IST_SET_FLAG
   aom_cdf_prob pb_mv_mpp_flag_cdf[NUM_MV_PREC_MPP_CONTEXT][CDF_SIZE(2)];
 
diff --git a/av1/common/idct.c b/av1/common/idct.c
index 5af71fc..72ff447 100644
--- a/av1/common/idct.c
+++ b/av1/common/idct.c
@@ -777,7 +777,9 @@
       transpose = 1;
 #if CONFIG_IST_SET_FLAG
     mode_t = txfm_param->sec_tx_set;
+#if !CONFIG_IST_INTER_MULTISET
     assert(mode_t < IST_SET_SIZE);
+#endif
 // If in debug mode, verify whether txfm_param->sec_tx_set == intra pred dir
 // based tx set id
 #if !CONFIG_IST_ANY_SET && !defined(NDEBUG)
@@ -801,6 +803,9 @@
       scan_order_out = (sb_size == 4) ? stx_scan_orders_4x4[log2width - 2]
                                       : stx_scan_orders_8x8[log2width - 2];
     }
+#if CONFIG_IST_INTER_MULTISET
+    mode_t = (txfm_param->is_inter ? (mode_t == 0 ? 0 : IST_SET_SIZE) : mode_t);
+#endif
 #if CONFIG_IST_REDUCE_METHOD4
     const int st_size_class = (width == 8 && height == 8) ? 1 : (width >= 8 && height >= 8) ? 2 : 0;
     inv_stxfm(buf0, buf1, mode_t, stx_type - 1, st_size_class);
diff --git a/av1/decoder/decodemv.c b/av1/decoder/decodemv.c
index a0c170c..13958ea 100644
--- a/av1/decoder/decodemv.c
+++ b/av1/decoder/decodemv.c
@@ -1440,9 +1440,16 @@
                                    IST_DIR_SIZE, ACCT_INFO("stx_set_flag"));
 #endif  // CONFIG_INTRA_TX_IST_PARSE
     assert(stx_set_flag < IST_DIR_SIZE);
-  }
 #if !CONFIG_IST_REDUCE_METHOD1
-  if (get_primary_tx_type(*tx_type) == ADST_ADST) stx_set_flag += IST_DIR_SIZE;
+    if (get_primary_tx_type(*tx_type) == ADST_ADST)
+      stx_set_flag += IST_DIR_SIZE;
+#endif
+  }
+#if CONFIG_IST_INTER_MULTISET
+  else {
+    stx_set_flag = aom_read_symbol(r, ec_ctx->inter_stx_set_cdf, 2,
+                                   ACCT_INFO("inter_stx_set_flag"));
+  }
 #endif
   set_secondary_tx_set(tx_type, stx_set_flag);
 }
diff --git a/av1/encoder/bitstream.c b/av1/encoder/bitstream.c
index 80de837..62e19b7 100644
--- a/av1/encoder/bitstream.c
+++ b/av1/encoder/bitstream.c
@@ -1621,9 +1621,20 @@
 
 // This function writes a 'secondary tx set' onto the bitstream
 static void write_sec_tx_set(FRAME_CONTEXT *ec_ctx, aom_writer *w,
-                             MB_MODE_INFO *mbmi, TX_TYPE tx_type) {
+                             MB_MODE_INFO *mbmi, TX_TYPE tx_type
+#if CONFIG_IST_INTER_MULTISET
+                             ,
+                             int is_inter
+#endif
+) {
   TX_TYPE stx_set_flag = get_secondary_tx_set(tx_type);
   assert(stx_set_flag <= IST_SET_SIZE - 1);
+#if CONFIG_IST_INTER_MULTISET
+  if (is_inter) {
+    assert(stx_set_flag < IST_DIR_SIZE);
+    aom_write_symbol(w, stx_set_flag, ec_ctx->inter_stx_set_cdf, 2);
+  } else {
+#endif
 #if !CONFIG_IST_REDUCE_METHOD1
   if (get_primary_tx_type(tx_type) == ADST_ADST) stx_set_flag -= IST_DIR_SIZE;
 #endif
@@ -1638,6 +1649,9 @@
   aom_write_symbol(w, stx_set_flag, ec_ctx->stx_set_cdf[stx_set_ctx],
                    IST_DIR_SIZE);
 #endif  // CONFIG_INTRA_TX_IST_PARSE
+#if CONFIG_IST_INTER_MULTISET
+  }
+#endif
 }
 
 void av1_write_sec_tx_type(const AV1_COMMON *const cm, const MACROBLOCKD *xd,
@@ -1659,7 +1673,11 @@
       aom_write_symbol(w, stx_flag, ec_ctx->stx_cdf[is_inter][square_tx_size],
                        STX_TYPES);
 #if CONFIG_IST_SET_FLAG
+#if CONFIG_IST_INTER_MULTISET
+      if (stx_flag > 0) write_sec_tx_set(ec_ctx, w, mbmi, tx_type, is_inter);
+#else
       if (stx_flag > 0 && !is_inter) write_sec_tx_set(ec_ctx, w, mbmi, tx_type);
+#endif
 #endif  // CONFIG_IST_SET_FLAG
     }
   } else if (!xd->lossless[mbmi->segment_id]) {
@@ -1671,7 +1689,11 @@
       aom_write_symbol(w, stx_flag, ec_ctx->stx_cdf[is_inter][square_tx_size],
                        STX_TYPES);
 #if CONFIG_IST_SET_FLAG
+#if CONFIG_IST_INTER_MULTISET
+      if (stx_flag > 0) write_sec_tx_set(ec_ctx, w, mbmi, tx_type, is_inter);
+#else
       if (stx_flag > 0 && !is_inter) write_sec_tx_set(ec_ctx, w, mbmi, tx_type);
+#endif
 #endif  // CONFIG_IST_SET_FLAG
     }
   }
diff --git a/av1/encoder/block.h b/av1/encoder/block.h
index f673b90..ee04c79 100644
--- a/av1/encoder/block.h
+++ b/av1/encoder/block.h
@@ -931,6 +931,9 @@
 #else
   int stx_set_flag_cost[IST_DIR_SIZE][IST_DIR_SIZE];
 #endif  // CONFIG_INTRA_TX_IST_PARSE
+#if CONFIG_IST_INTER_MULTISET
+  int inter_stx_set_flag_cost[2];
+#endif
 #endif  // CONFIG_IST_SET_FLAG
 
   //! Rate rate associated with each alpha codeword
diff --git a/av1/encoder/encodeframe_utils.c b/av1/encoder/encodeframe_utils.c
index 2a4d44d..d8951b0 100644
--- a/av1/encoder/encodeframe_utils.c
+++ b/av1/encoder/encodeframe_utils.c
@@ -1804,6 +1804,9 @@
 #else
   AVERAGE_CDF(ctx_left->stx_set_cdf, ctx_tr->stx_set_cdf, IST_DIR_SIZE);
 #endif  // CONFIG_INTRA_TX_IST_PARSE
+#if CONFIG_IST_INTER_MULTISET
+  AVERAGE_CDF(ctx_left->inter_stx_set_cdf, ctx_tr->inter_stx_set_cdf, 2);
+#endif
 #endif  // CONFIG_IST_SET_FLAG
 
   for (int p = 0; p < NUM_MV_PREC_MPP_CONTEXT; ++p) {
diff --git a/av1/encoder/encodetxb.c b/av1/encoder/encodetxb.c
index c8ac728..4e2f27d 100644
--- a/av1/encoder/encodetxb.c
+++ b/av1/encoder/encodetxb.c
@@ -1798,6 +1798,13 @@
 static int get_sec_tx_set_cost(const MACROBLOCK *x, const MB_MODE_INFO *mbmi,
                                TX_TYPE tx_type) {
   uint8_t stx_set_flag = get_secondary_tx_set(tx_type);
+#if CONFIG_IST_INTER_MULTISET
+  MACROBLOCKD *xd = &x->e_mbd;
+  if (is_inter_block(mbmi, xd->tree_type)) {
+    assert(stx_set_flag < IST_DIR_SIZE);
+    return x->mode_costs.inter_stx_set_flag_cost[stx_set_flag];
+  } else {
+#endif
 #if !CONFIG_IST_REDUCE_METHOD1
   if (get_primary_tx_type(tx_type) == ADST_ADST) stx_set_flag -= IST_DIR_SIZE;
 #endif
@@ -1811,6 +1818,9 @@
   assert(stx_set_ctx < IST_DIR_SIZE);
   return x->mode_costs.stx_set_flag_cost[stx_set_ctx][stx_set_flag];
 #endif  // CONFIG_INTRA_TX_IST_PARSE
+#if CONFIG_IST_INTER_MULTISET
+  }
+#endif
 }
 
 // TODO(angiebird): use this function whenever it's possible
@@ -1880,6 +1890,10 @@
           tx_type_cost +=
               x->mode_costs.stx_flag_cost[is_inter][square_tx_size]
                                          [get_secondary_tx_type(tx_type)];
+#if CONFIG_IST_INTER_MULTISET
+          if (get_secondary_tx_type(tx_type) > 0)
+            tx_type_cost += get_sec_tx_set_cost(x, mbmi, tx_type);
+#endif
         }
         return tx_type_cost;
       }
@@ -1969,8 +1983,13 @@
           x->mode_costs.stx_flag_cost[is_inter][square_tx_size]
                                      [get_secondary_tx_type(tx_type)];
 #if CONFIG_IST_SET_FLAG
+#if CONFIG_IST_INTER_MULTISET
+      if (get_secondary_tx_type(tx_type) > 0)
+        tx_type_cost += get_sec_tx_set_cost(x, mbmi, tx_type);
+#else
       if (get_secondary_tx_type(tx_type) > 0 && !is_inter)
         tx_type_cost += get_sec_tx_set_cost(x, mbmi, tx_type);
+#endif
 #endif  // CONFIG_IST_SET_FLAG
       return tx_type_cost;
     }
@@ -5382,6 +5401,11 @@
             block_signals_sec_tx_type(xd, tx_size, tx_type, eob)) {
           update_cdf(fc->stx_cdf[is_inter][txsize_sqr_map[tx_size]],
                      (int8_t)get_secondary_tx_type(tx_type), STX_TYPES);
+#if CONFIG_IST_INTER_MULTISET
+          if (get_secondary_tx_type(tx_type) > 0)
+            update_cdf(fc->inter_stx_set_cdf,
+                       (int8_t)get_secondary_tx_set(tx_type), 2);
+#endif
         }
 #endif  // CONFIG_TX_TYPE_FLEX_IMPROVE
       } else {
@@ -5495,8 +5519,18 @@
     update_cdf(fc->stx_cdf[is_inter][txsize_sqr_map[tx_size]],
                (int8_t)get_secondary_tx_type(tx_type), STX_TYPES);
 #if CONFIG_IST_SET_FLAG
+#if CONFIG_IST_INTER_MULTISET
+    if (get_secondary_tx_type(tx_type) > 0) {
+      if (is_inter)
+        update_cdf(fc->inter_stx_set_cdf, (int8_t)get_secondary_tx_set(tx_type),
+                   2);
+      else
+        update_sec_tx_set_cdf(fc, mbmi, tx_type);
+    }
+#else
     if (get_secondary_tx_type(tx_type) > 0 && !is_inter)
       update_sec_tx_set_cdf(fc, mbmi, tx_type);
+#endif
 #endif  // CONFIG_IST_SET_FLAG
   }
 }
diff --git a/av1/encoder/hybrid_fwd_txfm.c b/av1/encoder/hybrid_fwd_txfm.c
index b2014ab..ad91a74 100644
--- a/av1/encoder/hybrid_fwd_txfm.c
+++ b/av1/encoder/hybrid_fwd_txfm.c
@@ -526,7 +526,9 @@
       transpose = 1;
 #if CONFIG_IST_SET_FLAG
     mode_t = txfm_param->sec_tx_set;
+#if !CONFIG_IST_INTER_MULTISET
     assert(mode_t < IST_SET_SIZE);
+#endif
 // If in debug mode, verify whether txfm_param->sec_tx_set == intra pred dir
 // based tx set id
 #if !CONFIG_IST_ANY_SET && !defined(NDEBUG)
@@ -554,6 +556,9 @@
       *tmp = src[scan_order_in[r]];
       tmp++;
     }
+#if CONFIG_IST_INTER_MULTISET
+    mode_t = (txfm_param->is_inter ? (mode_t == 0 ? 0 : IST_SET_SIZE) : mode_t);
+#endif
 #if CONFIG_IST_REDUCE_METHOD4
     const int st_size_class = (width == 8 && height == 8) ? 1 : (width >= 8 && height >= 8) ? 2 : 0;
     fwd_stxfm(buf0, buf1, mode_t, stx_type - 1, st_size_class);
diff --git a/av1/encoder/rd.c b/av1/encoder/rd.c
index 71a1671..32f74aa 100644
--- a/av1/encoder/rd.c
+++ b/av1/encoder/rd.c
@@ -551,6 +551,10 @@
                              fc->stx_set_cdf[i], NULL);
   }
 #endif  // CONFIG_INTRA_TX_IST_PARSE
+#if CONFIG_IST_INTER_MULTISET
+  av1_cost_tokens_from_cdf(mode_costs->inter_stx_set_flag_cost,
+                           fc->inter_stx_set_cdf, NULL);
+#endif
 #endif  // CONFIG_IST_SET_FLAG
 
   for (i = 0; i < EXT_TX_SIZES; ++i) {
diff --git a/av1/encoder/tx_search.c b/av1/encoder/tx_search.c
index c240b1d..260d98a 100644
--- a/av1/encoder/tx_search.c
+++ b/av1/encoder/tx_search.c
@@ -2836,8 +2836,13 @@
 
 #if CONFIG_IST_ANY_SET
     int init_set_id = 0;
+#if CONFIG_IST_INTER_MULTISET
+      int max_set_id =
+          (skip_stx || is_inter_block(mbmi, xd->tree_type)) ? 2 : IST_DIR_SIZE;
+#else
     int max_set_id =
         (skip_stx || is_inter_block(mbmi, xd->tree_type)) ? 1 : IST_DIR_SIZE;
+#endif
     // Iterate through all possible secondary tx sets for given primary tx type
     for (int set_id = init_set_id; set_id < max_set_id; ++set_id) {
 #endif  // CONFIG_IST_ANY_SET
diff --git a/build/cmake/aom_config_defaults.cmake b/build/cmake/aom_config_defaults.cmake
index 086fc99..bc3d3de 100644
--- a/build/cmake/aom_config_defaults.cmake
+++ b/build/cmake/aom_config_defaults.cmake
@@ -156,6 +156,9 @@
 set_aom_config_var(CONFIG_IST_NON_ZERO_DEPTH_DCT_ONLY 0
                    "Debug for IST mode non-zero depth.")
 
+#IST multiset for inter
+set_aom_config_var(CONFIG_IST_INTER_MULTISET 1
+                   "Enable multiset IST for inter TU.")
 
 # AV2 experiment flags.
 set_aom_config_var(CONFIG_IMPROVEIDTX 1