diff options
author | trav90 <travawine@palemoon.org> | 2018-10-18 06:04:57 -0500 |
---|---|---|
committer | trav90 <travawine@palemoon.org> | 2018-10-18 06:04:57 -0500 |
commit | 7369c7d7a5eed32963d8af37658286617919f91c (patch) | |
tree | 5397ce7ee9bca1641118fdc3187bd9e2b24fdc9c /third_party/aom/av1/common/entropymode.c | |
parent | 77887af9c4ad1420bbdb33984af4f74b55ca59db (diff) | |
download | UXP-7369c7d7a5eed32963d8af37658286617919f91c.tar UXP-7369c7d7a5eed32963d8af37658286617919f91c.tar.gz UXP-7369c7d7a5eed32963d8af37658286617919f91c.tar.lz UXP-7369c7d7a5eed32963d8af37658286617919f91c.tar.xz UXP-7369c7d7a5eed32963d8af37658286617919f91c.zip |
Update aom to commit id f5bdeac22930ff4c6b219be49c843db35970b918
Diffstat (limited to 'third_party/aom/av1/common/entropymode.c')
-rw-r--r-- | third_party/aom/av1/common/entropymode.c | 2626 |
1 files changed, 1513 insertions, 1113 deletions
diff --git a/third_party/aom/av1/common/entropymode.c b/third_party/aom/av1/common/entropymode.c index 65ed163a6..9faa03e69 100644 --- a/third_party/aom/av1/common/entropymode.c +++ b/third_party/aom/av1/common/entropymode.c @@ -293,649 +293,52 @@ const aom_prob default_coeff_lps[TX_SIZES][PLANE_TYPES][LEVEL_CONTEXTS] = { }; #endif // CONFIG_LV_MAP -#if CONFIG_ALT_INTRA -#if CONFIG_SMOOTH_HV -const aom_prob av1_kf_y_mode_prob[INTRA_MODES][INTRA_MODES][INTRA_MODES - 1] = { - { - // above = dc - { 111, 28, 44, 99, 166, 154, 28, 28, 27, 45, 134, 109 }, // left = dc - { 82, 31, 102, 75, 117, 135, 33, 34, 21, 31, 134, 149 }, // left = v - { 40, 29, 14, 161, 235, 180, 14, 12, 34, 52, 128, 69 }, // left = h - { 98, 19, 36, 74, 137, 153, 49, 35, 25, 61, 137, 106 }, // left = d45 - { 59, 11, 25, 128, 47, 162, 29, 20, 53, 38, 143, 117 }, // left = d135 - { 86, 20, 51, 160, 39, 101, 69, 101, 112, 154, 158, 145 }, // left = d117 - { 49, 10, 17, 112, 98, 206, 16, 11, 104, 44, 138, 88 }, // left = d153 - { 64, 14, 22, 80, 170, 168, 19, 15, 26, 101, 137, 90 }, // left = d207 - { 84, 21, 31, 62, 110, 135, 40, 57, 22, 45, 143, 130 }, // left = d63 - { 58, 16, 31, 60, 154, 225, 17, 23, 19, 30, 138, 113 }, // left = smooth - { 51, 19, 46, 64, 148, 209, 18, 28, 17, 25, 137, - 149 }, // left = smooth_v - { 68, 15, 26, 61, 175, 233, 17, 17, 19, 29, 135, 76 }, // left = smooth_h - { 49, 61, 41, 113, 203, 158, 26, 26, 29, 55, 123, 99 }, // left = tm - }, - { - // above = v - { 31, 26, 135, 81, 100, 82, 13, 40, 14, 18, 131, 182 }, // left = dc - { 24, 27, 175, 53, 93, 85, 17, 40, 5, 14, 119, 195 }, // left = v - { 20, 34, 71, 97, 209, 133, 15, 24, 14, 28, 138, 129 }, // left = h - { 54, 19, 88, 55, 102, 103, 39, 45, 8, 44, 134, 167 }, // left = d45 - { 23, 16, 93, 101, 33, 119, 23, 41, 26, 22, 136, 168 }, // left = d135 - { 34, 17, 130, 149, 30, 72, 43, 129, 66, 100, 143, 192 }, // left = d117 - { 23, 17, 83, 85, 63, 158, 16, 30, 64, 28, 145, 146 }, // left = d153 - { 33, 17, 85, 60, 136, 115, 21, 32, 15, 59, 134, 155 }, // left = d207 - { 40, 20, 103, 53, 66, 84, 26, 72, 9, 29, 134, 177 }, // left = d63 - { 22, 18, 112, 41, 138, 192, 12, 30, 9, 16, 131, 178 }, // left = smooth - { 20, 20, 125, 39, 137, 179, 11, 28, 7, 12, 123, - 199 }, // left = smooth_v - { 26, 19, 111, 46, 160, 201, 13, 29, 8, 17, 132, - 156 }, // left = smooth_h - { 20, 35, 138, 62, 162, 107, 21, 36, 9, 24, 125, 181 }, // left = tm - }, - { - // above = h - { 89, 27, 21, 136, 218, 175, 20, 19, 35, 56, 134, 96 }, // left = dc - { 63, 37, 67, 117, 190, 160, 22, 29, 20, 45, 137, 137 }, // left = v - { 34, 23, 7, 177, 245, 207, 13, 9, 30, 73, 125, 63 }, // left = h - { 84, 29, 20, 83, 184, 182, 38, 25, 34, 86, 134, 106 }, // left = d45 - { 65, 19, 19, 119, 109, 177, 27, 19, 56, 56, 141, 103 }, // left = d135 - { 88, 25, 46, 152, 102, 130, 70, 61, 96, 157, 130, 102 }, // left = d117 - { 51, 11, 10, 108, 168, 216, 14, 9, 93, 58, 132, 79 }, // left = d153 - { 53, 15, 9, 103, 224, 192, 20, 13, 23, 122, 135, 80 }, // left = d207 - { 64, 30, 19, 90, 171, 176, 24, 44, 23, 56, 144, 121 }, // left = d63 - { 46, 20, 17, 94, 214, 234, 14, 15, 23, 38, 132, 98 }, // left = smooth - { 41, 27, 22, 102, 214, 229, 13, 17, 18, 35, 133, - 137 }, // left = smooth_v - { 52, 17, 14, 95, 224, 241, 14, 11, 24, 38, 133, 62 }, // left = smooth_h - { 35, 43, 21, 148, 234, 188, 22, 17, 27, 47, 133, 100 }, // left = tm - }, - { - // above = d45 - { 80, 14, 31, 74, 129, 146, 52, 50, 29, 50, 138, 110 }, // left = dc - { 59, 16, 84, 52, 106, 121, 63, 60, 20, 40, 143, 150 }, // left = v - { 41, 19, 16, 118, 216, 168, 36, 27, 24, 62, 136, 69 }, // left = h - { 86, 11, 11, 37, 168, 158, 113, 53, 8, 99, 140, 121 }, // left = d45 - { 49, 8, 24, 94, 49, 139, 48, 45, 40, 53, 134, 131 }, // left = d135 - { 58, 11, 36, 127, 45, 97, 90, 143, 91, 180, 153, 146 }, // left = d117 - { 39, 9, 14, 93, 97, 187, 32, 26, 66, 57, 134, 106 }, // left = d153 - { 75, 8, 26, 68, 135, 154, 51, 30, 17, 113, 144, 83 }, // left = d207 - { 77, 13, 18, 46, 146, 143, 81, 102, 18, 59, 142, 143 }, // left = d63 - { 49, 13, 31, 47, 142, 218, 46, 42, 19, 46, 146, 120 }, // left = smooth - { 46, 15, 35, 47, 132, 206, 47, 50, 18, 37, 143, - 147 }, // left = smooth_v - { 54, 11, 25, 54, 157, 229, 43, 34, 20, 44, 136, 99 }, // left = smooth_h - { 40, 26, 41, 72, 176, 145, 78, 51, 27, 59, 133, 121 }, // left = tm - }, - { - // above = d135 - { 57, 10, 21, 118, 61, 178, 16, 20, 65, 52, 145, 125 }, // left = dc - { 56, 15, 48, 107, 58, 153, 20, 32, 42, 35, 143, 162 }, // left = v - { 28, 19, 8, 132, 172, 184, 14, 14, 45, 55, 140, 79 }, // left = h - { 58, 13, 15, 73, 66, 177, 61, 24, 30, 72, 143, 122 }, // left = d45 - { 35, 5, 13, 150, 20, 187, 19, 21, 66, 38, 144, 130 }, // left = d135 - { 57, 9, 30, 173, 28, 133, 38, 71, 156, 140, 156, 173 }, // left = d117 - { 30, 6, 9, 121, 54, 207, 16, 20, 110, 62, 151, 94 }, // left = d153 - { 51, 9, 15, 88, 96, 188, 22, 18, 40, 95, 140, 98 }, // left = d207 - { 56, 12, 21, 82, 53, 140, 30, 37, 32, 47, 145, 149 }, // left = d63 - { 43, 12, 21, 83, 84, 222, 14, 23, 31, 35, 143, 127 }, // left = smooth - { 41, 12, 25, 81, 75, 210, 16, 29, 29, 29, 141, 154 }, // left = smooth_v - { 42, 11, 19, 81, 109, 226, 17, 20, 34, 36, 143, - 110 }, // left = smooth_h - { 36, 26, 27, 107, 132, 151, 24, 28, 38, 46, 140, 127 }, // left = tm - }, - { - // above = d117 - { 52, 15, 58, 191, 40, 95, 38, 78, 98, 140, 152, 175 }, // left = dc - { 50, 16, 85, 186, 28, 84, 41, 105, 65, 119, 158, 206 }, // left = v - { 30, 23, 30, 179, 122, 124, 38, 47, 68, 140, 161, 102 }, // left = h - { 75, 15, 47, 120, 49, 127, 63, 86, 54, 204, 175, 185 }, // left = d45 - { 36, 9, 37, 198, 15, 120, 56, 78, 104, 151, 155, 165 }, // left = d135 - { 38, 9, 54, 198, 12, 75, 47, 92, 71, 130, 170, 201 }, // left = d117 - { 31, 13, 33, 167, 46, 144, 32, 59, 124, 151, 162, 128 }, // left = d153 - { 47, 15, 43, 123, 70, 129, 49, 72, 48, 175, 163, 125 }, // left = d207 - { 61, 19, 62, 141, 35, 116, 55, 117, 51, 162, 150, 201 }, // left = d63 - { 22, 17, 34, 105, 41, 101, 20, 34, 26, 39, 146, 157 }, // left = smooth - { 19, 14, 37, 116, 33, 91, 23, 38, 17, 36, 137, 178 }, // left = smooth_v - { 25, 17, 35, 102, 59, 118, 23, 28, 30, 43, 147, - 148 }, // left = smooth_h - { 35, 24, 62, 164, 95, 103, 47, 94, 65, 115, 186, 128 }, // left = tm - }, - { - // above = d153 - { 75, 12, 17, 101, 150, 177, 14, 13, 101, 55, 141, 104 }, // left = dc - { 69, 19, 46, 91, 133, 167, 19, 22, 72, 41, 133, 143 }, // left = v - { 30, 12, 6, 132, 209, 214, 10, 8, 75, 78, 137, 70 }, // left = h - { 77, 16, 12, 85, 120, 203, 35, 17, 69, 66, 137, 96 }, // left = d45 - { 51, 8, 11, 119, 58, 178, 20, 17, 90, 51, 145, 92 }, // left = d135 - { 76, 8, 24, 144, 48, 128, 37, 46, 173, 153, 159, 111 }, // left = d117 - { 40, 6, 6, 87, 112, 213, 7, 7, 152, 54, 141, 84 }, // left = d153 - { 46, 6, 7, 78, 161, 195, 15, 11, 66, 97, 137, 83 }, // left = d207 - { 81, 17, 17, 82, 97, 187, 26, 34, 54, 60, 154, 128 }, // left = d63 - { 47, 10, 16, 74, 138, 233, 13, 17, 59, 42, 143, 106 }, // left = smooth - { 45, 12, 17, 76, 141, 227, 14, 16, 56, 43, 141, - 135 }, // left = smooth_v - { 55, 10, 13, 69, 162, 238, 11, 11, 59, 45, 133, 73 }, // left = smooth_h - { 44, 23, 19, 110, 176, 165, 16, 19, 68, 59, 131, 89 }, // left = tm - }, - { - // above = d207 - { 86, 15, 26, 87, 166, 178, 27, 25, 27, 75, 145, 108 }, // left = dc - { 71, 27, 62, 70, 126, 142, 29, 34, 17, 69, 141, 144 }, // left = v - { 48, 21, 11, 130, 231, 196, 24, 19, 27, 82, 133, 72 }, // left = h - { 82, 21, 14, 54, 128, 188, 55, 38, 19, 111, 148, 119 }, // left = d45 - { 57, 11, 17, 78, 83, 171, 43, 31, 37, 58, 143, 100 }, // left = d135 - { 76, 16, 44, 115, 77, 130, 78, 79, 82, 178, 132, 123 }, // left = d117 - { 50, 12, 11, 82, 133, 207, 27, 20, 67, 79, 138, 87 }, // left = d153 - { 77, 9, 13, 44, 174, 169, 26, 13, 9, 167, 135, 90 }, // left = d207 - { 70, 16, 18, 57, 117, 167, 43, 46, 17, 70, 150, 116 }, // left = d63 - { 56, 13, 18, 60, 170, 236, 24, 19, 18, 59, 139, 105 }, // left = smooth - { 50, 17, 26, 60, 165, 234, 24, 20, 15, 53, 134, - 136 }, // left = smooth_v - { 57, 11, 16, 62, 188, 239, 23, 15, 18, 57, 134, 79 }, // left = smooth_h - { 49, 31, 24, 78, 194, 184, 45, 27, 19, 81, 138, 102 }, // left = tm - }, - { - // above = d63 - { 53, 13, 46, 61, 109, 116, 40, 83, 19, 31, 141, 150 }, // left = dc - { 45, 14, 75, 40, 79, 102, 48, 118, 14, 23, 138, 174 }, // left = v - { 34, 14, 24, 98, 214, 128, 33, 54, 18, 51, 138, 103 }, // left = h - { 74, 11, 26, 37, 127, 154, 75, 89, 11, 61, 146, 125 }, // left = d45 - { 35, 9, 26, 68, 55, 128, 53, 74, 21, 33, 138, 132 }, // left = d135 - { 47, 9, 55, 108, 39, 105, 64, 193, 71, 127, 141, 193 }, // left = d117 - { 35, 9, 22, 66, 79, 172, 34, 64, 57, 44, 139, 112 }, // left = d153 - { 54, 7, 26, 48, 136, 139, 48, 60, 15, 82, 144, 116 }, // left = d207 - { 60, 9, 30, 25, 106, 127, 64, 143, 14, 42, 140, 165 }, // left = d63 - { 39, 11, 35, 40, 136, 212, 34, 67, 12, 28, 145, 150 }, // left = smooth - { 37, 12, 45, 36, 128, 190, 34, 80, 8, 23, 138, 165 }, // left = smooth_v - { 45, 9, 37, 46, 152, 196, 36, 58, 14, 29, 145, 127 }, // left = smooth_h - { 35, 17, 53, 48, 159, 101, 53, 104, 15, 36, 132, 152 }, // left = tm - }, - { - // above = smooth - { 58, 12, 33, 66, 168, 219, 13, 21, 16, 27, 137, 113 }, // left = dc - { 42, 20, 78, 51, 139, 216, 16, 27, 11, 18, 134, 160 }, // left = v - { 28, 17, 16, 118, 236, 231, 13, 14, 16, 41, 132, 77 }, // left = h - { 58, 12, 23, 47, 138, 238, 39, 31, 16, 63, 142, 125 }, // left = d45 - { 44, 9, 27, 76, 80, 220, 21, 27, 27, 30, 142, 122 }, // left = d135 - { 30, 13, 38, 96, 47, 111, 26, 40, 31, 40, 146, 146 }, // left = d117 - { 42, 9, 19, 70, 127, 234, 15, 18, 53, 39, 138, 97 }, // left = d153 - { 44, 10, 20, 57, 186, 229, 15, 18, 15, 80, 141, 97 }, // left = d207 - { 51, 13, 33, 46, 123, 225, 23, 46, 15, 34, 143, 132 }, // left = d63 - { 42, 11, 29, 49, 154, 226, 13, 20, 12, 27, 139, 117 }, // left = smooth - { 37, 13, 40, 48, 146, 217, 13, 23, 10, 24, 136, - 149 }, // left = smooth_v - { 45, 10, 24, 55, 176, 230, 11, 16, 14, 26, 136, 86 }, // left = smooth_h - { 32, 23, 43, 78, 204, 225, 18, 23, 15, 30, 134, 117 }, // left = tm - }, - { - // above = smooth_v - { 62, 13, 47, 68, 165, 204, 14, 24, 14, 22, 137, 146 }, // left = dc - { 42, 18, 97, 43, 138, 210, 12, 28, 8, 14, 127, 184 }, // left = v - { 30, 19, 21, 128, 238, 231, 13, 13, 17, 38, 138, 103 }, // left = h - { 66, 12, 31, 50, 132, 228, 37, 34, 14, 56, 142, 135 }, // left = d45 - { 45, 9, 33, 75, 73, 216, 20, 33, 25, 25, 146, 153 }, // left = d135 - { 31, 13, 48, 97, 46, 82, 26, 55, 31, 25, 140, 179 }, // left = d117 - { 47, 10, 26, 67, 109, 229, 15, 23, 52, 34, 136, 133 }, // left = d153 - { 49, 9, 25, 58, 174, 206, 14, 20, 13, 83, 144, 121 }, // left = d207 - { 54, 15, 42, 47, 120, 209, 22, 55, 13, 25, 139, 162 }, // left = d63 - { 41, 11, 43, 50, 146, 216, 11, 21, 11, 23, 136, 151 }, // left = smooth - { 37, 12, 58, 48, 148, 202, 11, 24, 8, 19, 134, 178 }, // left = smooth_v - { 47, 11, 39, 54, 169, 212, 12, 21, 14, 22, 144, - 115 }, // left = smooth_h - { 36, 25, 57, 80, 215, 211, 16, 28, 11, 25, 130, 154 }, // left = tm - }, - { - // above = smooth_h - { 57, 12, 28, 68, 186, 224, 11, 17, 20, 31, 133, 80 }, // left = dc - { 42, 21, 86, 51, 159, 221, 14, 25, 10, 19, 134, 131 }, // left = v - { 25, 17, 13, 123, 240, 240, 12, 10, 18, 42, 126, 56 }, // left = h - { 55, 11, 25, 47, 146, 238, 36, 32, 18, 67, 144, 99 }, // left = d45 - { 47, 11, 23, 75, 95, 222, 20, 24, 28, 36, 143, 103 }, // left = d135 - { 30, 14, 34, 92, 59, 101, 27, 44, 31, 41, 142, 129 }, // left = d117 - { 42, 11, 17, 73, 158, 234, 14, 14, 59, 46, 138, 67 }, // left = d153 - { 45, 10, 15, 64, 194, 228, 14, 15, 17, 78, 133, 73 }, // left = d207 - { 52, 14, 29, 45, 138, 227, 25, 43, 16, 36, 136, 119 }, // left = d63 - { 42, 12, 23, 51, 173, 235, 12, 16, 13, 28, 134, 95 }, // left = smooth - { 37, 16, 34, 52, 161, 228, 12, 19, 10, 28, 137, - 123 }, // left = smooth_v - { 45, 9, 18, 58, 200, 240, 10, 13, 13, 27, 129, 61 }, // left = smooth_h - { 32, 26, 44, 82, 217, 222, 19, 23, 16, 34, 134, 99 }, // left = tm - }, - { - // above = tm - { 51, 42, 80, 104, 178, 121, 20, 37, 25, 42, 136, 150 }, // left = dc - { 35, 38, 132, 73, 152, 132, 21, 36, 10, 32, 127, 174 }, // left = v - { 21, 34, 26, 149, 241, 165, 17, 15, 19, 60, 132, 95 }, // left = h - { 64, 20, 36, 67, 169, 142, 45, 30, 16, 86, 145, 134 }, // left = d45 - { 40, 23, 51, 96, 102, 149, 25, 33, 34, 43, 143, 125 }, // left = d135 - { 58, 29, 93, 140, 93, 89, 51, 107, 64, 146, 145, 154 }, // left = d117 - { 33, 23, 44, 95, 139, 209, 12, 20, 76, 56, 131, 104 }, // left = d153 - { 40, 21, 28, 79, 210, 165, 21, 15, 16, 134, 138, 108 }, // left = d207 - { 45, 24, 58, 62, 132, 127, 32, 58, 15, 51, 143, 152 }, // left = d63 - { 33, 27, 53, 71, 195, 223, 14, 24, 12, 36, 136, 135 }, // left = smooth - { 30, 29, 62, 68, 201, 217, 14, 24, 11, 31, 132, - 162 }, // left = smooth_v - { 37, 25, 50, 76, 204, 212, 12, 18, 15, 38, 134, - 106 }, // left = smooth_h - { 28, 53, 64, 100, 203, 162, 26, 29, 15, 52, 127, 138 }, // left = tm - }, -}; - -static const aom_prob default_if_y_probs[BLOCK_SIZE_GROUPS][INTRA_MODES - 1] = { - { 56, 13, 37, 112, 91, 147, 66, 55, 72, 82, 124, 121 }, // block_size < 8x8 - { 92, 120, 47, 89, 120, 139, 18, 38, 32, 51, 146, - 124 }, // block_size < 16x16 - { 115, 102, 41, 69, 170, 142, 8, 23, 13, 23, 122, - 110 }, // block_size < 32x32 - { 148, 157, 47, 62, 238, 64, 7, 3, 1, 3, 74, 87 }, // block_size >= 32x32 -}; - -static const aom_prob default_uv_probs[INTRA_MODES][INTRA_MODES - 1] = { - { 184, 3, 67, 135, 194, 108, 33, 43, 40, 86, 121, 118 }, // y = dc - { 23, 3, 204, 105, 117, 53, 14, 68, 13, 19, 112, 86 }, // y = v - { 34, 3, 7, 220, 249, 142, 11, 13, 59, 124, 119, 131 }, // y = h - { 138, 3, 45, 51, 162, 99, 110, 107, 21, 113, 119, 111 }, // y = d45 - { 130, 2, 28, 163, 52, 163, 16, 25, 94, 46, 127, 118 }, // y = d135 - { 109, 3, 55, 218, 20, 43, 34, 71, 74, 68, 108, 128 }, // y = d117 - { 124, 1, 17, 124, 151, 197, 8, 9, 184, 71, 123, 101 }, // y = d153 - { 127, 2, 16, 110, 225, 134, 28, 19, 18, 190, 124, 132 }, // y = d207 - { 115, 3, 65, 46, 134, 81, 37, 170, 20, 57, 122, 106 }, // y = d63 - { 131, 4, 52, 71, 177, 205, 17, 27, 20, 41, 128, 118 }, // y = smooth - { 131, 5, 65, 70, 182, 196, 17, 30, 17, 35, 123, 154 }, // y = smooth_v - { 137, 4, 43, 78, 196, 202, 16, 21, 24, 48, 123, 91 }, // y = smooth_h - { 137, 12, 92, 142, 217, 71, 14, 45, 29, 62, 108, 109 }, // y = tm -}; - -#else // !CONFIG_SMOOTH_HV - -const aom_prob av1_kf_y_mode_prob[INTRA_MODES][INTRA_MODES][INTRA_MODES - 1] = { - { - // above = dc - { 121, 30, 54, 128, 164, 158, 45, 41, 57, 91 }, // left = dc - { 91, 38, 101, 102, 124, 141, 49, 48, 45, 73 }, // left = v - { 66, 28, 27, 177, 225, 178, 32, 27, 52, 114 }, // left = h - { 106, 23, 50, 101, 134, 148, 64, 50, 49, 107 }, // left = d45 - { 75, 24, 32, 118, 66, 143, 42, 28, 57, 74 }, // left = d135 - { 95, 24, 40, 142, 56, 141, 72, 121, 129, 255 }, // left = d117 - { 71, 14, 25, 126, 117, 201, 28, 21, 117, 89 }, // left = d153 - { 85, 16, 37, 110, 163, 178, 41, 28, 48, 134 }, // left = d207 - { 86, 25, 32, 83, 105, 133, 58, 81, 46, 95 }, // left = d63 - { 79, 25, 38, 75, 150, 255, 30, 49, 34, 51 }, // left = smooth - { 68, 59, 48, 122, 193, 158, 43, 46, 46, 112 }, // left = paeth - }, - { - // above = v - { 66, 21, 118, 111, 145, 107, 27, 50, 27, 54 }, // left = dc - { 52, 25, 167, 81, 120, 101, 34, 55, 19, 32 }, // left = v - { 56, 18, 72, 134, 208, 139, 31, 34, 27, 89 }, // left = h - { 75, 21, 94, 88, 134, 123, 49, 57, 30, 68 }, // left = d45 - { 54, 18, 95, 96, 78, 107, 33, 49, 28, 65 }, // left = d135 - { 61, 19, 121, 131, 58, 101, 56, 143, 120, 255 }, // left = d117 - { 53, 13, 78, 103, 110, 147, 31, 41, 64, 77 }, // left = d153 - { 69, 14, 78, 93, 167, 121, 31, 39, 25, 113 }, // left = d207 - { 64, 18, 103, 79, 90, 108, 34, 73, 27, 69 }, // left = d63 - { 52, 20, 103, 61, 161, 255, 22, 42, 16, 35 }, // left = smooth - { 50, 31, 124, 92, 161, 120, 50, 53, 23, 60 }, // left = paeth - }, - { - // above = h - { 94, 29, 31, 158, 214, 178, 35, 31, 72, 111 }, // left = dc - { 72, 37, 72, 149, 184, 177, 43, 40, 53, 105 }, // left = v - { 53, 21, 14, 196, 242, 209, 29, 19, 55, 145 }, // left = h - { 93, 36, 36, 104, 176, 166, 56, 37, 49, 141 }, // left = d45 - { 84, 32, 27, 124, 108, 143, 38, 36, 76, 134 }, // left = d135 - { 82, 31, 47, 142, 122, 161, 83, 73, 126, 255 }, // left = d117 - { 66, 16, 20, 133, 148, 210, 30, 17, 113, 104 }, // left = d153 - { 76, 16, 17, 129, 207, 181, 41, 20, 46, 163 }, // left = d207 - { 72, 38, 21, 100, 142, 171, 37, 70, 49, 111 }, // left = d63 - { 61, 30, 27, 115, 208, 255, 27, 31, 44, 63 }, // left = smooth - { 53, 45, 29, 157, 222, 185, 49, 37, 55, 102 }, // left = paeth - }, - { - // above = d45 - { 96, 18, 37, 98, 138, 154, 68, 56, 59, 96 }, // left = dc - { 73, 18, 92, 81, 125, 132, 75, 64, 27, 67 }, // left = v - { 73, 17, 27, 128, 213, 154, 56, 44, 32, 105 }, // left = h - { 101, 20, 21, 75, 138, 138, 82, 56, 23, 154 }, // left = d45 - { 71, 15, 33, 91, 70, 150, 62, 55, 38, 118 }, // left = d135 - { 80, 19, 38, 116, 69, 122, 88, 132, 92, 255 }, // left = d117 - { 68, 11, 22, 101, 116, 179, 52, 44, 85, 96 }, // left = d153 - { 101, 8, 59, 77, 151, 170, 53, 41, 35, 172 }, // left = d207 - { 82, 19, 24, 81, 172, 129, 82, 128, 43, 108 }, // left = d63 - { 66, 18, 42, 64, 143, 255, 52, 52, 25, 83 }, // left = smooth - { 57, 24, 42, 85, 169, 145, 104, 71, 34, 86 }, // left = paeth - }, - { - // above = d135 - { 85, 15, 29, 113, 83, 176, 26, 29, 70, 110 }, // left = dc - { 78, 28, 49, 111, 91, 141, 30, 42, 48, 75 }, // left = v - { 56, 21, 16, 146, 190, 178, 23, 31, 49, 92 }, // left = h - { 70, 19, 20, 65, 90, 173, 97, 36, 57, 98 }, // left = d45 - { 77, 14, 26, 110, 51, 156, 34, 35, 54, 74 }, // left = d135 - { 78, 18, 36, 153, 47, 131, 62, 102, 155, 255 }, // left = d117 - { 56, 11, 15, 115, 85, 196, 32, 45, 81, 96 }, // left = d153 - { 90, 18, 24, 95, 126, 159, 34, 31, 46, 136 }, // left = d207 - { 80, 23, 28, 90, 75, 141, 39, 50, 46, 87 }, // left = d63 - { 63, 22, 31, 91, 110, 255, 26, 43, 51, 51 }, // left = smooth - { 66, 32, 31, 122, 145, 165, 40, 43, 56, 79 }, // left = paeth - }, - { - // above = d117 - { 81, 16, 61, 170, 74, 105, 54, 105, 113, 255 }, // left = dc - { 74, 20, 86, 163, 64, 97, 65, 129, 101, 255 }, // left = v - { 63, 15, 47, 168, 141, 176, 69, 77, 77, 255 }, // left = h - { 70, 17, 59, 97, 78, 114, 74, 122, 80, 255 }, // left = d45 - { 78, 13, 50, 153, 34, 126, 75, 114, 120, 255 }, // left = d135 - { 72, 16, 69, 159, 28, 108, 63, 134, 107, 255 }, // left = d117 - { 66, 9, 47, 131, 79, 148, 41, 88, 105, 255 }, // left = d153 - { 78, 12, 60, 119, 105, 133, 47, 95, 63, 255 }, // left = d207 - { 82, 21, 58, 128, 61, 98, 64, 136, 91, 255 }, // left = d63 - { 23, 26, 28, 96, 85, 128, 51, 64, 85, 128 }, // left = smooth - { 58, 27, 62, 162, 109, 151, 75, 106, 78, 255 }, // left = paeth - }, - { - // above = d153 - { 91, 18, 25, 121, 166, 173, 25, 25, 128, 102 }, // left = dc - { 80, 27, 51, 111, 141, 147, 45, 38, 70, 85 }, // left = v - { 53, 12, 11, 154, 197, 225, 17, 17, 74, 145 }, // left = h - { 93, 27, 23, 111, 143, 188, 43, 39, 69, 112 }, // left = d45 - { 83, 15, 21, 118, 67, 178, 40, 33, 73, 92 }, // left = d135 - { 94, 13, 31, 132, 66, 110, 61, 82, 148, 255 }, // left = d117 - { 76, 9, 11, 96, 105, 201, 16, 13, 157, 97 }, // left = d153 - { 70, 10, 12, 100, 172, 201, 23, 17, 53, 158 }, // left = d207 - { 114, 25, 21, 104, 108, 163, 30, 47, 53, 111 }, // left = d63 - { 70, 16, 21, 80, 157, 255, 25, 30, 81, 69 }, // left = smooth - { 87, 32, 26, 120, 191, 168, 32, 33, 70, 118 }, // left = paeth - }, - { - // above = d207 - { 98, 20, 39, 122, 168, 188, 38, 36, 54, 132 }, // left = dc - { 81, 37, 62, 97, 122, 153, 38, 43, 36, 118 }, // left = v - { 71, 21, 22, 154, 227, 183, 37, 31, 46, 140 }, // left = h - { 90, 34, 19, 93, 144, 194, 65, 47, 41, 163 }, // left = d45 - { 78, 20, 27, 91, 93, 173, 57, 52, 49, 113 }, // left = d135 - { 79, 25, 45, 121, 101, 147, 69, 56, 122, 255 }, // left = d117 - { 73, 13, 19, 105, 122, 206, 40, 28, 91, 126 }, // left = d153 - { 101, 14, 22, 87, 153, 169, 33, 25, 26, 175 }, // left = d207 - { 81, 28, 23, 86, 115, 169, 48, 56, 41, 111 }, // left = d63 - { 70, 24, 30, 90, 180, 255, 38, 26, 36, 82 }, // left = smooth - { 61, 37, 30, 94, 189, 163, 76, 50, 36, 127 }, // left = paeth - }, - { - // above = d63 - { 77, 13, 46, 86, 138, 117, 55, 88, 34, 68 }, // left = dc - { 68, 17, 80, 64, 105, 108, 66, 115, 32, 45 }, // left = v - { 62, 13, 37, 124, 210, 131, 46, 57, 28, 103 }, // left = h - { 88, 15, 45, 73, 134, 145, 73, 101, 37, 87 }, // left = d45 - { 68, 16, 35, 78, 81, 133, 54, 71, 33, 67 }, // left = d135 - { 71, 16, 57, 108, 61, 135, 71, 184, 113, 255 }, // left = d117 - { 55, 10, 27, 69, 107, 158, 39, 76, 82, 95 }, // left = d153 - { 80, 9, 38, 78, 153, 145, 50, 63, 28, 123 }, // left = d207 - { 86, 12, 33, 49, 107, 135, 64, 134, 57, 89 }, // left = d63 - { 56, 19, 55, 60, 163, 255, 38, 84, 22, 36 }, // left = smooth - { 53, 17, 60, 69, 151, 126, 73, 113, 26, 80 }, // left = paeth - }, - { - // above = smooth - { 79, 16, 46, 89, 167, 255, 22, 36, 29, 42 }, // left = dc - { 63, 22, 88, 71, 131, 255, 26, 41, 21, 35 }, // left = v - { 51, 18, 28, 142, 232, 255, 26, 25, 25, 75 }, // left = h - { 75, 18, 43, 70, 140, 255, 37, 49, 34, 89 }, // left = d45 - { 70, 14, 35, 87, 83, 255, 30, 36, 34, 50 }, // left = d135 - { 23, 26, 28, 96, 85, 128, 51, 64, 85, 128 }, // left = d117 - { 74, 12, 33, 83, 128, 255, 27, 33, 58, 68 }, // left = d153 - { 66, 11, 30, 77, 179, 255, 21, 27, 23, 113 }, // left = d207 - { 68, 22, 40, 65, 118, 255, 28, 61, 30, 50 }, // left = d63 - { 60, 18, 44, 69, 141, 255, 18, 32, 22, 40 }, // left = smooth - { 52, 32, 54, 96, 194, 255, 33, 37, 25, 53 }, // left = paeth - }, - { - // above = paeth - { 76, 47, 67, 123, 182, 150, 41, 52, 55, 97 }, // left = dc - { 69, 40, 125, 102, 138, 138, 42, 55, 32, 70 }, // left = v - { 46, 28, 27, 160, 232, 169, 34, 21, 32, 122 }, // left = h - { 78, 35, 41, 99, 128, 124, 49, 43, 35, 111 }, // left = d45 - { 66, 28, 47, 100, 113, 145, 37, 40, 72, 93 }, // left = d135 - { 77, 37, 76, 134, 124, 124, 65, 122, 88, 255 }, // left = d117 - { 53, 23, 38, 108, 128, 204, 26, 32, 115, 114 }, // left = d153 - { 65, 20, 29, 101, 202, 186, 29, 24, 29, 188 }, // left = d207 - { 71, 24, 49, 81, 126, 151, 36, 65, 28, 93 }, // left = d63 - { 54, 36, 53, 94, 193, 255, 25, 38, 20, 64 }, // left = smooth - { 52, 54, 60, 108, 176, 168, 47, 44, 50, 105 }, // left = paeth - }, -}; - -static const aom_prob default_if_y_probs[BLOCK_SIZE_GROUPS][INTRA_MODES - 1] = { - { 88, 16, 47, 133, 143, 150, 70, 48, 84, 122 }, // block_size < 8x8 - { 75, 26, 51, 120, 158, 157, 44, 45, 56, 102 }, // block_size < 16x16 - { 73, 24, 60, 115, 184, 164, 26, 36, 32, 63 }, // block_size < 32x32 - { 96, 27, 50, 107, 221, 148, 16, 22, 14, 39 }, // block_size >= 32x32 -}; - -static const aom_prob default_uv_probs[INTRA_MODES][INTRA_MODES - 1] = { - { 199, 3, 79, 179, 220, 109, 38, 50, 68, 138 }, // y = dc - { 17, 2, 219, 136, 131, 58, 21, 106, 23, 41 }, // y = v - { 26, 1, 5, 244, 253, 138, 16, 21, 68, 205 }, // y = h - { 183, 3, 66, 94, 195, 97, 101, 104, 41, 178 }, // y = d45 - { 178, 2, 36, 158, 99, 175, 21, 29, 105, 77 }, // y = d135 - { 154, 3, 65, 219, 40, 48, 45, 95, 146, 255 }, // y = d117 - { 167, 1, 16, 160, 214, 187, 10, 10, 200, 155 }, // y = d153 - { 154, 2, 18, 178, 238, 132, 25, 21, 34, 221 }, // y = d207 - { 153, 4, 76, 85, 157, 90, 38, 165, 46, 104 }, // y = d63 - { 163, 3, 68, 87, 190, 255, 19, 27, 25, 46 }, // y = smooth - { 185, 7, 113, 171, 203, 57, 18, 69, 49, 104 }, // y = paeth -}; - -#endif // CONFIG_SMOOTH_HV - -#else // !CONFIG_ALT_INTRA - -const aom_prob av1_kf_y_mode_prob[INTRA_MODES][INTRA_MODES][INTRA_MODES - 1] = { - { - // above = dc - { 137, 30, 42, 148, 151, 207, 70, 52, 91 }, // left = dc - { 92, 45, 102, 136, 116, 180, 74, 90, 100 }, // left = v - { 73, 32, 19, 187, 222, 215, 46, 34, 100 }, // left = h - { 91, 30, 32, 116, 121, 186, 93, 86, 94 }, // left = d45 - { 72, 35, 36, 149, 68, 206, 68, 63, 105 }, // left = d135 - { 73, 31, 28, 138, 57, 124, 55, 122, 151 }, // left = d117 - { 67, 23, 21, 140, 126, 197, 40, 37, 171 }, // left = d153 - { 86, 27, 28, 128, 154, 212, 45, 43, 53 }, // left = d207 - { 74, 32, 27, 107, 86, 160, 63, 134, 102 }, // left = d63 - { 59, 67, 44, 140, 161, 202, 78, 67, 119 } // left = tm - }, - { - // above = v - { 63, 36, 126, 146, 123, 158, 60, 90, 96 }, // left = dc - { 43, 46, 168, 134, 107, 128, 69, 142, 92 }, // left = v - { 44, 29, 68, 159, 201, 177, 50, 57, 77 }, // left = h - { 58, 38, 76, 114, 97, 172, 78, 133, 92 }, // left = d45 - { 46, 41, 76, 140, 63, 184, 69, 112, 57 }, // left = d135 - { 38, 32, 85, 140, 46, 112, 54, 151, 133 }, // left = d117 - { 39, 27, 61, 131, 110, 175, 44, 75, 136 }, // left = d153 - { 52, 30, 74, 113, 130, 175, 51, 64, 58 }, // left = d207 - { 47, 35, 80, 100, 74, 143, 64, 163, 74 }, // left = d63 - { 36, 61, 116, 114, 128, 162, 80, 125, 82 } // left = tm - }, - { - // above = h - { 82, 26, 26, 171, 208, 204, 44, 32, 105 }, // left = dc - { 55, 44, 68, 166, 179, 192, 57, 57, 108 }, // left = v - { 42, 26, 11, 199, 241, 228, 23, 15, 85 }, // left = h - { 68, 42, 19, 131, 160, 199, 55, 52, 83 }, // left = d45 - { 58, 50, 25, 139, 115, 232, 39, 52, 118 }, // left = d135 - { 50, 35, 33, 153, 104, 162, 64, 59, 131 }, // left = d117 - { 44, 24, 16, 150, 177, 202, 33, 19, 156 }, // left = d153 - { 55, 27, 12, 153, 203, 218, 26, 27, 49 }, // left = d207 - { 53, 49, 21, 110, 116, 168, 59, 80, 76 }, // left = d63 - { 38, 72, 19, 168, 203, 212, 50, 50, 107 } // left = tm - }, - { - // above = d45 - { 103, 26, 36, 129, 132, 201, 83, 80, 93 }, // left = dc - { 59, 38, 83, 112, 103, 162, 98, 136, 90 }, // left = v - { 62, 30, 23, 158, 200, 207, 59, 57, 50 }, // left = h - { 67, 30, 29, 84, 86, 191, 102, 91, 59 }, // left = d45 - { 60, 32, 33, 112, 71, 220, 64, 89, 104 }, // left = d135 - { 53, 26, 34, 130, 56, 149, 84, 120, 103 }, // left = d117 - { 53, 21, 23, 133, 109, 210, 56, 77, 172 }, // left = d153 - { 77, 19, 29, 112, 142, 228, 55, 66, 36 }, // left = d207 - { 61, 29, 29, 93, 97, 165, 83, 175, 162 }, // left = d63 - { 47, 47, 43, 114, 137, 181, 100, 99, 95 } // left = tm - }, - { - // above = d135 - { 69, 23, 29, 128, 83, 199, 46, 44, 101 }, // left = dc - { 53, 40, 55, 139, 69, 183, 61, 80, 110 }, // left = v - { 40, 29, 19, 161, 180, 207, 43, 24, 91 }, // left = h - { 60, 34, 19, 105, 61, 198, 53, 64, 89 }, // left = d45 - { 52, 31, 22, 158, 40, 209, 58, 62, 89 }, // left = d135 - { 44, 31, 29, 147, 46, 158, 56, 102, 198 }, // left = d117 - { 35, 19, 12, 135, 87, 209, 41, 45, 167 }, // left = d153 - { 55, 25, 21, 118, 95, 215, 38, 39, 66 }, // left = d207 - { 51, 38, 25, 113, 58, 164, 70, 93, 97 }, // left = d63 - { 47, 54, 34, 146, 108, 203, 72, 103, 151 } // left = tm - }, - { - // above = d117 - { 64, 19, 37, 156, 66, 138, 49, 95, 133 }, // left = dc - { 46, 27, 80, 150, 55, 124, 55, 121, 135 }, // left = v - { 36, 23, 27, 165, 149, 166, 54, 64, 118 }, // left = h - { 53, 21, 36, 131, 63, 163, 60, 109, 81 }, // left = d45 - { 40, 26, 35, 154, 40, 185, 51, 97, 123 }, // left = d135 - { 35, 19, 34, 179, 19, 97, 48, 129, 124 }, // left = d117 - { 36, 20, 26, 136, 62, 164, 33, 77, 154 }, // left = d153 - { 45, 18, 32, 130, 90, 157, 40, 79, 91 }, // left = d207 - { 45, 26, 28, 129, 45, 129, 49, 147, 123 }, // left = d63 - { 38, 44, 51, 136, 74, 162, 57, 97, 121 } // left = tm - }, - { - // above = d153 - { 75, 17, 22, 136, 138, 185, 32, 34, 166 }, // left = dc - { 56, 39, 58, 133, 117, 173, 48, 53, 187 }, // left = v - { 35, 21, 12, 161, 212, 207, 20, 23, 145 }, // left = h - { 56, 29, 19, 117, 109, 181, 55, 68, 112 }, // left = d45 - { 47, 29, 17, 153, 64, 220, 59, 51, 114 }, // left = d135 - { 46, 16, 24, 136, 76, 147, 41, 64, 172 }, // left = d117 - { 34, 17, 11, 108, 152, 187, 13, 15, 209 }, // left = d153 - { 51, 24, 14, 115, 133, 209, 32, 26, 104 }, // left = d207 - { 55, 30, 18, 122, 79, 179, 44, 88, 116 }, // left = d63 - { 37, 49, 25, 129, 168, 164, 41, 54, 148 } // left = tm - }, - { - // above = d207 - { 82, 22, 32, 127, 143, 213, 39, 41, 70 }, // left = dc - { 62, 44, 61, 123, 105, 189, 48, 57, 64 }, // left = v - { 47, 25, 17, 175, 222, 220, 24, 30, 86 }, // left = h - { 68, 36, 17, 106, 102, 206, 59, 74, 74 }, // left = d45 - { 57, 39, 23, 151, 68, 216, 55, 63, 58 }, // left = d135 - { 49, 30, 35, 141, 70, 168, 82, 40, 115 }, // left = d117 - { 51, 25, 15, 136, 129, 202, 38, 35, 139 }, // left = d153 - { 68, 26, 16, 111, 141, 215, 29, 28, 28 }, // left = d207 - { 59, 39, 19, 114, 75, 180, 77, 104, 42 }, // left = d63 - { 40, 61, 26, 126, 152, 206, 61, 59, 93 } // left = tm - }, - { - // above = d63 - { 78, 23, 39, 111, 117, 170, 74, 124, 94 }, // left = dc - { 48, 34, 86, 101, 92, 146, 78, 179, 134 }, // left = v - { 47, 22, 24, 138, 187, 178, 68, 69, 59 }, // left = h - { 56, 25, 33, 105, 112, 187, 95, 177, 129 }, // left = d45 - { 48, 31, 27, 114, 63, 183, 82, 116, 56 }, // left = d135 - { 43, 28, 37, 121, 63, 123, 61, 192, 169 }, // left = d117 - { 42, 17, 24, 109, 97, 177, 56, 76, 122 }, // left = d153 - { 58, 18, 28, 105, 139, 182, 70, 92, 63 }, // left = d207 - { 46, 23, 32, 74, 86, 150, 67, 183, 88 }, // left = d63 - { 36, 38, 48, 92, 122, 165, 88, 137, 91 } // left = tm - }, - { - // above = tm - { 65, 70, 60, 155, 159, 199, 61, 60, 81 }, // left = dc - { 44, 78, 115, 132, 119, 173, 71, 112, 93 }, // left = v - { 39, 38, 21, 184, 227, 206, 42, 32, 64 }, // left = h - { 58, 47, 36, 124, 137, 193, 80, 82, 78 }, // left = d45 - { 49, 50, 35, 144, 95, 205, 63, 78, 59 }, // left = d135 - { 41, 53, 52, 148, 71, 142, 65, 128, 51 }, // left = d117 - { 40, 36, 28, 143, 143, 202, 40, 55, 137 }, // left = d153 - { 52, 34, 29, 129, 183, 227, 42, 35, 43 }, // left = d207 - { 42, 44, 44, 104, 105, 164, 64, 130, 80 }, // left = d63 - { 43, 81, 53, 140, 169, 204, 68, 84, 72 } // left = tm - } -}; - -// Default probabilities for signaling Intra mode for Y plane -- used only for -// inter frames. ('av1_kf_y_mode_prob' is used for intra-only frames). -// Context used: block size group. -static const aom_prob default_if_y_probs[BLOCK_SIZE_GROUPS][INTRA_MODES - 1] = { - { 65, 32, 18, 144, 162, 194, 41, 51, 98 }, // block_size < 8x8 - { 132, 68, 18, 165, 217, 196, 45, 40, 78 }, // block_size < 16x16 - { 173, 80, 19, 176, 240, 193, 64, 35, 46 }, // block_size < 32x32 - { 221, 135, 38, 194, 248, 121, 96, 85, 29 } // block_size >= 32x32 -}; - -// Default probabilities for signaling Intra mode for UV plane -- common for -// both intra and inter frames. -// Context used: Intra mode used by Y plane of the same block. -static const aom_prob default_uv_probs[INTRA_MODES][INTRA_MODES - 1] = { - { 120, 7, 76, 176, 208, 126, 28, 54, 103 }, // y = dc - { 48, 12, 154, 155, 139, 90, 34, 117, 119 }, // y = v - { 67, 6, 25, 204, 243, 158, 13, 21, 96 }, // y = h - { 97, 5, 44, 131, 176, 139, 48, 68, 97 }, // y = d45 - { 83, 5, 42, 156, 111, 152, 26, 49, 152 }, // y = d135 - { 80, 5, 58, 178, 74, 83, 33, 62, 145 }, // y = d117 - { 86, 5, 32, 154, 192, 168, 14, 22, 163 }, // y = d153 - { 85, 5, 32, 156, 216, 148, 19, 29, 73 }, // y = d207 - { 77, 7, 64, 116, 132, 122, 37, 126, 120 }, // y = d63 - { 101, 21, 107, 181, 192, 103, 19, 67, 125 } // y = tm -}; - -#endif // CONFIG_ALT_INTRA - #if CONFIG_EXT_PARTITION_TYPES static const aom_prob default_partition_probs[PARTITION_CONTEXTS][EXT_PARTITION_TYPES - 1] = { // 8x8 -> 4x4 - { 199, 122, 141, 128, 128, 128, 128 }, // a/l both not split - { 147, 63, 159, 128, 128, 128, 128 }, // a split, l not split - { 148, 133, 118, 128, 128, 128, 128 }, // l split, a not split - { 121, 104, 114, 128, 128, 128, 128 }, // a/l both split + { 199, 122, 141, 128, 128, 128, 255, 128, 255 }, // a/l both not split + { 147, 63, 159, 128, 128, 128, 255, 128, 255 }, // a split, l not split + { 148, 133, 118, 128, 128, 128, 255, 128, 255 }, // l split, a not split + { 121, 104, 114, 128, 128, 128, 255, 128, 255 }, // a/l both split // 16x16 -> 8x8 - { 174, 73, 87, 128, 128, 128, 128 }, // a/l both not split - { 92, 41, 83, 128, 128, 128, 128 }, // a split, l not split - { 82, 99, 50, 128, 128, 128, 128 }, // l split, a not split - { 53, 39, 39, 128, 128, 128, 128 }, // a/l both split + { 174, 73, 87, 128, 128, 128, 255, 128, 255 }, // a/l both not split + { 92, 41, 83, 128, 128, 128, 255, 128, 255 }, // a split, l not split + { 82, 99, 50, 128, 128, 128, 255, 128, 255 }, // l split, a not split + { 53, 39, 39, 128, 128, 128, 255, 128, 255 }, // a/l both split // 32x32 -> 16x16 - { 177, 58, 59, 128, 128, 128, 128 }, // a/l both not split - { 68, 26, 63, 128, 128, 128, 128 }, // a split, l not split - { 52, 79, 25, 128, 128, 128, 128 }, // l split, a not split - { 17, 14, 12, 128, 128, 128, 128 }, // a/l both split + { 177, 58, 59, 128, 128, 85, 128, 85, 128 }, // a/l both not split + { 68, 26, 63, 128, 128, 85, 128, 85, 128 }, // a split, l not split + { 52, 79, 25, 128, 128, 85, 128, 85, 128 }, // l split, a not split + { 17, 14, 12, 128, 128, 85, 128, 85, 128 }, // a/l both split // 64x64 -> 32x32 - { 222, 34, 30, 128, 128, 128, 128 }, // a/l both not split - { 72, 16, 44, 128, 128, 128, 128 }, // a split, l not split - { 58, 32, 12, 128, 128, 128, 128 }, // l split, a not split - { 10, 7, 6, 128, 128, 128, 128 }, // a/l both split + { 222, 34, 30, 128, 128, 128, 255, 128, 255 }, // a/l both not split + { 72, 16, 44, 128, 128, 128, 255, 128, 255 }, // a split, l not split + { 58, 32, 12, 128, 128, 128, 255, 128, 255 }, // l split, a not split + { 10, 7, 6, 128, 128, 128, 255, 128, 255 }, // a/l both split #if CONFIG_EXT_PARTITION // 128x128 -> 64x64 - { 222, 34, 30, 128, 128, 128, 128 }, // a/l both not split - { 72, 16, 44, 128, 128, 128, 128 }, // a split, l not split - { 58, 32, 12, 128, 128, 128, 128 }, // l split, a not split - { 10, 7, 6, 128, 128, 128, 128 }, // a/l both split -#endif // CONFIG_EXT_PARTITION + { 222, 34, 30, 128, 128, 128, 255, 128, 255 }, // a/l both not split + { 72, 16, 44, 128, 128, 128, 255, 128, 255 }, // a split, l not split + { 58, 32, 12, 128, 128, 128, 255, 128, 255 }, // l split, a not split + { 10, 7, 6, 128, 128, 128, 255, 128, 255 }, // a/l both split +#endif // CONFIG_EXT_PARTITION #if CONFIG_UNPOISON_PARTITION_CTX - { 0, 0, 141, 0, 0, 0, 0 }, // 8x8 -> 4x4 - { 0, 0, 87, 0, 0, 0, 0 }, // 16x16 -> 8x8 - { 0, 0, 59, 0, 0, 0, 0 }, // 32x32 -> 16x16 - { 0, 0, 30, 0, 0, 0, 0 }, // 64x64 -> 32x32 + { 0, 0, 141, 0, 0, 0, 0, 0, 0 }, // 8x8 -> 4x4 + { 0, 0, 87, 0, 0, 0, 0, 0, 0 }, // 16x16 -> 8x8 + { 0, 0, 59, 0, 0, 0, 0, 0, 0 }, // 32x32 -> 16x16 + { 0, 0, 30, 0, 0, 0, 0, 0, 0 }, // 64x64 -> 32x32 #if CONFIG_EXT_PARTITION - { 0, 0, 30, 0, 0, 0, 0 }, // 128x128 -> 64x64 -#endif // CONFIG_EXT_PARTITION - { 0, 122, 0, 0, 0, 0, 0 }, // 8x8 -> 4x4 - { 0, 73, 0, 0, 0, 0, 0 }, // 16x16 -> 8x8 - { 0, 58, 0, 0, 0, 0, 0 }, // 32x32 -> 16x16 - { 0, 34, 0, 0, 0, 0, 0 }, // 64x64 -> 32x32 + { 0, 0, 30, 0, 0, 0, 0, 0, 0 }, // 128x128 -> 64x64 +#endif // CONFIG_EXT_PARTITION + { 0, 122, 0, 0, 0, 0, 0, 0, 0 }, // 8x8 -> 4x4 + { 0, 73, 0, 0, 0, 0, 0, 0, 0 }, // 16x16 -> 8x8 + { 0, 58, 0, 0, 0, 0, 0, 0, 0 }, // 32x32 -> 16x16 + { 0, 34, 0, 0, 0, 0, 0, 0, 0 }, // 64x64 -> 32x32 #if CONFIG_EXT_PARTITION - { 0, 34, 0, 0, 0, 0, 0 }, // 128x128 -> 64x64 -#endif // CONFIG_EXT_PARTITION -#endif // CONFIG_UNPOISON_PARTITION_CTX + { 0, 34, 0, 0, 0, 0, 0, 0, 0 }, // 128x128 -> 64x64 +#endif // CONFIG_EXT_PARTITION +#endif // CONFIG_UNPOISON_PARTITION_CTX }; #else static const aom_prob @@ -987,46 +390,86 @@ static const aom_prob #endif // CONFIG_EXT_PARTITION_TYPES static const aom_prob default_newmv_prob[NEWMV_MODE_CONTEXTS] = { - 200, 180, 150, 150, 110, 70, 60, + 155, 116, 94, 32, 96, 56, 30, }; static const aom_prob default_zeromv_prob[ZEROMV_MODE_CONTEXTS] = { - 192, 64, + 45, 13, }; static const aom_prob default_refmv_prob[REFMV_MODE_CONTEXTS] = { - 220, 220, 200, 200, 180, 128, 30, 220, 30, + 178, 212, 135, 244, 203, 122, 128, 128, 128, }; -static const aom_prob default_drl_prob[DRL_MODE_CONTEXTS] = { 128, 160, 180, - 128, 160 }; - -static const aom_prob - default_inter_mode_probs[INTER_MODE_CONTEXTS][INTER_MODES - 1] = { - { 2, 173, 34 }, // 0 = both zero mv - { 7, 145, 85 }, // 1 = one zero mv + one a predicted mv - { 7, 166, 63 }, // 2 = two predicted mvs - { 7, 94, 66 }, // 3 = one predicted/zero and one new mv - { 8, 64, 46 }, // 4 = two new mvs - { 17, 81, 31 }, // 5 = one intra neighbour + x - { 25, 29, 30 }, // 6 = two intra neighbours - }; +static const aom_prob default_drl_prob[DRL_MODE_CONTEXTS] = { + 119, 128, 189, 134, 128, +}; +#if CONFIG_NEW_MULTISYMBOL +static const aom_cdf_prob default_newmv_cdf[NEWMV_MODE_CONTEXTS][CDF_SIZE(2)] = + { { AOM_ICDF(128 * 155), AOM_ICDF(32768), 0 }, + { AOM_ICDF(128 * 116), AOM_ICDF(32768), 0 }, + { AOM_ICDF(128 * 94), AOM_ICDF(32768), 0 }, + { AOM_ICDF(128 * 32), AOM_ICDF(32768), 0 }, + { AOM_ICDF(128 * 96), AOM_ICDF(32768), 0 }, + { AOM_ICDF(128 * 56), AOM_ICDF(32768), 0 }, + { AOM_ICDF(128 * 30), AOM_ICDF(32768), 0 } }; +static const aom_cdf_prob default_zeromv_cdf[ZEROMV_MODE_CONTEXTS][CDF_SIZE( + 2)] = { { AOM_ICDF(128 * 45), AOM_ICDF(32768), 0 }, + { AOM_ICDF(128 * 13), AOM_ICDF(32768), 0 } }; +static const aom_cdf_prob default_refmv_cdf[REFMV_MODE_CONTEXTS][CDF_SIZE(2)] = + { { AOM_ICDF(128 * 178), AOM_ICDF(32768), 0 }, + { AOM_ICDF(128 * 212), AOM_ICDF(32768), 0 }, + { AOM_ICDF(128 * 135), AOM_ICDF(32768), 0 }, + { AOM_ICDF(128 * 244), AOM_ICDF(32768), 0 }, + { AOM_ICDF(128 * 203), AOM_ICDF(32768), 0 }, + { AOM_ICDF(128 * 122), AOM_ICDF(32768), 0 }, + { AOM_ICDF(128 * 128), AOM_ICDF(32768), 0 }, + { AOM_ICDF(128 * 128), AOM_ICDF(32768), 0 }, + { AOM_ICDF(128 * 128), AOM_ICDF(32768), 0 } }; +static const aom_cdf_prob default_drl_cdf[DRL_MODE_CONTEXTS][CDF_SIZE(2)] = { + { AOM_ICDF(128 * 119), AOM_ICDF(32768), 0 }, + { AOM_ICDF(128 * 128), AOM_ICDF(32768), 0 }, + { AOM_ICDF(128 * 189), AOM_ICDF(32768), 0 }, + { AOM_ICDF(128 * 134), AOM_ICDF(32768), 0 }, + { AOM_ICDF(128 * 128), AOM_ICDF(32768), 0 } +}; +#endif #if CONFIG_EXT_INTER static const aom_prob default_inter_compound_mode_probs [INTER_MODE_CONTEXTS][INTER_COMPOUND_MODES - 1] = { - { 2, 173, 68, 192, 128, 180, 180 }, // 0 = both zero mv - { 7, 145, 160, 192, 128, 180, 180 }, // 1 = 1 zero + 1 predicted - { 7, 166, 126, 192, 128, 180, 180 }, // 2 = two predicted mvs - { 7, 94, 132, 192, 128, 180, 180 }, // 3 = 1 pred/zero, 1 new - { 8, 64, 64, 192, 128, 180, 180 }, // 4 = two new mvs - { 17, 81, 52, 192, 128, 180, 180 }, // 5 = one intra neighbour - { 25, 29, 50, 192, 128, 180, 180 }, // 6 = two intra neighbours + { 154, 167, 233, 165, 143, 170, 167 }, // 0 = both zero mv + { 75, 168, 237, 155, 135, 176, 172 }, // 1 = 1 zero + 1 predicted + { 7, 173, 227, 128, 153, 188, 189 }, // 2 = two predicted mvs + { 8, 120, 214, 113, 154, 178, 174 }, // 3 = 1 pred/zero, 1 new + { 4, 85, 194, 94, 155, 173, 167 }, // 4 = two new mvs + { 23, 89, 180, 73, 157, 151, 155 }, // 5 = one intra neighbour + { 27, 49, 152, 91, 134, 153, 142 }, // 6 = two intra neighbours + }; + +static const aom_cdf_prob + default_inter_compound_mode_cdf[INTER_MODE_CONTEXTS][CDF_SIZE( + INTER_COMPOUND_MODES)] = { + { AOM_ICDF(19712), AOM_ICDF(28229), AOM_ICDF(30892), AOM_ICDF(31437), + AOM_ICDF(31712), AOM_ICDF(32135), AOM_ICDF(32360), AOM_ICDF(32768), 0 }, + { AOM_ICDF(9600), AOM_ICDF(24804), AOM_ICDF(29268), AOM_ICDF(30323), + AOM_ICDF(30802), AOM_ICDF(31726), AOM_ICDF(32177), AOM_ICDF(32768), 0 }, + { AOM_ICDF(896), AOM_ICDF(22434), AOM_ICDF(27015), AOM_ICDF(29026), + AOM_ICDF(29753), AOM_ICDF(31114), AOM_ICDF(31597), AOM_ICDF(32768), 0 }, + { AOM_ICDF(1024), AOM_ICDF(15904), AOM_ICDF(22127), AOM_ICDF(25421), + AOM_ICDF(26864), AOM_ICDF(28996), AOM_ICDF(30001), AOM_ICDF(32768), 0 }, + { AOM_ICDF(512), AOM_ICDF(11222), AOM_ICDF(17217), AOM_ICDF(21445), + AOM_ICDF(23473), AOM_ICDF(26133), AOM_ICDF(27550), AOM_ICDF(32768), 0 }, + { AOM_ICDF(2944), AOM_ICDF(13313), AOM_ICDF(17214), AOM_ICDF(20751), + AOM_ICDF(23211), AOM_ICDF(25500), AOM_ICDF(26992), AOM_ICDF(32768), 0 }, + { AOM_ICDF(3456), AOM_ICDF(9067), AOM_ICDF(14069), AOM_ICDF(16907), + AOM_ICDF(18817), AOM_ICDF(21214), AOM_ICDF(23139), AOM_ICDF(32768), 0 } }; #if CONFIG_COMPOUND_SINGLEREF // TODO(zoeliu): Default values to be further adjusted based on the collected // stats. +/* static const aom_prob default_inter_singleref_comp_mode_probs [INTER_MODE_CONTEXTS][INTER_SINGLEREF_COMP_MODES - 1] = { { 2, 173, 68, 180 }, // 0 = both zero mv @@ -1036,26 +479,49 @@ static const aom_prob default_inter_singleref_comp_mode_probs { 8, 64, 64, 180 }, // 4 = two new mvs { 17, 81, 52, 180 }, // 5 = one intra neighbour { 25, 29, 50, 180 }, // 6 = two intra neighbours + };*/ +static const aom_prob default_inter_singleref_comp_mode_probs + [INTER_MODE_CONTEXTS][INTER_SINGLEREF_COMP_MODES - 1] = { + { 2, 173, 68 }, // 0 = both zero mv + { 7, 145, 160 }, // 1 = 1 zero + 1 predicted + { 7, 166, 126 }, // 2 = two predicted mvs + { 7, 94, 132 }, // 3 = 1 pred/zero, 1 new + { 8, 64, 64 }, // 4 = two new mvs + { 17, 81, 52 }, // 5 = one intra neighbour + { 25, 29, 50 }, // 6 = two intra neighbours + }; + +static const aom_cdf_prob + default_inter_singleref_comp_mode_cdf[INTER_MODE_CONTEXTS][CDF_SIZE( + INTER_SINGLEREF_COMP_MODES)] = { + { AOM_ICDF(21971), AOM_ICDF(24771), AOM_ICDF(25027), AOM_ICDF(32768), 0 }, + { AOM_ICDF(18053), AOM_ICDF(26690), AOM_ICDF(27586), AOM_ICDF(32768), 0 }, + { AOM_ICDF(20667), AOM_ICDF(26182), AOM_ICDF(27078), AOM_ICDF(32768), 0 }, + { AOM_ICDF(11703), AOM_ICDF(22103), AOM_ICDF(22999), AOM_ICDF(32768), 0 }, + { AOM_ICDF(7936), AOM_ICDF(13888), AOM_ICDF(14912), AOM_ICDF(32768), 0 }, + { AOM_ICDF(9679), AOM_ICDF(13927), AOM_ICDF(16103), AOM_ICDF(32768), 0 }, + { AOM_ICDF(3349), AOM_ICDF(8470), AOM_ICDF(11670), AOM_ICDF(32768), 0 } }; #endif // CONFIG_COMPOUND_SINGLEREF #if CONFIG_COMPOUND_SEGMENT && CONFIG_WEDGE static const aom_prob - default_compound_type_probs[BLOCK_SIZES][COMPOUND_TYPES - 1] = { -#if CONFIG_CB4X4 - { 255, 128 }, { 255, 128 }, { 255, 128 }, + default_compound_type_probs[BLOCK_SIZES_ALL][COMPOUND_TYPES - 1] = { +#if CONFIG_CHROMA_2X2 || CONFIG_CHROMA_SUB8X8 + { 128, 128 }, { 128, 128 }, { 128, 128 }, #endif - { 208, 128 }, { 208, 128 }, { 208, 128 }, { 208, 128 }, { 208, 128 }, - { 208, 128 }, { 216, 128 }, { 216, 128 }, { 216, 128 }, { 224, 128 }, - { 224, 1 }, { 240, 1 }, { 240, 1 }, + { 128, 128 }, { 255, 128 }, { 255, 128 }, { 66, 51 }, { 72, 35 }, + { 79, 29 }, { 71, 18 }, { 81, 29 }, { 81, 26 }, { 69, 19 }, + { 104, 1 }, { 99, 1 }, { 75, 1 }, #if CONFIG_EXT_PARTITION { 255, 1 }, { 255, 1 }, { 255, 1 }, #endif // CONFIG_EXT_PARTITION + { 208, 128 }, { 208, 128 }, { 208, 128 }, { 208, 128 }, }; #elif !CONFIG_COMPOUND_SEGMENT && CONFIG_WEDGE static const aom_prob - default_compound_type_probs[BLOCK_SIZES][COMPOUND_TYPES - 1] = { -#if CONFIG_CB4X4 + default_compound_type_probs[BLOCK_SIZES_ALL][COMPOUND_TYPES - 1] = { +#if CONFIG_CHROMA_2X2 || CONFIG_CHROMA_SUB8X8 { 255 }, { 255 }, { 255 }, #endif { 208 }, { 208 }, { 208 }, { 208 }, { 208 }, { 208 }, { 216 }, @@ -1063,11 +529,12 @@ static const aom_prob #if CONFIG_EXT_PARTITION { 255 }, { 255 }, { 255 }, #endif // CONFIG_EXT_PARTITION + { 208 }, { 208 }, { 208 }, { 208 }, }; #elif CONFIG_COMPOUND_SEGMENT && !CONFIG_WEDGE static const aom_prob - default_compound_type_probs[BLOCK_SIZES][COMPOUND_TYPES - 1] = { -#if CONFIG_CB4X4 + default_compound_type_probs[BLOCK_SIZES_ALL][COMPOUND_TYPES - 1] = { +#if CONFIG_CHROMA_2X2 || CONFIG_CHROMA_SUB8X8 { 255 }, { 255 }, { 255 }, #endif { 208 }, { 208 }, { 208 }, { 208 }, { 208 }, { 208 }, { 216 }, @@ -1075,45 +542,228 @@ static const aom_prob #if CONFIG_EXT_PARTITION { 255 }, { 255 }, { 255 }, #endif // CONFIG_EXT_PARTITION + { 208 }, { 208 }, { 208 }, { 208 }, }; #else -static const aom_prob default_compound_type_probs[BLOCK_SIZES] +static const aom_prob default_compound_type_probs[BLOCK_SIZES_ALL] [COMPOUND_TYPES - 1]; #endif // CONFIG_COMPOUND_SEGMENT && CONFIG_WEDGE +#if CONFIG_COMPOUND_SEGMENT && CONFIG_WEDGE +static const aom_cdf_prob + default_compound_type_cdf[BLOCK_SIZES_ALL][CDF_SIZE(COMPOUND_TYPES)] = { +#if CONFIG_CHROMA_2X2 || CONFIG_CHROMA_SUB8X8 + { AOM_ICDF(16384), AOM_ICDF(24576), AOM_ICDF(32768), 0 }, + { AOM_ICDF(16384), AOM_ICDF(24576), AOM_ICDF(32768), 0 }, + { AOM_ICDF(16384), AOM_ICDF(24576), AOM_ICDF(32768), 0 }, +#endif + { AOM_ICDF(16384), AOM_ICDF(24576), AOM_ICDF(32768), 0 }, + { AOM_ICDF(32640), AOM_ICDF(32704), AOM_ICDF(32768), 0 }, + { AOM_ICDF(32640), AOM_ICDF(32704), AOM_ICDF(32768), 0 }, + { AOM_ICDF(8448), AOM_ICDF(13293), AOM_ICDF(32768), 0 }, + { AOM_ICDF(9216), AOM_ICDF(12436), AOM_ICDF(32768), 0 }, + { AOM_ICDF(10112), AOM_ICDF(12679), AOM_ICDF(32768), 0 }, + { AOM_ICDF(9088), AOM_ICDF(10753), AOM_ICDF(32768), 0 }, + { AOM_ICDF(10368), AOM_ICDF(12906), AOM_ICDF(32768), 0 }, + { AOM_ICDF(10368), AOM_ICDF(12643), AOM_ICDF(32768), 0 }, + { AOM_ICDF(8832), AOM_ICDF(10609), AOM_ICDF(32768), 0 }, + { AOM_ICDF(13312), AOM_ICDF(13388), AOM_ICDF(32768), 0 }, + { AOM_ICDF(12672), AOM_ICDF(12751), AOM_ICDF(32768), 0 }, + { AOM_ICDF(9600), AOM_ICDF(9691), AOM_ICDF(32768), 0 }, +#if CONFIG_EXT_PARTITION + { AOM_ICDF(32640), AOM_ICDF(32641), AOM_ICDF(32768), 0 }, // 255, 1 + { AOM_ICDF(32640), AOM_ICDF(32641), AOM_ICDF(32768), 0 }, + { AOM_ICDF(32640), AOM_ICDF(32641), AOM_ICDF(32768), 0 }, +#endif // CONFIG_EXT_PARTITION + { 16384, 8192, 0, 0 }, + { 16384, 8192, 0, 0 }, + { 16384, 8192, 0, 0 }, + { 16384, 8192, 0, 0 }, + }; +#elif !CONFIG_COMPOUND_SEGMENT && CONFIG_WEDGE +static const aom_cdf_prob + default_compound_type_cdf[BLOCK_SIZES_ALL][CDF_SIZE(COMPOUND_TYPES)] = { +#if CONFIG_CHROMA_2X2 || CONFIG_CHROMA_SUB8X8 + { AOM_ICDF(32640), AOM_ICDF(32768), 0 }, // 255 + { AOM_ICDF(32640), AOM_ICDF(32768), 0 }, + { AOM_ICDF(32640), AOM_ICDF(32768), 0 }, +#endif + { AOM_ICDF(26624), AOM_ICDF(32768), 0 }, // 208 + { AOM_ICDF(26624), AOM_ICDF(32768), 0 }, + { AOM_ICDF(26624), AOM_ICDF(32768), 0 }, + { AOM_ICDF(26624), AOM_ICDF(32768), 0 }, + { AOM_ICDF(26624), AOM_ICDF(32768), 0 }, + { AOM_ICDF(26624), AOM_ICDF(32768), 0 }, + { AOM_ICDF(27648), AOM_ICDF(32768), 0 }, // 216 + { AOM_ICDF(27648), AOM_ICDF(32768), 0 }, + { AOM_ICDF(27648), AOM_ICDF(32768), 0 }, + { AOM_ICDF(28672), AOM_ICDF(32768), 0 }, // 224 + { AOM_ICDF(28672), AOM_ICDF(32768), 0 }, + { AOM_ICDF(30720), AOM_ICDF(32768), 0 }, // 240 + { AOM_ICDF(30720), AOM_ICDF(32768), 0 }, +#if CONFIG_EXT_PARTITION + { AOM_ICDF(32640), AOM_ICDF(32768), 0 }, // 255 + { AOM_ICDF(32640), AOM_ICDF(32768), 0 }, + { AOM_ICDF(32640), AOM_ICDF(32768), 0 }, +#endif // CONFIG_EXT_PARTITION + { AOM_ICDF(32640), AOM_ICDF(32768), 0 }, + { AOM_ICDF(32640), AOM_ICDF(32768), 0 }, + { AOM_ICDF(32640), AOM_ICDF(32768), 0 }, + { AOM_ICDF(32640), AOM_ICDF(32768), 0 }, + }; +#elif CONFIG_COMPOUND_SEGMENT && !CONFIG_WEDGE +static const aom_cdf_prob + default_compound_type_cdf[BLOCK_SIZES_ALL][CDF_SIZE(COMPOUND_TYPES)] = { +#if CONFIG_CHROMA_2X2 || CONFIG_CHROMA_SUB8X8 + { AOM_ICDF(32640), AOM_ICDF(32768), 0 }, // 255 + { AOM_ICDF(32640), AOM_ICDF(32768), 0 }, + { AOM_ICDF(32640), AOM_ICDF(32768), 0 }, +#endif + { AOM_ICDF(26624), AOM_ICDF(32768), 0 }, // 208 + { AOM_ICDF(26624), AOM_ICDF(32768), 0 }, + { AOM_ICDF(26624), AOM_ICDF(32768), 0 }, + { AOM_ICDF(26624), AOM_ICDF(32768), 0 }, + { AOM_ICDF(26624), AOM_ICDF(32768), 0 }, + { AOM_ICDF(26624), AOM_ICDF(32768), 0 }, + { AOM_ICDF(27648), AOM_ICDF(32768), 0 }, // 216 + { AOM_ICDF(27648), AOM_ICDF(32768), 0 }, + { AOM_ICDF(27648), AOM_ICDF(32768), 0 }, + { AOM_ICDF(28672), AOM_ICDF(32768), 0 }, // 224 + { AOM_ICDF(28672), AOM_ICDF(32768), 0 }, + { AOM_ICDF(30720), AOM_ICDF(32768), 0 }, // 240 + { AOM_ICDF(30720), AOM_ICDF(32768), 0 }, +#if CONFIG_EXT_PARTITION + { AOM_ICDF(32640), AOM_ICDF(32768), 0 }, // 255 + { AOM_ICDF(32640), AOM_ICDF(32768), 0 }, + { AOM_ICDF(32640), AOM_ICDF(32768), 0 }, +#endif // CONFIG_EXT_PARTITION + { AOM_ICDF(32640), AOM_ICDF(32768), 0 }, + { AOM_ICDF(32640), AOM_ICDF(32768), 0 }, + { AOM_ICDF(32640), AOM_ICDF(32768), 0 }, + { AOM_ICDF(32640), AOM_ICDF(32768), 0 }, + }; +#else +static const aom_cdf_prob default_compound_type_cdf[BLOCK_SIZES_ALL] + [CDF_SIZE(COMPOUND_TYPES)]; +#endif // CONFIG_COMPOUND_SEGMENT && CONFIG_WEDGE + #if CONFIG_INTERINTRA static const aom_prob default_interintra_prob[BLOCK_SIZE_GROUPS] = { - 208, 208, 208, 208, + 128, 226, 244, 254, }; +#if CONFIG_NEW_MULTISYMBOL +static const aom_cdf_prob default_interintra_cdf[BLOCK_SIZE_GROUPS][CDF_SIZE( + 2)] = { { AOM_ICDF(128 * 128), AOM_ICDF(32768), 0 }, + { AOM_ICDF(226 * 128), AOM_ICDF(32768), 0 }, + { AOM_ICDF(244 * 128), AOM_ICDF(32768), 0 }, + { AOM_ICDF(254 * 128), AOM_ICDF(32768), 0 } }; +#endif static const aom_prob default_interintra_mode_prob[BLOCK_SIZE_GROUPS][INTERINTRA_MODES - 1] = { - { 88, 16, 150 }, // block_size < 8x8 - { 75, 26, 150 }, // block_size < 16x16 - { 73, 24, 150 }, // block_size < 32x32 - { 96, 27, 150 } // block_size >= 32x32 + { 128, 128, 128 }, // block_size < 8x8 + { 24, 34, 119 }, // block_size < 16x16 + { 38, 33, 95 }, // block_size < 32x32 + { 51, 21, 110 }, // block_size >= 32x32 + }; +static const aom_cdf_prob + default_interintra_mode_cdf[BLOCK_SIZE_GROUPS][CDF_SIZE( + INTERINTRA_MODES)] = { + { AOM_ICDF(16384), AOM_ICDF(24576), AOM_ICDF(28672), AOM_ICDF(32768), 0 }, + { AOM_ICDF(3072), AOM_ICDF(7016), AOM_ICDF(18987), AOM_ICDF(32768), 0 }, + { AOM_ICDF(4864), AOM_ICDF(8461), AOM_ICDF(17481), AOM_ICDF(32768), 0 }, + { AOM_ICDF(6528), AOM_ICDF(8681), AOM_ICDF(19031), AOM_ICDF(32768), 0 } }; -static const aom_prob default_wedge_interintra_prob[BLOCK_SIZES] = { -#if CONFIG_CB4X4 - 208, 208, 208, +static const aom_prob default_wedge_interintra_prob[BLOCK_SIZES_ALL] = { +#if CONFIG_CHROMA_2X2 || CONFIG_CHROMA_SUB8X8 + 128, 128, 128, #endif - 208, 208, 208, 208, 208, 208, 216, 216, 216, 224, 224, 224, 240, + 128, 128, 128, 194, 213, 217, 222, 224, 226, 220, 128, 128, 128, #if CONFIG_EXT_PARTITION - 208, 208, 208 + 208, 208, 208, #endif // CONFIG_EXT_PARTITION + 208, 208, 208, 208, }; + +#if CONFIG_NEW_MULTISYMBOL +static const aom_cdf_prob + default_wedge_interintra_cdf[BLOCK_SIZES_ALL][CDF_SIZE(2)] = { +#if CONFIG_CHROMA_2X2 || CONFIG_CHROMA_SUB8X8 + { AOM_ICDF(128 * 128), AOM_ICDF(32768), 0 }, + { AOM_ICDF(128 * 128), AOM_ICDF(32768), 0 }, + { AOM_ICDF(128 * 128), AOM_ICDF(32768), 0 }, +#endif + { AOM_ICDF(128 * 128), AOM_ICDF(32768), 0 }, + { AOM_ICDF(128 * 128), AOM_ICDF(32768), 0 }, + { AOM_ICDF(128 * 128), AOM_ICDF(32768), 0 }, + { AOM_ICDF(194 * 128), AOM_ICDF(32768), 0 }, + { AOM_ICDF(213 * 128), AOM_ICDF(32768), 0 }, + { AOM_ICDF(217 * 128), AOM_ICDF(32768), 0 }, + { AOM_ICDF(222 * 128), AOM_ICDF(32768), 0 }, + { AOM_ICDF(224 * 128), AOM_ICDF(32768), 0 }, + { AOM_ICDF(226 * 128), AOM_ICDF(32768), 0 }, + { AOM_ICDF(220 * 128), AOM_ICDF(32768), 0 }, + { AOM_ICDF(128 * 128), AOM_ICDF(32768), 0 }, + { AOM_ICDF(128 * 128), AOM_ICDF(32768), 0 }, + { AOM_ICDF(128 * 128), AOM_ICDF(32768), 0 }, +#if CONFIG_EXT_PARTITION + { AOM_ICDF(208 * 128), AOM_ICDF(32768), 0 }, + { AOM_ICDF(208 * 128), AOM_ICDF(32768), 0 }, + { AOM_ICDF(208 * 128), AOM_ICDF(32768), 0 }, +#endif // CONFIG_EXT_PARTITION + { AOM_ICDF(208 * 128), AOM_ICDF(32768), 0 }, + { AOM_ICDF(208 * 128), AOM_ICDF(32768), 0 }, + { AOM_ICDF(208 * 128), AOM_ICDF(32768), 0 }, + { AOM_ICDF(208 * 128), AOM_ICDF(32768), 0 }, + }; +#endif // CONFIG_NEW_MULTISYMBOL + #endif // CONFIG_INTERINTRA #endif // CONFIG_EXT_INTER +#if CONFIG_NCOBMC_ADAPT_WEIGHT +const aom_tree_index av1_ncobmc_mode_tree[TREE_SIZE(MAX_NCOBMC_MODES)] = { + -NO_OVERLAP, 2, -NCOBMC_MODE_1, 4, + -NCOBMC_MODE_2, 6, -NCOBMC_MODE_3, 8, + -NCOBMC_MODE_4, 10, -NCOBMC_MODE_5, 12, + -NCOBMC_MODE_6, 14, -NCOBMC_MODE_7, -NCOBMC_MODE_8 +}; + +// TODO(weitinglin): find default prob +static const aom_prob + default_ncobmc_mode_prob[ADAPT_OVERLAP_BLOCKS][MAX_NCOBMC_MODES - 1] = { + { 23, 37, 37, 38, 65, 71, 81, 86 }, // 8x8 + { 28, 32, 37, 43, 51, 64, 85, 128 }, // 16X16 equal prob + { 86, 22, 32, 25, 10, 40, 97, 65 }, // 32X32 + { 28, 32, 37, 43, 51, 64, 85, 128 } // 64X64 equal prob + }; +static const aom_cdf_prob + default_ncobmc_mode_cdf[ADAPT_OVERLAP_BLOCKS][CDF_SIZE(MAX_NCOBMC_MODES)] = + { { AOM_ICDF(127), AOM_ICDF(4207), AOM_ICDF(8287), AOM_ICDF(12367), + AOM_ICDF(16447), AOM_ICDF(20527), AOM_ICDF(24607), AOM_ICDF(28687), + AOM_ICDF(32768), 0 }, + { AOM_ICDF(127), AOM_ICDF(4207), AOM_ICDF(8287), AOM_ICDF(12367), + AOM_ICDF(16447), AOM_ICDF(20527), AOM_ICDF(24607), AOM_ICDF(28687), + AOM_ICDF(32768), 0 }, + { AOM_ICDF(127), AOM_ICDF(4207), AOM_ICDF(8287), AOM_ICDF(12367), + AOM_ICDF(16447), AOM_ICDF(20527), AOM_ICDF(24607), AOM_ICDF(28687), + AOM_ICDF(32768), 0 }, + { AOM_ICDF(127), AOM_ICDF(4207), AOM_ICDF(8287), AOM_ICDF(12367), + AOM_ICDF(16447), AOM_ICDF(20527), AOM_ICDF(24607), AOM_ICDF(28687), + AOM_ICDF(32768), 0 } }; +#endif // CONFIG_NCOBMC_ADAPT_WEIGHT + // Change this section appropriately once warped motion is supported #if CONFIG_MOTION_VAR && !CONFIG_WARPED_MOTION +#if !CONFIG_NCOBMC_ADAPT_WEIGHT const aom_tree_index av1_motion_mode_tree[TREE_SIZE(MOTION_MODES)] = { -SIMPLE_TRANSLATION, -OBMC_CAUSAL }; -static const aom_prob default_motion_mode_prob[BLOCK_SIZES][MOTION_MODES - 1] = - { -#if CONFIG_CB4X4 + +static const aom_prob + default_motion_mode_prob[BLOCK_SIZES_ALL][MOTION_MODES - 1] = { +#if CONFIG_CHROMA_2X2 || CONFIG_CHROMA_SUB8X8 { 255 }, { 255 }, { 255 }, #endif { 255 }, { 255 }, { 255 }, { 151 }, { 153 }, { 144 }, { 178 }, @@ -1121,17 +771,103 @@ static const aom_prob default_motion_mode_prob[BLOCK_SIZES][MOTION_MODES - 1] = #if CONFIG_EXT_PARTITION { 252 }, { 252 }, { 252 }, #endif // CONFIG_EXT_PARTITION + { 208 }, { 208 }, { 208 }, { 208 }, + }; + +static const aom_cdf_prob + default_motion_mode_cdf[BLOCK_SIZES_ALL][CDF_SIZE(MOTION_MODES)] = { +#if CONFIG_CHROMA_2X2 || CONFIG_CHROMA_SUB8X8 + { AOM_ICDF(255 * 128), AOM_ICDF(32768), 0 }, + { AOM_ICDF(255 * 128), AOM_ICDF(32768), 0 }, + { AOM_ICDF(255 * 128), AOM_ICDF(32768), 0 }, +#endif + { AOM_ICDF(255 * 128), AOM_ICDF(32768), 0 }, + { AOM_ICDF(255 * 128), AOM_ICDF(32768), 0 }, + { AOM_ICDF(255 * 128), AOM_ICDF(32768), 0 }, + { AOM_ICDF(151 * 128), AOM_ICDF(32768), 0 }, + { AOM_ICDF(153 * 128), AOM_ICDF(32768), 0 }, + { AOM_ICDF(144 * 128), AOM_ICDF(32768), 0 }, + { AOM_ICDF(178 * 128), AOM_ICDF(32768), 0 }, + { AOM_ICDF(165 * 128), AOM_ICDF(32768), 0 }, + { AOM_ICDF(160 * 128), AOM_ICDF(32768), 0 }, + { AOM_ICDF(207 * 128), AOM_ICDF(32768), 0 }, + { AOM_ICDF(195 * 128), AOM_ICDF(32768), 0 }, + { AOM_ICDF(168 * 128), AOM_ICDF(32768), 0 }, + { AOM_ICDF(244 * 128), AOM_ICDF(32768), 0 }, +#if CONFIG_EXT_PARTITION + { AOM_ICDF(252 * 128), AOM_ICDF(32768), 0 }, + { AOM_ICDF(252 * 128), AOM_ICDF(32768), 0 }, + { AOM_ICDF(252 * 128), AOM_ICDF(32768), 0 }, +#endif // CONFIG_EXT_PARTITION + { AOM_ICDF(255 * 128), AOM_ICDF(32768), 0 }, + { AOM_ICDF(255 * 128), AOM_ICDF(32768), 0 }, + { AOM_ICDF(255 * 128), AOM_ICDF(32768), 0 }, + { AOM_ICDF(255 * 128), AOM_ICDF(32768), 0 }, }; +#else +// TODO(weitinglin): The default probability is copied from warped motion right +// now as a place holder. It needs to be fined tuned after +// NCOBMC_ADAPT_WEIGHT is actually implemented. Also needs to +// change this section appropriately once warped motion is +// supported. +const aom_tree_index av1_motion_mode_tree[TREE_SIZE(MOTION_MODES)] = { + -SIMPLE_TRANSLATION, 2, -OBMC_CAUSAL, -NCOBMC_ADAPT_WEIGHT, +}; +static const aom_prob + default_motion_mode_prob[BLOCK_SIZES_ALL][MOTION_MODES - 1] = { +#if CONFIG_CHROMA_2X2 || CONFIG_CHROMA_SUB8X8 + { 255, 200 }, { 255, 200 }, { 255, 200 }, +#endif + { 255, 200 }, { 255, 200 }, { 255, 200 }, { 151, 200 }, { 153, 200 }, + { 144, 200 }, { 178, 200 }, { 165, 200 }, { 160, 200 }, { 207, 200 }, + { 195, 200 }, { 168, 200 }, { 244, 200 }, +#if CONFIG_EXT_PARTITION + { 252, 200 }, { 252, 200 }, { 252, 200 }, +#endif // CONFIG_EXT_PARTITION + { 255, 200 }, { 255, 200 }, { 255, 200 }, { 255, 200 }, + }; +static const aom_cdf_prob + default_motion_mode_cdf[BLOCK_SIZES_ALL][CDF_SIZE(MOTION_MODES)] = { +#if CONFIG_CHROMA_2X2 || CONFIG_CHROMA_SUB8X8 + { AOM_ICDF(16384), AOM_ICDF(24576), AOM_ICDF(32768), 0 }, + { AOM_ICDF(16384), AOM_ICDF(24576), AOM_ICDF(32768), 0 }, + { AOM_ICDF(16384), AOM_ICDF(24576), AOM_ICDF(32768), 0 }, +#endif + { AOM_ICDF(16384), AOM_ICDF(24576), AOM_ICDF(32768), 0 }, + { AOM_ICDF(16384), AOM_ICDF(24576), AOM_ICDF(32768), 0 }, + { AOM_ICDF(16384), AOM_ICDF(24576), AOM_ICDF(32768), 0 }, + { AOM_ICDF(7936), AOM_ICDF(19091), AOM_ICDF(32768), 0 }, + { AOM_ICDF(4991), AOM_ICDF(19205), AOM_ICDF(32768), 0 }, + { AOM_ICDF(4992), AOM_ICDF(19314), AOM_ICDF(32768), 0 }, + { AOM_ICDF(15104), AOM_ICDF(21590), AOM_ICDF(32768), 0 }, + { AOM_ICDF(9855), AOM_ICDF(21043), AOM_ICDF(32768), 0 }, + { AOM_ICDF(12800), AOM_ICDF(22238), AOM_ICDF(32768), 0 }, + { AOM_ICDF(24320), AOM_ICDF(26498), AOM_ICDF(32768), 0 }, + { AOM_ICDF(26496), AOM_ICDF(28995), AOM_ICDF(32768), 0 }, + { AOM_ICDF(25216), AOM_ICDF(28166), AOM_ICDF(32768), 0 }, + { AOM_ICDF(30592), AOM_ICDF(31238), AOM_ICDF(32768), 0 }, +#if CONFIG_EXT_PARTITION + { AOM_ICDF(32256), AOM_ICDF(32656), AOM_ICDF(32768), 0 }, + { AOM_ICDF(32256), AOM_ICDF(32656), AOM_ICDF(32768), 0 }, + { AOM_ICDF(32256), AOM_ICDF(32656), AOM_ICDF(32768), 0 }, +#endif + { AOM_ICDF(32640), AOM_ICDF(32740), AOM_ICDF(32768), 0 }, + { AOM_ICDF(32640), AOM_ICDF(32740), AOM_ICDF(32768), 0 }, + { AOM_ICDF(32640), AOM_ICDF(32740), AOM_ICDF(32768), 0 }, + { AOM_ICDF(32640), AOM_ICDF(32740), AOM_ICDF(32768), 0 }, + }; +#endif // CONFIG_NCOBMC_ADAPT_WEIGHT + #elif !CONFIG_MOTION_VAR && CONFIG_WARPED_MOTION const aom_tree_index av1_motion_mode_tree[TREE_SIZE(MOTION_MODES)] = { -SIMPLE_TRANSLATION, -WARPED_CAUSAL }; -static const aom_prob default_motion_mode_prob[BLOCK_SIZES][MOTION_MODES - 1] = - { -#if CONFIG_CB4X4 +static const aom_prob + default_motion_mode_prob[BLOCK_SIZES_ALL][MOTION_MODES - 1] = { +#if CONFIG_CHROMA_2X2 || CONFIG_CHROMA_SUB8X8 { 255 }, { 255 }, { 255 }, #endif { 255 }, { 255 }, { 255 }, { 151 }, { 153 }, { 144 }, { 178 }, @@ -1139,6 +875,38 @@ static const aom_prob default_motion_mode_prob[BLOCK_SIZES][MOTION_MODES - 1] = #if CONFIG_EXT_PARTITION { 252 }, { 252 }, { 252 }, #endif // CONFIG_EXT_PARTITION + { 208 }, { 208 }, { 208 }, { 208 }, + }; + +static const aom_cdf_prob + default_motion_mode_cdf[BLOCK_SIZES_ALL][CDF_SIZE(MOTION_MODES)] = { +#if CONFIG_CHROMA_2X2 || CONFIG_CHROMA_SUB8X8 + { AOM_ICDF(255 * 128), AOM_ICDF(32768), 0 }, + { AOM_ICDF(255 * 128), AOM_ICDF(32768), 0 }, + { AOM_ICDF(255 * 128), AOM_ICDF(32768), 0 }, +#endif + { AOM_ICDF(255 * 128), AOM_ICDF(32768), 0 }, + { AOM_ICDF(255 * 128), AOM_ICDF(32768), 0 }, + { AOM_ICDF(255 * 128), AOM_ICDF(32768), 0 }, + { AOM_ICDF(151 * 128), AOM_ICDF(32768), 0 }, + { AOM_ICDF(153 * 128), AOM_ICDF(32768), 0 }, + { AOM_ICDF(144 * 128), AOM_ICDF(32768), 0 }, + { AOM_ICDF(178 * 128), AOM_ICDF(32768), 0 }, + { AOM_ICDF(165 * 128), AOM_ICDF(32768), 0 }, + { AOM_ICDF(160 * 128), AOM_ICDF(32768), 0 }, + { AOM_ICDF(207 * 128), AOM_ICDF(32768), 0 }, + { AOM_ICDF(195 * 128), AOM_ICDF(32768), 0 }, + { AOM_ICDF(168 * 128), AOM_ICDF(32768), 0 }, + { AOM_ICDF(244 * 128), AOM_ICDF(32768), 0 }, +#if CONFIG_EXT_PARTITION + { AOM_ICDF(252 * 128), AOM_ICDF(32768), 0 }, + { AOM_ICDF(252 * 128), AOM_ICDF(32768), 0 }, + { AOM_ICDF(252 * 128), AOM_ICDF(32768), 0 }, +#endif // CONFIG_EXT_PARTITION + { AOM_ICDF(255 * 128), AOM_ICDF(32768), 0 }, + { AOM_ICDF(255 * 128), AOM_ICDF(32768), 0 }, + { AOM_ICDF(255 * 128), AOM_ICDF(32768), 0 }, + { AOM_ICDF(255 * 128), AOM_ICDF(32768), 0 }, }; #elif CONFIG_MOTION_VAR && CONFIG_WARPED_MOTION @@ -1146,29 +914,94 @@ static const aom_prob default_motion_mode_prob[BLOCK_SIZES][MOTION_MODES - 1] = const aom_tree_index av1_motion_mode_tree[TREE_SIZE(MOTION_MODES)] = { -SIMPLE_TRANSLATION, 2, -OBMC_CAUSAL, -WARPED_CAUSAL, }; -static const aom_prob default_motion_mode_prob[BLOCK_SIZES][MOTION_MODES - 1] = - { -#if CONFIG_CB4X4 - { 255, 200 }, { 255, 200 }, { 255, 200 }, + +static const aom_prob + default_motion_mode_prob[BLOCK_SIZES_ALL][MOTION_MODES - 1] = { +#if CONFIG_CHROMA_2X2 || CONFIG_CHROMA_SUB8X8 + { 128, 128 }, { 128, 128 }, { 128, 128 }, #endif - { 255, 200 }, { 255, 200 }, { 255, 200 }, { 151, 200 }, { 153, 200 }, - { 144, 200 }, { 178, 200 }, { 165, 200 }, { 160, 200 }, { 207, 200 }, - { 195, 200 }, { 168, 200 }, { 244, 200 }, + { 128, 128 }, { 128, 128 }, { 128, 128 }, { 62, 115 }, { 39, 131 }, + { 39, 132 }, { 118, 94 }, { 77, 125 }, { 100, 121 }, { 190, 66 }, + { 207, 102 }, { 197, 100 }, { 239, 76 }, #if CONFIG_EXT_PARTITION { 252, 200 }, { 252, 200 }, { 252, 200 }, #endif // CONFIG_EXT_PARTITION + { 208, 200 }, { 208, 200 }, { 208, 200 }, { 208, 200 }, + }; +static const aom_cdf_prob + default_motion_mode_cdf[BLOCK_SIZES_ALL][CDF_SIZE(MOTION_MODES)] = { +#if CONFIG_CHROMA_2X2 || CONFIG_CHROMA_SUB8X8 + { AOM_ICDF(16384), AOM_ICDF(24576), AOM_ICDF(32768), 0 }, + { AOM_ICDF(16384), AOM_ICDF(24576), AOM_ICDF(32768), 0 }, + { AOM_ICDF(16384), AOM_ICDF(24576), AOM_ICDF(32768), 0 }, +#endif + { AOM_ICDF(16384), AOM_ICDF(24576), AOM_ICDF(32768), 0 }, + { AOM_ICDF(16384), AOM_ICDF(24576), AOM_ICDF(32768), 0 }, + { AOM_ICDF(16384), AOM_ICDF(24576), AOM_ICDF(32768), 0 }, + { AOM_ICDF(7936), AOM_ICDF(19091), AOM_ICDF(32768), 0 }, + { AOM_ICDF(4991), AOM_ICDF(19205), AOM_ICDF(32768), 0 }, + { AOM_ICDF(4992), AOM_ICDF(19314), AOM_ICDF(32768), 0 }, + { AOM_ICDF(15104), AOM_ICDF(21590), AOM_ICDF(32768), 0 }, + { AOM_ICDF(9855), AOM_ICDF(21043), AOM_ICDF(32768), 0 }, + { AOM_ICDF(12800), AOM_ICDF(22238), AOM_ICDF(32768), 0 }, + { AOM_ICDF(24320), AOM_ICDF(26498), AOM_ICDF(32768), 0 }, + { AOM_ICDF(26496), AOM_ICDF(28995), AOM_ICDF(32768), 0 }, + { AOM_ICDF(25216), AOM_ICDF(28166), AOM_ICDF(32768), 0 }, + { AOM_ICDF(30592), AOM_ICDF(31238), AOM_ICDF(32768), 0 }, +#if CONFIG_EXT_PARTITION + { AOM_ICDF(32256), AOM_ICDF(32656), AOM_ICDF(32768), 0 }, + { AOM_ICDF(32256), AOM_ICDF(32656), AOM_ICDF(32768), 0 }, + { AOM_ICDF(32256), AOM_ICDF(32656), AOM_ICDF(32768), 0 }, +#endif + { AOM_ICDF(32640), AOM_ICDF(32740), AOM_ICDF(32768), 0 }, + { AOM_ICDF(32640), AOM_ICDF(32740), AOM_ICDF(32768), 0 }, + { AOM_ICDF(32640), AOM_ICDF(32740), AOM_ICDF(32768), 0 }, + { AOM_ICDF(32640), AOM_ICDF(32740), AOM_ICDF(32768), 0 }, }; // Probability for the case that only 1 additional motion mode is allowed -static const aom_prob default_obmc_prob[BLOCK_SIZES] = { -#if CONFIG_CB4X4 - 255, 255, 255, +static const aom_prob default_obmc_prob[BLOCK_SIZES_ALL] = { +#if CONFIG_CHROMA_2X2 || CONFIG_CHROMA_SUB8X8 + 128, 128, 128, #endif - 255, 255, 255, 151, 153, 144, 178, 165, 160, 207, 195, 168, 244, + 128, 128, 128, 45, 79, 75, 130, 141, 144, 208, 201, 186, 231, #if CONFIG_EXT_PARTITION 252, 252, 252, #endif // CONFIG_EXT_PARTITION + 208, 208, 208, 208, +}; + +#if CONFIG_NEW_MULTISYMBOL +static const aom_cdf_prob default_obmc_cdf[BLOCK_SIZES_ALL][CDF_SIZE(2)] = { +#if CONFIG_CHROMA_2X2 || CONFIG_CHROMA_SUB8X8 + { AOM_ICDF(128 * 128), AOM_ICDF(32768), 0 }, + { AOM_ICDF(128 * 128), AOM_ICDF(32768), 0 }, + { AOM_ICDF(128 * 128), AOM_ICDF(32768), 0 }, +#endif + { AOM_ICDF(128 * 128), AOM_ICDF(32768), 0 }, + { AOM_ICDF(128 * 128), AOM_ICDF(32768), 0 }, + { AOM_ICDF(128 * 128), AOM_ICDF(32768), 0 }, + { AOM_ICDF(45 * 128), AOM_ICDF(32768), 0 }, + { AOM_ICDF(79 * 128), AOM_ICDF(32768), 0 }, + { AOM_ICDF(75 * 128), AOM_ICDF(32768), 0 }, + { AOM_ICDF(130 * 128), AOM_ICDF(32768), 0 }, + { AOM_ICDF(141 * 128), AOM_ICDF(32768), 0 }, + { AOM_ICDF(144 * 128), AOM_ICDF(32768), 0 }, + { AOM_ICDF(208 * 128), AOM_ICDF(32768), 0 }, + { AOM_ICDF(201 * 128), AOM_ICDF(32768), 0 }, + { AOM_ICDF(186 * 128), AOM_ICDF(32768), 0 }, + { AOM_ICDF(231 * 128), AOM_ICDF(32768), 0 }, +#if CONFIG_EXT_PARTITION + { AOM_ICDF(252 * 128), AOM_ICDF(32768), 0 }, + { AOM_ICDF(252 * 128), AOM_ICDF(32768), 0 }, + { AOM_ICDF(252 * 128), AOM_ICDF(32768), 0 }, +#endif // CONFIG_EXT_PARTITION + { AOM_ICDF(208 * 128), AOM_ICDF(32768), 0 }, + { AOM_ICDF(208 * 128), AOM_ICDF(32768), 0 }, + { AOM_ICDF(208 * 128), AOM_ICDF(32768), 0 }, + { AOM_ICDF(208 * 128), AOM_ICDF(32768), 0 }, }; +#endif // CONFIG_NEW_MULTISYMBOL #endif #if CONFIG_DELTA_Q @@ -1184,10 +1017,6 @@ static const aom_cdf_prob default_delta_lf_cdf[CDF_SIZE(DELTA_LF_PROBS + 1)] = { }; #endif #endif -int av1_intra_mode_ind[INTRA_MODES]; -int av1_intra_mode_inv[INTRA_MODES]; -int av1_inter_mode_ind[INTER_MODES]; -int av1_inter_mode_inv[INTER_MODES]; #if CONFIG_EXT_TX int av1_ext_tx_intra_ind[EXT_TX_SETS_INTRA][TX_TYPES]; int av1_ext_tx_intra_inv[EXT_TX_SETS_INTRA][TX_TYPES]; @@ -1197,65 +1026,23 @@ int av1_ext_tx_inter_inv[EXT_TX_SETS_INTER][TX_TYPES]; #if CONFIG_ALT_INTRA #if CONFIG_SMOOTH_HV -const aom_tree_index av1_intra_mode_tree[TREE_SIZE(INTRA_MODES)] = { - -DC_PRED, - 2, /* 0 = DC_NODE */ - -TM_PRED, - 4, /* 1 = TM_NODE */ - -V_PRED, - 6, /* 2 = V_NODE */ - 8, - 12, /* 3 = COM_NODE */ - -H_PRED, - 10, /* 4 = H_NODE */ - -D135_PRED, - -D117_PRED, /* 5 = D135_NODE */ - -D45_PRED, - 14, /* 6 = D45_NODE */ - -D63_PRED, - 16, /* 7 = D63_NODE */ - -D153_PRED, - 18, /* 8 = D153_NODE */ - -D207_PRED, - 20, /* 9 = D207_NODE */ - -SMOOTH_PRED, - 22, /* 10 = SMOOTH_NODE */ - -SMOOTH_V_PRED, - -SMOOTH_H_PRED /* 11 = SMOOTH_V_NODE */ -}; +const int av1_intra_mode_ind[INTRA_MODES] = { 0, 2, 3, 6, 4, 5, 8, + 9, 7, 10, 11, 12, 1 }; +const int av1_intra_mode_inv[INTRA_MODES] = { 0, 12, 1, 2, 4, 5, 3, + 8, 6, 7, 9, 10, 11 }; #else -const aom_tree_index av1_intra_mode_tree[TREE_SIZE(INTRA_MODES)] = { - -DC_PRED, 2, /* 0 = DC_NODE */ - -TM_PRED, 4, /* 1 = TM_NODE */ - -V_PRED, 6, /* 2 = V_NODE */ - 8, 12, /* 3 = COM_NODE */ - -H_PRED, 10, /* 4 = H_NODE */ - -D135_PRED, -D117_PRED, /* 5 = D135_NODE */ - -D45_PRED, 14, /* 6 = D45_NODE */ - -D63_PRED, 16, /* 7 = D63_NODE */ - -D153_PRED, 18, /* 8 = D153_NODE */ - -D207_PRED, -SMOOTH_PRED, /* 9 = D207_NODE */ +const int av1_intra_mode_ind[INTRA_MODES] = { + 0, 2, 3, 6, 4, 5, 8, 9, 7, 10, 1 +}; +const int av1_intra_mode_inv[INTRA_MODES] = { + 0, 10, 1, 2, 4, 5, 3, 8, 6, 7, 9 }; #endif // CONFIG_SMOOTH_HV #else -const aom_tree_index av1_intra_mode_tree[TREE_SIZE(INTRA_MODES)] = { - -DC_PRED, 2, /* 0 = DC_NODE */ - -TM_PRED, 4, /* 1 = TM_NODE */ - -V_PRED, 6, /* 2 = V_NODE */ - 8, 12, /* 3 = COM_NODE */ - -H_PRED, 10, /* 4 = H_NODE */ - -D135_PRED, -D117_PRED, /* 5 = D135_NODE */ - -D45_PRED, 14, /* 6 = D45_NODE */ - -D63_PRED, 16, /* 7 = D63_NODE */ - -D153_PRED, -D207_PRED /* 8 = D153_NODE */ -}; +const int av1_intra_mode_ind[INTRA_MODES] = { 0, 2, 3, 6, 4, 5, 8, 9, 7, 1 }; +const int av1_intra_mode_inv[INTRA_MODES] = { 0, 9, 1, 2, 4, 5, 3, 8, 6, 7 }; #endif // CONFIG_ALT_INTRA -const aom_tree_index av1_inter_mode_tree[TREE_SIZE(INTER_MODES)] = { - -INTER_OFFSET(ZEROMV), 2, -INTER_OFFSET(NEARESTMV), 4, -INTER_OFFSET(NEARMV), - -INTER_OFFSET(NEWMV) -}; - #if CONFIG_EXT_INTER /* clang-format off */ #if CONFIG_INTERINTRA @@ -1282,6 +1069,8 @@ const aom_tree_index av1_inter_compound_mode_tree }; #if CONFIG_COMPOUND_SINGLEREF +// TODO(zoeliu): To redesign the tree structure once the number of mode changes. +/* const aom_tree_index av1_inter_singleref_comp_mode_tree [TREE_SIZE(INTER_SINGLEREF_COMP_MODES)] = { -INTER_SINGLEREF_COMP_OFFSET(SR_ZERO_NEWMV), 2, @@ -1289,6 +1078,14 @@ const aom_tree_index av1_inter_singleref_comp_mode_tree 6, -INTER_SINGLEREF_COMP_OFFSET(SR_NEW_NEWMV), -INTER_SINGLEREF_COMP_OFFSET(SR_NEAREST_NEWMV), -INTER_SINGLEREF_COMP_OFFSET(SR_NEAR_NEWMV) +};*/ + +const aom_tree_index av1_inter_singleref_comp_mode_tree + [TREE_SIZE(INTER_SINGLEREF_COMP_MODES)] = { + -INTER_SINGLEREF_COMP_OFFSET(SR_ZERO_NEWMV), 2, + -INTER_SINGLEREF_COMP_OFFSET(SR_NEAREST_NEARMV), 4, + -INTER_SINGLEREF_COMP_OFFSET(SR_NEAR_NEWMV), + -INTER_SINGLEREF_COMP_OFFSET(SR_NEW_NEWMV) }; #endif // CONFIG_COMPOUND_SINGLEREF @@ -1321,94 +1118,373 @@ const aom_tree_index av1_ext_partition_tree[TREE_SIZE(EXT_PARTITION_TYPES)] = { 6, 4, 8, -PARTITION_SPLIT, -PARTITION_HORZ, 10, - -PARTITION_VERT, 12, - -PARTITION_HORZ_A, -PARTITION_HORZ_B, - -PARTITION_VERT_A, -PARTITION_VERT_B + -PARTITION_VERT, 14, + + -PARTITION_HORZ_A, 12, + -PARTITION_HORZ_B, -PARTITION_HORZ_4, + + -PARTITION_VERT_A, 16, + -PARTITION_VERT_B, -PARTITION_VERT_4 }; /* clang-format on */ #endif // CONFIG_EXT_PARTITION_TYPES static const aom_prob default_intra_inter_p[INTRA_INTER_CONTEXTS] = { - 9, 102, 187, 225 + 6, 97, 151, 205, }; +#if CONFIG_NEW_MULTISYMBOL +static const aom_cdf_prob + default_intra_inter_cdf[INTRA_INTER_CONTEXTS][CDF_SIZE(2)] = { + { AOM_ICDF(768), AOM_ICDF(32768), 0 }, + { AOM_ICDF(12416), AOM_ICDF(32768), 0 }, + { AOM_ICDF(19328), AOM_ICDF(32768), 0 }, + { AOM_ICDF(26240), AOM_ICDF(32768), 0 } + }; +#endif + static const aom_prob default_comp_inter_p[COMP_INTER_CONTEXTS] = { - 239, 183, 119, 96, 41 +#if !CONFIG_EXT_COMP_REFS + 216, 170, 131, 92, 42 +#else // CONFIG_EXT_COMP_REFS + 206, 182, 117, 104, 32 +#endif // !CONFIG_EXT_COMP_REFS }; +#if CONFIG_NEW_MULTISYMBOL +static const aom_cdf_prob + default_comp_inter_cdf[COMP_INTER_CONTEXTS][CDF_SIZE(2)] = { +#if !CONFIG_EXT_COMP_REFS + { AOM_ICDF(216 * 128), AOM_ICDF(32768), 0 }, + { AOM_ICDF(170 * 128), AOM_ICDF(32768), 0 }, + { AOM_ICDF(131 * 128), AOM_ICDF(32768), 0 }, + { AOM_ICDF(92 * 128), AOM_ICDF(32768), 0 }, + { AOM_ICDF(42 * 128), AOM_ICDF(32768), 0 } +#else // CONFIG_EXT_COMP_REFS + { AOM_ICDF(206 * 128), AOM_ICDF(32768), 0 }, + { AOM_ICDF(182 * 128), AOM_ICDF(32768), 0 }, + { AOM_ICDF(117 * 128), AOM_ICDF(32768), 0 }, + { AOM_ICDF(104 * 128), AOM_ICDF(32768), 0 }, + { AOM_ICDF(32 * 128), AOM_ICDF(32768), 0 } +#endif // !CONFIG_EXT_COMP_REFS + }; +#endif // CONFIG_NEW_MULTISYMBOL + +#if CONFIG_EXT_COMP_REFS +static const aom_prob default_comp_ref_type_p[COMP_REF_TYPE_CONTEXTS] = { + 8, 20, 78, 91, 194 +}; +static const aom_prob + default_uni_comp_ref_p[UNI_COMP_REF_CONTEXTS][UNIDIR_COMP_REFS - 1] = { + { 88, 30, 28 }, { 218, 97, 105 }, { 254, 180, 196 } + }; + +#if CONFIG_NEW_MULTISYMBOL +static const aom_cdf_prob + default_comp_ref_type_cdf[COMP_REF_TYPE_CONTEXTS][CDF_SIZE(2)] = { + { AOM_ICDF(8 * 128), AOM_ICDF(32768), 0 }, + { AOM_ICDF(20 * 128), AOM_ICDF(32768), 0 }, + { AOM_ICDF(78 * 128), AOM_ICDF(32768), 0 }, + { AOM_ICDF(91 * 128), AOM_ICDF(32768), 0 }, + { AOM_ICDF(194 * 128), AOM_ICDF(32768), 0 } + }; +static const aom_cdf_prob + default_uni_comp_ref_cdf[UNI_COMP_REF_CONTEXTS][UNIDIR_COMP_REFS - 1] + [CDF_SIZE(2)] = { + { { AOM_ICDF(88 * 128), AOM_ICDF(32768), 0 }, + { AOM_ICDF(30 * 128), AOM_ICDF(32768), 0 }, + { AOM_ICDF(28 * 128), AOM_ICDF(32768), 0 } }, + { { AOM_ICDF(218 * 128), AOM_ICDF(32768), 0 }, + { AOM_ICDF(97 * 128), AOM_ICDF(32768), 0 }, + { AOM_ICDF(105 * 128), AOM_ICDF(32768), 0 } }, + { { AOM_ICDF(254 * 128), AOM_ICDF(32768), 0 }, + { AOM_ICDF(180 * 128), AOM_ICDF(32768), 0 }, + { AOM_ICDF(196 * 128), AOM_ICDF(32768), 0 } } + }; +#endif // CONFIG_NEW_MULTISYMBOL +#endif // CONFIG_EXT_COMP_REFS + #if CONFIG_EXT_REFS static const aom_prob default_comp_ref_p[REF_CONTEXTS][FWD_REFS - 1] = { - // TODO(zoeliu): To adjust the initial prob values. +#if !CONFIG_EXT_COMP_REFS { 33, 16, 16 }, { 77, 74, 74 }, { 142, 142, 142 }, { 172, 170, 170 }, { 238, 247, 247 } +#else // CONFIG_EXT_COMP_REFS + { 21, 7, 5 }, + { 68, 20, 16 }, + { 128, 56, 36 }, + { 197, 111, 139 }, + { 238, 131, 136 } +#endif // !CONFIG_EXT_COMP_REFS }; + static const aom_prob default_comp_bwdref_p[REF_CONTEXTS][BWD_REFS - 1] = { +#if CONFIG_ALTREF2 + // TODO(zoeliu): ALTREF2 to work with EXT_COMP_REFS and NEW_MULTISYMBOL. + { 50, 50 }, + { 130, 130 }, + { 210, 210 }, + { 128, 128 }, + { 128, 128 } +#else // !CONFIG_ALTREF2 +#if !CONFIG_EXT_COMP_REFS { 16 }, { 74 }, { 142 }, { 170 }, { 247 } +#else // CONFIG_EXT_COMP_REFS + { 7 }, { 56 }, { 29 }, { 230 }, { 220 } +#endif // CONFIG_EXT_COMP_REFS +#endif // CONFIG_ALTREF2 }; -#else + +#if CONFIG_NEW_MULTISYMBOL +static const aom_cdf_prob + default_comp_ref_cdf[REF_CONTEXTS][FWD_REFS - 1][CDF_SIZE(2)] = { +#if !CONFIG_EXT_COMP_REFS + { { AOM_ICDF(33 * 128), AOM_ICDF(32768), 0 }, + { AOM_ICDF(16 * 128), AOM_ICDF(32768), 0 }, + { AOM_ICDF(16 * 128), AOM_ICDF(32768), 0 } }, + { { AOM_ICDF(77 * 128), AOM_ICDF(32768), 0 }, + { AOM_ICDF(74 * 128), AOM_ICDF(32768), 0 }, + { AOM_ICDF(74 * 128), AOM_ICDF(32768), 0 } }, + { { AOM_ICDF(142 * 128), AOM_ICDF(32768), 0 }, + { AOM_ICDF(142 * 128), AOM_ICDF(32768), 0 }, + { AOM_ICDF(142 * 128), AOM_ICDF(32768), 0 } }, + { { AOM_ICDF(172 * 128), AOM_ICDF(32768), 0 }, + { AOM_ICDF(170 * 128), AOM_ICDF(32768), 0 }, + { AOM_ICDF(170 * 128), AOM_ICDF(32768), 0 } }, + { { AOM_ICDF(238 * 128), AOM_ICDF(32768), 0 }, + { AOM_ICDF(247 * 128), AOM_ICDF(32768), 0 }, + { AOM_ICDF(247 * 128), AOM_ICDF(32768), 0 } } +#else // CONFIG_EXT_COMP_REFS + { { AOM_ICDF(21 * 128), AOM_ICDF(32768), 0 }, + { AOM_ICDF(7 * 128), AOM_ICDF(32768), 0 }, + { AOM_ICDF(5 * 128), AOM_ICDF(32768), 0 } }, + { { AOM_ICDF(68 * 128), AOM_ICDF(32768), 0 }, + { AOM_ICDF(20 * 128), AOM_ICDF(32768), 0 }, + { AOM_ICDF(16 * 128), AOM_ICDF(32768), 0 } }, + { { AOM_ICDF(128 * 128), AOM_ICDF(32768), 0 }, + { AOM_ICDF(56 * 128), AOM_ICDF(32768), 0 }, + { AOM_ICDF(36 * 128), AOM_ICDF(32768), 0 } }, + { { AOM_ICDF(197 * 128), AOM_ICDF(32768), 0 }, + { AOM_ICDF(111 * 128), AOM_ICDF(32768), 0 }, + { AOM_ICDF(139 * 128), AOM_ICDF(32768), 0 } }, + { { AOM_ICDF(238 * 128), AOM_ICDF(32768), 0 }, + { AOM_ICDF(131 * 128), AOM_ICDF(32768), 0 }, + { AOM_ICDF(136 * 128), AOM_ICDF(32768), 0 } } +#endif // !CONFIG_EXT_COMP_REFS + }; + +static const aom_cdf_prob + default_comp_bwdref_cdf[REF_CONTEXTS][BWD_REFS - 1][CDF_SIZE(2)] = { +#if !CONFIG_EXT_COMP_REFS + { { AOM_ICDF(16 * 128), AOM_ICDF(32768), 0 } }, + { { AOM_ICDF(74 * 128), AOM_ICDF(32768), 0 } }, + { { AOM_ICDF(142 * 128), AOM_ICDF(32768), 0 } }, + { { AOM_ICDF(170 * 128), AOM_ICDF(32768), 0 } }, + { { AOM_ICDF(247 * 128), AOM_ICDF(32768), 0 } } +#else // CONFIG_EXT_COMP_REFS + { { AOM_ICDF(7 * 128), AOM_ICDF(32768), 0 } }, + { { AOM_ICDF(56 * 128), AOM_ICDF(32768), 0 } }, + { { AOM_ICDF(29 * 128), AOM_ICDF(32768), 0 } }, + { { AOM_ICDF(230 * 128), AOM_ICDF(32768), 0 } }, + { { AOM_ICDF(220 * 128), AOM_ICDF(32768), 0 } } +#endif // !CONFIG_EXT_COMP_REFS + }; +#endif // CONFIG_NEW_MULTISYMBOL + +#else // !CONFIG_EXT_REFS + static const aom_prob default_comp_ref_p[REF_CONTEXTS][COMP_REFS - 1] = { - { 50 }, { 126 }, { 123 }, { 221 }, { 226 } + { 43 }, { 100 }, { 137 }, { 212 }, { 229 }, }; +#if CONFIG_NEW_MULTISYMBOL +static const aom_cdf_prob + default_comp_ref_cdf[REF_CONTEXTS][COMP_REFS - 1][CDF_SIZE(2)] = { + { { AOM_ICDF(43 * 128), AOM_ICDF(32768), 0 } }, + { { AOM_ICDF(100 * 128), AOM_ICDF(32768), 0 } }, + { { AOM_ICDF(137 * 128), AOM_ICDF(32768), 0 } }, + { { AOM_ICDF(212 * 128), AOM_ICDF(32768), 0 } }, + { { AOM_ICDF(229 * 128), AOM_ICDF(32768), 0 } } + }; +#endif // CONFIG_NEW_MULTISYMBOL #endif // CONFIG_EXT_REFS static const aom_prob default_single_ref_p[REF_CONTEXTS][SINGLE_REFS - 1] = { #if CONFIG_EXT_REFS +#if CONFIG_ALTREF2 + // TODO(zoeliu): ALTREF2 to work with EXT_COMP_REFS and NEW_MULTISYMBOL. + { 33, 50, 16, 16, 16, 50 }, + { 77, 130, 74, 74, 74, 130 }, + { 142, 210, 142, 142, 142, 210 }, + { 172, 128, 170, 170, 170, 128 }, + { 238, 128, 247, 247, 247, 128 } +#else // !CONFIG_ALTREF2 +#if !CONFIG_EXT_COMP_REFS { 33, 16, 16, 16, 16 }, { 77, 74, 74, 74, 74 }, { 142, 142, 142, 142, 142 }, { 172, 170, 170, 170, 170 }, { 238, 247, 247, 247, 247 } -#else - { 33, 16 }, { 77, 74 }, { 142, 142 }, { 172, 170 }, { 238, 247 } +#else // CONFIG_EXT_COMP_REFS + { 36, 2, 28, 58, 9 }, + { 64, 22, 60, 122, 40 }, + { 153, 69, 126, 179, 71 }, + { 128, 174, 189, 216, 101 }, + { 233, 252, 228, 246, 200 } +#endif // !CONFIG_EXT_COMP_REFS +#endif // CONFIG_ALTREF2 +#else // !CONFIG_EXT_REFS + { 31, 25 }, { 72, 80 }, { 147, 148 }, { 197, 191 }, { 235, 247 }, #endif // CONFIG_EXT_REFS }; +#if CONFIG_NEW_MULTISYMBOL +static const aom_cdf_prob + default_single_ref_cdf[REF_CONTEXTS][SINGLE_REFS - 1][CDF_SIZE(2)] = { +#if CONFIG_EXT_REFS +#if !CONFIG_EXT_COMP_REFS + { { AOM_ICDF(33 * 128), AOM_ICDF(32768), 0 }, + { AOM_ICDF(16 * 128), AOM_ICDF(32768), 0 }, + { AOM_ICDF(16 * 128), AOM_ICDF(32768), 0 }, + { AOM_ICDF(16 * 128), AOM_ICDF(32768), 0 }, + { AOM_ICDF(16 * 128), AOM_ICDF(32768), 0 } }, + { { AOM_ICDF(77 * 128), AOM_ICDF(32768), 0 }, + { AOM_ICDF(74 * 128), AOM_ICDF(32768), 0 }, + { AOM_ICDF(74 * 128), AOM_ICDF(32768), 0 }, + { AOM_ICDF(74 * 128), AOM_ICDF(32768), 0 }, + { AOM_ICDF(74 * 128), AOM_ICDF(32768), 0 } }, + { { AOM_ICDF(142 * 128), AOM_ICDF(32768), 0 }, + { AOM_ICDF(142 * 128), AOM_ICDF(32768), 0 }, + { AOM_ICDF(142 * 128), AOM_ICDF(32768), 0 }, + { AOM_ICDF(142 * 128), AOM_ICDF(32768), 0 }, + { AOM_ICDF(142 * 128), AOM_ICDF(32768), 0 } }, + { { AOM_ICDF(172 * 128), AOM_ICDF(32768), 0 }, + { AOM_ICDF(170 * 128), AOM_ICDF(32768), 0 }, + { AOM_ICDF(170 * 128), AOM_ICDF(32768), 0 }, + { AOM_ICDF(170 * 128), AOM_ICDF(32768), 0 }, + { AOM_ICDF(170 * 128), AOM_ICDF(32768), 0 } }, + { { AOM_ICDF(238 * 128), AOM_ICDF(32768), 0 }, + { AOM_ICDF(247 * 128), AOM_ICDF(32768), 0 }, + { AOM_ICDF(247 * 128), AOM_ICDF(32768), 0 }, + { AOM_ICDF(247 * 128), AOM_ICDF(32768), 0 }, + { AOM_ICDF(247 * 128), AOM_ICDF(32768), 0 } } +#else // CONFIG_EXT_COMP_REFS + { { AOM_ICDF(36 * 128), AOM_ICDF(32768), 0 }, + { AOM_ICDF(2 * 128), AOM_ICDF(32768), 0 }, + { AOM_ICDF(28 * 128), AOM_ICDF(32768), 0 }, + { AOM_ICDF(58 * 128), AOM_ICDF(32768), 0 }, + { AOM_ICDF(9 * 128), AOM_ICDF(32768), 0 } }, + { { AOM_ICDF(64 * 128), AOM_ICDF(32768), 0 }, + { AOM_ICDF(22 * 128), AOM_ICDF(32768), 0 }, + { AOM_ICDF(60 * 128), AOM_ICDF(32768), 0 }, + { AOM_ICDF(122 * 128), AOM_ICDF(32768), 0 }, + { AOM_ICDF(40 * 128), AOM_ICDF(32768), 0 } }, + { { AOM_ICDF(153 * 128), AOM_ICDF(32768), 0 }, + { AOM_ICDF(69 * 128), AOM_ICDF(32768), 0 }, + { AOM_ICDF(126 * 128), AOM_ICDF(32768), 0 }, + { AOM_ICDF(179 * 128), AOM_ICDF(32768), 0 }, + { AOM_ICDF(71 * 128), AOM_ICDF(32768), 0 } }, + { { AOM_ICDF(128 * 128), AOM_ICDF(32768), 0 }, + { AOM_ICDF(174 * 128), AOM_ICDF(32768), 0 }, + { AOM_ICDF(189 * 128), AOM_ICDF(32768), 0 }, + { AOM_ICDF(216 * 128), AOM_ICDF(32768), 0 }, + { AOM_ICDF(101 * 128), AOM_ICDF(32768), 0 } }, + { { AOM_ICDF(233 * 128), AOM_ICDF(32768), 0 }, + { AOM_ICDF(252 * 128), AOM_ICDF(32768), 0 }, + { AOM_ICDF(228 * 128), AOM_ICDF(32768), 0 }, + { AOM_ICDF(246 * 128), AOM_ICDF(32768), 0 }, + { AOM_ICDF(200 * 128), AOM_ICDF(32768), 0 } } +#endif // !CONFIG_EXT_COMP_REFS +#else // CONFIG_EXT_REFS + { { AOM_ICDF(31 * 128), AOM_ICDF(32768), 0 }, + { AOM_ICDF(25 * 128), AOM_ICDF(32768), 0 } }, + { { AOM_ICDF(72 * 128), AOM_ICDF(32768), 0 }, + { AOM_ICDF(80 * 128), AOM_ICDF(32768), 0 } }, + { { AOM_ICDF(147 * 128), AOM_ICDF(32768), 0 }, + { AOM_ICDF(148 * 128), AOM_ICDF(32768), 0 } }, + { { AOM_ICDF(197 * 128), AOM_ICDF(32768), 0 }, + { AOM_ICDF(191 * 128), AOM_ICDF(32768), 0 } }, + { { AOM_ICDF(235 * 128), AOM_ICDF(32768), 0 }, + { AOM_ICDF(247 * 128), AOM_ICDF(32768), 0 } } +#endif // CONFIG_EXT_REFS + }; +#endif // CONFIG_NEW_MULTISYMBOL + #if CONFIG_EXT_INTER && CONFIG_COMPOUND_SINGLEREF // TODO(zoeliu): Default values to be further adjusted based on the collected // stats. static const aom_prob default_comp_inter_mode_p[COMP_INTER_MODE_CONTEXTS] = { - 41, 119, 187, 225 + 40, 110, 160, 220 }; #endif // CONFIG_EXT_INTER && CONFIG_COMPOUND_SINGLEREF #if CONFIG_PALETTE - -// Tree to code palette size (number of colors in a palette) and the -// corresponding probabilities for Y and UV planes. -const aom_tree_index av1_palette_size_tree[TREE_SIZE(PALETTE_SIZES)] = { - -TWO_COLORS, 2, -THREE_COLORS, 4, -FOUR_COLORS, 6, - -FIVE_COLORS, 8, -SIX_COLORS, 10, -SEVEN_COLORS, -EIGHT_COLORS, -}; - -// TODO(huisu): tune these probs -const aom_prob - av1_default_palette_y_size_prob[PALETTE_BLOCK_SIZES][PALETTE_SIZES - 1] = { - { 96, 89, 100, 64, 77, 130 }, { 22, 15, 44, 16, 34, 82 }, - { 30, 19, 57, 18, 38, 86 }, { 94, 36, 104, 23, 43, 92 }, - { 116, 76, 107, 46, 65, 105 }, { 112, 82, 94, 40, 70, 112 }, - { 147, 124, 123, 58, 69, 103 }, { 180, 113, 136, 49, 45, 114 }, - { 107, 70, 87, 49, 154, 156 }, { 98, 105, 142, 63, 64, 152 }, +// TODO(huisu): tune these cdfs +const aom_cdf_prob + default_palette_y_size_cdf[PALETTE_BLOCK_SIZES][CDF_SIZE(PALETTE_SIZES)] = { + { AOM_ICDF(12288), AOM_ICDF(19408), AOM_ICDF(24627), AOM_ICDF(26662), + AOM_ICDF(28499), AOM_ICDF(30667), AOM_ICDF(32768), 0 }, + { AOM_ICDF(2815), AOM_ICDF(4570), AOM_ICDF(9416), AOM_ICDF(10875), + AOM_ICDF(13782), AOM_ICDF(19863), AOM_ICDF(32768), 0 }, + { AOM_ICDF(3839), AOM_ICDF(5986), AOM_ICDF(11949), AOM_ICDF(13413), + AOM_ICDF(16286), AOM_ICDF(21823), AOM_ICDF(32768), 0 }, + { AOM_ICDF(12032), AOM_ICDF(14948), AOM_ICDF(22187), AOM_ICDF(23138), + AOM_ICDF(24756), AOM_ICDF(27635), AOM_ICDF(32768), 0 }, + { AOM_ICDF(14847), AOM_ICDF(20167), AOM_ICDF(25433), AOM_ICDF(26751), + AOM_ICDF(28278), AOM_ICDF(30119), AOM_ICDF(32768), 0 }, + { AOM_ICDF(14336), AOM_ICDF(20240), AOM_ICDF(24840), AOM_ICDF(26079), + AOM_ICDF(27908), AOM_ICDF(30034), AOM_ICDF(32768), 0 }, + { AOM_ICDF(18816), AOM_ICDF(25574), AOM_ICDF(29030), AOM_ICDF(29877), + AOM_ICDF(30656), AOM_ICDF(31506), AOM_ICDF(32768), 0 }, + { AOM_ICDF(23039), AOM_ICDF(27333), AOM_ICDF(30220), AOM_ICDF(30708), + AOM_ICDF(31070), AOM_ICDF(31826), AOM_ICDF(32768), 0 }, + { AOM_ICDF(13696), AOM_ICDF(18911), AOM_ICDF(23620), AOM_ICDF(25371), + AOM_ICDF(29821), AOM_ICDF(31617), AOM_ICDF(32768), 0 }, + { AOM_ICDF(12543), AOM_ICDF(20838), AOM_ICDF(27455), AOM_ICDF(28762), + AOM_ICDF(29763), AOM_ICDF(31546), AOM_ICDF(32768), 0 }, #if CONFIG_EXT_PARTITION - { 98, 105, 142, 63, 64, 152 }, { 98, 105, 142, 63, 64, 152 }, - { 98, 105, 142, 63, 64, 152 }, -#endif // CONFIG_EXT_PARTITION + { AOM_ICDF(12543), AOM_ICDF(20838), AOM_ICDF(27455), AOM_ICDF(28762), + AOM_ICDF(29763), AOM_ICDF(31546), AOM_ICDF(32768), 0 }, + { AOM_ICDF(12543), AOM_ICDF(20838), AOM_ICDF(27455), AOM_ICDF(28762), + AOM_ICDF(29763), AOM_ICDF(31546), AOM_ICDF(32768), 0 }, + { AOM_ICDF(12543), AOM_ICDF(20838), AOM_ICDF(27455), AOM_ICDF(28762), + AOM_ICDF(29763), AOM_ICDF(31546), AOM_ICDF(32768), 0 }, +#endif }; -const aom_prob - av1_default_palette_uv_size_prob[PALETTE_BLOCK_SIZES][PALETTE_SIZES - 1] = { - { 160, 196, 228, 213, 175, 230 }, { 87, 148, 208, 141, 166, 163 }, - { 72, 151, 204, 139, 155, 161 }, { 78, 135, 171, 104, 120, 173 }, - { 59, 92, 131, 78, 92, 142 }, { 75, 118, 149, 84, 90, 128 }, - { 89, 87, 92, 66, 66, 128 }, { 67, 53, 54, 55, 66, 93 }, - { 120, 130, 83, 171, 75, 214 }, { 72, 55, 66, 68, 79, 107 }, +const aom_cdf_prob default_palette_uv_size_cdf[PALETTE_BLOCK_SIZES][CDF_SIZE( + PALETTE_SIZES)] = { + { AOM_ICDF(20480), AOM_ICDF(29888), AOM_ICDF(32453), AOM_ICDF(32715), + AOM_ICDF(32751), AOM_ICDF(32766), AOM_ICDF(32768), 0 }, + { AOM_ICDF(11135), AOM_ICDF(23641), AOM_ICDF(31056), AOM_ICDF(31998), + AOM_ICDF(32496), AOM_ICDF(32668), AOM_ICDF(32768), 0 }, + { AOM_ICDF(9216), AOM_ICDF(23108), AOM_ICDF(30806), AOM_ICDF(31871), + AOM_ICDF(32414), AOM_ICDF(32637), AOM_ICDF(32768), 0 }, + { AOM_ICDF(9984), AOM_ICDF(21999), AOM_ICDF(29192), AOM_ICDF(30645), + AOM_ICDF(31640), AOM_ICDF(32402), AOM_ICDF(32768), 0 }, + { AOM_ICDF(7552), AOM_ICDF(16614), AOM_ICDF(24880), AOM_ICDF(27283), + AOM_ICDF(29254), AOM_ICDF(31203), AOM_ICDF(32768), 0 }, + { AOM_ICDF(9600), AOM_ICDF(20279), AOM_ICDF(27548), AOM_ICDF(29261), + AOM_ICDF(30494), AOM_ICDF(31631), AOM_ICDF(32768), 0 }, + { AOM_ICDF(11391), AOM_ICDF(18656), AOM_ICDF(23727), AOM_ICDF(26058), + AOM_ICDF(27788), AOM_ICDF(30278), AOM_ICDF(32768), 0 }, + { AOM_ICDF(8576), AOM_ICDF(13585), AOM_ICDF(17632), AOM_ICDF(20884), + AOM_ICDF(23948), AOM_ICDF(27152), AOM_ICDF(32768), 0 }, + { AOM_ICDF(15360), AOM_ICDF(24200), AOM_ICDF(26978), AOM_ICDF(30846), + AOM_ICDF(31409), AOM_ICDF(32545), AOM_ICDF(32768), 0 }, + { AOM_ICDF(9216), AOM_ICDF(14276), AOM_ICDF(19043), AOM_ICDF(22689), + AOM_ICDF(25799), AOM_ICDF(28712), AOM_ICDF(32768), 0 }, #if CONFIG_EXT_PARTITION - { 72, 55, 66, 68, 79, 107 }, { 72, 55, 66, 68, 79, 107 }, - { 72, 55, 66, 68, 79, 107 }, -#endif // CONFIG_EXT_PARTITION - }; + { AOM_ICDF(9216), AOM_ICDF(14276), AOM_ICDF(19043), AOM_ICDF(22689), + AOM_ICDF(25799), AOM_ICDF(28712), AOM_ICDF(32768), 0 }, + { AOM_ICDF(9216), AOM_ICDF(14276), AOM_ICDF(19043), AOM_ICDF(22689), + AOM_ICDF(25799), AOM_ICDF(28712), AOM_ICDF(32768), 0 }, + { AOM_ICDF(9216), AOM_ICDF(14276), AOM_ICDF(19043), AOM_ICDF(22689), + AOM_ICDF(25799), AOM_ICDF(28712), AOM_ICDF(32768), 0 }, +#endif +}; // When palette mode is enabled, following probability tables indicate the // probabilities to code the "is_palette" bit (i.e. the bit that indicates @@ -1428,178 +1504,182 @@ const aom_prob av1_default_palette_uv_mode_prob[PALETTE_UV_MODE_CONTEXTS] = { 253, 229 }; -// Trees to code palette color indices (for various palette sizes), and the -// corresponding probability tables for Y and UV planes. -const aom_tree_index - av1_palette_color_index_tree[PALETTE_SIZES][TREE_SIZE(PALETTE_COLORS)] = { - { // 2 colors - -PALETTE_COLOR_ONE, -PALETTE_COLOR_TWO }, - { // 3 colors - -PALETTE_COLOR_ONE, 2, -PALETTE_COLOR_TWO, -PALETTE_COLOR_THREE }, - { // 4 colors - -PALETTE_COLOR_ONE, 2, -PALETTE_COLOR_TWO, 4, -PALETTE_COLOR_THREE, - -PALETTE_COLOR_FOUR }, - { // 5 colors - -PALETTE_COLOR_ONE, 2, -PALETTE_COLOR_TWO, 4, -PALETTE_COLOR_THREE, 6, - -PALETTE_COLOR_FOUR, -PALETTE_COLOR_FIVE }, - { // 6 colors - -PALETTE_COLOR_ONE, 2, -PALETTE_COLOR_TWO, 4, -PALETTE_COLOR_THREE, 6, - -PALETTE_COLOR_FOUR, 8, -PALETTE_COLOR_FIVE, -PALETTE_COLOR_SIX }, - { // 7 colors - -PALETTE_COLOR_ONE, 2, -PALETTE_COLOR_TWO, 4, -PALETTE_COLOR_THREE, 6, - -PALETTE_COLOR_FOUR, 8, -PALETTE_COLOR_FIVE, 10, -PALETTE_COLOR_SIX, - -PALETTE_COLOR_SEVEN }, - { // 8 colors - -PALETTE_COLOR_ONE, 2, -PALETTE_COLOR_TWO, 4, -PALETTE_COLOR_THREE, 6, - -PALETTE_COLOR_FOUR, 8, -PALETTE_COLOR_FIVE, 10, -PALETTE_COLOR_SIX, 12, - -PALETTE_COLOR_SEVEN, -PALETTE_COLOR_EIGHT }, - }; - -// Note: Has to be non-zero to avoid any asserts triggering. -#define UNUSED_PROB 128 - -const aom_prob av1_default_palette_y_color_index_prob - [PALETTE_SIZES][PALETTE_COLOR_INDEX_CONTEXTS][PALETTE_COLORS - 1] = { +const aom_cdf_prob default_palette_y_color_index_cdf + [PALETTE_SIZES][PALETTE_COLOR_INDEX_CONTEXTS][CDF_SIZE(PALETTE_COLORS)] = { { - // 2 colors - { 231, UNUSED_PROB, UNUSED_PROB, UNUSED_PROB, UNUSED_PROB, - UNUSED_PROB, UNUSED_PROB }, - { UNUSED_PROB, UNUSED_PROB, UNUSED_PROB, UNUSED_PROB, UNUSED_PROB, - UNUSED_PROB, UNUSED_PROB }, - { 69, UNUSED_PROB, UNUSED_PROB, UNUSED_PROB, UNUSED_PROB, UNUSED_PROB, - UNUSED_PROB }, - { 224, UNUSED_PROB, UNUSED_PROB, UNUSED_PROB, UNUSED_PROB, - UNUSED_PROB, UNUSED_PROB }, - { 249, UNUSED_PROB, UNUSED_PROB, UNUSED_PROB, UNUSED_PROB, - UNUSED_PROB, UNUSED_PROB }, + { AOM_ICDF(29568), AOM_ICDF(32768), 0, 0, 0, 0, 0, 0, 0 }, + { AOM_ICDF(16384), AOM_ICDF(32768), 0, 0, 0, 0, 0, 0, 0 }, + { AOM_ICDF(8832), AOM_ICDF(32768), 0, 0, 0, 0, 0, 0, 0 }, + { AOM_ICDF(28672), AOM_ICDF(32768), 0, 0, 0, 0, 0, 0, 0 }, + { AOM_ICDF(31872), AOM_ICDF(32768), 0, 0, 0, 0, 0, 0, 0 }, }, { - // 3 colors - { 219, 124, UNUSED_PROB, UNUSED_PROB, UNUSED_PROB, UNUSED_PROB, - UNUSED_PROB }, - { 91, 191, UNUSED_PROB, UNUSED_PROB, UNUSED_PROB, UNUSED_PROB, - UNUSED_PROB }, - { 34, 237, UNUSED_PROB, UNUSED_PROB, UNUSED_PROB, UNUSED_PROB, - UNUSED_PROB }, - { 184, 118, UNUSED_PROB, UNUSED_PROB, UNUSED_PROB, UNUSED_PROB, - UNUSED_PROB }, - { 252, 124, UNUSED_PROB, UNUSED_PROB, UNUSED_PROB, UNUSED_PROB, - UNUSED_PROB }, + { AOM_ICDF(28032), AOM_ICDF(30326), AOM_ICDF(32768), 0, 0, 0, 0, 0, + 0 }, + { AOM_ICDF(11647), AOM_ICDF(27405), AOM_ICDF(32768), 0, 0, 0, 0, 0, + 0 }, + { AOM_ICDF(4352), AOM_ICDF(30659), AOM_ICDF(32768), 0, 0, 0, 0, 0, + 0 }, + { AOM_ICDF(23552), AOM_ICDF(27800), AOM_ICDF(32768), 0, 0, 0, 0, 0, + 0 }, + { AOM_ICDF(32256), AOM_ICDF(32504), AOM_ICDF(32768), 0, 0, 0, 0, 0, + 0 }, }, { - // 4 colors - { 204, 87, 97, UNUSED_PROB, UNUSED_PROB, UNUSED_PROB, UNUSED_PROB }, - { 74, 144, 129, UNUSED_PROB, UNUSED_PROB, UNUSED_PROB, UNUSED_PROB }, - { 52, 191, 134, UNUSED_PROB, UNUSED_PROB, UNUSED_PROB, UNUSED_PROB }, - { 151, 85, 147, UNUSED_PROB, UNUSED_PROB, UNUSED_PROB, UNUSED_PROB }, - { 248, 60, 115, UNUSED_PROB, UNUSED_PROB, UNUSED_PROB, UNUSED_PROB }, + { AOM_ICDF(26112), AOM_ICDF(28374), AOM_ICDF(30039), AOM_ICDF(32768), + 0, 0, 0, 0, 0 }, + { AOM_ICDF(9472), AOM_ICDF(22576), AOM_ICDF(27712), AOM_ICDF(32768), + 0, 0, 0, 0, 0 }, + { AOM_ICDF(6656), AOM_ICDF(26138), AOM_ICDF(29608), AOM_ICDF(32768), + 0, 0, 0, 0, 0 }, + { AOM_ICDF(19328), AOM_ICDF(23791), AOM_ICDF(28946), AOM_ICDF(32768), + 0, 0, 0, 0, 0 }, + { AOM_ICDF(31744), AOM_ICDF(31984), AOM_ICDF(32336), AOM_ICDF(32768), + 0, 0, 0, 0, 0 }, }, { - // 5 colors - { 218, 69, 62, 106, UNUSED_PROB, UNUSED_PROB, UNUSED_PROB }, - { 76, 143, 89, 127, UNUSED_PROB, UNUSED_PROB, UNUSED_PROB }, - { 21, 233, 94, 131, UNUSED_PROB, UNUSED_PROB, UNUSED_PROB }, - { 172, 72, 89, 112, UNUSED_PROB, UNUSED_PROB, UNUSED_PROB }, - { 253, 66, 65, 128, UNUSED_PROB, UNUSED_PROB, UNUSED_PROB }, + { AOM_ICDF(27904), AOM_ICDF(29215), AOM_ICDF(30075), AOM_ICDF(31190), + AOM_ICDF(32768), 0, 0, 0, 0 }, + { AOM_ICDF(9728), AOM_ICDF(22598), AOM_ICDF(26134), AOM_ICDF(29425), + AOM_ICDF(32768), 0, 0, 0, 0 }, + { AOM_ICDF(2688), AOM_ICDF(30066), AOM_ICDF(31058), AOM_ICDF(31933), + AOM_ICDF(32768), 0, 0, 0, 0 }, + { AOM_ICDF(22015), AOM_ICDF(25039), AOM_ICDF(27726), AOM_ICDF(29932), + AOM_ICDF(32768), 0, 0, 0, 0 }, + { AOM_ICDF(32383), AOM_ICDF(32482), AOM_ICDF(32554), AOM_ICDF(32660), + AOM_ICDF(32768), 0, 0, 0, 0 }, }, { - // 6 colors - { 190, 60, 47, 54, 74, UNUSED_PROB, UNUSED_PROB }, - { 62, 106, 51, 95, 110, UNUSED_PROB, UNUSED_PROB }, - { 52, 180, 69, 72, 107, UNUSED_PROB, UNUSED_PROB }, - { 156, 83, 72, 83, 101, UNUSED_PROB, UNUSED_PROB }, - { 245, 45, 37, 52, 91, UNUSED_PROB, UNUSED_PROB }, + { AOM_ICDF(24319), AOM_ICDF(26299), AOM_ICDF(27486), AOM_ICDF(28600), + AOM_ICDF(29804), AOM_ICDF(32768), 0, 0, 0 }, + { AOM_ICDF(7935), AOM_ICDF(18217), AOM_ICDF(21116), AOM_ICDF(25440), + AOM_ICDF(28589), AOM_ICDF(32768), 0, 0, 0 }, + { AOM_ICDF(6656), AOM_ICDF(25016), AOM_ICDF(27105), AOM_ICDF(28698), + AOM_ICDF(30399), AOM_ICDF(32768), 0, 0, 0 }, + { AOM_ICDF(19967), AOM_ICDF(24117), AOM_ICDF(26550), AOM_ICDF(28566), + AOM_ICDF(30224), AOM_ICDF(32768), 0, 0, 0 }, + { AOM_ICDF(31359), AOM_ICDF(31607), AOM_ICDF(31775), AOM_ICDF(31977), + AOM_ICDF(32258), AOM_ICDF(32768), 0, 0, 0 }, }, { - // 7 colors - { 206, 56, 42, 42, 53, 85, UNUSED_PROB }, - { 70, 100, 45, 68, 77, 94, UNUSED_PROB }, - { 57, 169, 51, 62, 74, 119, UNUSED_PROB }, - { 172, 76, 71, 40, 59, 76, UNUSED_PROB }, - { 248, 47, 36, 53, 61, 110, UNUSED_PROB }, + { AOM_ICDF(26368), AOM_ICDF(27768), AOM_ICDF(28588), AOM_ICDF(29274), + AOM_ICDF(29997), AOM_ICDF(30917), AOM_ICDF(32768), 0, 0 }, + { AOM_ICDF(8960), AOM_ICDF(18260), AOM_ICDF(20810), AOM_ICDF(23986), + AOM_ICDF(26627), AOM_ICDF(28882), AOM_ICDF(32768), 0, 0 }, + { AOM_ICDF(7295), AOM_ICDF(24111), AOM_ICDF(25836), AOM_ICDF(27515), + AOM_ICDF(29033), AOM_ICDF(30769), AOM_ICDF(32768), 0, 0 }, + { AOM_ICDF(22016), AOM_ICDF(25208), AOM_ICDF(27305), AOM_ICDF(28159), + AOM_ICDF(29221), AOM_ICDF(30274), AOM_ICDF(32768), 0, 0 }, + { AOM_ICDF(31744), AOM_ICDF(31932), AOM_ICDF(32050), AOM_ICDF(32199), + AOM_ICDF(32335), AOM_ICDF(32521), AOM_ICDF(32768), 0, 0 }, }, { - // 8 colors - { 208, 52, 38, 34, 34, 44, 66 }, - { 52, 107, 34, 73, 69, 82, 87 }, - { 28, 208, 53, 43, 62, 70, 102 }, - { 184, 64, 45, 37, 37, 69, 105 }, - { 251, 18, 31, 45, 47, 61, 104 }, + { AOM_ICDF(26624), AOM_ICDF(27872), AOM_ICDF(28599), AOM_ICDF(29153), + AOM_ICDF(29633), AOM_ICDF(30172), AOM_ICDF(30841), AOM_ICDF(32768), + 0 }, + { AOM_ICDF(6655), AOM_ICDF(17569), AOM_ICDF(19587), AOM_ICDF(23345), + AOM_ICDF(25884), AOM_ICDF(28088), AOM_ICDF(29678), AOM_ICDF(32768), + 0 }, + { AOM_ICDF(3584), AOM_ICDF(27296), AOM_ICDF(28429), AOM_ICDF(29158), + AOM_ICDF(30032), AOM_ICDF(30780), AOM_ICDF(31572), AOM_ICDF(32768), + 0 }, + { AOM_ICDF(23551), AOM_ICDF(25855), AOM_ICDF(27070), AOM_ICDF(27893), + AOM_ICDF(28597), AOM_ICDF(29721), AOM_ICDF(30970), AOM_ICDF(32768), + 0 }, + { AOM_ICDF(32128), AOM_ICDF(32173), AOM_ICDF(32245), AOM_ICDF(32337), + AOM_ICDF(32416), AOM_ICDF(32500), AOM_ICDF(32609), AOM_ICDF(32768), + 0 }, }, }; -const aom_prob av1_default_palette_uv_color_index_prob - [PALETTE_SIZES][PALETTE_COLOR_INDEX_CONTEXTS][PALETTE_COLORS - 1] = { +const aom_cdf_prob default_palette_uv_color_index_cdf + [PALETTE_SIZES][PALETTE_COLOR_INDEX_CONTEXTS][CDF_SIZE(PALETTE_COLORS)] = { { - // 2 colors - { 233, UNUSED_PROB, UNUSED_PROB, UNUSED_PROB, UNUSED_PROB, - UNUSED_PROB, UNUSED_PROB }, - { UNUSED_PROB, UNUSED_PROB, UNUSED_PROB, UNUSED_PROB, UNUSED_PROB, - UNUSED_PROB, UNUSED_PROB }, - { 69, UNUSED_PROB, UNUSED_PROB, UNUSED_PROB, UNUSED_PROB, UNUSED_PROB, - UNUSED_PROB }, - { 240, UNUSED_PROB, UNUSED_PROB, UNUSED_PROB, UNUSED_PROB, - UNUSED_PROB, UNUSED_PROB }, - { 248, UNUSED_PROB, UNUSED_PROB, UNUSED_PROB, UNUSED_PROB, - UNUSED_PROB, UNUSED_PROB }, + { AOM_ICDF(29824), AOM_ICDF(32768), 0, 0, 0, 0, 0, 0, 0 }, + { AOM_ICDF(16384), AOM_ICDF(32768), 0, 0, 0, 0, 0, 0, 0 }, + { AOM_ICDF(8832), AOM_ICDF(32768), 0, 0, 0, 0, 0, 0, 0 }, + { AOM_ICDF(30720), AOM_ICDF(32768), 0, 0, 0, 0, 0, 0, 0 }, + { AOM_ICDF(31744), AOM_ICDF(32768), 0, 0, 0, 0, 0, 0, 0 }, }, { - // 3 colors - { 216, 128, UNUSED_PROB, UNUSED_PROB, UNUSED_PROB, UNUSED_PROB, - UNUSED_PROB }, - { 110, 171, UNUSED_PROB, UNUSED_PROB, UNUSED_PROB, UNUSED_PROB, - UNUSED_PROB }, - { 40, 239, UNUSED_PROB, UNUSED_PROB, UNUSED_PROB, UNUSED_PROB, - UNUSED_PROB }, - { 191, 104, UNUSED_PROB, UNUSED_PROB, UNUSED_PROB, UNUSED_PROB, - UNUSED_PROB }, - { 247, 134, UNUSED_PROB, UNUSED_PROB, UNUSED_PROB, UNUSED_PROB, - UNUSED_PROB }, + { AOM_ICDF(27648), AOM_ICDF(30208), AOM_ICDF(32768), 0, 0, 0, 0, 0, + 0 }, + { AOM_ICDF(14080), AOM_ICDF(26563), AOM_ICDF(32768), 0, 0, 0, 0, 0, + 0 }, + { AOM_ICDF(5120), AOM_ICDF(30932), AOM_ICDF(32768), 0, 0, 0, 0, 0, + 0 }, + { AOM_ICDF(24448), AOM_ICDF(27828), AOM_ICDF(32768), 0, 0, 0, 0, 0, + 0 }, + { AOM_ICDF(31616), AOM_ICDF(32219), AOM_ICDF(32768), 0, 0, 0, 0, 0, + 0 }, }, { - // 4 colors - { 202, 89, 132, UNUSED_PROB, UNUSED_PROB, UNUSED_PROB, UNUSED_PROB }, - { 90, 132, 136, UNUSED_PROB, UNUSED_PROB, UNUSED_PROB, UNUSED_PROB }, - { 63, 195, 149, UNUSED_PROB, UNUSED_PROB, UNUSED_PROB, UNUSED_PROB }, - { 152, 84, 152, UNUSED_PROB, UNUSED_PROB, UNUSED_PROB, UNUSED_PROB }, - { 241, 87, 136, UNUSED_PROB, UNUSED_PROB, UNUSED_PROB, UNUSED_PROB }, + { AOM_ICDF(25856), AOM_ICDF(28259), AOM_ICDF(30584), AOM_ICDF(32768), + 0, 0, 0, 0, 0 }, + { AOM_ICDF(11520), AOM_ICDF(22476), AOM_ICDF(27944), AOM_ICDF(32768), + 0, 0, 0, 0, 0 }, + { AOM_ICDF(8064), AOM_ICDF(26882), AOM_ICDF(30308), AOM_ICDF(32768), + 0, 0, 0, 0, 0 }, + { AOM_ICDF(19455), AOM_ICDF(23823), AOM_ICDF(29134), AOM_ICDF(32768), + 0, 0, 0, 0, 0 }, + { AOM_ICDF(30848), AOM_ICDF(31501), AOM_ICDF(32174), AOM_ICDF(32768), + 0, 0, 0, 0, 0 }, }, { - // 5 colors - { 209, 54, 82, 134, UNUSED_PROB, UNUSED_PROB, UNUSED_PROB }, - { 94, 173, 180, 93, UNUSED_PROB, UNUSED_PROB, UNUSED_PROB }, - { 10, 251, 127, 84, UNUSED_PROB, UNUSED_PROB, UNUSED_PROB }, - { 183, 20, 150, 47, UNUSED_PROB, UNUSED_PROB, UNUSED_PROB }, - { 252, 73, 111, 150, UNUSED_PROB, UNUSED_PROB, UNUSED_PROB }, + { AOM_ICDF(26751), AOM_ICDF(28020), AOM_ICDF(29541), AOM_ICDF(31230), + AOM_ICDF(32768), 0, 0, 0, 0 }, + { AOM_ICDF(12032), AOM_ICDF(26045), AOM_ICDF(30772), AOM_ICDF(31497), + AOM_ICDF(32768), 0, 0, 0, 0 }, + { AOM_ICDF(1280), AOM_ICDF(32153), AOM_ICDF(32458), AOM_ICDF(32560), + AOM_ICDF(32768), 0, 0, 0, 0 }, + { AOM_ICDF(23424), AOM_ICDF(24154), AOM_ICDF(29201), AOM_ICDF(29856), + AOM_ICDF(32768), 0, 0, 0, 0 }, + { AOM_ICDF(32256), AOM_ICDF(32402), AOM_ICDF(32561), AOM_ICDF(32682), + AOM_ICDF(32768), 0, 0, 0, 0 }, }, { - // 6 colors - { 192, 67, 59, 46, 184, UNUSED_PROB, UNUSED_PROB }, - { 59, 92, 61, 100, 130, UNUSED_PROB, UNUSED_PROB }, - { 49, 162, 68, 91, 150, UNUSED_PROB, UNUSED_PROB }, - { 133, 29, 36, 153, 101, UNUSED_PROB, UNUSED_PROB }, - { 247, 71, 44, 90, 129, UNUSED_PROB, UNUSED_PROB }, + { AOM_ICDF(24576), AOM_ICDF(26720), AOM_ICDF(28114), AOM_ICDF(28950), + AOM_ICDF(31694), AOM_ICDF(32768), 0, 0, 0 }, + { AOM_ICDF(7551), AOM_ICDF(16613), AOM_ICDF(20462), AOM_ICDF(25269), + AOM_ICDF(29077), AOM_ICDF(32768), 0, 0, 0 }, + { AOM_ICDF(6272), AOM_ICDF(23039), AOM_ICDF(25623), AOM_ICDF(28163), + AOM_ICDF(30861), AOM_ICDF(32768), 0, 0, 0 }, + { AOM_ICDF(17024), AOM_ICDF(18808), AOM_ICDF(20771), AOM_ICDF(27941), + AOM_ICDF(29845), AOM_ICDF(32768), 0, 0, 0 }, + { AOM_ICDF(31616), AOM_ICDF(31936), AOM_ICDF(32079), AOM_ICDF(32321), + AOM_ICDF(32546), AOM_ICDF(32768), 0, 0, 0 }, }, { - // 7 colors - { 182, 62, 80, 78, 46, 116, UNUSED_PROB }, - { 59, 62, 39, 81, 65, 99, UNUSED_PROB }, - { 54, 177, 48, 58, 93, 104, UNUSED_PROB }, - { 137, 79, 54, 55, 44, 134, UNUSED_PROB }, - { 239, 82, 79, 44, 69, 71, UNUSED_PROB }, + { AOM_ICDF(23296), AOM_ICDF(25590), AOM_ICDF(27833), AOM_ICDF(29337), + AOM_ICDF(29954), AOM_ICDF(31229), AOM_ICDF(32768), 0, 0 }, + { AOM_ICDF(7552), AOM_ICDF(13659), AOM_ICDF(16570), AOM_ICDF(21695), + AOM_ICDF(24506), AOM_ICDF(27701), AOM_ICDF(32768), 0, 0 }, + { AOM_ICDF(6911), AOM_ICDF(24788), AOM_ICDF(26284), AOM_ICDF(27753), + AOM_ICDF(29575), AOM_ICDF(30872), AOM_ICDF(32768), 0, 0 }, + { AOM_ICDF(17535), AOM_ICDF(22236), AOM_ICDF(24457), AOM_ICDF(26242), + AOM_ICDF(27363), AOM_ICDF(30191), AOM_ICDF(32768), 0, 0 }, + { AOM_ICDF(30592), AOM_ICDF(31289), AOM_ICDF(31745), AOM_ICDF(31921), + AOM_ICDF(32149), AOM_ICDF(32321), AOM_ICDF(32768), 0, 0 }, }, { - // 8 colors - { 172, 53, 27, 67, 30, 79, 113 }, - { 63, 57, 45, 81, 62, 35, 47 }, - { 51, 200, 36, 47, 82, 165, 129 }, - { 141, 100, 47, 29, 33, 37, 129 }, - { 236, 42, 50, 91, 24, 154, 65 }, - }, + { AOM_ICDF(22016), AOM_ICDF(24242), AOM_ICDF(25141), AOM_ICDF(27137), + AOM_ICDF(27797), AOM_ICDF(29331), AOM_ICDF(30848), AOM_ICDF(32768), + 0 }, + { AOM_ICDF(8063), AOM_ICDF(13564), AOM_ICDF(16940), AOM_ICDF(21948), + AOM_ICDF(24568), AOM_ICDF(25689), AOM_ICDF(26989), AOM_ICDF(32768), + 0 }, + { AOM_ICDF(6528), AOM_ICDF(27028), AOM_ICDF(27835), AOM_ICDF(28741), + AOM_ICDF(30031), AOM_ICDF(31795), AOM_ICDF(32285), AOM_ICDF(32768), + 0 }, + { AOM_ICDF(18047), AOM_ICDF(23797), AOM_ICDF(25444), AOM_ICDF(26274), + AOM_ICDF(27111), AOM_ICDF(27929), AOM_ICDF(30367), AOM_ICDF(32768), + 0 }, + { AOM_ICDF(30208), AOM_ICDF(30628), AOM_ICDF(31046), AOM_ICDF(31658), + AOM_ICDF(31762), AOM_ICDF(32367), AOM_ICDF(32469), AOM_ICDF(32768), + 0 }, + } }; -#undef UNUSED_PROB - #define MAX_COLOR_CONTEXT_HASH 8 // Negative values are invalid static const int palette_color_index_context_lookup[MAX_COLOR_CONTEXT_HASH + @@ -1657,9 +1737,9 @@ static const aom_prob default_tx_size_prob[MAX_TX_DEPTH][TX_SIZE_CONTEXTS] #endif // CONFIG_TX64X64 }; -#if CONFIG_EXT_TX && CONFIG_RECT_TX && CONFIG_RECT_TX_EXT +#if CONFIG_RECT_TX_EXT && (CONFIG_EXT_TX || CONFIG_VAR_TX) static const aom_prob default_quarter_tx_size_prob = 192; -#endif // CONFIG_EXT_TX && CONFIG_RECT_TX && CONFIG_RECT_TX_EXT +#endif #if CONFIG_LOOP_RESTORATION const aom_tree_index @@ -1764,9 +1844,37 @@ int av1_get_palette_color_index_context(const uint8_t *color_map, int stride, static const aom_prob default_txfm_partition_probs[TXFM_PARTITION_CONTEXTS] = { 250, 231, 212, 241, 166, 66, 241, 230, 135, 243, 154, 64, 248, 161, 63, 128, }; +#if CONFIG_NEW_MULTISYMBOL +static const aom_cdf_prob + default_txfm_partition_cdf[TXFM_PARTITION_CONTEXTS][CDF_SIZE(2)] = { + { AOM_ICDF(250 * 128), AOM_ICDF(32768), 0 }, + { AOM_ICDF(231 * 128), AOM_ICDF(32768), 0 }, + { AOM_ICDF(212 * 128), AOM_ICDF(32768), 0 }, + { AOM_ICDF(241 * 128), AOM_ICDF(32768), 0 }, + { AOM_ICDF(166 * 128), AOM_ICDF(32768), 0 }, + { AOM_ICDF(66 * 128), AOM_ICDF(32768), 0 }, + { AOM_ICDF(241 * 128), AOM_ICDF(32768), 0 }, + { AOM_ICDF(230 * 128), AOM_ICDF(32768), 0 }, + { AOM_ICDF(135 * 128), AOM_ICDF(32768), 0 }, + { AOM_ICDF(243 * 128), AOM_ICDF(32768), 0 }, + { AOM_ICDF(154 * 128), AOM_ICDF(32768), 0 }, + { AOM_ICDF(64 * 128), AOM_ICDF(32768), 0 }, + { AOM_ICDF(248 * 128), AOM_ICDF(32768), 0 }, + { AOM_ICDF(161 * 128), AOM_ICDF(32768), 0 }, + { AOM_ICDF(63 * 128), AOM_ICDF(32768), 0 }, + { AOM_ICDF(128 * 128), AOM_ICDF(32768), 0 } + }; +#endif // CONFIG_NEW_MULTISYMBOL #endif static const aom_prob default_skip_probs[SKIP_CONTEXTS] = { 192, 128, 64 }; +#if CONFIG_NEW_MULTISYMBOL +static const aom_cdf_prob default_skip_cdfs[SKIP_CONTEXTS][CDF_SIZE(2)] = { + { AOM_ICDF(24576), AOM_ICDF(32768), 0 }, + { AOM_ICDF(16384), AOM_ICDF(32768), 0 }, + { AOM_ICDF(8192), AOM_ICDF(32768), 0 } +}; +#endif #if CONFIG_DUAL_FILTER #if USE_EXTRA_FILTER @@ -1783,10 +1891,10 @@ static const aom_prob default_switchable_interp_prob #else // USE_EXTRA_FILTER static const aom_prob default_switchable_interp_prob [SWITCHABLE_FILTER_CONTEXTS][SWITCHABLE_FILTERS - 1] = { - { 235, 162 }, { 36, 255 }, { 34, 3 }, { 149, 144 }, - { 235, 162 }, { 36, 255 }, { 34, 3 }, { 149, 144 }, - { 235, 162 }, { 36, 255 }, { 34, 3 }, { 149, 144 }, - { 235, 162 }, { 36, 255 }, { 34, 3 }, { 149, 144 }, + { 252, 199 }, { 22, 255 }, { 4, 2 }, { 238, 146 }, + { 253, 66 }, { 24, 255 }, { 2, 1 }, { 198, 41 }, + { 250, 177 }, { 16, 255 }, { 3, 4 }, { 226, 162 }, + { 247, 38 }, { 33, 253 }, { 1, 1 }, { 136, 14 }, }; #endif // USE_EXTRA_FILTER #else // CONFIG_DUAL_FILTER @@ -1835,7 +1943,12 @@ const aom_tree_index av1_ext_tx_inter_tree[EXT_TX_SETS_INTER] -ADST_FLIPADST, -FLIPADST_ADST }, { -IDTX, -DCT_DCT, + }, +#if CONFIG_MRC_TX + { + -IDTX, 2, -DCT_DCT, -MRC_DCT, } +#endif // CONFIG_MRC_TX }; const aom_tree_index av1_ext_tx_intra_tree[EXT_TX_SETS_INTRA] @@ -1854,7 +1967,12 @@ const aom_tree_index av1_ext_tx_intra_tree[EXT_TX_SETS_INTRA] -DCT_DCT, 4, -ADST_ADST, 6, -ADST_DCT, -DCT_ADST, + }, +#if CONFIG_MRC_TX + { + -DCT_DCT, -MRC_DCT, } +#endif // CONFIG_MRC_TX }; /* clang-format on */ @@ -1900,7 +2018,18 @@ static const aom_prob { 12 }, { 12 }, { 12 }, + }, +#if CONFIG_MRC_TX + { +#if CONFIG_CHROMA_2X2 + { 0 }, +#endif + { 12, 128 }, + { 12, 128 }, + { 12, 128 }, + { 12, 128 }, } +#endif // CONFIG_MRC_TX }; // TODO(urvang): 3rd context should be tx_type instead of intra mode just like @@ -2158,20 +2287,152 @@ static const aom_prob { 10, 32, 16, 64 }, }, }, +#if CONFIG_MRC_TX + { +// ToDo(yaowu): remove unused entry 0. +#if CONFIG_CHROMA_2X2 + { + { 0 }, + }, +#endif + { + { 128 }, + { 128 }, + { 128 }, + { 128 }, + { 128 }, + { 128 }, + { 128 }, + { 128 }, + { 128 }, +#if CONFIG_ALT_INTRA + { 128 }, +#if CONFIG_SMOOTH_HV + { 128 }, + { 128 }, +#endif // CONFIG_SMOOTH_HV +#endif // CONFIG_ALT_INTRA + { 128 }, + }, + { + { 128 }, + { 128 }, + { 128 }, + { 128 }, + { 128 }, + { 128 }, + { 128 }, + { 128 }, + { 128 }, +#if CONFIG_ALT_INTRA + { 128 }, +#if CONFIG_SMOOTH_HV + { 128 }, + { 128 }, +#endif // CONFIG_SMOOTH_HV +#endif // CONFIG_ALT_INTRA + { 128 }, + }, + { + { 128 }, + { 128 }, + { 128 }, + { 128 }, + { 128 }, + { 128 }, + { 128 }, + { 128 }, + { 128 }, +#if CONFIG_ALT_INTRA + { 128 }, +#if CONFIG_SMOOTH_HV + { 128 }, + { 128 }, +#endif // CONFIG_SMOOTH_HV +#endif // CONFIG_ALT_INTRA + { 128 }, + }, + { + { 128 }, + { 128 }, + { 128 }, + { 128 }, + { 128 }, + { 128 }, + { 128 }, + { 128 }, + { 128 }, +#if CONFIG_ALT_INTRA + { 128 }, +#if CONFIG_SMOOTH_HV + { 128 }, + { 128 }, +#endif // CONFIG_SMOOTH_HV +#endif // CONFIG_ALT_INTRA + { 128 }, + }, + }, + +#endif // CONFIG_MRC_TX }; #else // !CONFIG_EXT_TX /* clang-format off */ +#if CONFIG_MRC_TX +const aom_tree_index av1_ext_tx_tree[TREE_SIZE(TX_TYPES)] = { + -DCT_DCT, 2, + -MRC_DCT, 4, + -ADST_ADST, 6, + -ADST_DCT, -DCT_ADST +}; +#else const aom_tree_index av1_ext_tx_tree[TREE_SIZE(TX_TYPES)] = { -DCT_DCT, 2, -ADST_ADST, 4, -ADST_DCT, -DCT_ADST }; +#endif // CONFIG_MRC_TX /* clang-format on */ int av1_ext_tx_ind[TX_TYPES]; int av1_ext_tx_inv[TX_TYPES]; +#if CONFIG_MRC_TX +static const aom_prob default_intra_ext_tx_prob[EXT_TX_SIZES][TX_TYPES] + [TX_TYPES - 1] = { +#if CONFIG_CHROMA_2X2 + { { 240, 1, 85, 128 }, + { 4, 1, 1, 248 }, + { 4, 1, 1, 8 }, + { 4, 1, 248, 128 }, + { 4, 1, 248, 128 } }, +#endif + { { 240, 1, 85, 128 }, + { 4, 1, 1, 248 }, + { 4, 1, 1, 8 }, + { 4, 1, 248, 128 }, + { 4, 1, 248, 128 } }, + { { 244, 1, 85, 128 }, + { 8, 1, 2, 248 }, + { 8, 1, 2, 8 }, + { 8, 1, 248, 128 }, + { 4, 1, 248, 128 } }, + { { 248, 128, 85, 128 }, + { 16, 128, 4, 248 }, + { 16, 128, 4, 8 }, + { 16, 128, 248, 128 }, + { 4, 1, 248, 128 } }, + }; + +static const aom_prob default_inter_ext_tx_prob[EXT_TX_SIZES][TX_TYPES - 1] = { +#if CONFIG_CHROMA_2X2 + { 160, 1, 85, 128 }, +#endif + { 160, 1, 85, 128 }, + { 176, 1, 85, 128 }, + { 192, 128, 85, 128 }, +}; +#else static const aom_prob default_intra_ext_tx_prob[EXT_TX_SIZES][TX_TYPES][TX_TYPES - 1] = { #if CONFIG_CHROMA_2X2 @@ -2190,6 +2451,7 @@ static const aom_prob default_inter_ext_tx_prob[EXT_TX_SIZES][TX_TYPES - 1] = { { 176, 85, 128 }, { 192, 85, 128 }, }; +#endif // CONFIG_MRC_TX #endif // CONFIG_EXT_TX #if CONFIG_EXT_INTRA && CONFIG_INTRA_INTERP @@ -2237,6 +2499,14 @@ static const aom_prob default_segment_tree_probs[SEG_TREE_PROBS] = { static const aom_prob default_segment_pred_probs[PREDICTION_PROBS] = { 128, 128, 128 }; +#if CONFIG_NEW_MULTISYMBOL +static const aom_cdf_prob + default_segment_pred_cdf[PREDICTION_PROBS][CDF_SIZE(2)] = { + { AOM_ICDF(128 * 128), AOM_ICDF(32768), 0}, + { AOM_ICDF(128 * 128), AOM_ICDF(32768), 0}, + { AOM_ICDF(128 * 128), AOM_ICDF(32768), 0} +}; +#endif // clang-format on #if CONFIG_DUAL_FILTER @@ -2269,22 +2539,22 @@ static const aom_cdf_prob static const aom_cdf_prob default_switchable_interp_cdf[SWITCHABLE_FILTER_CONTEXTS][CDF_SIZE( SWITCHABLE_FILTERS)] = { - { AOM_ICDF(30080), AOM_ICDF(31781), AOM_ICDF(32768), 0 }, - { AOM_ICDF(4608), AOM_ICDF(32658), AOM_ICDF(32768), 0 }, - { AOM_ICDF(4352), AOM_ICDF(4685), AOM_ICDF(32768), 0 }, - { AOM_ICDF(19072), AOM_ICDF(26776), AOM_ICDF(32768), 0 }, - { AOM_ICDF(30080), AOM_ICDF(31781), AOM_ICDF(32768), 0 }, - { AOM_ICDF(4608), AOM_ICDF(32658), AOM_ICDF(32768), 0 }, - { AOM_ICDF(4352), AOM_ICDF(4685), AOM_ICDF(32768), 0 }, - { AOM_ICDF(19072), AOM_ICDF(26776), AOM_ICDF(32768), 0 }, - { AOM_ICDF(30080), AOM_ICDF(31781), AOM_ICDF(32768), 0 }, - { AOM_ICDF(4608), AOM_ICDF(32658), AOM_ICDF(32768), 0 }, - { AOM_ICDF(4352), AOM_ICDF(4685), AOM_ICDF(32768), 0 }, - { AOM_ICDF(19072), AOM_ICDF(26776), AOM_ICDF(32768), 0 }, - { AOM_ICDF(30080), AOM_ICDF(31781), AOM_ICDF(32768), 0 }, - { AOM_ICDF(4608), AOM_ICDF(32658), AOM_ICDF(32768), 0 }, - { AOM_ICDF(4352), AOM_ICDF(4685), AOM_ICDF(32768), 0 }, - { AOM_ICDF(19072), AOM_ICDF(26776), AOM_ICDF(32768), 0 }, + { AOM_ICDF(32256), AOM_ICDF(32654), AOM_ICDF(32768), 0 }, + { AOM_ICDF(2816), AOM_ICDF(32651), AOM_ICDF(32768), 0 }, + { AOM_ICDF(512), AOM_ICDF(764), AOM_ICDF(32768), 0 }, + { AOM_ICDF(30464), AOM_ICDF(31778), AOM_ICDF(32768), 0 }, + { AOM_ICDF(32384), AOM_ICDF(32483), AOM_ICDF(32768), 0 }, + { AOM_ICDF(3072), AOM_ICDF(32652), AOM_ICDF(32768), 0 }, + { AOM_ICDF(256), AOM_ICDF(383), AOM_ICDF(32768), 0 }, + { AOM_ICDF(25344), AOM_ICDF(26533), AOM_ICDF(32768), 0 }, + { AOM_ICDF(32000), AOM_ICDF(32531), AOM_ICDF(32768), 0 }, + { AOM_ICDF(2048), AOM_ICDF(32648), AOM_ICDF(32768), 0 }, + { AOM_ICDF(384), AOM_ICDF(890), AOM_ICDF(32768), 0 }, + { AOM_ICDF(28928), AOM_ICDF(31358), AOM_ICDF(32768), 0 }, + { AOM_ICDF(31616), AOM_ICDF(31787), AOM_ICDF(32768), 0 }, + { AOM_ICDF(4224), AOM_ICDF(32433), AOM_ICDF(32768), 0 }, + { AOM_ICDF(128), AOM_ICDF(256), AOM_ICDF(32768), 0 }, + { AOM_ICDF(17408), AOM_ICDF(18248), AOM_ICDF(32768), 0 } }; #endif // USE_EXTRA_FILTER #else // CONFIG_DUAL_FILTER @@ -2344,7 +2614,7 @@ static const aom_cdf_prob }; static const aom_cdf_prob - default_uv_mode_cdf[INTRA_MODES][CDF_SIZE(INTRA_MODES)] = { + default_uv_mode_cdf[INTRA_MODES][CDF_SIZE(UV_INTRA_MODES)] = { { AOM_ICDF(23552), AOM_ICDF(23660), AOM_ICDF(26044), AOM_ICDF(28731), AOM_ICDF(29093), AOM_ICDF(29590), AOM_ICDF(30000), AOM_ICDF(30465), AOM_ICDF(30825), AOM_ICDF(31478), AOM_ICDF(32088), AOM_ICDF(32401), @@ -2416,7 +2686,7 @@ static const aom_cdf_prob }; static const aom_cdf_prob - default_uv_mode_cdf[INTRA_MODES][CDF_SIZE(INTRA_MODES)] = { + default_uv_mode_cdf[INTRA_MODES][CDF_SIZE(UV_INTRA_MODES)] = { { AOM_ICDF(25472), AOM_ICDF(25558), AOM_ICDF(27783), AOM_ICDF(30779), AOM_ICDF(30988), AOM_ICDF(31269), AOM_ICDF(31492), AOM_ICDF(31741), AOM_ICDF(32014), AOM_ICDF(32420), AOM_ICDF(32768), 0 }, @@ -2470,7 +2740,7 @@ static const aom_cdf_prob }; static const aom_cdf_prob - default_uv_mode_cdf[INTRA_MODES][CDF_SIZE(INTRA_MODES)] = { + default_uv_mode_cdf[INTRA_MODES][CDF_SIZE(UV_INTRA_MODES)] = { { AOM_ICDF(15360), AOM_ICDF(15836), AOM_ICDF(20863), AOM_ICDF(27513), AOM_ICDF(28269), AOM_ICDF(29048), AOM_ICDF(29455), AOM_ICDF(30154), AOM_ICDF(31206), AOM_ICDF(32768), 0 }, @@ -2509,46 +2779,66 @@ static const aom_cdf_prob default_partition_cdf[PARTITION_CONTEXTS][CDF_SIZE(EXT_PARTITION_TYPES)] = { // 8x8 -> 4x4 only supports the four legacy partition types { AOM_ICDF(25472), AOM_ICDF(28949), AOM_ICDF(31052), AOM_ICDF(32768), 0, - 0, 0, 0, 0 }, + 0, 0, 0, 0, 0, 0 }, { AOM_ICDF(18816), AOM_ICDF(22250), AOM_ICDF(28783), AOM_ICDF(32768), 0, - 0, 0, 0, 0 }, + 0, 0, 0, 0, 0, 0 }, { AOM_ICDF(18944), AOM_ICDF(26126), AOM_ICDF(29188), AOM_ICDF(32768), 0, - 0, 0, 0, 0 }, + 0, 0, 0, 0, 0, 0 }, { AOM_ICDF(15488), AOM_ICDF(22508), AOM_ICDF(27077), AOM_ICDF(32768), 0, - 0, 0, 0, 0 }, + 0, 0, 0, 0, 0, 0 }, + // 16x16 -> 8x8 { AOM_ICDF(22272), AOM_ICDF(23768), AOM_ICDF(25043), AOM_ICDF(29996), - AOM_ICDF(30744), AOM_ICDF(31493), AOM_ICDF(32130), AOM_ICDF(32768), 0 }, + AOM_ICDF(30744), AOM_ICDF(31493), AOM_ICDF(32130), AOM_ICDF(32768), 0, + 0, 0 }, { AOM_ICDF(11776), AOM_ICDF(13457), AOM_ICDF(16315), AOM_ICDF(28229), - AOM_ICDF(29069), AOM_ICDF(29910), AOM_ICDF(31339), AOM_ICDF(32768), 0 }, + AOM_ICDF(29069), AOM_ICDF(29910), AOM_ICDF(31339), AOM_ICDF(32768), 0, + 0, 0 }, { AOM_ICDF(10496), AOM_ICDF(14802), AOM_ICDF(16136), AOM_ICDF(27127), - AOM_ICDF(29280), AOM_ICDF(31434), AOM_ICDF(32101), AOM_ICDF(32768), 0 }, + AOM_ICDF(29280), AOM_ICDF(31434), AOM_ICDF(32101), AOM_ICDF(32768), 0, + 0, 0 }, { AOM_ICDF(6784), AOM_ICDF(8763), AOM_ICDF(10440), AOM_ICDF(29110), - AOM_ICDF(30100), AOM_ICDF(31090), AOM_ICDF(31929), AOM_ICDF(32768), 0 }, + AOM_ICDF(30100), AOM_ICDF(31090), AOM_ICDF(31929), AOM_ICDF(32768), 0, + 0, 0 }, + // 32x32 -> 16x16 { AOM_ICDF(22656), AOM_ICDF(23801), AOM_ICDF(24702), AOM_ICDF(30721), - AOM_ICDF(31294), AOM_ICDF(31867), AOM_ICDF(32317), AOM_ICDF(32768), 0 }, + AOM_ICDF(31103), AOM_ICDF(31485), AOM_ICDF(31785), AOM_ICDF(32085), + AOM_ICDF(32467), AOM_ICDF(32768), 0 }, { AOM_ICDF(8704), AOM_ICDF(9926), AOM_ICDF(12586), AOM_ICDF(28885), - AOM_ICDF(29496), AOM_ICDF(30107), AOM_ICDF(31437), AOM_ICDF(32768), 0 }, + AOM_ICDF(29292), AOM_ICDF(29699), AOM_ICDF(30586), AOM_ICDF(31473), + AOM_ICDF(31881), AOM_ICDF(32768), 0 }, { AOM_ICDF(6656), AOM_ICDF(10685), AOM_ICDF(11566), AOM_ICDF(27857), - AOM_ICDF(29871), AOM_ICDF(31886), AOM_ICDF(32327), AOM_ICDF(32768), 0 }, + AOM_ICDF(29200), AOM_ICDF(30543), AOM_ICDF(30837), AOM_ICDF(31131), + AOM_ICDF(32474), AOM_ICDF(32768), 0 }, { AOM_ICDF(2176), AOM_ICDF(3012), AOM_ICDF(3690), AOM_ICDF(31253), - AOM_ICDF(31671), AOM_ICDF(32090), AOM_ICDF(32429), AOM_ICDF(32768), 0 }, + AOM_ICDF(31532), AOM_ICDF(31811), AOM_ICDF(32037), AOM_ICDF(32263), + AOM_ICDF(32542), AOM_ICDF(32768), 0 }, + // 64x64 -> 32x32 { AOM_ICDF(28416), AOM_ICDF(28705), AOM_ICDF(28926), AOM_ICDF(32258), - AOM_ICDF(32402), AOM_ICDF(32547), AOM_ICDF(32657), AOM_ICDF(32768), 0 }, + AOM_ICDF(32402), AOM_ICDF(32547), AOM_ICDF(32657), AOM_ICDF(32768), 0, + 0, 0 }, { AOM_ICDF(9216), AOM_ICDF(9952), AOM_ICDF(11849), AOM_ICDF(30134), - AOM_ICDF(30502), AOM_ICDF(30870), AOM_ICDF(31819), AOM_ICDF(32768), 0 }, + AOM_ICDF(30502), AOM_ICDF(30870), AOM_ICDF(31819), AOM_ICDF(32768), 0, + 0, 0 }, { AOM_ICDF(7424), AOM_ICDF(9008), AOM_ICDF(9528), AOM_ICDF(30664), - AOM_ICDF(31456), AOM_ICDF(32248), AOM_ICDF(32508), AOM_ICDF(32768), 0 }, + AOM_ICDF(31456), AOM_ICDF(32248), AOM_ICDF(32508), AOM_ICDF(32768), 0, + 0, 0 }, { AOM_ICDF(1280), AOM_ICDF(1710), AOM_ICDF(2069), AOM_ICDF(31978), - AOM_ICDF(32193), AOM_ICDF(32409), AOM_ICDF(32588), AOM_ICDF(32768), 0 }, + AOM_ICDF(32193), AOM_ICDF(32409), AOM_ICDF(32588), AOM_ICDF(32768), 0, + 0, 0 }, #if CONFIG_EXT_PARTITION + // 128x128 -> 64x64 { AOM_ICDF(28416), AOM_ICDF(28705), AOM_ICDF(28926), AOM_ICDF(32258), - AOM_ICDF(32402), AOM_ICDF(32547), AOM_ICDF(32657), AOM_ICDF(32768), 0 }, + AOM_ICDF(32402), AOM_ICDF(32547), AOM_ICDF(32548), AOM_ICDF(32768), 0, + 0, 0 }, { AOM_ICDF(9216), AOM_ICDF(9952), AOM_ICDF(11849), AOM_ICDF(30134), - AOM_ICDF(30502), AOM_ICDF(30870), AOM_ICDF(31819), AOM_ICDF(32768), 0 }, + AOM_ICDF(30502), AOM_ICDF(30870), AOM_ICDF(30871), AOM_ICDF(32768), 0, + 0, 0 }, { AOM_ICDF(7424), AOM_ICDF(9008), AOM_ICDF(9528), AOM_ICDF(30664), - AOM_ICDF(31456), AOM_ICDF(32248), AOM_ICDF(32508), AOM_ICDF(32768), 0 }, + AOM_ICDF(31456), AOM_ICDF(32248), AOM_ICDF(32249), AOM_ICDF(32768), 0, + 0, 0 }, { AOM_ICDF(1280), AOM_ICDF(1710), AOM_ICDF(2069), AOM_ICDF(31978), - AOM_ICDF(32193), AOM_ICDF(32409), AOM_ICDF(32588), AOM_ICDF(32768), 0 }, + AOM_ICDF(32193), AOM_ICDF(32409), AOM_ICDF(32410), AOM_ICDF(32768), 0, + 0, 0 }, #endif }; #else @@ -2579,17 +2869,6 @@ static const aom_cdf_prob }; #endif -static const aom_cdf_prob - default_inter_mode_cdf[INTER_MODE_CONTEXTS][CDF_SIZE(INTER_MODES)] = { - { AOM_ICDF(256), AOM_ICDF(22227), AOM_ICDF(23627), AOM_ICDF(32768), 0 }, - { AOM_ICDF(896), AOM_ICDF(18948), AOM_ICDF(23537), AOM_ICDF(32768), 0 }, - { AOM_ICDF(896), AOM_ICDF(21563), AOM_ICDF(24320), AOM_ICDF(32768), 0 }, - { AOM_ICDF(896), AOM_ICDF(12599), AOM_ICDF(17799), AOM_ICDF(32768), 0 }, - { AOM_ICDF(1024), AOM_ICDF(8960), AOM_ICDF(13238), AOM_ICDF(32768), 0 }, - { AOM_ICDF(2176), AOM_ICDF(11856), AOM_ICDF(14388), AOM_ICDF(32768), 0 }, - { AOM_ICDF(3200), AOM_ICDF(6550), AOM_ICDF(9622), AOM_ICDF(32768), 0 }, - }; - #if CONFIG_EXT_TX static const aom_cdf_prob default_intra_ext_tx_cdf [EXT_TX_SETS_INTRA][EXT_TX_SIZES][INTRA_MODES][CDF_SIZE(TX_TYPES)] = { @@ -2944,7 +3223,87 @@ static const aom_cdf_prob default_intra_ext_tx_cdf { AOM_ICDF(1280), AOM_ICDF(5216), AOM_ICDF(6938), AOM_ICDF(13396), AOM_ICDF(32768), 0 }, }, + }, +#if CONFIG_MRC_TX + { + { + { AOM_ICDF(1024), AOM_ICDF(32768), 0 }, + { AOM_ICDF(1280), AOM_ICDF(32768), 0 }, + { AOM_ICDF(1280), AOM_ICDF(32768), 0 }, + { AOM_ICDF(1152), AOM_ICDF(32768), 0 }, + { AOM_ICDF(1024), AOM_ICDF(32768), 0 }, + { AOM_ICDF(1280), AOM_ICDF(32768), 0 }, + { AOM_ICDF(1280), AOM_ICDF(32768), 0 }, + { AOM_ICDF(1280), AOM_ICDF(32768), 0 }, + { AOM_ICDF(1280), AOM_ICDF(32768), 0 }, +#if CONFIG_ALT_INTRA + { AOM_ICDF(1280), AOM_ICDF(32768), 0 }, +#if CONFIG_SMOOTH_HV + { AOM_ICDF(1280), AOM_ICDF(32768), 0 }, + { AOM_ICDF(1280), AOM_ICDF(32768), 0 }, +#endif // CONFIG_SMOOTH_HV +#endif // CONFIG_ALT_INTRA + { AOM_ICDF(1280), AOM_ICDF(32768), 0 }, + }, + { + { AOM_ICDF(1024), AOM_ICDF(32768), 0 }, + { AOM_ICDF(1280), AOM_ICDF(32768), 0 }, + { AOM_ICDF(1280), AOM_ICDF(32768), 0 }, + { AOM_ICDF(1152), AOM_ICDF(32768), 0 }, + { AOM_ICDF(1024), AOM_ICDF(32768), 0 }, + { AOM_ICDF(1280), AOM_ICDF(32768), 0 }, + { AOM_ICDF(1280), AOM_ICDF(32768), 0 }, + { AOM_ICDF(1280), AOM_ICDF(32768), 0 }, + { AOM_ICDF(1280), AOM_ICDF(32768), 0 }, +#if CONFIG_ALT_INTRA + { AOM_ICDF(1280), AOM_ICDF(32768), 0 }, +#if CONFIG_SMOOTH_HV + { AOM_ICDF(1280), AOM_ICDF(32768), 0 }, + { AOM_ICDF(1280), AOM_ICDF(32768), 0 }, +#endif // CONFIG_SMOOTH_HV +#endif // CONFIG_ALT_INTRA + { AOM_ICDF(1280), AOM_ICDF(32768), 0 }, + }, + { + { AOM_ICDF(1024), AOM_ICDF(32768), 0 }, + { AOM_ICDF(1280), AOM_ICDF(32768), 0 }, + { AOM_ICDF(1280), AOM_ICDF(32768), 0 }, + { AOM_ICDF(1152), AOM_ICDF(32768), 0 }, + { AOM_ICDF(1024), AOM_ICDF(32768), 0 }, + { AOM_ICDF(1280), AOM_ICDF(32768), 0 }, + { AOM_ICDF(1280), AOM_ICDF(32768), 0 }, + { AOM_ICDF(1280), AOM_ICDF(32768), 0 }, + { AOM_ICDF(1280), AOM_ICDF(32768), 0 }, +#if CONFIG_ALT_INTRA + { AOM_ICDF(1280), AOM_ICDF(32768), 0 }, +#if CONFIG_SMOOTH_HV + { AOM_ICDF(1280), AOM_ICDF(32768), 0 }, + { AOM_ICDF(1280), AOM_ICDF(32768), 0 }, +#endif // CONFIG_SMOOTH_HV +#endif // CONFIG_ALT_INTRA + { AOM_ICDF(1280), AOM_ICDF(32768), 0 }, + }, + { + { AOM_ICDF(1024), AOM_ICDF(32768), 0 }, + { AOM_ICDF(1280), AOM_ICDF(32768), 0 }, + { AOM_ICDF(1280), AOM_ICDF(32768), 0 }, + { AOM_ICDF(1152), AOM_ICDF(32768), 0 }, + { AOM_ICDF(1024), AOM_ICDF(32768), 0 }, + { AOM_ICDF(1280), AOM_ICDF(32768), 0 }, + { AOM_ICDF(1280), AOM_ICDF(32768), 0 }, + { AOM_ICDF(1280), AOM_ICDF(32768), 0 }, + { AOM_ICDF(1280), AOM_ICDF(32768), 0 }, +#if CONFIG_ALT_INTRA + { AOM_ICDF(1280), AOM_ICDF(32768), 0 }, +#if CONFIG_SMOOTH_HV + { AOM_ICDF(1280), AOM_ICDF(32768), 0 }, + { AOM_ICDF(1280), AOM_ICDF(32768), 0 }, +#endif // CONFIG_SMOOTH_HV +#endif // CONFIG_ALT_INTRA + { AOM_ICDF(1280), AOM_ICDF(32768), 0 }, + }, } +#endif // CONFIG_MRC_TX }; static const aom_cdf_prob default_inter_ext_tx_cdf[EXT_TX_SETS_INTER][EXT_TX_SIZES][CDF_SIZE( @@ -3008,9 +3367,82 @@ static const aom_cdf_prob { AOM_ICDF(1536), AOM_ICDF(32768), 0 }, { AOM_ICDF(1536), AOM_ICDF(32768), 0 }, { AOM_ICDF(1536), AOM_ICDF(32768), 0 }, - { AOM_ICDF(1536), AOM_ICDF(32768), 0 } } + { AOM_ICDF(1536), AOM_ICDF(32768), 0 } }, +#if CONFIG_MRC_TX + { +#if CONFIG_CHROMA_2X2 + { 0 }, +#endif + { AOM_ICDF(30080), AOM_ICDF(31781), AOM_ICDF(32768), 0 }, + { AOM_ICDF(4608), AOM_ICDF(32658), AOM_ICDF(32768), 0 }, + { AOM_ICDF(4352), AOM_ICDF(4685), AOM_ICDF(32768), 0 }, + { AOM_ICDF(19072), AOM_ICDF(26776), AOM_ICDF(32768), 0 } }, +#endif // CONFIG_MRC_TX }; #else +#if CONFIG_MRC_TX +static const aom_cdf_prob + default_intra_ext_tx_cdf[EXT_TX_SIZES][TX_TYPES][CDF_SIZE(TX_TYPES)] = { +#if CONFIG_CHROMA_2X2 + { { AOM_ICDF(30720), AOM_ICDF(31104), AOM_ICDF(31400), AOM_ICDF(32084), + AOM_ICDF(32768), 0 }, + { AOM_ICDF(512), AOM_ICDF(582), AOM_ICDF(638), AOM_ICDF(31764), + AOM_ICDF(32768), 0 }, + { AOM_ICDF(512), AOM_ICDF(582), AOM_ICDF(638), AOM_ICDF(1642), + AOM_ICDF(32768), 0 }, + { AOM_ICDF(512), AOM_ICDF(582), AOM_ICDF(638), AOM_ICDF(1642), + AOM_ICDF(32768), 0 }, + { AOM_ICDF(512), AOM_ICDF(1280), AOM_ICDF(31760), AOM_ICDF(32264), + AOM_ICDF(32768), 0 } }, +#endif + { { AOM_ICDF(30720), AOM_ICDF(31104), AOM_ICDF(31400), AOM_ICDF(32084), + AOM_ICDF(32768), 0 }, + { AOM_ICDF(512), AOM_ICDF(582), AOM_ICDF(638), AOM_ICDF(31764), + AOM_ICDF(32768), 0 }, + { AOM_ICDF(512), AOM_ICDF(582), AOM_ICDF(638), AOM_ICDF(1642), + AOM_ICDF(32768), 0 }, + { AOM_ICDF(512), AOM_ICDF(582), AOM_ICDF(638), AOM_ICDF(1642), + AOM_ICDF(32768), 0 }, + { AOM_ICDF(512), AOM_ICDF(1280), AOM_ICDF(31760), AOM_ICDF(32264), + AOM_ICDF(32768), 0 } }, + + { { AOM_ICDF(31232), AOM_ICDF(31488), AOM_ICDF(31742), AOM_ICDF(32255), + AOM_ICDF(32768), 0 }, + { AOM_ICDF(1024), AOM_ICDF(1152), AOM_ICDF(1272), AOM_ICDF(31784), + AOM_ICDF(32768), 0 }, + { AOM_ICDF(1024), AOM_ICDF(1152), AOM_ICDF(1272), AOM_ICDF(2256), + AOM_ICDF(32768), 0 }, + { AOM_ICDF(1024), AOM_ICDF(1052), AOM_ICDF(1272), AOM_ICDF(2256), + AOM_ICDF(32768), 0 }, + { AOM_ICDF(1024), AOM_ICDF(1792), AOM_ICDF(31776), AOM_ICDF(32272), + AOM_ICDF(32768), 0 } }, + + { { AOM_ICDF(31744), AOM_ICDF(29440), AOM_ICDF(32084), AOM_ICDF(32426), + AOM_ICDF(32768), 0 }, + { AOM_ICDF(2048), AOM_ICDF(2176), AOM_ICDF(2528), AOM_ICDF(31823), + AOM_ICDF(32768), 0 }, + { AOM_ICDF(2048), AOM_ICDF(2176), AOM_ICDF(2528), AOM_ICDF(3473), + AOM_ICDF(32768), 0 }, + { AOM_ICDF(2048), AOM_ICDF(2176), AOM_ICDF(2528), AOM_ICDF(3473), + AOM_ICDF(32768), 0 }, + { AOM_ICDF(2048), AOM_ICDF(28160), AOM_ICDF(31808), AOM_ICDF(32288), + AOM_ICDF(32768), 0 } }, + }; + +static const aom_cdf_prob + default_inter_ext_tx_cdf[EXT_TX_SIZES][CDF_SIZE(TX_TYPES)] = { +#if CONFIG_CHROMA_2X2 + { AOM_ICDF(20480), AOM_ICDF(23040), AOM_ICDF(24560), AOM_ICDF(28664), + AOM_ICDF(32768), 0 }, +#endif + { AOM_ICDF(20480), AOM_ICDF(23040), AOM_ICDF(24560), AOM_ICDF(28664), + AOM_ICDF(32768), 0 }, + { AOM_ICDF(22528), AOM_ICDF(24320), AOM_ICDF(25928), AOM_ICDF(29348), + AOM_ICDF(32768), 0 }, + { AOM_ICDF(24576), AOM_ICDF(25600), AOM_ICDF(27296), AOM_ICDF(30032), + AOM_ICDF(32768), 0 }, + }; +#else // CONFIG_MRC_TX static const aom_cdf_prob default_intra_ext_tx_cdf[EXT_TX_SIZES][TX_TYPES][CDF_SIZE(TX_TYPES)] = { #if CONFIG_CHROMA_2X2 @@ -3051,6 +3483,7 @@ static const aom_cdf_prob { AOM_ICDF(22528), AOM_ICDF(25928), AOM_ICDF(29348), AOM_ICDF(32768), 0 }, { AOM_ICDF(24576), AOM_ICDF(27296), AOM_ICDF(30032), AOM_ICDF(32768), 0 }, }; +#endif // CONFIG_MRC_TX #endif // !CONFIG_EXT_TX #if CONFIG_EXT_INTRA && CONFIG_INTRA_INTERP @@ -3066,11 +3499,10 @@ static const aom_cdf_prob #if CONFIG_CFL static const aom_cdf_prob default_cfl_alpha_cdf[CDF_SIZE(CFL_ALPHABET_SIZE)] = { - // decreasing likelihood, after 6 iterations of alpha RDO on subset 3 - AOM_ICDF(23928), AOM_ICDF(26267), AOM_ICDF(27319), AOM_ICDF(28330), - AOM_ICDF(29341), AOM_ICDF(30160), AOM_ICDF(30581), AOM_ICDF(30983), - AOM_ICDF(31353), AOM_ICDF(31634), AOM_ICDF(31907), AOM_ICDF(32171), - AOM_ICDF(32407), AOM_ICDF(32558), AOM_ICDF(32669), AOM_ICDF(32768) + AOM_ICDF(20492), AOM_ICDF(24094), AOM_ICDF(25679), AOM_ICDF(27242), + AOM_ICDF(28286), AOM_ICDF(29153), AOM_ICDF(29807), AOM_ICDF(30352), + AOM_ICDF(30866), AOM_ICDF(31295), AOM_ICDF(31703), AOM_ICDF(32046), + AOM_ICDF(32317), AOM_ICDF(32534), AOM_ICDF(32663), AOM_ICDF(32768) }; #endif @@ -4473,13 +4905,31 @@ const aom_cdf_prob }; static void init_mode_probs(FRAME_CONTEXT *fc) { - av1_copy(fc->uv_mode_prob, default_uv_probs); - av1_copy(fc->y_mode_prob, default_if_y_probs); av1_copy(fc->switchable_interp_prob, default_switchable_interp_prob); av1_copy(fc->partition_prob, default_partition_probs); av1_copy(fc->intra_inter_prob, default_intra_inter_p); av1_copy(fc->comp_inter_prob, default_comp_inter_p); +#if CONFIG_PALETTE + av1_copy(fc->palette_y_size_cdf, default_palette_y_size_cdf); + av1_copy(fc->palette_uv_size_cdf, default_palette_uv_size_cdf); + av1_copy(fc->palette_y_color_index_cdf, default_palette_y_color_index_cdf); + av1_copy(fc->palette_uv_color_index_cdf, default_palette_uv_color_index_cdf); +#endif // CONFIG_PALETTE +#if CONFIG_NEW_MULTISYMBOL + av1_copy(fc->comp_inter_cdf, default_comp_inter_cdf); +#endif // CONFIG_NEW_MULTISYMBOL +#if CONFIG_EXT_COMP_REFS + av1_copy(fc->comp_ref_type_prob, default_comp_ref_type_p); + av1_copy(fc->uni_comp_ref_prob, default_uni_comp_ref_p); +#if CONFIG_NEW_MULTISYMBOL + av1_copy(fc->comp_ref_type_cdf, default_comp_ref_type_cdf); + av1_copy(fc->uni_comp_ref_cdf, default_uni_comp_ref_cdf); +#endif // CONFIG_NEW_MULTISYMBOL +#endif // CONFIG_EXT_COMP_REFS av1_copy(fc->comp_ref_prob, default_comp_ref_p); +#if CONFIG_NEW_MULTISYMBOL + av1_copy(fc->comp_ref_cdf, default_comp_ref_cdf); +#endif #if CONFIG_LV_MAP av1_copy(fc->txb_skip, default_txb_skip); av1_copy(fc->nz_map, default_nz_map); @@ -4490,48 +4940,82 @@ static void init_mode_probs(FRAME_CONTEXT *fc) { #endif #if CONFIG_EXT_REFS av1_copy(fc->comp_bwdref_prob, default_comp_bwdref_p); +#if CONFIG_NEW_MULTISYMBOL + av1_copy(fc->comp_bwdref_cdf, default_comp_bwdref_cdf); +#endif #endif // CONFIG_EXT_REFS av1_copy(fc->single_ref_prob, default_single_ref_p); +#if CONFIG_NEW_MULTISYMBOL + av1_copy(fc->single_ref_cdf, default_single_ref_cdf); +#endif #if CONFIG_EXT_INTER && CONFIG_COMPOUND_SINGLEREF av1_copy(fc->comp_inter_mode_prob, default_comp_inter_mode_p); #endif // CONFIG_EXT_INTER && CONFIG_COMPOUND_SINGLEREF av1_copy(fc->tx_size_probs, default_tx_size_prob); -#if CONFIG_EXT_TX && CONFIG_RECT_TX && CONFIG_RECT_TX_EXT +#if CONFIG_RECT_TX_EXT && (CONFIG_EXT_TX || CONFIG_VAR_TX) fc->quarter_tx_size_prob = default_quarter_tx_size_prob; -#endif // CONFIG_EXT_TX && CONFIG_RECT_TX && CONFIG_RECT_TX_EXT +#endif #if CONFIG_VAR_TX av1_copy(fc->txfm_partition_prob, default_txfm_partition_probs); +#if CONFIG_NEW_MULTISYMBOL + av1_copy(fc->txfm_partition_cdf, default_txfm_partition_cdf); +#endif #endif av1_copy(fc->skip_probs, default_skip_probs); av1_copy(fc->newmv_prob, default_newmv_prob); av1_copy(fc->zeromv_prob, default_zeromv_prob); av1_copy(fc->refmv_prob, default_refmv_prob); av1_copy(fc->drl_prob, default_drl_prob); - av1_copy(fc->inter_mode_probs, default_inter_mode_probs); +#if CONFIG_NEW_MULTISYMBOL + av1_copy(fc->newmv_cdf, default_newmv_cdf); + av1_copy(fc->zeromv_cdf, default_zeromv_cdf); + av1_copy(fc->refmv_cdf, default_refmv_cdf); + av1_copy(fc->drl_cdf, default_drl_cdf); +#endif #if CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION av1_copy(fc->motion_mode_prob, default_motion_mode_prob); + av1_copy(fc->motion_mode_cdf, default_motion_mode_cdf); +#if CONFIG_NCOBMC_ADAPT_WEIGHT && CONFIG_MOTION_VAR + av1_copy(fc->ncobmc_mode_prob, default_ncobmc_mode_prob); + av1_copy(fc->ncobmc_mode_cdf, default_ncobmc_mode_cdf); +#endif #if CONFIG_MOTION_VAR && CONFIG_WARPED_MOTION av1_copy(fc->obmc_prob, default_obmc_prob); +#if CONFIG_NEW_MULTISYMBOL + av1_copy(fc->obmc_cdf, default_obmc_cdf); +#endif #endif // CONFIG_MOTION_VAR && CONFIG_WARPED_MOTION #endif // CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION #if CONFIG_EXT_INTER av1_copy(fc->inter_compound_mode_probs, default_inter_compound_mode_probs); + av1_copy(fc->inter_compound_mode_cdf, default_inter_compound_mode_cdf); #if CONFIG_COMPOUND_SINGLEREF av1_copy(fc->inter_singleref_comp_mode_probs, default_inter_singleref_comp_mode_probs); + av1_copy(fc->inter_singleref_comp_mode_cdf, + default_inter_singleref_comp_mode_cdf); #endif // CONFIG_COMPOUND_SINGLEREF av1_copy(fc->compound_type_prob, default_compound_type_probs); + av1_copy(fc->compound_type_cdf, default_compound_type_cdf); #if CONFIG_INTERINTRA av1_copy(fc->interintra_prob, default_interintra_prob); - av1_copy(fc->interintra_mode_prob, default_interintra_mode_prob); av1_copy(fc->wedge_interintra_prob, default_wedge_interintra_prob); -#endif +#if CONFIG_NEW_MULTISYMBOL + av1_copy(fc->interintra_cdf, default_interintra_cdf); + av1_copy(fc->wedge_interintra_cdf, default_wedge_interintra_cdf); +#endif // CONFIG_NEW_MULTISYMBOL + av1_copy(fc->interintra_mode_prob, default_interintra_mode_prob); + av1_copy(fc->interintra_mode_cdf, default_interintra_mode_cdf); +#endif // CONFIG_INTERINTRA #endif // CONFIG_EXT_INTER #if CONFIG_SUPERTX av1_copy(fc->supertx_prob, default_supertx_prob); #endif // CONFIG_SUPERTX av1_copy(fc->seg.tree_probs, default_segment_tree_probs); av1_copy(fc->seg.pred_probs, default_segment_pred_probs); +#if CONFIG_NEW_MULTISYMBOL + av1_copy(fc->seg.pred_cdf, default_segment_pred_cdf); +#endif #if CONFIG_EXT_INTRA #if CONFIG_INTRA_INTERP av1_copy(fc->intra_filter_probs, default_intra_filter_probs); @@ -4549,9 +5033,12 @@ static void init_mode_probs(FRAME_CONTEXT *fc) { av1_copy(fc->uv_mode_cdf, default_uv_mode_cdf); av1_copy(fc->switchable_interp_cdf, default_switchable_interp_cdf); av1_copy(fc->partition_cdf, default_partition_cdf); - av1_copy(fc->inter_mode_cdf, default_inter_mode_cdf); av1_copy(fc->intra_ext_tx_cdf, default_intra_ext_tx_cdf); av1_copy(fc->inter_ext_tx_cdf, default_inter_ext_tx_cdf); +#if CONFIG_NEW_MULTISYMBOL + av1_copy(fc->skip_cdfs, default_skip_cdfs); + av1_copy(fc->intra_inter_cdf, default_intra_inter_cdf); +#endif #if CONFIG_EXT_INTRA && CONFIG_INTRA_INTERP av1_copy(fc->intra_filter_cdf, default_intra_filter_cdf); #endif // CONFIG_EXT_INTRA && CONFIG_INTRA_INTERP @@ -4576,104 +5063,6 @@ static void init_mode_probs(FRAME_CONTEXT *fc) { int av1_switchable_interp_ind[SWITCHABLE_FILTERS]; int av1_switchable_interp_inv[SWITCHABLE_FILTERS]; -#if !CONFIG_EC_ADAPT -void av1_set_mode_cdfs(struct AV1Common *cm) { - FRAME_CONTEXT *fc = cm->fc; - int i, j; - if (cm->seg.enabled && cm->seg.update_map) { - av1_tree_to_cdf(av1_segment_tree, cm->fc->seg.tree_probs, - cm->fc->seg.tree_cdf); - } - - for (i = 0; i < INTRA_MODES; ++i) - av1_tree_to_cdf(av1_intra_mode_tree, fc->uv_mode_prob[i], - fc->uv_mode_cdf[i]); -#if CONFIG_EXT_PARTITION_TYPES - for (i = 0; i < PARTITION_PLOFFSET; ++i) - av1_tree_to_cdf(av1_partition_tree, fc->partition_prob[i], - fc->partition_cdf[i]); - // Logical index (enum value) to inorder index (tree_to_cdf order) - aom_cdf_prob inorder_partition_cdf[CDF_SIZE(EXT_PARTITION_TYPES)] = {}; - // TODO(aconverse): Generate this dynamically. The assumptions that - // av1_indices_from_tree() makes don't hold for this tree. - static const uint8_t av1_ext_partition_index_map[EXT_PARTITION_TYPES] = { - 0, 1, 4, 7, 2, 3, 5, 6, - }; - for (; i < PARTITION_CONTEXTS; ++i) { - av1_tree_to_cdf(av1_ext_partition_tree, fc->partition_prob[i], - inorder_partition_cdf); - aom_cdf_prob cum_prob = 0; - for (j = 0; j < EXT_PARTITION_TYPES; ++j) { - int inorder_idx = av1_ext_partition_index_map[j]; - aom_cdf_prob prob = - AOM_ICDF(inorder_partition_cdf[inorder_idx]) - - (inorder_idx > 0 ? AOM_ICDF(inorder_partition_cdf[inorder_idx - 1]) - : 0); - cum_prob += prob; - fc->partition_cdf[i][j] = AOM_ICDF(cum_prob); - } - assert(cum_prob == CDF_PROB_TOP); - } -#else - for (i = 0; i < PARTITION_CONTEXTS; ++i) - av1_tree_to_cdf(av1_partition_tree, fc->partition_prob[i], - fc->partition_cdf[i]); -#endif - - for (i = 0; i < INTRA_MODES; ++i) - for (j = 0; j < INTRA_MODES; ++j) - av1_tree_to_cdf(av1_intra_mode_tree, cm->kf_y_prob[i][j], - cm->fc->kf_y_cdf[i][j]); - - for (j = 0; j < SWITCHABLE_FILTER_CONTEXTS; ++j) - av1_tree_to_cdf(av1_switchable_interp_tree, fc->switchable_interp_prob[j], - fc->switchable_interp_cdf[j]); - - for (i = 0; i < INTER_MODE_CONTEXTS; ++i) - av1_tree_to_cdf(av1_inter_mode_tree, fc->inter_mode_probs[i], - fc->inter_mode_cdf[i]); - - for (i = 0; i < BLOCK_SIZE_GROUPS; ++i) - av1_tree_to_cdf(av1_intra_mode_tree, fc->y_mode_prob[i], fc->y_mode_cdf[i]); - -#if CONFIG_EXT_TX - int s; - for (s = 0; s < EXT_TX_SETS_INTRA; ++s) - for (i = TX_4X4; i < EXT_TX_SIZES; ++i) - for (j = 0; j < INTRA_MODES; ++j) - av1_tree_to_cdf(av1_ext_tx_intra_tree[s], - fc->intra_ext_tx_prob[s][i][j], - fc->intra_ext_tx_cdf[s][i][j]); - - for (s = 0; s < EXT_TX_SETS_INTER; ++s) - for (i = TX_4X4; i < EXT_TX_SIZES; ++i) - av1_tree_to_cdf(av1_ext_tx_inter_tree[s], fc->inter_ext_tx_prob[s][i], - fc->inter_ext_tx_cdf[s][i]); -#else - for (i = TX_4X4; i < EXT_TX_SIZES; ++i) - for (j = 0; j < TX_TYPES; ++j) - av1_tree_to_cdf(av1_ext_tx_tree, fc->intra_ext_tx_prob[i][j], - fc->intra_ext_tx_cdf[i][j]); - - for (i = TX_4X4; i < EXT_TX_SIZES; ++i) - av1_tree_to_cdf(av1_ext_tx_tree, fc->inter_ext_tx_prob[i], - fc->inter_ext_tx_cdf[i]); -#endif - for (i = 0; i < MAX_TX_DEPTH; i++) { - for (j = 0; j < TX_SIZE_CONTEXTS; j++) { - av1_tree_to_cdf(av1_tx_size_tree[i], fc->tx_size_probs[i][j], - fc->tx_size_cdf[i][j]); - } - } -#if CONFIG_EXT_INTRA && CONFIG_INTRA_INTERP - for (i = 0; i < INTRA_FILTERS + 1; ++i) { - av1_tree_to_cdf(av1_intra_filter_tree, fc->intra_filter_probs[i], - fc->intra_filter_cdf[i]); - } -#endif // CONFIG_EXT_INTRA && CONFIG_INTRA_INTERP -} -#endif // !CONFIG_EC_ADAPT - #if CONFIG_DUAL_FILTER && USE_EXTRA_FILTER const aom_tree_index av1_switchable_interp_tree[TREE_SIZE(SWITCHABLE_FILTERS)] = { @@ -4699,6 +5088,17 @@ void av1_adapt_inter_frame_probs(AV1_COMMON *cm) { fc->comp_inter_prob[i] = av1_mode_mv_merge_probs(pre_fc->comp_inter_prob[i], counts->comp_inter[i]); +#if CONFIG_EXT_COMP_REFS + for (i = 0; i < COMP_REF_TYPE_CONTEXTS; i++) + fc->comp_ref_type_prob[i] = av1_mode_mv_merge_probs( + pre_fc->comp_ref_type_prob[i], counts->comp_ref_type[i]); + + for (i = 0; i < UNI_COMP_REF_CONTEXTS; i++) + for (j = 0; j < (UNIDIR_COMP_REFS - 1); j++) + fc->uni_comp_ref_prob[i][j] = av1_mode_mv_merge_probs( + pre_fc->uni_comp_ref_prob[i][j], counts->uni_comp_ref[i][j]); +#endif // CONFIG_EXT_COMP_REFS + #if CONFIG_EXT_REFS for (i = 0; i < REF_CONTEXTS; i++) for (j = 0; j < (FWD_REFS - 1); j++) @@ -4742,11 +5142,16 @@ void av1_adapt_inter_frame_probs(AV1_COMMON *cm) { av1_mode_mv_merge_probs(pre_fc->drl_prob[i], counts->drl_mode[i]); #if CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION - for (i = BLOCK_8X8; i < BLOCK_SIZES; ++i) + for (i = BLOCK_8X8; i < BLOCK_SIZES_ALL; ++i) aom_tree_merge_probs(av1_motion_mode_tree, pre_fc->motion_mode_prob[i], counts->motion_mode[i], fc->motion_mode_prob[i]); +#if CONFIG_NCOBMC_ADAPT_WEIGHT + for (i = 0; i < ADAPT_OVERLAP_BLOCKS; ++i) + aom_tree_merge_probs(av1_ncobmc_mode_tree, pre_fc->ncobmc_mode_prob[i], + counts->ncobmc_mode[i], fc->ncobmc_mode_prob[i]); +#endif #if CONFIG_MOTION_VAR && CONFIG_WARPED_MOTION - for (i = BLOCK_8X8; i < BLOCK_SIZES; ++i) + for (i = BLOCK_8X8; i < BLOCK_SIZES_ALL; ++i) fc->obmc_prob[i] = av1_mode_mv_merge_probs(pre_fc->obmc_prob[i], counts->obmc[i]); #endif // CONFIG_MOTION_VAR && CONFIG_WARPED_MOTION @@ -4786,7 +5191,7 @@ void av1_adapt_inter_frame_probs(AV1_COMMON *cm) { counts->interintra_mode[i], fc->interintra_mode_prob[i]); } #if CONFIG_WEDGE - for (i = 0; i < BLOCK_SIZES; ++i) { + for (i = 0; i < BLOCK_SIZES_ALL; ++i) { if (is_interintra_allowed_bsize(i) && is_interintra_wedge_used(i)) fc->wedge_interintra_prob[i] = av1_mode_mv_merge_probs( pre_fc->wedge_interintra_prob[i], counts->wedge_interintra[i]); @@ -4797,7 +5202,7 @@ void av1_adapt_inter_frame_probs(AV1_COMMON *cm) { #if CONFIG_COMPOUND_SEGMENT || CONFIG_WEDGE if (cm->allow_masked_compound) { - for (i = 0; i < BLOCK_SIZES; ++i) { + for (i = 0; i < BLOCK_SIZES_ALL; ++i) { aom_tree_merge_probs( av1_compound_type_tree, pre_fc->compound_type_prob[i], counts->compound_interinter[i], fc->compound_type_prob[i]); @@ -4806,10 +5211,6 @@ void av1_adapt_inter_frame_probs(AV1_COMMON *cm) { #endif // CONFIG_COMPOUND_SEGMENT || CONFIG_WEDGE #endif // CONFIG_EXT_INTER - for (i = 0; i < BLOCK_SIZE_GROUPS; i++) - aom_tree_merge_probs(av1_intra_mode_tree, pre_fc->y_mode_prob[i], - counts->y_mode[i], fc->y_mode_prob[i]); - if (cm->interp_filter == SWITCHABLE) { for (i = 0; i < SWITCHABLE_FILTER_CONTEXTS; i++) aom_tree_merge_probs( @@ -4830,10 +5231,10 @@ void av1_adapt_intra_frame_probs(AV1_COMMON *cm) { aom_tree_merge_probs(av1_tx_size_tree[i], pre_fc->tx_size_probs[i][j], counts->tx_size[i][j], fc->tx_size_probs[i][j]); } -#if CONFIG_EXT_TX && CONFIG_RECT_TX && CONFIG_RECT_TX_EXT +#if CONFIG_RECT_TX_EXT && (CONFIG_EXT_TX || CONFIG_VAR_TX) fc->quarter_tx_size_prob = av1_mode_mv_merge_probs( pre_fc->quarter_tx_size_prob, counts->quarter_tx_size); -#endif // CONFIG_EXT_TX && CONFIG_RECT_TX && CONFIG_RECT_TX_EXT +#endif } #if CONFIG_VAR_TX @@ -4893,10 +5294,6 @@ void av1_adapt_intra_frame_probs(AV1_COMMON *cm) { counts->seg.tree_total, fc->seg.tree_probs); } - for (i = 0; i < INTRA_MODES; ++i) - aom_tree_merge_probs(av1_intra_mode_tree, pre_fc->uv_mode_prob[i], - counts->uv_mode[i], fc->uv_mode_prob[i]); - #if CONFIG_EXT_PARTITION_TYPES for (i = 0; i < PARTITION_PLOFFSET; ++i) aom_tree_merge_probs(av1_partition_tree, pre_fc->partition_prob[i], @@ -4972,6 +5369,9 @@ static void set_default_lf_deltas(struct loopfilter *lf) { lf->ref_deltas[BWDREF_FRAME] = lf->ref_deltas[LAST_FRAME]; #endif // CONFIG_EXT_REFS lf->ref_deltas[GOLDEN_FRAME] = -1; +#if CONFIG_ALTREF2 + lf->ref_deltas[ALTREF2_FRAME] = -1; +#endif // CONFIG_ALTREF2 lf->ref_deltas[ALTREF_FRAME] = -1; lf->mode_deltas[0] = 0; |