shithub: dav1d

Download patch

ref: a819653e1b71ea69c13faaa64c5bb89534ce2772
parent: dff0a08cd3ad1c1673b290bfa90ec32edd3ddc54
author: Henrik Gramner <gramner@twoorioles.com>
date: Thu Aug 8 21:45:11 EDT 2019

Remove unused CDF:s

--- a/src/cdf.c
+++ b/src/cdf.c
@@ -386,148 +386,92 @@
         { { AOM_CDF2(26549) }, { AOM_CDF2(19308) }, { AOM_CDF2(14224) }, },
         { { AOM_CDF2(28015) }, { AOM_CDF2(21546) }, { AOM_CDF2(14400) }, },
         { { AOM_CDF2(28165) }, { AOM_CDF2(22401) }, { AOM_CDF2(16088) }, },
-    }, .txtp_inter = {
-        { { 0 } }, {
-            { AOM_CDF16(4458, 5560, 7695, 9709, 13330, 14789, 17537, 20266,
-                        21504, 22848, 23934, 25474, 27727, 28915, 30631) },
-            { AOM_CDF16(1645, 2573, 4778, 5711, 7807, 8622, 10522, 15357,
-                        17674, 20408, 22517, 25010, 27116, 28856, 30749) },
-            { AOM_CDF16(2048, 4096, 6144, 8192, 10240, 12288, 14336, 16384,
-                        18432, 20480, 22528, 24576, 26624, 28672, 30720) },
-            { AOM_CDF16(2048, 4096, 6144, 8192, 10240, 12288, 14336, 16384,
-                        18432, 20480, 22528, 24576, 26624, 28672, 30720) },
+    }, .txtp_inter1 = {
+        { AOM_CDF16(4458, 5560, 7695, 9709, 13330, 14789, 17537, 20266,
+                    21504, 22848, 23934, 25474, 27727, 28915, 30631) },
+        { AOM_CDF16(1645, 2573, 4778, 5711, 7807, 8622, 10522, 15357,
+                    17674, 20408, 22517, 25010, 27116, 28856, 30749) },
+    }, .txtp_inter2 = {
+        AOM_CDF12(770, 2421, 5225, 12907, 15819, 18927, 21561, 24089,
+                  26595, 28526, 30529)
+    }, .txtp_inter3 = {
+        { AOM_CDF2(16384) },
+        { AOM_CDF2(4167) },
+        { AOM_CDF2(1998) },
+        { AOM_CDF2(748) },
+    }, .txtp_intra1 = {
+        {
+            { AOM_CDF7(1535, 8035, 9461, 12751, 23467, 27825) },
+            { AOM_CDF7(564, 3335, 9709, 10870, 18143, 28094) },
+            { AOM_CDF7(672, 3247, 3676, 11982, 19415, 23127) },
+            { AOM_CDF7(5279, 13885, 15487, 18044, 23527, 30252) },
+            { AOM_CDF7(4423, 6074, 7985, 10416, 25693, 29298) },
+            { AOM_CDF7(1486, 4241, 9460, 10662, 16456, 27694) },
+            { AOM_CDF7(439, 2838, 3522, 6737, 18058, 23754) },
+            { AOM_CDF7(1190, 4233, 4855, 11670, 20281, 24377) },
+            { AOM_CDF7(1045, 4312, 8647, 10159, 18644, 29335) },
+            { AOM_CDF7(202, 3734, 4747, 7298, 17127, 24016) },
+            { AOM_CDF7(447, 4312, 6819, 8884, 16010, 23858) },
+            { AOM_CDF7(277, 4369, 5255, 8905, 16465, 22271) },
+            { AOM_CDF7(3409, 5436, 10599, 15599, 19687, 24040) },
         }, {
-            { AOM_CDF12(2731, 5461, 8192, 10923, 13653, 16384, 19115, 21845,
-                        24576, 27307, 30037) },
-            { AOM_CDF12(2731, 5461, 8192, 10923, 13653, 16384, 19115, 21845,
-                        24576, 27307, 30037) },
-            { AOM_CDF12(770, 2421, 5225, 12907, 15819, 18927, 21561, 24089,
-                        26595, 28526, 30529) },
-            { AOM_CDF12(2731, 5461, 8192, 10923, 13653, 16384, 19115, 21845,
-                        24576, 27307, 30037) },
-        }, {
-            { AOM_CDF2(16384) },
-            { AOM_CDF2(4167) },
-            { AOM_CDF2(1998) },
-            { AOM_CDF2(748) },
+            { AOM_CDF7(1870, 13742, 14530, 16498, 23770, 27698) },
+            { AOM_CDF7(326, 8796, 14632, 15079, 19272, 27486) },
+            { AOM_CDF7(484, 7576, 7712, 14443, 19159, 22591) },
+            { AOM_CDF7(1126, 15340, 15895, 17023, 20896, 30279) },
+            { AOM_CDF7(655, 4854, 5249, 5913, 22099, 27138) },
+            { AOM_CDF7(1299, 6458, 8885, 9290, 14851, 25497) },
+            { AOM_CDF7(311, 5295, 5552, 6885, 16107, 22672) },
+            { AOM_CDF7(883, 8059, 8270, 11258, 17289, 21549) },
+            { AOM_CDF7(741, 7580, 9318, 10345, 16688, 29046) },
+            { AOM_CDF7(110, 7406, 7915, 9195, 16041, 23329) },
+            { AOM_CDF7(363, 7974, 9357, 10673, 15629, 24474) },
+            { AOM_CDF7(153, 7647, 8112, 9936, 15307, 19996) },
+            { AOM_CDF7(3511, 6332, 11165, 15335, 19323, 23594) },
         },
-    }, .txtp_intra = {
-        { { { 0 } } }, {
-            {
-                { AOM_CDF7(1535, 8035, 9461, 12751, 23467, 27825) },
-                { AOM_CDF7(564, 3335, 9709, 10870, 18143, 28094) },
-                { AOM_CDF7(672, 3247, 3676, 11982, 19415, 23127) },
-                { AOM_CDF7(5279, 13885, 15487, 18044, 23527, 30252) },
-                { AOM_CDF7(4423, 6074, 7985, 10416, 25693, 29298) },
-                { AOM_CDF7(1486, 4241, 9460, 10662, 16456, 27694) },
-                { AOM_CDF7(439, 2838, 3522, 6737, 18058, 23754) },
-                { AOM_CDF7(1190, 4233, 4855, 11670, 20281, 24377) },
-                { AOM_CDF7(1045, 4312, 8647, 10159, 18644, 29335) },
-                { AOM_CDF7(202, 3734, 4747, 7298, 17127, 24016) },
-                { AOM_CDF7(447, 4312, 6819, 8884, 16010, 23858) },
-                { AOM_CDF7(277, 4369, 5255, 8905, 16465, 22271) },
-                { AOM_CDF7(3409, 5436, 10599, 15599, 19687, 24040) },
-            }, {
-                { AOM_CDF7(1870, 13742, 14530, 16498, 23770, 27698) },
-                { AOM_CDF7(326, 8796, 14632, 15079, 19272, 27486) },
-                { AOM_CDF7(484, 7576, 7712, 14443, 19159, 22591) },
-                { AOM_CDF7(1126, 15340, 15895, 17023, 20896, 30279) },
-                { AOM_CDF7(655, 4854, 5249, 5913, 22099, 27138) },
-                { AOM_CDF7(1299, 6458, 8885, 9290, 14851, 25497) },
-                { AOM_CDF7(311, 5295, 5552, 6885, 16107, 22672) },
-                { AOM_CDF7(883, 8059, 8270, 11258, 17289, 21549) },
-                { AOM_CDF7(741, 7580, 9318, 10345, 16688, 29046) },
-                { AOM_CDF7(110, 7406, 7915, 9195, 16041, 23329) },
-                { AOM_CDF7(363, 7974, 9357, 10673, 15629, 24474) },
-                { AOM_CDF7(153, 7647, 8112, 9936, 15307, 19996) },
-                { AOM_CDF7(3511, 6332, 11165, 15335, 19323, 23594) },
-            }, {
-                { AOM_CDF7(4681, 9362, 14043, 18725, 23406, 28087) },
-                { AOM_CDF7(4681, 9362, 14043, 18725, 23406, 28087) },
-                { AOM_CDF7(4681, 9362, 14043, 18725, 23406, 28087) },
-                { AOM_CDF7(4681, 9362, 14043, 18725, 23406, 28087) },
-                { AOM_CDF7(4681, 9362, 14043, 18725, 23406, 28087) },
-                { AOM_CDF7(4681, 9362, 14043, 18725, 23406, 28087) },
-                { AOM_CDF7(4681, 9362, 14043, 18725, 23406, 28087) },
-                { AOM_CDF7(4681, 9362, 14043, 18725, 23406, 28087) },
-                { AOM_CDF7(4681, 9362, 14043, 18725, 23406, 28087) },
-                { AOM_CDF7(4681, 9362, 14043, 18725, 23406, 28087) },
-                { AOM_CDF7(4681, 9362, 14043, 18725, 23406, 28087) },
-                { AOM_CDF7(4681, 9362, 14043, 18725, 23406, 28087) },
-                { AOM_CDF7(4681, 9362, 14043, 18725, 23406, 28087) },
-            }, {
-                { AOM_CDF7(4681, 9362, 14043, 18725, 23406, 28087) },
-                { AOM_CDF7(4681, 9362, 14043, 18725, 23406, 28087) },
-                { AOM_CDF7(4681, 9362, 14043, 18725, 23406, 28087) },
-                { AOM_CDF7(4681, 9362, 14043, 18725, 23406, 28087) },
-                { AOM_CDF7(4681, 9362, 14043, 18725, 23406, 28087) },
-                { AOM_CDF7(4681, 9362, 14043, 18725, 23406, 28087) },
-                { AOM_CDF7(4681, 9362, 14043, 18725, 23406, 28087) },
-                { AOM_CDF7(4681, 9362, 14043, 18725, 23406, 28087) },
-                { AOM_CDF7(4681, 9362, 14043, 18725, 23406, 28087) },
-                { AOM_CDF7(4681, 9362, 14043, 18725, 23406, 28087) },
-                { AOM_CDF7(4681, 9362, 14043, 18725, 23406, 28087) },
-                { AOM_CDF7(4681, 9362, 14043, 18725, 23406, 28087) },
-                { AOM_CDF7(4681, 9362, 14043, 18725, 23406, 28087) },
-            },
+    }, .txtp_intra2 = {
+        {
+            { AOM_CDF5(6554, 13107, 19661, 26214) },
+            { AOM_CDF5(6554, 13107, 19661, 26214) },
+            { AOM_CDF5(6554, 13107, 19661, 26214) },
+            { AOM_CDF5(6554, 13107, 19661, 26214) },
+            { AOM_CDF5(6554, 13107, 19661, 26214) },
+            { AOM_CDF5(6554, 13107, 19661, 26214) },
+            { AOM_CDF5(6554, 13107, 19661, 26214) },
+            { AOM_CDF5(6554, 13107, 19661, 26214) },
+            { AOM_CDF5(6554, 13107, 19661, 26214) },
+            { AOM_CDF5(6554, 13107, 19661, 26214) },
+            { AOM_CDF5(6554, 13107, 19661, 26214) },
+            { AOM_CDF5(6554, 13107, 19661, 26214) },
+            { AOM_CDF5(6554, 13107, 19661, 26214) },
         }, {
-            {
-                { AOM_CDF5(6554, 13107, 19661, 26214) },
-                { AOM_CDF5(6554, 13107, 19661, 26214) },
-                { AOM_CDF5(6554, 13107, 19661, 26214) },
-                { AOM_CDF5(6554, 13107, 19661, 26214) },
-                { AOM_CDF5(6554, 13107, 19661, 26214) },
-                { AOM_CDF5(6554, 13107, 19661, 26214) },
-                { AOM_CDF5(6554, 13107, 19661, 26214) },
-                { AOM_CDF5(6554, 13107, 19661, 26214) },
-                { AOM_CDF5(6554, 13107, 19661, 26214) },
-                { AOM_CDF5(6554, 13107, 19661, 26214) },
-                { AOM_CDF5(6554, 13107, 19661, 26214) },
-                { AOM_CDF5(6554, 13107, 19661, 26214) },
-                { AOM_CDF5(6554, 13107, 19661, 26214) },
-            }, {
-                { AOM_CDF5(6554, 13107, 19661, 26214) },
-                { AOM_CDF5(6554, 13107, 19661, 26214) },
-                { AOM_CDF5(6554, 13107, 19661, 26214) },
-                { AOM_CDF5(6554, 13107, 19661, 26214) },
-                { AOM_CDF5(6554, 13107, 19661, 26214) },
-                { AOM_CDF5(6554, 13107, 19661, 26214) },
-                { AOM_CDF5(6554, 13107, 19661, 26214) },
-                { AOM_CDF5(6554, 13107, 19661, 26214) },
-                { AOM_CDF5(6554, 13107, 19661, 26214) },
-                { AOM_CDF5(6554, 13107, 19661, 26214) },
-                { AOM_CDF5(6554, 13107, 19661, 26214) },
-                { AOM_CDF5(6554, 13107, 19661, 26214) },
-                { AOM_CDF5(6554, 13107, 19661, 26214) },
-            }, {
-                { AOM_CDF5(1127, 12814, 22772, 27483) },
-                { AOM_CDF5(145, 6761, 11980, 26667) },
-                { AOM_CDF5(362, 5887, 11678, 16725) },
-                { AOM_CDF5(385, 15213, 18587, 30693) },
-                { AOM_CDF5(25, 2914, 23134, 27903) },
-                { AOM_CDF5(60, 4470, 11749, 23991) },
-                { AOM_CDF5(37, 3332, 14511, 21448) },
-                { AOM_CDF5(157, 6320, 13036, 17439) },
-                { AOM_CDF5(119, 6719, 12906, 29396) },
-                { AOM_CDF5(47, 5537, 12576, 21499) },
-                { AOM_CDF5(269, 6076, 11258, 23115) },
-                { AOM_CDF5(83, 5615, 12001, 17228) },
-                { AOM_CDF5(1968, 5556, 12023, 18547) },
-            }, {
-                { AOM_CDF5(6554, 13107, 19661, 26214) },
-                { AOM_CDF5(6554, 13107, 19661, 26214) },
-                { AOM_CDF5(6554, 13107, 19661, 26214) },
-                { AOM_CDF5(6554, 13107, 19661, 26214) },
-                { AOM_CDF5(6554, 13107, 19661, 26214) },
-                { AOM_CDF5(6554, 13107, 19661, 26214) },
-                { AOM_CDF5(6554, 13107, 19661, 26214) },
-                { AOM_CDF5(6554, 13107, 19661, 26214) },
-                { AOM_CDF5(6554, 13107, 19661, 26214) },
-                { AOM_CDF5(6554, 13107, 19661, 26214) },
-                { AOM_CDF5(6554, 13107, 19661, 26214) },
-                { AOM_CDF5(6554, 13107, 19661, 26214) },
-                { AOM_CDF5(6554, 13107, 19661, 26214) },
-            },
+            { AOM_CDF5(6554, 13107, 19661, 26214) },
+            { AOM_CDF5(6554, 13107, 19661, 26214) },
+            { AOM_CDF5(6554, 13107, 19661, 26214) },
+            { AOM_CDF5(6554, 13107, 19661, 26214) },
+            { AOM_CDF5(6554, 13107, 19661, 26214) },
+            { AOM_CDF5(6554, 13107, 19661, 26214) },
+            { AOM_CDF5(6554, 13107, 19661, 26214) },
+            { AOM_CDF5(6554, 13107, 19661, 26214) },
+            { AOM_CDF5(6554, 13107, 19661, 26214) },
+            { AOM_CDF5(6554, 13107, 19661, 26214) },
+            { AOM_CDF5(6554, 13107, 19661, 26214) },
+            { AOM_CDF5(6554, 13107, 19661, 26214) },
+            { AOM_CDF5(6554, 13107, 19661, 26214) },
+        }, {
+            { AOM_CDF5(1127, 12814, 22772, 27483) },
+            { AOM_CDF5(145, 6761, 11980, 26667) },
+            { AOM_CDF5(362, 5887, 11678, 16725) },
+            { AOM_CDF5(385, 15213, 18587, 30693) },
+            { AOM_CDF5(25, 2914, 23134, 27903) },
+            { AOM_CDF5(60, 4470, 11749, 23991) },
+            { AOM_CDF5(37, 3332, 14511, 21448) },
+            { AOM_CDF5(157, 6320, 13036, 17439) },
+            { AOM_CDF5(119, 6719, 12906, 29396) },
+            { AOM_CDF5(47, 5537, 12576, 21499) },
+            { AOM_CDF5(269, 6076, 11258, 23115) },
+            { AOM_CDF5(83, 5615, 12001, 17228) },
+            { AOM_CDF5(1968, 5556, 12023, 18547) },
         },
     }, .skip = {
         { AOM_CDF2(31671) },
@@ -966,23 +910,15 @@
             { { AOM_CDF9(2520, 3240, 5952, 8870, 12577, 17558, 19954, 24168) },
               { AOM_CDF9(2203, 4130, 7435, 10739, 20652, 23681, 25609, 27261) } }
         }, .eob_bin_512 = {
-            { { AOM_CDF10(641, 983, 3707, 5430, 10234, 14958, 18788,
-                          23412, 26061) },
-              { AOM_CDF10(3277, 6554, 9830, 13107, 16384, 19661, 22938,
-                          26214, 29491) } },
-            { { AOM_CDF10(5095, 6446, 9996, 13354, 16017, 17986, 20919,
-                          26129, 29140) },
-              { AOM_CDF10(3277, 6554, 9830, 13107, 16384, 19661, 22938,
-                          26214, 29491) } }
+            { AOM_CDF10(641, 983, 3707, 5430, 10234, 14958, 18788,
+                        23412, 26061) },
+            { AOM_CDF10(5095, 6446, 9996, 13354, 16017, 17986, 20919,
+                        26129, 29140) },
         }, .eob_bin_1024 = {
-            { { AOM_CDF11(393, 421, 751, 1623, 3160, 6352, 13345, 18047,
-                          22571, 25830) },
-              { AOM_CDF11(2979, 5958, 8937, 11916, 14895, 17873, 20852,
-                          23831, 26810, 29789) } },
-            { { AOM_CDF11(1865, 1988, 2930, 4242, 10533, 16538, 21354,
-                          27255, 28546, 31784) },
-              { AOM_CDF11(2979, 5958, 8937, 11916, 14895, 17873, 20852,
-                          23831, 26810, 29789) } }
+            { AOM_CDF11(393, 421, 751, 1623, 3160, 6352, 13345, 18047,
+                        22571, 25830) },
+            { AOM_CDF11(1865, 1988, 2930, 4242, 10533, 16538, 21354,
+                        27255, 28546, 31784) },
         }, .eob_hi_bit = {
             { { { AOM_CDF2(16384) }, { AOM_CDF2(16384) },
                 { AOM_CDF2(16961) }, { AOM_CDF2(17223) }, { AOM_CDF2(7621) },
@@ -1749,23 +1685,15 @@
             { { AOM_CDF9(6402, 8148, 12623, 15072, 18728, 22847, 26447, 29377) },
               { AOM_CDF9(1674, 3252, 5734, 10159, 22397, 23802, 24821, 30940) } }
         }, .eob_bin_512 = {
-            { { AOM_CDF10(1230, 2278, 5035, 7776, 11871, 15346, 19590,
-                          24584, 28749) },
-              { AOM_CDF10(3277, 6554, 9830, 13107, 16384, 19661, 22938,
-                          26214, 29491) } },
-            { { AOM_CDF10(7265, 9979, 15819, 19250, 21780, 23846, 26478,
-                          28396, 31811) },
-              { AOM_CDF10(3277, 6554, 9830, 13107, 16384, 19661, 22938,
-                          26214, 29491) } }
+            { AOM_CDF10(1230, 2278, 5035, 7776, 11871, 15346, 19590,
+                        24584, 28749) },
+            { AOM_CDF10(7265, 9979, 15819, 19250, 21780, 23846, 26478,
+                        28396, 31811) },
         }, .eob_bin_1024 = {
-            { { AOM_CDF11(696, 948, 3145, 5702, 9706, 13217, 17851,
-                          21856, 25692, 28034) },
-              { AOM_CDF11(2979, 5958, 8937, 11916, 14895, 17873, 20852,
-                          23831, 26810, 29789) } },
-            { { AOM_CDF11(2672, 3591, 9330, 17084, 22725, 24284, 26527,
-                          28027, 28377, 30876) },
-              { AOM_CDF11(2979, 5958, 8937, 11916, 14895, 17873, 20852,
-                          23831, 26810, 29789) } }
+            { AOM_CDF11(696, 948, 3145, 5702, 9706, 13217, 17851,
+                        21856, 25692, 28034) },
+            { AOM_CDF11(2672, 3591, 9330, 17084, 22725, 24284, 26527,
+                        28027, 28377, 30876) },
         }, .eob_hi_bit = {
             { { { AOM_CDF2(16384) }, { AOM_CDF2(16384) },
                 { AOM_CDF2(17471) }, { AOM_CDF2(20223) }, { AOM_CDF2(11357) },
@@ -2533,23 +2461,15 @@
             { { AOM_CDF9(11514, 13794, 17480, 20754, 24361, 27378, 29492, 31277) },
               { AOM_CDF9(6571, 9610, 15516, 21826, 29092, 30829, 31842, 32708) } }
         }, .eob_bin_512 = {
-            { { AOM_CDF10(2624, 3936, 6480, 9686, 13979, 17726, 23267,
-                          28410, 31078) },
-              { AOM_CDF10(3277, 6554, 9830, 13107, 16384, 19661, 22938,
-                          26214, 29491) } },
-            { { AOM_CDF10(12015, 14769, 19588, 22052, 24222, 25812,
-                          27300, 29219, 32114) },
-              { AOM_CDF10(3277, 6554, 9830, 13107, 16384, 19661, 22938,
-                          26214, 29491) } }
+            { AOM_CDF10(2624, 3936, 6480, 9686, 13979, 17726, 23267,
+                        28410, 31078) },
+            { AOM_CDF10(12015, 14769, 19588, 22052, 24222, 25812,
+                        27300, 29219, 32114) },
         }, .eob_bin_1024 = {
-            { { AOM_CDF11(2784, 3831, 7041, 10521, 14847, 18844, 23155,
-                          26682, 29229, 31045) },
-              { AOM_CDF11(2979, 5958, 8937, 11916, 14895, 17873, 20852,
-                          23831, 26810, 29789) } },
-            { { AOM_CDF11(9577, 12466, 17739, 20750, 22061, 23215, 24601,
-                          25483, 25843, 32056) },
-              { AOM_CDF11(2979, 5958, 8937, 11916, 14895, 17873, 20852,
-                          23831, 26810, 29789) } }
+            { AOM_CDF11(2784, 3831, 7041, 10521, 14847, 18844, 23155,
+                        26682, 29229, 31045) },
+            { AOM_CDF11(9577, 12466, 17739, 20750, 22061, 23215, 24601,
+                        25483, 25843, 32056) },
         }, .eob_hi_bit = {
             { { { AOM_CDF2(16384) }, { AOM_CDF2(16384) },
                 { AOM_CDF2(18983) }, { AOM_CDF2(20512) }, { AOM_CDF2(14885) },
@@ -3317,23 +3237,15 @@
             { { AOM_CDF9(23110, 24597, 27140, 28894, 30167, 30927, 31392, 32094) },
               { AOM_CDF9(9998, 17661, 25178, 28097, 31308, 32038, 32403, 32695) } }
         }, .eob_bin_512 = {
-            { { AOM_CDF10(5927, 7809, 10923, 14597, 19439, 24135, 28456,
-                          31142, 32060) },
-              { AOM_CDF10(3277, 6554, 9830, 13107, 16384, 19661, 22938,
-                          26214, 29491) } },
-            { { AOM_CDF10(21093, 23043, 25742, 27658, 29097, 29716,
-                          30073, 30820, 31956) },
-              { AOM_CDF10(3277, 6554, 9830, 13107, 16384, 19661, 22938,
-                          26214, 29491) } }
+            { AOM_CDF10(5927, 7809, 10923, 14597, 19439, 24135, 28456,
+                        31142, 32060) },
+            { AOM_CDF10(21093, 23043, 25742, 27658, 29097, 29716,
+                        30073, 30820, 31956) },
         }, .eob_bin_1024 = {
-            { { AOM_CDF11(6698, 8334, 11961, 15762, 20186, 23862, 27434,
-                          29326, 31082, 32050) },
-              { AOM_CDF11(2979, 5958, 8937, 11916, 14895, 17873, 20852,
-                          23831, 26810, 29789) } },
-            { { AOM_CDF11(20569, 22426, 25569, 26859, 28053, 28913,
-                          29486, 29724, 29807, 32570) },
-              { AOM_CDF11(2979, 5958, 8937, 11916, 14895, 17873, 20852,
-                          23831, 26810, 29789) } }
+            { AOM_CDF11(6698, 8334, 11961, 15762, 20186, 23862, 27434,
+                        29326, 31082, 32050) },
+            { AOM_CDF11(20569, 22426, 25569, 26859, 28053, 28913,
+                        29486, 29724, 29807, 32570) },
         }, .eob_hi_bit = {
             { { { AOM_CDF2(16384) }, { AOM_CDF2(16384) },
                 { AOM_CDF2(20177) }, { AOM_CDF2(20789) }, { AOM_CDF2(20262) },
@@ -4053,8 +3965,8 @@
     update_cdf_3d(2, N_INTRA_PRED_MODES, N_UV_INTRA_PRED_MODES - !k, m.uv_mode);
     update_cdf_2d(8, 7, m.angle_delta);
     update_cdf_3d(N_TX_SIZES - 1, 3, imin(k + 2, 3), m.txsz);
-    update_cdf_3d(N_TX_SIZES - 1, N_INTRA_PRED_MODES, 7, m.txtp_intra[1]);
-    update_cdf_3d(N_TX_SIZES - 1, N_INTRA_PRED_MODES, 5, m.txtp_intra[2]);
+    update_cdf_3d(2, N_INTRA_PRED_MODES, 7, m.txtp_intra1);
+    update_cdf_3d(3, N_INTRA_PRED_MODES, 5, m.txtp_intra2);
     update_bit_1d(3, m.skip);
     static const uint8_t n_partitions[N_BL_LEVELS] = {
         [BL_128X128] = N_PARTITIONS - 2,
@@ -4070,8 +3982,8 @@
     update_cdf_3d(2, 2, 7, coef.eob_bin_64);
     update_cdf_3d(2, 2, 8, coef.eob_bin_128);
     update_cdf_3d(2, 2, 9, coef.eob_bin_256);
-    update_cdf_3d(2, 2, 10, coef.eob_bin_512);
-    update_cdf_3d(2, 2, 11, coef.eob_bin_1024);
+    update_cdf_2d(2, 10, coef.eob_bin_512);
+    update_cdf_2d(2, 11, coef.eob_bin_1024);
     update_bit_3d(N_TX_SIZES, 2, 11 /*22*/, coef.eob_hi_bit);
     update_cdf_4d(N_TX_SIZES, 2, 4, 3, coef.eob_base_tok);
     update_cdf_4d(N_TX_SIZES, 2, 41 /*42*/, 4, coef.base_tok);
@@ -4091,9 +4003,9 @@
     update_cdf_4d(2, 7, 5, k + 2, m.color_map);
 
     update_bit_2d(7, 3, m.txpart);
-    update_cdf_2d(N_TX_SIZES - 1, 16, m.txtp_inter[1]);
-    update_cdf_2d(N_TX_SIZES - 1, 12, m.txtp_inter[2]);
-    update_cdf_2d(N_TX_SIZES - 1,  2, m.txtp_inter[3]);
+    update_cdf_2d(2, 16, m.txtp_inter1);
+    update_cdf_1d(12, m.txtp_inter2);
+    update_bit_1d(4, m.txtp_inter3);
 
     if (!(hdr->frame_type & 1)) {
         update_bit_0d(m.intrabc);
--- a/src/cdf.h
+++ b/src/cdf.h
@@ -64,8 +64,11 @@
     uint16_t comp_uni_ref[3][3][2];
     uint16_t txsz[N_TX_SIZES - 1][3][4];
     uint16_t txpart[7][3][2];
-    uint16_t txtp_inter[4][N_TX_SIZES][N_TX_TYPES + 1];
-    uint16_t txtp_intra[3][N_TX_SIZES][N_INTRA_PRED_MODES][N_TX_TYPES + 1];
+    uint16_t txtp_inter1[2][16 + 1];
+    uint16_t txtp_inter2[12 + 1 + 3];
+    uint16_t txtp_inter3[4][2];
+    uint16_t txtp_intra1[2][N_INTRA_PRED_MODES][7 + 1];
+    uint16_t txtp_intra2[3][N_INTRA_PRED_MODES][5 + 1 + 2];
     uint16_t skip[3][2];
     uint16_t skip_mode[3][2];
     uint16_t partition[N_BL_LEVELS][4][N_PARTITIONS + 1 + 5];
@@ -94,8 +97,8 @@
     uint16_t eob_bin_64[2][2][8];
     uint16_t eob_bin_128[2][2][9];
     uint16_t eob_bin_256[2][2][10 + 6];
-    uint16_t eob_bin_512[2][2][11 + 5];
-    uint16_t eob_bin_1024[2][2][12 + 4];
+    uint16_t eob_bin_512[2][11 + 5];
+    uint16_t eob_bin_1024[2][12 + 4];
     uint16_t eob_hi_bit[N_TX_SIZES][2][11 /*22*/][2];
     uint16_t eob_base_tok[N_TX_SIZES][2][4][4];
     uint16_t base_tok[N_TX_SIZES][2][41][5];
--- a/src/env.h
+++ b/src/env.h
@@ -118,27 +118,6 @@
     return out;
 }
 
-static inline enum TxfmTypeSet get_ext_txtp_set(const TxfmInfo *const t_dim,
-                                                const int inter,
-                                                const int reduced_txtp_set)
-{
-    if (t_dim->max >= TX_64X64)
-        return TXTP_SET_DCT;
-
-    if (t_dim->max == TX_32X32)
-        return inter ? TXTP_SET_DCT_ID : TXTP_SET_DCT;
-
-    if (reduced_txtp_set)
-        return inter ? TXTP_SET_DCT_ID : TXTP_SET_DT4_ID;
-
-    const enum TxfmSize txsqsz = t_dim->min;
-
-    if (inter)
-        return txsqsz == TX_16X16 ? TXTP_SET_DT9_ID_1D : TXTP_SET_ALL;
-    else
-        return txsqsz == TX_16X16 ? TXTP_SET_DT4_ID : TXTP_SET_DT4_ID_1D;
-}
-
 static inline enum TxfmType get_uv_inter_txtp(const TxfmInfo *const uvt_dim,
                                               const enum TxfmType ytxtp)
 {
--- a/src/levels.h
+++ b/src/levels.h
@@ -109,17 +109,6 @@
     N_TX_TYPES_PLUS_LL,
 };
 
-enum TxfmTypeSet {
-    TXTP_SET_DCT,
-    TXTP_SET_DCT_ID,
-    TXTP_SET_DT4_ID,
-    TXTP_SET_DT4_ID_1D,
-    TXTP_SET_DT9_ID_1D,
-    TXTP_SET_ALL,
-    TXTP_SET_LOSSLESS,
-    N_TXTP_SETS
-};
-
 enum TxClass {
     TX_CLASS_2D,
     TX_CLASS_H,
--- a/src/recon_tmpl.c
+++ b/src/recon_tmpl.c
@@ -82,47 +82,55 @@
                t_dim->ctx, sctx, all_skip, ts->msac.rng);
     if (all_skip) {
         *res_ctx = 0x40;
-        *txtp = lossless ? WHT_WHT : DCT_DCT;
+        *txtp = lossless * WHT_WHT; /* lossless ? WHT_WHT : DCT_DCT */
         return -1;
     }
 
     // transform type (chroma: derived, luma: explicitly coded)
     if (lossless) {
-        assert(t_dim->max == (int) TX_4X4);
+        assert(t_dim->max == TX_4X4);
         *txtp = WHT_WHT;
+    } else if (!f->frame_hdr->segmentation.qidx[b->seg_id] ||
+               t_dim->max + intra >= TX_64X64)
+    {
+        *txtp = DCT_DCT;
     } else if (chroma) {
+        *txtp = intra ? dav1d_txtp_from_uvmode[b->uv_mode] :
+                        get_uv_inter_txtp(t_dim, *txtp);
+    } else {
+        unsigned idx;
         if (intra) {
-            *txtp = t_dim->max == TX_32X32 ?
-                DCT_DCT : dav1d_txtp_from_uvmode[b->uv_mode];
+            const enum IntraPredMode y_mode_nofilt = b->y_mode == FILTER_PRED ?
+                dav1d_filter_mode_to_y_mode[b->y_angle] : b->y_mode;
+            if (f->frame_hdr->reduced_txtp_set || t_dim->min == TX_16X16) {
+                idx = dav1d_msac_decode_symbol_adapt4(&ts->msac,
+                          ts->cdf.m.txtp_intra2[t_dim->min][y_mode_nofilt], 5);
+                *txtp = dav1d_tx_types_per_set[idx + 0];
+            } else {
+                idx = dav1d_msac_decode_symbol_adapt8(&ts->msac,
+                          ts->cdf.m.txtp_intra1[t_dim->min][y_mode_nofilt], 7);
+                *txtp = dav1d_tx_types_per_set[idx + 5];
+            }
+            if (dbg)
+                printf("Post-txtp-intra[%d->%d][%d][%d->%d]: r=%d\n",
+                       tx, t_dim->min, y_mode_nofilt, idx, *txtp, ts->msac.rng);
         } else {
-            const enum TxfmType y_txtp = *txtp;
-            *txtp = get_uv_inter_txtp(t_dim, y_txtp);
-        }
-    } else {
-        if (!f->frame_hdr->segmentation.qidx[b->seg_id]) {
-            *txtp = DCT_DCT;
-        } else {
-            const enum TxfmTypeSet set =
-                get_ext_txtp_set(t_dim, !intra, f->frame_hdr->reduced_txtp_set);
-            if (set == TXTP_SET_DCT)
-                *txtp = DCT_DCT;
-            else {
-                const unsigned set_cnt = dav1d_tx_type_count[set];
-                const int set_idx = dav1d_tx_type_set_index[!intra][set];
-                const enum IntraPredMode y_mode_nofilt = intra ? b->y_mode == FILTER_PRED ?
-                    dav1d_filter_mode_to_y_mode[b->y_angle] : b->y_mode : 0;
-                uint16_t *const txtp_cdf = intra ?
-                          ts->cdf.m.txtp_intra[set_idx][t_dim->min][y_mode_nofilt] :
-                          ts->cdf.m.txtp_inter[set_idx][t_dim->min];
-                const unsigned idx = (set_cnt <= 8 ? dav1d_msac_decode_symbol_adapt8 :
-                        dav1d_msac_decode_symbol_adapt16)(&ts->msac, txtp_cdf, set_cnt);
-
-                *txtp = dav1d_tx_types_per_set[set][idx];
-                if (dbg)
-                    printf("Post-txtp[%d->%d][%d->%d][%d][%d->%d]: r=%d\n",
-                           set, set_idx, tx, t_dim->min, intra ? (int)y_mode_nofilt : -1,
-                           idx, dav1d_tx_types_per_set[set][idx], ts->msac.rng);
+            if (f->frame_hdr->reduced_txtp_set || t_dim->max == TX_32X32) {
+                idx = dav1d_msac_decode_bool_adapt(&ts->msac,
+                          ts->cdf.m.txtp_inter3[t_dim->min]);
+                *txtp = (idx - 1) & IDTX; /* idx ? DCT_DCT : IDTX */
+            } else if (t_dim->min == TX_16X16) {
+                idx = dav1d_msac_decode_symbol_adapt16(&ts->msac,
+                          ts->cdf.m.txtp_inter2, 12);
+                *txtp = dav1d_tx_types_per_set[idx + 12];
+            } else {
+                idx = dav1d_msac_decode_symbol_adapt16(&ts->msac,
+                          ts->cdf.m.txtp_inter1[t_dim->min], 16);
+                *txtp = dav1d_tx_types_per_set[idx + 24];
             }
+            if (dbg)
+                printf("Post-txtp-inter[%d->%d][%d->%d]: r=%d\n",
+                       tx, t_dim->min, idx, *txtp, ts->msac.rng);
         }
     }
 
@@ -132,19 +140,19 @@
     const enum TxClass tx_class = dav1d_tx_type_class[*txtp];
     const int is_1d = tx_class != TX_CLASS_2D;
     switch (tx2dszctx) {
-#define case_sz(sz, bin, ns) \
+#define case_sz(sz, bin, ns, is_1d) \
     case sz: { \
-        uint16_t *const eob_bin_cdf = ts->cdf.coef.eob_bin_##bin[chroma][is_1d]; \
+        uint16_t *const eob_bin_cdf = ts->cdf.coef.eob_bin_##bin[chroma]is_1d; \
         eob_bin = dav1d_msac_decode_symbol_adapt##ns(&ts->msac, eob_bin_cdf, 5 + sz); \
         break; \
     }
-    case_sz(0,   16,  4);
-    case_sz(1,   32,  8);
-    case_sz(2,   64,  8);
-    case_sz(3,  128,  8);
-    case_sz(4,  256, 16);
-    case_sz(5,  512, 16);
-    case_sz(6, 1024, 16);
+    case_sz(0,   16,  4, [is_1d]);
+    case_sz(1,   32,  8, [is_1d]);
+    case_sz(2,   64,  8, [is_1d]);
+    case_sz(3,  128,  8, [is_1d]);
+    case_sz(4,  256, 16, [is_1d]);
+    case_sz(5,  512, 16,        );
+    case_sz(6, 1024, 16,        );
 #undef case_sz
     }
     if (dbg)
--- a/src/tables.c
+++ b/src/tables.c
@@ -225,37 +225,18 @@
     [NEARMV_NEWMV]        = { NEARMV,    NEWMV     },
 };
 
-const uint8_t dav1d_tx_type_count[N_TXTP_SETS] = {
-    [TXTP_SET_DCT] = 1,
-    [TXTP_SET_DCT_ID] = 2,
-    [TXTP_SET_DT4_ID] = 5,
-    [TXTP_SET_DT4_ID_1D] = 7,
-    [TXTP_SET_DT9_ID_1D] = 12,
-    [TXTP_SET_ALL] = 16,
-    [TXTP_SET_LOSSLESS] = 1,
-};
-
-const uint8_t /* enum TxfmType */
-              dav1d_tx_types_per_set[N_TXTP_SETS][N_TX_TYPES] =
-{
-    [TXTP_SET_DCT]       = { DCT_DCT },
-    [TXTP_SET_DCT_ID]    = { IDTX, DCT_DCT },
-    [TXTP_SET_DT4_ID]    = { IDTX, DCT_DCT, ADST_ADST, ADST_DCT, DCT_ADST },
-    [TXTP_SET_DT4_ID_1D] = { IDTX, DCT_DCT, V_DCT, H_DCT, ADST_ADST, ADST_DCT,
-                             DCT_ADST },
-    [TXTP_SET_DT9_ID_1D] = { IDTX, V_DCT, H_DCT, DCT_DCT, ADST_DCT, DCT_ADST,
-                             FLIPADST_DCT, DCT_FLIPADST, ADST_ADST,
-                             FLIPADST_FLIPADST, ADST_FLIPADST, FLIPADST_ADST },
-    [TXTP_SET_ALL]       = { IDTX, V_DCT, H_DCT, V_ADST, H_ADST, V_FLIPADST,
-                             H_FLIPADST, DCT_DCT, ADST_DCT, DCT_ADST,
-                             FLIPADST_DCT, DCT_FLIPADST, ADST_ADST,
-                             FLIPADST_FLIPADST, ADST_FLIPADST, FLIPADST_ADST },
-    [TXTP_SET_LOSSLESS]  = { WHT_WHT },
-};
-
-const uint8_t dav1d_tx_type_set_index[2][N_TXTP_SETS] = {
-    { 0, -1,  2,  1, -1, -1, 3 },
-    { 0,  3, -1, -1,  2,  1, 4 },
+const uint8_t /* enum TxfmType */ dav1d_tx_types_per_set[40] = {
+    /* Intra2 */
+    IDTX, DCT_DCT, ADST_ADST, ADST_DCT, DCT_ADST,
+    /* Intra1 */
+    IDTX, DCT_DCT, V_DCT, H_DCT, ADST_ADST, ADST_DCT, DCT_ADST,
+    /* Inter2 */
+    IDTX, V_DCT, H_DCT, DCT_DCT, ADST_DCT, DCT_ADST, FLIPADST_DCT,
+    DCT_FLIPADST, ADST_ADST, FLIPADST_FLIPADST, ADST_FLIPADST, FLIPADST_ADST,
+    /* Inter1 */
+    IDTX, V_DCT, H_DCT, V_ADST, H_ADST, V_FLIPADST, H_FLIPADST,
+    DCT_DCT, ADST_DCT, DCT_ADST, FLIPADST_DCT, DCT_FLIPADST,
+    ADST_ADST, FLIPADST_FLIPADST, ADST_FLIPADST, FLIPADST_ADST,
 };
 
 const uint8_t dav1d_ymode_size_context[N_BS_SIZES] = {
--- a/src/tables.h
+++ b/src/tables.h
@@ -52,10 +52,7 @@
 extern const uint8_t /* enum InterPredMode */
                      dav1d_comp_inter_pred_modes[N_COMP_INTER_PRED_MODES][2];
 
-extern const uint8_t dav1d_tx_type_count[N_TXTP_SETS];
-extern const uint8_t /* enum TxfmType */
-                     dav1d_tx_types_per_set[N_TXTP_SETS][N_TX_TYPES];
-extern const uint8_t dav1d_tx_type_set_index[2][N_TXTP_SETS];
+extern const uint8_t /* enum TxfmType */ dav1d_tx_types_per_set[40];
 
 extern const uint8_t dav1d_filter_mode_to_y_mode[5];
 extern const uint8_t dav1d_ymode_size_context[N_BS_SIZES];