entropymode.c 121 KB
Newer Older
Jingning Han's avatar
Jingning Han committed
1
/*
Yaowu Xu's avatar
Yaowu Xu committed
2
 * Copyright (c) 2016, Alliance for Open Media. All rights reserved
Jingning Han's avatar
Jingning Han committed
3
 *
Yaowu Xu's avatar
Yaowu Xu committed
4 5 6 7 8 9
 * This source code is subject to the terms of the BSD 2 Clause License and
 * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License
 * was not distributed with this source code in the LICENSE file, you can
 * obtain it at www.aomedia.org/license/software. If the Alliance for Open
 * Media Patent License 1.0 was not distributed with this source code in the
 * PATENTS file, you can obtain it at www.aomedia.org/license/patent.
Jingning Han's avatar
Jingning Han committed
10 11
 */

Yaowu Xu's avatar
Yaowu Xu committed
12
#include "aom_mem/aom_mem.h"
Jingning Han's avatar
Jingning Han committed
13

14
#include "av1/common/reconinter.h"
Angie Chiang's avatar
Angie Chiang committed
15
#include "av1/common/scan.h"
16 17
#include "av1/common/onyxc_int.h"
#include "av1/common/seg_common.h"
18 19 20
#if CONFIG_LV_MAP
#include "av1/common/txb_common.h"
#endif
Jingning Han's avatar
Jingning Han committed
21

22
#if CONFIG_LV_MAP
23
#include "av1/common/txb_common.h"
Hui Su's avatar
Hui Su committed
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89
static const aom_cdf_prob default_txb_skip_cdf[TX_SIZES][TXB_SKIP_CONTEXTS]
                                              [CDF_SIZE(2)] = {
                                                {
                                                    { AOM_CDF2(128 * 255) },
                                                    { AOM_CDF2(128 * 86) },
                                                    { AOM_CDF2(128 * 115) },
                                                    { AOM_CDF2(128 * 175) },
                                                    { AOM_CDF2(128 * 148) },
                                                    { AOM_CDF2(128 * 203) },
                                                    { AOM_CDF2(128 * 249) },
                                                    { AOM_CDF2(128 * 35) },
                                                    { AOM_CDF2(128 * 126) },
                                                    { AOM_CDF2(128 * 219) },
                                                    { AOM_CDF2(128 * 14) },
                                                    { AOM_CDF2(128 * 79) },
                                                    { AOM_CDF2(128 * 185) },
                                                },

                                                {
                                                    { AOM_CDF2(128 * 255) },
                                                    { AOM_CDF2(128 * 76) },
                                                    { AOM_CDF2(128 * 109) },
                                                    { AOM_CDF2(128 * 162) },
                                                    { AOM_CDF2(128 * 150) },
                                                    { AOM_CDF2(128 * 201) },
                                                    { AOM_CDF2(128 * 244) },
                                                    { AOM_CDF2(128 * 26) },
                                                    { AOM_CDF2(128 * 118) },
                                                    { AOM_CDF2(128 * 218) },
                                                    { AOM_CDF2(128 * 12) },
                                                    { AOM_CDF2(128 * 72) },
                                                    { AOM_CDF2(128 * 187) },
                                                },

                                                {
                                                    { AOM_CDF2(128 * 253) },
                                                    { AOM_CDF2(128 * 78) },
                                                    { AOM_CDF2(128 * 124) },
                                                    { AOM_CDF2(128 * 165) },
                                                    { AOM_CDF2(128 * 170) },
                                                    { AOM_CDF2(128 * 211) },
                                                    { AOM_CDF2(128 * 245) },
                                                    { AOM_CDF2(128 * 34) },
                                                    { AOM_CDF2(128 * 135) },
                                                    { AOM_CDF2(128 * 223) },
                                                    { AOM_CDF2(128 * 15) },
                                                    { AOM_CDF2(128 * 98) },
                                                    { AOM_CDF2(128 * 212) },
                                                },

                                                {
                                                    { AOM_CDF2(128 * 243) },
                                                    { AOM_CDF2(128 * 46) },
                                                    { AOM_CDF2(128 * 143) },
                                                    { AOM_CDF2(128 * 173) },
                                                    { AOM_CDF2(128 * 205) },
                                                    { AOM_CDF2(128 * 226) },
                                                    { AOM_CDF2(128 * 250) },
                                                    { AOM_CDF2(128 * 52) },
                                                    { AOM_CDF2(128 * 182) },
                                                    { AOM_CDF2(128 * 240) },
                                                    { AOM_CDF2(128 * 15) },
                                                    { AOM_CDF2(128 * 100) },
                                                    { AOM_CDF2(128 * 220) },
                                                },

90
#if CONFIG_TX64X64
Hui Su's avatar
Hui Su committed
91 92 93 94 95 96 97 98 99 100 101 102 103 104 105
                                                {
                                                    { AOM_CDF2(128 * 243) },
                                                    { AOM_CDF2(128 * 46) },
                                                    { AOM_CDF2(128 * 143) },
                                                    { AOM_CDF2(128 * 173) },
                                                    { AOM_CDF2(128 * 205) },
                                                    { AOM_CDF2(128 * 226) },
                                                    { AOM_CDF2(128 * 250) },
                                                    { AOM_CDF2(128 * 52) },
                                                    { AOM_CDF2(128 * 182) },
                                                    { AOM_CDF2(128 * 240) },
                                                    { AOM_CDF2(128 * 15) },
                                                    { AOM_CDF2(128 * 100) },
                                                    { AOM_CDF2(128 * 220) },
                                                },
106
#endif
Hui Su's avatar
Hui Su committed
107 108 109 110 111 112 113 114 115 116 117 118 119 120 121
                                              };

static const aom_cdf_prob default_dc_sign_cdf[PLANE_TYPES][DC_SIGN_CONTEXTS]
                                             [CDF_SIZE(2)] = {
                                               {
                                                   { AOM_CDF2(128 * 125) },
                                                   { AOM_CDF2(128 * 102) },
                                                   { AOM_CDF2(128 * 147) },
                                               },
                                               {
                                                   { AOM_CDF2(128 * 119) },
                                                   { AOM_CDF2(128 * 101) },
                                                   { AOM_CDF2(128 * 135) },
                                               },
                                             };
122

123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175
static const aom_cdf_prob default_eob_multi16[PLANE_TYPES][2][CDF_SIZE(5)] = {
  { { AOM_CDF5(11070, 14028, 19190, 25681) },
    { AOM_CDF5(3385, 5466, 8797, 17499) } },
  { { AOM_CDF5(16053, 18992, 24073, 29172) },
    { AOM_CDF5(6554, 13107, 19661, 26214) } }
};

static const aom_cdf_prob default_eob_multi32[PLANE_TYPES][2][CDF_SIZE(6)] = {
  { { AOM_CDF6(3593, 4657, 6587, 9956, 17920) },
    { AOM_CDF6(876, 1385, 3472, 6857, 13870) } },
  { { AOM_CDF6(15524, 17691, 20904, 25082, 30263) },
    { AOM_CDF6(5461, 10923, 16384, 21845, 27307) } }
};

static const aom_cdf_prob default_eob_multi64[PLANE_TYPES][2][CDF_SIZE(7)] = {
  { { AOM_CDF7(8446, 10052, 12712, 15920, 19942, 25110) },
    { AOM_CDF7(2970, 4203, 6290, 9040, 13519, 20938) } },
  { { AOM_CDF7(19771, 21583, 24153, 26766, 29217, 31560) },
    { AOM_CDF7(4681, 9362, 14043, 18725, 23406, 28087) } }
};

static const aom_cdf_prob default_eob_multi128[PLANE_TYPES][2][CDF_SIZE(8)] = {
  { { AOM_CDF8(4562, 5578, 7411, 9502, 12670, 17243, 23467) },
    { AOM_CDF8(940, 1670, 3326, 9541, 16036, 21103, 26146) } },
  { { AOM_CDF8(21536, 22942, 25165, 27067, 29045, 30824, 32112) },
    { AOM_CDF8(4096, 8192, 12288, 16384, 20480, 24576, 28672) } }
};

static const aom_cdf_prob default_eob_multi256[PLANE_TYPES][2][CDF_SIZE(9)] = {
  { { AOM_CDF9(7093, 8715, 11204, 14326, 18248, 22182, 25706, 28845) },
    { AOM_CDF9(3641, 7282, 10923, 14564, 18204, 21845, 25486, 29127) } },
  { { AOM_CDF9(21080, 22437, 24396, 26528, 28519, 29980, 31092, 32088) },
    { AOM_CDF9(3641, 7282, 10923, 14564, 18204, 21845, 25486, 29127) } }
};

static const aom_cdf_prob default_eob_multi512[PLANE_TYPES][2][CDF_SIZE(10)] = {
  { { AOM_CDF10(5050, 6030, 8263, 10721, 14291, 18057, 22390, 26207, 28963) },
    { AOM_CDF10(3277, 6554, 9830, 13107, 16384, 19661, 22938, 26214, 29491) } },
  { { AOM_CDF10(21229, 22805, 25590, 27709, 29526, 30696, 31448, 32055,
                32485) },
    { AOM_CDF10(3277, 6554, 9830, 13107, 16384, 19661, 22938, 26214, 29491) } }
};

static const aom_cdf_prob default_eob_multi1024[PLANE_TYPES][2][CDF_SIZE(11)] =
    { { { AOM_CDF11(6028, 7445, 10558, 13479, 16814, 20418, 23777, 26301, 28478,
                    30332) },
        { AOM_CDF11(2979, 5958, 8937, 11916, 14895, 17873, 20852, 23831, 26810,
                    29789) } },
      { { AOM_CDF11(18178, 19598, 22478, 24261, 25825, 27320, 28457, 29366,
                    30436, 31625) },
        { AOM_CDF11(2979, 5958, 8937, 11916, 14895, 17873, 20852, 23831, 26810,
                    29789) } } };

Dake He's avatar
Dake He committed
176 177 178
static const aom_cdf_prob
    default_coeff_base_multi[TX_SIZES][PLANE_TYPES][SIG_COEF_CONTEXTS]
                            [CDF_SIZE(NUM_BASE_LEVELS + 2)] = {
179 180 181 182 183 184 185 186 187 188 189
                              { { { AOM_CDF4(7183, 17717, 24002) },
                                  { AOM_CDF4(23451, 31870, 32641) },
                                  { AOM_CDF4(16322, 29159, 31933) },
                                  { AOM_CDF4(9142, 21447, 27889) },
                                  { AOM_CDF4(5545, 14536, 21726) },
                                  { AOM_CDF4(3362, 9272, 14874) },
                                  { AOM_CDF4(26106, 32335, 32702) },
                                  { AOM_CDF4(19417, 30468, 32295) },
                                  { AOM_CDF4(10257, 22748, 28865) },
                                  { AOM_CDF4(6453, 15920, 23353) },
                                  { AOM_CDF4(4240, 10813, 17042) },
Dake He's avatar
Dake He committed
190 191 192 193 194 195 196 197 198 199
                                  { AOM_CDF4(8192, 16384, 24576) },
                                  { AOM_CDF4(8192, 16384, 24576) },
                                  { AOM_CDF4(8192, 16384, 24576) },
                                  { AOM_CDF4(8192, 16384, 24576) },
                                  { AOM_CDF4(8192, 16384, 24576) },
                                  { AOM_CDF4(8192, 16384, 24576) },
                                  { AOM_CDF4(8192, 16384, 24576) },
                                  { AOM_CDF4(8192, 16384, 24576) },
                                  { AOM_CDF4(8192, 16384, 24576) },
                                  { AOM_CDF4(8192, 16384, 24576) },
200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218
                                  { AOM_CDF4(25880, 32172, 32651) },
                                  { AOM_CDF4(20737, 30491, 32251) },
                                  { AOM_CDF4(10179, 20937, 27247) },
                                  { AOM_CDF4(8481, 15529, 21830) },
                                  { AOM_CDF4(5734, 11114, 16002) },
                                  { AOM_CDF4(24660, 31870, 32536) },
                                  { AOM_CDF4(16955, 29389, 31825) },
                                  { AOM_CDF4(8276, 19516, 26159) },
                                  { AOM_CDF4(3332, 10035, 17183) },
                                  { AOM_CDF4(1507, 4836, 9024) },
                                  { AOM_CDF4(28122, 32477, 32705) },
                                  { AOM_CDF4(19876, 29745, 31851) },
                                  { AOM_CDF4(9151, 20203, 26591) },
                                  { AOM_CDF4(3946, 11826, 18720) },
                                  { AOM_CDF4(2325, 7443, 12261) },
                                  { AOM_CDF4(28937, 32433, 32676) },
                                  { AOM_CDF4(21190, 30139, 31974) },
                                  { AOM_CDF4(9187, 19792, 26200) },
                                  { AOM_CDF4(3284, 9615, 16503) },
Dake He's avatar
Dake He committed
219 220
                                  { AOM_CDF4(8192, 16384, 24576) },
                                  { AOM_CDF4(8192, 16384, 24576) } },
221 222 223 224 225 226 227 228 229 230 231
                                { { AOM_CDF4(11679, 24447, 29219) },
                                  { AOM_CDF4(26227, 32384, 32728) },
                                  { AOM_CDF4(21452, 31272, 32481) },
                                  { AOM_CDF4(12417, 24947, 29799) },
                                  { AOM_CDF4(5997, 15568, 22801) },
                                  { AOM_CDF4(3359, 9517, 15606) },
                                  { AOM_CDF4(28396, 32616, 32748) },
                                  { AOM_CDF4(23612, 31918, 32623) },
                                  { AOM_CDF4(14104, 26806, 30699) },
                                  { AOM_CDF4(6710, 17351, 24822) },
                                  { AOM_CDF4(4069, 12421, 19722) },
Dake He's avatar
Dake He committed
232 233 234 235 236 237 238 239 240 241
                                  { AOM_CDF4(8192, 16384, 24576) },
                                  { AOM_CDF4(8192, 16384, 24576) },
                                  { AOM_CDF4(8192, 16384, 24576) },
                                  { AOM_CDF4(8192, 16384, 24576) },
                                  { AOM_CDF4(8192, 16384, 24576) },
                                  { AOM_CDF4(8192, 16384, 24576) },
                                  { AOM_CDF4(8192, 16384, 24576) },
                                  { AOM_CDF4(8192, 16384, 24576) },
                                  { AOM_CDF4(8192, 16384, 24576) },
                                  { AOM_CDF4(8192, 16384, 24576) },
242 243 244 245 246
                                  { AOM_CDF4(27906, 32610, 32748) },
                                  { AOM_CDF4(24904, 32295, 32703) },
                                  { AOM_CDF4(14691, 27331, 31206) },
                                  { AOM_CDF4(4139, 17936, 24145) },
                                  { AOM_CDF4(4096, 16384, 28672) },
Dake He's avatar
Dake He committed
247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262
                                  { AOM_CDF4(8192, 16384, 24576) },
                                  { AOM_CDF4(8192, 16384, 24576) },
                                  { AOM_CDF4(8192, 16384, 24576) },
                                  { AOM_CDF4(8192, 16384, 24576) },
                                  { AOM_CDF4(8192, 16384, 24576) },
                                  { AOM_CDF4(8192, 16384, 24576) },
                                  { AOM_CDF4(8192, 16384, 24576) },
                                  { AOM_CDF4(8192, 16384, 24576) },
                                  { AOM_CDF4(8192, 16384, 24576) },
                                  { AOM_CDF4(8192, 16384, 24576) },
                                  { AOM_CDF4(8192, 16384, 24576) },
                                  { AOM_CDF4(8192, 16384, 24576) },
                                  { AOM_CDF4(8192, 16384, 24576) },
                                  { AOM_CDF4(8192, 16384, 24576) },
                                  { AOM_CDF4(8192, 16384, 24576) },
                                  { AOM_CDF4(8192, 16384, 24576) } } },
263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303
                              { { { AOM_CDF4(6005, 15082, 20820) },
                                  { AOM_CDF4(24434, 31844, 32546) },
                                  { AOM_CDF4(16299, 28874, 31655) },
                                  { AOM_CDF4(9269, 21626, 27744) },
                                  { AOM_CDF4(5855, 15207, 22095) },
                                  { AOM_CDF4(3296, 9111, 14341) },
                                  { AOM_CDF4(26083, 32387, 32718) },
                                  { AOM_CDF4(18841, 30442, 32298) },
                                  { AOM_CDF4(11302, 24413, 29758) },
                                  { AOM_CDF4(6880, 17607, 24789) },
                                  { AOM_CDF4(3983, 11039, 17204) },
                                  { AOM_CDF4(26732, 32378, 32692) },
                                  { AOM_CDF4(18163, 29705, 31984) },
                                  { AOM_CDF4(9878, 22156, 28144) },
                                  { AOM_CDF4(5878, 15362, 22313) },
                                  { AOM_CDF4(3348, 9233, 14631) },
                                  { AOM_CDF4(24967, 32196, 32664) },
                                  { AOM_CDF4(17634, 29494, 31911) },
                                  { AOM_CDF4(9881, 22036, 27931) },
                                  { AOM_CDF4(5729, 14992, 21837) },
                                  { AOM_CDF4(3289, 9048, 14286) },
                                  { AOM_CDF4(28440, 32636, 32748) },
                                  { AOM_CDF4(22878, 31718, 32585) },
                                  { AOM_CDF4(13828, 26554, 30888) },
                                  { AOM_CDF4(8213, 19516, 26670) },
                                  { AOM_CDF4(4912, 13008, 19955) },
                                  { AOM_CDF4(26780, 32210, 32642) },
                                  { AOM_CDF4(17454, 29629, 31942) },
                                  { AOM_CDF4(10169, 22403, 27936) },
                                  { AOM_CDF4(4956, 13505, 20482) },
                                  { AOM_CDF4(2180, 6299, 10593) },
                                  { AOM_CDF4(29177, 32622, 32746) },
                                  { AOM_CDF4(21436, 31157, 32396) },
                                  { AOM_CDF4(13299, 25880, 30054) },
                                  { AOM_CDF4(7230, 18023, 24564) },
                                  { AOM_CDF4(3488, 9858, 15335) },
                                  { AOM_CDF4(29429, 32638, 32744) },
                                  { AOM_CDF4(22433, 31362, 32435) },
                                  { AOM_CDF4(13162, 25466, 29846) },
                                  { AOM_CDF4(6785, 17313, 24087) },
                                  { AOM_CDF4(3825, 10655, 16533) },
Dake He's avatar
Dake He committed
304
                                  { AOM_CDF4(8192, 16384, 24576) } },
305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330
                                { { AOM_CDF4(11226, 23568, 28513) },
                                  { AOM_CDF4(26516, 32274, 32646) },
                                  { AOM_CDF4(20521, 30766, 32303) },
                                  { AOM_CDF4(11911, 25079, 29959) },
                                  { AOM_CDF4(7415, 18381, 25203) },
                                  { AOM_CDF4(4069, 11546, 17702) },
                                  { AOM_CDF4(28421, 32625, 32748) },
                                  { AOM_CDF4(23791, 32015, 32654) },
                                  { AOM_CDF4(15359, 28137, 31423) },
                                  { AOM_CDF4(8444, 20424, 26901) },
                                  { AOM_CDF4(4447, 12679, 19328) },
                                  { AOM_CDF4(29187, 32642, 32748) },
                                  { AOM_CDF4(22947, 31670, 32556) },
                                  { AOM_CDF4(13815, 26327, 30340) },
                                  { AOM_CDF4(6757, 17257, 23826) },
                                  { AOM_CDF4(3611, 9802, 15733) },
                                  { AOM_CDF4(28083, 32474, 32728) },
                                  { AOM_CDF4(21546, 31193, 32487) },
                                  { AOM_CDF4(13159, 26202, 30631) },
                                  { AOM_CDF4(7992, 19377, 26101) },
                                  { AOM_CDF4(4456, 11826, 18257) },
                                  { AOM_CDF4(30366, 32738, 32748) },
                                  { AOM_CDF4(26565, 32533, 32742) },
                                  { AOM_CDF4(18826, 30532, 32277) },
                                  { AOM_CDF4(10407, 23385, 29201) },
                                  { AOM_CDF4(5807, 15078, 22248) },
Dake He's avatar
Dake He committed
331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346
                                  { AOM_CDF4(8192, 16384, 24576) },
                                  { AOM_CDF4(8192, 16384, 24576) },
                                  { AOM_CDF4(8192, 16384, 24576) },
                                  { AOM_CDF4(8192, 16384, 24576) },
                                  { AOM_CDF4(8192, 16384, 24576) },
                                  { AOM_CDF4(8192, 16384, 24576) },
                                  { AOM_CDF4(8192, 16384, 24576) },
                                  { AOM_CDF4(8192, 16384, 24576) },
                                  { AOM_CDF4(8192, 16384, 24576) },
                                  { AOM_CDF4(8192, 16384, 24576) },
                                  { AOM_CDF4(8192, 16384, 24576) },
                                  { AOM_CDF4(8192, 16384, 24576) },
                                  { AOM_CDF4(8192, 16384, 24576) },
                                  { AOM_CDF4(8192, 16384, 24576) },
                                  { AOM_CDF4(8192, 16384, 24576) },
                                  { AOM_CDF4(8192, 16384, 24576) } } },
347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387
                              { { { AOM_CDF4(5434, 13996, 19553) },
                                  { AOM_CDF4(23736, 31736, 32558) },
                                  { AOM_CDF4(15308, 28053, 31269) },
                                  { AOM_CDF4(8397, 20168, 26461) },
                                  { AOM_CDF4(5077, 13751, 20245) },
                                  { AOM_CDF4(2641, 7466, 11895) },
                                  { AOM_CDF4(26955, 32424, 32719) },
                                  { AOM_CDF4(18432, 30076, 32125) },
                                  { AOM_CDF4(10432, 23414, 29015) },
                                  { AOM_CDF4(6359, 16744, 23684) },
                                  { AOM_CDF4(3526, 9938, 15469) },
                                  { AOM_CDF4(29136, 32594, 32735) },
                                  { AOM_CDF4(19181, 30314, 32175) },
                                  { AOM_CDF4(10499, 23237, 28822) },
                                  { AOM_CDF4(6070, 16037, 22924) },
                                  { AOM_CDF4(3362, 9335, 14579) },
                                  { AOM_CDF4(27918, 32536, 32728) },
                                  { AOM_CDF4(19184, 30360, 32190) },
                                  { AOM_CDF4(10762, 23450, 28878) },
                                  { AOM_CDF4(6025, 15831, 22610) },
                                  { AOM_CDF4(2995, 8460, 13403) },
                                  { AOM_CDF4(30355, 32736, 32748) },
                                  { AOM_CDF4(24606, 32179, 32680) },
                                  { AOM_CDF4(15144, 28326, 31617) },
                                  { AOM_CDF4(8875, 21701, 28207) },
                                  { AOM_CDF4(5239, 14403, 21303) },
                                  { AOM_CDF4(27283, 32265, 32668) },
                                  { AOM_CDF4(17272, 29364, 31827) },
                                  { AOM_CDF4(9134, 20779, 26448) },
                                  { AOM_CDF4(4195, 11754, 17948) },
                                  { AOM_CDF4(1687, 5036, 8895) },
                                  { AOM_CDF4(29766, 32636, 32742) },
                                  { AOM_CDF4(22641, 31427, 32418) },
                                  { AOM_CDF4(14190, 26761, 30476) },
                                  { AOM_CDF4(7835, 18886, 25419) },
                                  { AOM_CDF4(3545, 9801, 15154) },
                                  { AOM_CDF4(30600, 32740, 32748) },
                                  { AOM_CDF4(25611, 32272, 32680) },
                                  { AOM_CDF4(16016, 28262, 31248) },
                                  { AOM_CDF4(7916, 19470, 25829) },
                                  { AOM_CDF4(3606, 10415, 16160) },
Dake He's avatar
Dake He committed
388
                                  { AOM_CDF4(8192, 16384, 24576) } },
389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414
                                { { AOM_CDF4(8812, 19661, 25070) },
                                  { AOM_CDF4(25902, 32024, 32583) },
                                  { AOM_CDF4(18512, 29596, 31775) },
                                  { AOM_CDF4(10432, 23205, 28796) },
                                  { AOM_CDF4(6977, 17757, 24626) },
                                  { AOM_CDF4(4477, 11904, 17687) },
                                  { AOM_CDF4(28625, 32615, 32748) },
                                  { AOM_CDF4(21615, 31412, 32541) },
                                  { AOM_CDF4(12447, 26362, 30862) },
                                  { AOM_CDF4(7854, 20126, 27031) },
                                  { AOM_CDF4(4719, 13087, 19748) },
                                  { AOM_CDF4(30557, 32650, 32737) },
                                  { AOM_CDF4(22370, 31140, 32261) },
                                  { AOM_CDF4(11592, 24317, 29049) },
                                  { AOM_CDF4(6576, 16561, 22683) },
                                  { AOM_CDF4(3570, 10410, 16502) },
                                  { AOM_CDF4(29600, 32636, 32744) },
                                  { AOM_CDF4(22196, 31451, 32469) },
                                  { AOM_CDF4(12934, 26163, 30434) },
                                  { AOM_CDF4(7679, 19149, 25833) },
                                  { AOM_CDF4(4458, 12574, 18807) },
                                  { AOM_CDF4(31200, 32751, 32755) },
                                  { AOM_CDF4(26115, 32373, 32719) },
                                  { AOM_CDF4(15767, 28986, 31914) },
                                  { AOM_CDF4(9830, 23077, 29171) },
                                  { AOM_CDF4(6000, 16081, 23394) },
Dake He's avatar
Dake He committed
415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430
                                  { AOM_CDF4(8192, 16384, 24576) },
                                  { AOM_CDF4(8192, 16384, 24576) },
                                  { AOM_CDF4(8192, 16384, 24576) },
                                  { AOM_CDF4(8192, 16384, 24576) },
                                  { AOM_CDF4(8192, 16384, 24576) },
                                  { AOM_CDF4(8192, 16384, 24576) },
                                  { AOM_CDF4(8192, 16384, 24576) },
                                  { AOM_CDF4(8192, 16384, 24576) },
                                  { AOM_CDF4(8192, 16384, 24576) },
                                  { AOM_CDF4(8192, 16384, 24576) },
                                  { AOM_CDF4(8192, 16384, 24576) },
                                  { AOM_CDF4(8192, 16384, 24576) },
                                  { AOM_CDF4(8192, 16384, 24576) },
                                  { AOM_CDF4(8192, 16384, 24576) },
                                  { AOM_CDF4(8192, 16384, 24576) },
                                  { AOM_CDF4(8192, 16384, 24576) } } },
431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456
                              { { { AOM_CDF4(5062, 13302, 18713) },
                                  { AOM_CDF4(22049, 31256, 32425) },
                                  { AOM_CDF4(14073, 27265, 30826) },
                                  { AOM_CDF4(7765, 19491, 25995) },
                                  { AOM_CDF4(5016, 13604, 19934) },
                                  { AOM_CDF4(2155, 6220, 9842) },
                                  { AOM_CDF4(27307, 32441, 32726) },
                                  { AOM_CDF4(17713, 29717, 32023) },
                                  { AOM_CDF4(9655, 22570, 28384) },
                                  { AOM_CDF4(5839, 15735, 22580) },
                                  { AOM_CDF4(2786, 8019, 12638) },
                                  { AOM_CDF4(30158, 32629, 32736) },
                                  { AOM_CDF4(18784, 30149, 32061) },
                                  { AOM_CDF4(10046, 22733, 28332) },
                                  { AOM_CDF4(5905, 15607, 22207) },
                                  { AOM_CDF4(2960, 8361, 13116) },
                                  { AOM_CDF4(29116, 32614, 32746) },
                                  { AOM_CDF4(19167, 30581, 32310) },
                                  { AOM_CDF4(10771, 24330, 29683) },
                                  { AOM_CDF4(6581, 17522, 24526) },
                                  { AOM_CDF4(3253, 9275, 14455) },
                                  { AOM_CDF4(31481, 32751, 32755) },
                                  { AOM_CDF4(24838, 32091, 32658) },
                                  { AOM_CDF4(13936, 27569, 31262) },
                                  { AOM_CDF4(8385, 21066, 27551) },
                                  { AOM_CDF4(4533, 12763, 18961) },
Dake He's avatar
Dake He committed
457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472
                                  { AOM_CDF4(8192, 16384, 24576) },
                                  { AOM_CDF4(8192, 16384, 24576) },
                                  { AOM_CDF4(8192, 16384, 24576) },
                                  { AOM_CDF4(8192, 16384, 24576) },
                                  { AOM_CDF4(8192, 16384, 24576) },
                                  { AOM_CDF4(8192, 16384, 24576) },
                                  { AOM_CDF4(8192, 16384, 24576) },
                                  { AOM_CDF4(8192, 16384, 24576) },
                                  { AOM_CDF4(8192, 16384, 24576) },
                                  { AOM_CDF4(8192, 16384, 24576) },
                                  { AOM_CDF4(8192, 16384, 24576) },
                                  { AOM_CDF4(8192, 16384, 24576) },
                                  { AOM_CDF4(8192, 16384, 24576) },
                                  { AOM_CDF4(8192, 16384, 24576) },
                                  { AOM_CDF4(8192, 16384, 24576) },
                                  { AOM_CDF4(8192, 16384, 24576) } },
473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498
                                { { AOM_CDF4(8012, 18815, 23982) },
                                  { AOM_CDF4(25293, 31524, 32369) },
                                  { AOM_CDF4(15111, 25966, 29558) },
                                  { AOM_CDF4(7072, 17223, 22296) },
                                  { AOM_CDF4(4690, 12305, 17346) },
                                  { AOM_CDF4(2932, 8352, 12626) },
                                  { AOM_CDF4(28379, 32423, 32700) },
                                  { AOM_CDF4(18724, 29705, 31868) },
                                  { AOM_CDF4(9996, 23002, 28437) },
                                  { AOM_CDF4(6810, 17812, 24323) },
                                  { AOM_CDF4(4245, 12235, 18499) },
                                  { AOM_CDF4(30926, 32693, 32748) },
                                  { AOM_CDF4(21632, 31299, 32457) },
                                  { AOM_CDF4(11363, 25356, 29975) },
                                  { AOM_CDF4(5722, 17653, 25102) },
                                  { AOM_CDF4(3842, 10847, 18305) },
                                  { AOM_CDF4(30364, 32682, 32748) },
                                  { AOM_CDF4(22377, 31490, 32516) },
                                  { AOM_CDF4(11885, 25435, 30313) },
                                  { AOM_CDF4(7069, 18630, 24977) },
                                  { AOM_CDF4(4195, 12132, 18085) },
                                  { AOM_CDF4(31825, 32752, 32756) },
                                  { AOM_CDF4(26182, 32375, 32719) },
                                  { AOM_CDF4(15415, 29154, 31991) },
                                  { AOM_CDF4(10046, 23913, 29680) },
                                  { AOM_CDF4(6365, 17246, 24251) },
Dake He's avatar
Dake He committed
499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515
                                  { AOM_CDF4(8192, 16384, 24576) },
                                  { AOM_CDF4(8192, 16384, 24576) },
                                  { AOM_CDF4(8192, 16384, 24576) },
                                  { AOM_CDF4(8192, 16384, 24576) },
                                  { AOM_CDF4(8192, 16384, 24576) },
                                  { AOM_CDF4(8192, 16384, 24576) },
                                  { AOM_CDF4(8192, 16384, 24576) },
                                  { AOM_CDF4(8192, 16384, 24576) },
                                  { AOM_CDF4(8192, 16384, 24576) },
                                  { AOM_CDF4(8192, 16384, 24576) },
                                  { AOM_CDF4(8192, 16384, 24576) },
                                  { AOM_CDF4(8192, 16384, 24576) },
                                  { AOM_CDF4(8192, 16384, 24576) },
                                  { AOM_CDF4(8192, 16384, 24576) },
                                  { AOM_CDF4(8192, 16384, 24576) },
                                  { AOM_CDF4(8192, 16384, 24576) } } },
#if CONFIG_TX64X64
516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541
                              { { { AOM_CDF4(4262, 11039, 15994) },
                                  { AOM_CDF4(20472, 29927, 31691) },
                                  { AOM_CDF4(11874, 24067, 28293) },
                                  { AOM_CDF4(6342, 16163, 22121) },
                                  { AOM_CDF4(4009, 10648, 15895) },
                                  { AOM_CDF4(1297, 3838, 5965) },
                                  { AOM_CDF4(27649, 32356, 32713) },
                                  { AOM_CDF4(16986, 28822, 31547) },
                                  { AOM_CDF4(9023, 20976, 26822) },
                                  { AOM_CDF4(5344, 14209, 20225) },
                                  { AOM_CDF4(2077, 6016, 9225) },
                                  { AOM_CDF4(30470, 32618, 32743) },
                                  { AOM_CDF4(19721, 30282, 32128) },
                                  { AOM_CDF4(11292, 24255, 29222) },
                                  { AOM_CDF4(6807, 17590, 24200) },
                                  { AOM_CDF4(3244, 9331, 14323) },
                                  { AOM_CDF4(30198, 32644, 32748) },
                                  { AOM_CDF4(19743, 30622, 32308) },
                                  { AOM_CDF4(11348, 24756, 29955) },
                                  { AOM_CDF4(7226, 18600, 25353) },
                                  { AOM_CDF4(3819, 10659, 16315) },
                                  { AOM_CDF4(31688, 32752, 32756) },
                                  { AOM_CDF4(25512, 32175, 32670) },
                                  { AOM_CDF4(14444, 27658, 31221) },
                                  { AOM_CDF4(8230, 20581, 27092) },
                                  { AOM_CDF4(3833, 10651, 16087) },
Dake He's avatar
Dake He committed
542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605
                                  { AOM_CDF4(8192, 16384, 24576) },
                                  { AOM_CDF4(8192, 16384, 24576) },
                                  { AOM_CDF4(8192, 16384, 24576) },
                                  { AOM_CDF4(8192, 16384, 24576) },
                                  { AOM_CDF4(8192, 16384, 24576) },
                                  { AOM_CDF4(8192, 16384, 24576) },
                                  { AOM_CDF4(8192, 16384, 24576) },
                                  { AOM_CDF4(8192, 16384, 24576) },
                                  { AOM_CDF4(8192, 16384, 24576) },
                                  { AOM_CDF4(8192, 16384, 24576) },
                                  { AOM_CDF4(8192, 16384, 24576) },
                                  { AOM_CDF4(8192, 16384, 24576) },
                                  { AOM_CDF4(8192, 16384, 24576) },
                                  { AOM_CDF4(8192, 16384, 24576) },
                                  { AOM_CDF4(8192, 16384, 24576) },
                                  { AOM_CDF4(8192, 16384, 24576) } },
                                { { AOM_CDF4(8192, 16384, 24576) },
                                  { AOM_CDF4(8192, 16384, 24576) },
                                  { AOM_CDF4(8192, 16384, 24576) },
                                  { AOM_CDF4(8192, 16384, 24576) },
                                  { AOM_CDF4(8192, 16384, 24576) },
                                  { AOM_CDF4(8192, 16384, 24576) },
                                  { AOM_CDF4(8192, 16384, 24576) },
                                  { AOM_CDF4(8192, 16384, 24576) },
                                  { AOM_CDF4(8192, 16384, 24576) },
                                  { AOM_CDF4(8192, 16384, 24576) },
                                  { AOM_CDF4(8192, 16384, 24576) },
                                  { AOM_CDF4(8192, 16384, 24576) },
                                  { AOM_CDF4(8192, 16384, 24576) },
                                  { AOM_CDF4(8192, 16384, 24576) },
                                  { AOM_CDF4(8192, 16384, 24576) },
                                  { AOM_CDF4(8192, 16384, 24576) },
                                  { AOM_CDF4(8192, 16384, 24576) },
                                  { AOM_CDF4(8192, 16384, 24576) },
                                  { AOM_CDF4(8192, 16384, 24576) },
                                  { AOM_CDF4(8192, 16384, 24576) },
                                  { AOM_CDF4(8192, 16384, 24576) },
                                  { AOM_CDF4(8192, 16384, 24576) },
                                  { AOM_CDF4(8192, 16384, 24576) },
                                  { AOM_CDF4(8192, 16384, 24576) },
                                  { AOM_CDF4(8192, 16384, 24576) },
                                  { AOM_CDF4(8192, 16384, 24576) },
                                  { AOM_CDF4(8192, 16384, 24576) },
                                  { AOM_CDF4(8192, 16384, 24576) },
                                  { AOM_CDF4(8192, 16384, 24576) },
                                  { AOM_CDF4(8192, 16384, 24576) },
                                  { AOM_CDF4(8192, 16384, 24576) },
                                  { AOM_CDF4(8192, 16384, 24576) },
                                  { AOM_CDF4(8192, 16384, 24576) },
                                  { AOM_CDF4(8192, 16384, 24576) },
                                  { AOM_CDF4(8192, 16384, 24576) },
                                  { AOM_CDF4(8192, 16384, 24576) },
                                  { AOM_CDF4(8192, 16384, 24576) },
                                  { AOM_CDF4(8192, 16384, 24576) },
                                  { AOM_CDF4(8192, 16384, 24576) },
                                  { AOM_CDF4(8192, 16384, 24576) },
                                  { AOM_CDF4(8192, 16384, 24576) },
                                  { AOM_CDF4(8192, 16384, 24576) } } }
#endif
                            };

static const aom_cdf_prob
    default_coeff_base_eob_multi[TX_SIZES][PLANE_TYPES][SIG_COEF_CONTEXTS_EOB]
                                [CDF_SIZE(NUM_BASE_LEVELS + 1)] = {
606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636
                                  { { { AOM_CDF3(26406, 31407) },
                                      { AOM_CDF3(31541, 32669) },
                                      { AOM_CDF3(31825, 32677) },
                                      { AOM_CDF3(31793, 32623) } },
                                    { { AOM_CDF3(28736, 32063) },
                                      { AOM_CDF3(31937, 32727) },
                                      { AOM_CDF3(32407, 32754) },
                                      { AOM_CDF3(32532, 32756) } } },
                                  { { { AOM_CDF3(25824, 31212) },
                                      { AOM_CDF3(32123, 32717) },
                                      { AOM_CDF3(32414, 32744) },
                                      { AOM_CDF3(32274, 32715) } },
                                    { { AOM_CDF3(29276, 32110) },
                                      { AOM_CDF3(31990, 32707) },
                                      { AOM_CDF3(32408, 32752) },
                                      { AOM_CDF3(32626, 32756) } } },
                                  { { { AOM_CDF3(24649, 30865) },
                                      { AOM_CDF3(32220, 32717) },
                                      { AOM_CDF3(32643, 32756) },
                                      { AOM_CDF3(32670, 32756) } },
                                    { { AOM_CDF3(27932, 31415) },
                                      { AOM_CDF3(32361, 32726) },
                                      { AOM_CDF3(32681, 32756) },
                                      { AOM_CDF3(32725, 32756) } } },
                                  { { { AOM_CDF3(26749, 31719) },
                                      { AOM_CDF3(32418, 32740) },
                                      { AOM_CDF3(32670, 32756) },
                                      { AOM_CDF3(32717, 32756) } },
                                    { { AOM_CDF3(29650, 32131) },
                                      { AOM_CDF3(32017, 32613) },
                                      { AOM_CDF3(32753, 32757) },
Dake He's avatar
Dake He committed
637 638
                                      { AOM_CDF3(32721, 32756) } } },
#if CONFIG_TX64X64
639 640 641 642
                                  { { { AOM_CDF3(26028, 31648) },
                                      { AOM_CDF3(31035, 32098) },
                                      { AOM_CDF3(32251, 32736) },
                                      { AOM_CDF3(32314, 32741) } },
Dake He's avatar
Dake He committed
643 644 645 646 647 648 649
                                    { { AOM_CDF3(10923, 21845) },
                                      { AOM_CDF3(10923, 21845) },
                                      { AOM_CDF3(10923, 21845) },
                                      { AOM_CDF3(10923, 21845) } } }
#endif
                                };

Hui Su's avatar
Hui Su committed
650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680
static const aom_cdf_prob
    default_eob_extra_cdf[TX_SIZES][PLANE_TYPES][EOB_COEF_CONTEXTS][CDF_SIZE(
        2)] = {
      {
          {
              { AOM_CDF2(128 * 128) }, { AOM_CDF2(128 * 128) },
              { AOM_CDF2(128 * 128) }, { AOM_CDF2(128 * 138) },
              { AOM_CDF2(128 * 138) }, { AOM_CDF2(128 * 148) },
              { AOM_CDF2(128 * 128) }, { AOM_CDF2(128 * 128) },
              { AOM_CDF2(128 * 128) }, { AOM_CDF2(128 * 128) },
              { AOM_CDF2(128 * 128) }, { AOM_CDF2(128 * 128) },
              { AOM_CDF2(128 * 128) }, { AOM_CDF2(128 * 128) },
              { AOM_CDF2(128 * 128) }, { AOM_CDF2(128 * 128) },
              { AOM_CDF2(128 * 128) }, { AOM_CDF2(128 * 128) },
              { AOM_CDF2(128 * 128) }, { AOM_CDF2(128 * 128) },
              { AOM_CDF2(128 * 128) }, { AOM_CDF2(128 * 128) },
          },
          {
              { AOM_CDF2(128 * 128) }, { AOM_CDF2(128 * 128) },
              { AOM_CDF2(128 * 128) }, { AOM_CDF2(128 * 156) },
              { AOM_CDF2(128 * 156) }, { AOM_CDF2(128 * 152) },
              { AOM_CDF2(128 * 128) }, { AOM_CDF2(128 * 128) },
              { AOM_CDF2(128 * 128) }, { AOM_CDF2(128 * 128) },
              { AOM_CDF2(128 * 128) }, { AOM_CDF2(128 * 128) },
              { AOM_CDF2(128 * 128) }, { AOM_CDF2(128 * 128) },
              { AOM_CDF2(128 * 128) }, { AOM_CDF2(128 * 128) },
              { AOM_CDF2(128 * 128) }, { AOM_CDF2(128 * 128) },
              { AOM_CDF2(128 * 128) }, { AOM_CDF2(128 * 128) },
              { AOM_CDF2(128 * 128) }, { AOM_CDF2(128 * 128) },
          },
      },
681

Hui Su's avatar
Hui Su committed
682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709
      {
          {
              { AOM_CDF2(128 * 128) }, { AOM_CDF2(128 * 128) },
              { AOM_CDF2(128 * 128) }, { AOM_CDF2(128 * 134) },
              { AOM_CDF2(128 * 148) }, { AOM_CDF2(128 * 143) },
              { AOM_CDF2(128 * 144) }, { AOM_CDF2(128 * 140) },
              { AOM_CDF2(128 * 128) }, { AOM_CDF2(128 * 128) },
              { AOM_CDF2(128 * 128) }, { AOM_CDF2(128 * 128) },
              { AOM_CDF2(128 * 128) }, { AOM_CDF2(128 * 128) },
              { AOM_CDF2(128 * 128) }, { AOM_CDF2(128 * 128) },
              { AOM_CDF2(128 * 128) }, { AOM_CDF2(128 * 128) },
              { AOM_CDF2(128 * 128) }, { AOM_CDF2(128 * 128) },
              { AOM_CDF2(128 * 128) }, { AOM_CDF2(128 * 128) },
          },
          {
              { AOM_CDF2(128 * 128) }, { AOM_CDF2(128 * 128) },
              { AOM_CDF2(128 * 128) }, { AOM_CDF2(128 * 165) },
              { AOM_CDF2(128 * 164) }, { AOM_CDF2(128 * 160) },
              { AOM_CDF2(128 * 161) }, { AOM_CDF2(128 * 157) },
              { AOM_CDF2(128 * 128) }, { AOM_CDF2(128 * 128) },
              { AOM_CDF2(128 * 128) }, { AOM_CDF2(128 * 128) },
              { AOM_CDF2(128 * 128) }, { AOM_CDF2(128 * 128) },
              { AOM_CDF2(128 * 128) }, { AOM_CDF2(128 * 128) },
              { AOM_CDF2(128 * 128) }, { AOM_CDF2(128 * 128) },
              { AOM_CDF2(128 * 128) }, { AOM_CDF2(128 * 128) },
              { AOM_CDF2(128 * 128) }, { AOM_CDF2(128 * 128) },
          },
      },
Dake He's avatar
Dake He committed
710

Hui Su's avatar
Hui Su committed
711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738
      {
          {
              { AOM_CDF2(128 * 128) }, { AOM_CDF2(128 * 128) },
              { AOM_CDF2(128 * 128) }, { AOM_CDF2(128 * 142) },
              { AOM_CDF2(128 * 145) }, { AOM_CDF2(128 * 146) },
              { AOM_CDF2(128 * 153) }, { AOM_CDF2(128 * 144) },
              { AOM_CDF2(128 * 139) }, { AOM_CDF2(128 * 136) },
              { AOM_CDF2(128 * 128) }, { AOM_CDF2(128 * 128) },
              { AOM_CDF2(128 * 128) }, { AOM_CDF2(128 * 128) },
              { AOM_CDF2(128 * 128) }, { AOM_CDF2(128 * 128) },
              { AOM_CDF2(128 * 128) }, { AOM_CDF2(128 * 128) },
              { AOM_CDF2(128 * 128) }, { AOM_CDF2(128 * 128) },
              { AOM_CDF2(128 * 128) }, { AOM_CDF2(128 * 128) },
          },
          {
              { AOM_CDF2(128 * 128) }, { AOM_CDF2(128 * 128) },
              { AOM_CDF2(128 * 128) }, { AOM_CDF2(128 * 175) },
              { AOM_CDF2(128 * 168) }, { AOM_CDF2(128 * 162) },
              { AOM_CDF2(128 * 162) }, { AOM_CDF2(128 * 156) },
              { AOM_CDF2(128 * 157) }, { AOM_CDF2(128 * 163) },
              { AOM_CDF2(128 * 128) }, { AOM_CDF2(128 * 128) },
              { AOM_CDF2(128 * 128) }, { AOM_CDF2(128 * 128) },
              { AOM_CDF2(128 * 128) }, { AOM_CDF2(128 * 128) },
              { AOM_CDF2(128 * 128) }, { AOM_CDF2(128 * 128) },
              { AOM_CDF2(128 * 128) }, { AOM_CDF2(128 * 128) },
              { AOM_CDF2(128 * 128) }, { AOM_CDF2(128 * 128) },
          },
      },
Jingning Han's avatar
Jingning Han committed
739

Hui Su's avatar
Hui Su committed
740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767
      {
          {
              { AOM_CDF2(128 * 128) }, { AOM_CDF2(128 * 128) },
              { AOM_CDF2(128 * 128) }, { AOM_CDF2(128 * 180) },
              { AOM_CDF2(128 * 161) }, { AOM_CDF2(128 * 149) },
              { AOM_CDF2(128 * 151) }, { AOM_CDF2(128 * 158) },
              { AOM_CDF2(128 * 153) }, { AOM_CDF2(128 * 142) },
              { AOM_CDF2(128 * 141) }, { AOM_CDF2(128 * 141) },
              { AOM_CDF2(128 * 128) }, { AOM_CDF2(128 * 128) },
              { AOM_CDF2(128 * 128) }, { AOM_CDF2(128 * 128) },
              { AOM_CDF2(128 * 128) }, { AOM_CDF2(128 * 128) },
              { AOM_CDF2(128 * 128) }, { AOM_CDF2(128 * 128) },
              { AOM_CDF2(128 * 128) }, { AOM_CDF2(128 * 128) },
          },
          {
              { AOM_CDF2(128 * 128) }, { AOM_CDF2(128 * 128) },
              { AOM_CDF2(128 * 128) }, { AOM_CDF2(128 * 204) },
              { AOM_CDF2(128 * 172) }, { AOM_CDF2(128 * 156) },
              { AOM_CDF2(128 * 139) }, { AOM_CDF2(128 * 170) },
              { AOM_CDF2(128 * 170) }, { AOM_CDF2(128 * 154) },
              { AOM_CDF2(128 * 166) }, { AOM_CDF2(128 * 157) },
              { AOM_CDF2(128 * 128) }, { AOM_CDF2(128 * 128) },
              { AOM_CDF2(128 * 128) }, { AOM_CDF2(128 * 128) },
              { AOM_CDF2(128 * 128) }, { AOM_CDF2(128 * 128) },
              { AOM_CDF2(128 * 128) }, { AOM_CDF2(128 * 128) },
              { AOM_CDF2(128 * 128) }, { AOM_CDF2(128 * 128) },
          },
      },
768
#if CONFIG_TX64X64
Hui Su's avatar
Hui Su committed
769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796
      {
          {
              { AOM_CDF2(128 * 128) }, { AOM_CDF2(128 * 128) },
              { AOM_CDF2(128 * 128) }, { AOM_CDF2(128 * 177) },
              { AOM_CDF2(128 * 160) }, { AOM_CDF2(128 * 150) },
              { AOM_CDF2(128 * 147) }, { AOM_CDF2(128 * 157) },
              { AOM_CDF2(128 * 151) }, { AOM_CDF2(128 * 142) },
              { AOM_CDF2(128 * 139) }, { AOM_CDF2(128 * 133) },
              { AOM_CDF2(128 * 128) }, { AOM_CDF2(128 * 128) },
              { AOM_CDF2(128 * 128) }, { AOM_CDF2(128 * 128) },
              { AOM_CDF2(128 * 128) }, { AOM_CDF2(128 * 128) },
              { AOM_CDF2(128 * 128) }, { AOM_CDF2(128 * 128) },
              { AOM_CDF2(128 * 128) }, { AOM_CDF2(128 * 128) },
          },
          {
              { AOM_CDF2(128 * 128) }, { AOM_CDF2(128 * 128) },
              { AOM_CDF2(128 * 128) }, { AOM_CDF2(128 * 200) },
              { AOM_CDF2(128 * 173) }, { AOM_CDF2(128 * 159) },
              { AOM_CDF2(128 * 135) }, { AOM_CDF2(128 * 158) },
              { AOM_CDF2(128 * 174) }, { AOM_CDF2(128 * 160) },
              { AOM_CDF2(128 * 172) }, { AOM_CDF2(128 * 163) },
              { AOM_CDF2(128 * 128) }, { AOM_CDF2(128 * 128) },
              { AOM_CDF2(128 * 128) }, { AOM_CDF2(128 * 128) },
              { AOM_CDF2(128 * 128) }, { AOM_CDF2(128 * 128) },
              { AOM_CDF2(128 * 128) }, { AOM_CDF2(128 * 128) },
              { AOM_CDF2(128 * 128) }, { AOM_CDF2(128 * 128) },
          },
      },
797
#endif
798
    };
799

Dake He's avatar
Dake He committed
800
static const aom_cdf_prob
Dake He's avatar
Dake He committed
801 802
    default_coeff_lps_multi[TX_SIZES][PLANE_TYPES][LEVEL_CONTEXTS][CDF_SIZE(
        BR_CDF_SIZE)] = {
803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890
      { { { AOM_CDF4(21416, 28070, 30521) }, { AOM_CDF4(15981, 23864, 27832) },
          { AOM_CDF4(10689, 17953, 22905) }, { AOM_CDF4(7375, 13404, 18236) },
          { AOM_CDF4(5570, 10384, 14646) },  { AOM_CDF4(4328, 8379, 12101) },
          { AOM_CDF4(2787, 5453, 8130) },    { AOM_CDF4(23652, 29328, 31161) },
          { AOM_CDF4(21507, 28367, 30857) }, { AOM_CDF4(16485, 24728, 28662) },
          { AOM_CDF4(12093, 20007, 25006) }, { AOM_CDF4(9339, 16499, 21627) },
          { AOM_CDF4(7743, 13975, 19061) },  { AOM_CDF4(5467, 10329, 14656) },
          { AOM_CDF4(24439, 30357, 31813) }, { AOM_CDF4(22540, 29044, 31234) },
          { AOM_CDF4(18015, 26091, 29531) }, { AOM_CDF4(13744, 21890, 26690) },
          { AOM_CDF4(10600, 18444, 23689) }, { AOM_CDF4(9618, 16246, 21185) },
          { AOM_CDF4(6493, 12666, 17180) } },
        { { AOM_CDF4(23735, 29495, 31320) }, { AOM_CDF4(18451, 25947, 29198) },
          { AOM_CDF4(11940, 19196, 23808) }, { AOM_CDF4(7214, 13112, 17731) },
          { AOM_CDF4(5194, 10063, 14349) },  { AOM_CDF4(4379, 8467, 12128) },
          { AOM_CDF4(2777, 5583, 8291) },    { AOM_CDF4(27177, 31186, 32177) },
          { AOM_CDF4(23504, 29622, 31499) }, { AOM_CDF4(17464, 25301, 29064) },
          { AOM_CDF4(12891, 20729, 25428) }, { AOM_CDF4(9054, 16624, 21960) },
          { AOM_CDF4(8420, 14165, 19941) },  { AOM_CDF4(6296, 12115, 17219) },
          { AOM_CDF4(27050, 31488, 32348) }, { AOM_CDF4(25095, 30575, 32093) },
          { AOM_CDF4(19528, 27676, 30689) }, { AOM_CDF4(15333, 24981, 28806) },
          { AOM_CDF4(11199, 18354, 23124) }, { AOM_CDF4(8602, 19661, 24576) },
          { AOM_CDF4(10240, 18432, 23552) } } },
      { { { AOM_CDF4(19486, 26512, 29456) }, { AOM_CDF4(14133, 21812, 26094) },
          { AOM_CDF4(9060, 15733, 20521) },  { AOM_CDF4(6301, 11585, 15977) },
          { AOM_CDF4(4727, 9041, 12864) },   { AOM_CDF4(3884, 7454, 10812) },
          { AOM_CDF4(2431, 4672, 6872) },    { AOM_CDF4(19399, 25800, 28594) },
          { AOM_CDF4(18674, 26040, 29231) }, { AOM_CDF4(14680, 22598, 26908) },
          { AOM_CDF4(10987, 18395, 23357) }, { AOM_CDF4(8650, 15307, 20252) },
          { AOM_CDF4(7261, 13084, 17750) },  { AOM_CDF4(4745, 8876, 12602) },
          { AOM_CDF4(24548, 29962, 31590) }, { AOM_CDF4(22058, 28667, 30968) },
          { AOM_CDF4(17905, 25725, 29276) }, { AOM_CDF4(13791, 21856, 26440) },
          { AOM_CDF4(11034, 18604, 23699) }, { AOM_CDF4(9314, 16220, 21260) },
          { AOM_CDF4(6540, 11964, 16457) } },
        { { AOM_CDF4(21953, 28610, 30909) }, { AOM_CDF4(17634, 25355, 28920) },
          { AOM_CDF4(12266, 19872, 24675) }, { AOM_CDF4(8461, 14845, 19678) },
          { AOM_CDF4(6143, 11296, 15673) },  { AOM_CDF4(4676, 8637, 12400) },
          { AOM_CDF4(2630, 5217, 7701) },    { AOM_CDF4(25191, 30262, 31793) },
          { AOM_CDF4(23295, 29514, 31456) }, { AOM_CDF4(18539, 26071, 29410) },
          { AOM_CDF4(13598, 21119, 25662) }, { AOM_CDF4(9988, 17419, 22030) },
          { AOM_CDF4(7690, 14150, 19039) },  { AOM_CDF4(5034, 9588, 13704) },
          { AOM_CDF4(27494, 31652, 32399) }, { AOM_CDF4(25026, 30532, 31999) },
          { AOM_CDF4(19773, 27270, 30180) }, { AOM_CDF4(14716, 22401, 27225) },
          { AOM_CDF4(11477, 19134, 24240) }, { AOM_CDF4(8515, 15537, 20984) },
          { AOM_CDF4(7205, 13031, 18051) } } },
      { { { AOM_CDF4(19432, 26297, 29219) }, { AOM_CDF4(13661, 21257, 25527) },
          { AOM_CDF4(8524, 14899, 19587) },  { AOM_CDF4(5780, 10737, 14834) },
          { AOM_CDF4(4386, 8328, 11778) },   { AOM_CDF4(3531, 6721, 9692) },
          { AOM_CDF4(1877, 3678, 5439) },    { AOM_CDF4(15554, 21341, 24401) },
          { AOM_CDF4(15475, 22178, 25562) }, { AOM_CDF4(12335, 19596, 23871) },
          { AOM_CDF4(9340, 15996, 20737) },  { AOM_CDF4(7335, 13123, 17682) },
          { AOM_CDF4(6062, 11184, 15482) },  { AOM_CDF4(3767, 7123, 10223) },
          { AOM_CDF4(24611, 30209, 31770) }, { AOM_CDF4(21907, 28517, 30870) },
          { AOM_CDF4(17697, 25455, 28982) }, { AOM_CDF4(13608, 21489, 26025) },
          { AOM_CDF4(10760, 18086, 22993) }, { AOM_CDF4(8832, 15472, 20260) },
          { AOM_CDF4(5823, 10708, 14748) } },
        { { AOM_CDF4(18296, 25470, 28736) }, { AOM_CDF4(13344, 20861, 25159) },
          { AOM_CDF4(8801, 15417, 20047) },  { AOM_CDF4(6306, 11709, 16038) },
          { AOM_CDF4(4852, 8959, 13089) },   { AOM_CDF4(4595, 8632, 11824) },
          { AOM_CDF4(2331, 4652, 6810) },    { AOM_CDF4(15693, 22202, 25735) },
          { AOM_CDF4(15659, 21973, 25127) }, { AOM_CDF4(12853, 19617, 23378) },
          { AOM_CDF4(11209, 18192, 22134) }, { AOM_CDF4(8727, 15604, 20119) },
          { AOM_CDF4(8370, 14355, 19199) },  { AOM_CDF4(5271, 9919, 14187) },
          { AOM_CDF4(25937, 30482, 31689) }, { AOM_CDF4(23874, 29665, 31625) },
          { AOM_CDF4(20547, 27813, 30563) }, { AOM_CDF4(15726, 24207, 28240) },
          { AOM_CDF4(12745, 21009, 25903) }, { AOM_CDF4(9916, 17380, 22831) },
          { AOM_CDF4(7559, 13937, 18544) } } },
      { { { AOM_CDF4(16055, 22453, 25462) }, { AOM_CDF4(14574, 22376, 26465) },
          { AOM_CDF4(9357, 16444, 21544) },  { AOM_CDF4(6520, 12090, 16776) },
          { AOM_CDF4(4825, 9318, 13440) },   { AOM_CDF4(3911, 7671, 11183) },
          { AOM_CDF4(1688, 3309, 4937) },    { AOM_CDF4(14126, 21520, 25510) },
          { AOM_CDF4(12993, 19464, 23130) }, { AOM_CDF4(10480, 16875, 20913) },
          { AOM_CDF4(8099, 14009, 18196) },  { AOM_CDF4(6379, 11413, 15385) },
          { AOM_CDF4(5309, 9692, 13321) },   { AOM_CDF4(2638, 5075, 7290) },
          { AOM_CDF4(22248, 28261, 30490) }, { AOM_CDF4(20077, 26794, 29613) },
          { AOM_CDF4(16271, 23812, 27591) }, { AOM_CDF4(12495, 20001, 24589) },
          { AOM_CDF4(9936, 16831, 21595) },  { AOM_CDF4(8217, 14402, 19047) },
          { AOM_CDF4(4547, 8474, 11827) } },
        { { AOM_CDF4(15712, 20787, 23633) }, { AOM_CDF4(17313, 24501, 27939) },
          { AOM_CDF4(10928, 18743, 23648) }, { AOM_CDF4(7786, 14243, 19306) },
          { AOM_CDF4(5649, 11263, 15329) },  { AOM_CDF4(4596, 8541, 12229) },
          { AOM_CDF4(2035, 4110, 5990) },    { AOM_CDF4(16053, 22593, 26087) },
          { AOM_CDF4(12516, 18956, 23103) }, { AOM_CDF4(8886, 14647, 18911) },
          { AOM_CDF4(7498, 12379, 16318) },  { AOM_CDF4(5726, 10519, 14371) },
          { AOM_CDF4(4895, 8971, 13110) },   { AOM_CDF4(3562, 6776, 9924) },
          { AOM_CDF4(22085, 28077, 29858) }, { AOM_CDF4(21946, 27950, 30291) },
          { AOM_CDF4(19117, 26550, 29504) }, { AOM_CDF4(15829, 23871, 27889) },
          { AOM_CDF4(12944, 21092, 25623) }, { AOM_CDF4(11432, 19053, 23889) },
          { AOM_CDF4(7507, 13964, 18716) } } },
Dake He's avatar
Dake He committed
891
#if CONFIG_TX64X64
Dake He's avatar
Dake He committed
892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913
      { { { AOM_CDF4(8192, 16384, 24576) }, { AOM_CDF4(8192, 16384, 24576) },
          { AOM_CDF4(8192, 16384, 24576) }, { AOM_CDF4(8192, 16384, 24576) },
          { AOM_CDF4(8192, 16384, 24576) }, { AOM_CDF4(8192, 16384, 24576) },
          { AOM_CDF4(8192, 16384, 24576) }, { AOM_CDF4(8192, 16384, 24576) },
          { AOM_CDF4(8192, 16384, 24576) }, { AOM_CDF4(8192, 16384, 24576) },
          { AOM_CDF4(8192, 16384, 24576) }, { AOM_CDF4(8192, 16384, 24576) },
          { AOM_CDF4(8192, 16384, 24576) }, { AOM_CDF4(8192, 16384, 24576) },
          { AOM_CDF4(8192, 16384, 24576) }, { AOM_CDF4(8192, 16384, 24576) },
          { AOM_CDF4(8192, 16384, 24576) }, { AOM_CDF4(8192, 16384, 24576) },
          { AOM_CDF4(8192, 16384, 24576) }, { AOM_CDF4(8192, 16384, 24576) },
          { AOM_CDF4(8192, 16384, 24576) } },
        { { AOM_CDF4(8192, 16384, 24576) }, { AOM_CDF4(8192, 16384, 24576) },
          { AOM_CDF4(8192, 16384, 24576) }, { AOM_CDF4(8192, 16384, 24576) },
          { AOM_CDF4(8192, 16384, 24576) }, { AOM_CDF4(8192, 16384, 24576) },
          { AOM_CDF4(8192, 16384, 24576) }, { AOM_CDF4(8192, 16384, 24576) },
          { AOM_CDF4(8192, 16384, 24576) }, { AOM_CDF4(8192, 16384, 24576) },
          { AOM_CDF4(8192, 16384, 24576) }, { AOM_CDF4(8192, 16384, 24576) },
          { AOM_CDF4(8192, 16384, 24576) }, { AOM_CDF4(8192, 16384, 24576) },
          { AOM_CDF4(8192, 16384, 24576) }, { AOM_CDF4(8192, 16384, 24576) },
          { AOM_CDF4(8192, 16384, 24576) }, { AOM_CDF4(8192, 16384, 24576) },
          { AOM_CDF4(8192, 16384, 24576) }, { AOM_CDF4(8192, 16384, 24576) },
          { AOM_CDF4(8192, 16384, 24576) } } }
Dake He's avatar
Dake He committed
914 915
#endif
    };
Jingning Han's avatar
Jingning Han committed
916

917 918
#endif  // CONFIG_LV_MAP

919
static const aom_cdf_prob default_newmv_cdf[NEWMV_MODE_CONTEXTS][CDF_SIZE(2)] =
920 921 922
    { { AOM_CDF2(128 * 155) }, { AOM_CDF2(128 * 116) }, { AOM_CDF2(128 * 94) },
      { AOM_CDF2(128 * 32) },  { AOM_CDF2(128 * 96) },  { AOM_CDF2(128 * 56) },
      { AOM_CDF2(128 * 30) } };
Sarah Parker's avatar
Sarah Parker committed
923
static const aom_cdf_prob default_zeromv_cdf[GLOBALMV_MODE_CONTEXTS][CDF_SIZE(
924
    2)] = { { AOM_CDF2(128 * 45) }, { AOM_CDF2(128 * 13) } };
925
static const aom_cdf_prob default_refmv_cdf[REFMV_MODE_CONTEXTS][CDF_SIZE(2)] =
926 927 928 929 930
    {
      { AOM_CDF2(128 * 178) }, { AOM_CDF2(128 * 212) }, { AOM_CDF2(128 * 135) },
      { AOM_CDF2(128 * 244) }, { AOM_CDF2(128 * 203) }, { AOM_CDF2(128 * 122) },
      { AOM_CDF2(128 * 128) }, { AOM_CDF2(128 * 128) }, { AOM_CDF2(128 * 128) }
    };
931
static const aom_cdf_prob default_drl_cdf[DRL_MODE_CONTEXTS][CDF_SIZE(2)] = {
932 933 934 935 936
  { AOM_CDF2(128 * 119) },
  { AOM_CDF2(128 * 128) },
  { AOM_CDF2(128 * 189) },
  { AOM_CDF2(128 * 134) },
  { AOM_CDF2(128 * 128) }
937
};
938

939 940 941
static const aom_cdf_prob
    default_inter_compound_mode_cdf[INTER_MODE_CONTEXTS][CDF_SIZE(
        INTER_COMPOUND_MODES)] = {
942 943 944 945 946 947 948
      { AOM_CDF8(19712, 28229, 30892, 31437, 31712, 32135, 32360) },
      { AOM_CDF8(9600, 24804, 29268, 30323, 30802, 31726, 32177) },
      { AOM_CDF8(896, 22434, 27015, 29026, 29753, 31114, 31597) },
      { AOM_CDF8(1024, 15904, 22127, 25421, 26864, 28996, 30001) },
      { AOM_CDF8(512, 11222, 17217, 21445, 23473, 26133, 27550) },
      { AOM_CDF8(2944, 13313, 17214, 20751, 23211, 25500, 26992) },
      { AOM_CDF8(3456, 9067, 14069, 16907, 18817, 21214, 23139) }
949 950
    };

951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970
#if CONFIG_JNT_COMP
static const aom_cdf_prob
    default_compound_type_cdf[BLOCK_SIZES_ALL][CDF_SIZE(COMPOUND_TYPES - 1)] = {
      { AOM_CDF2(16384) }, { AOM_CDF2(16384) }, { AOM_CDF2(16384) },
      { AOM_CDF2(16384) }, { AOM_CDF2(16384) }, { AOM_CDF2(16384) },
      { AOM_CDF2(16384) }, { AOM_CDF2(16384) }, { AOM_CDF2(16384) },
      { AOM_CDF2(16384) }, { AOM_CDF2(16384) }, { AOM_CDF2(16384) },
      { AOM_CDF2(16384) },
#if CONFIG_EXT_PARTITION
      { AOM_CDF2(16384) },  // 255, 1
      { AOM_CDF2(16384) }, { AOM_CDF2(16384) },
#endif  // CONFIG_EXT_PARTITION
      { AOM_CDF2(16384) }, { AOM_CDF2(16384) }, { AOM_CDF2(16384) },
      { AOM_CDF2(16384) }, { AOM_CDF2(16384) },  // 208, 1
      { AOM_CDF2(16384) },
#if CONFIG_EXT_PARTITION
      { AOM_CDF2(16384) }, { AOM_CDF2(16384) },
#endif
    };
#else
971
static const aom_cdf_prob
972
    default_compound_type_cdf[BLOCK_SIZES_ALL][CDF_SIZE(COMPOUND_TYPES)] = {
973 974 975 976 977 978 979
      { AOM_CDF3(16384, 24576) }, { AOM_CDF3(32640, 32704) },
      { AOM_CDF3(32640, 32704) }, { AOM_CDF3(8448, 13293) },
      { AOM_CDF3(9216, 12436) },  { AOM_CDF3(10112, 12679) },
      { AOM_CDF3(9088, 10753) },  { AOM_CDF3(10368, 12906) },
      { AOM_CDF3(10368, 12643) }, { AOM_CDF3(8832, 10609) },
      { AOM_CDF3(13312, 13388) }, { AOM_CDF3(12672, 12751) },
      { AOM_CDF3(9600, 9691) },
980
#if CONFIG_EXT_PARTITION
981 982
      { AOM_CDF3(32640, 32641) },  // 255, 1
      { AOM_CDF3(32640, 32641) }, { AOM_CDF3(32640, 32641) },
983
#endif  // CONFIG_EXT_PARTITION
984 985 986 987
      { AOM_CDF3(16384, 24576) }, { AOM_CDF3(16384, 24576) },
      { AOM_CDF3(16384, 24576) }, { AOM_CDF3(16384, 24576) },
      { AOM_CDF3(26624, 26648) },  // 208, 1
      { AOM_CDF3(26624, 26648) },
988
#if CONFIG_EXT_PARTITION
989
      { AOM_CDF3(26624, 26648) }, { AOM_CDF3(26624, 26648) },
990
#endif
991
    };
992
#endif  // CONFIG_JNT_COMP
993

994
static const aom_cdf_prob default_interintra_cdf[BLOCK_SIZE_GROUPS][CDF_SIZE(
995 996 997 998
    2)] = { { AOM_CDF2(128 * 128) },
            { AOM_CDF2(226 * 128) },
            { AOM_CDF2(244 * 128) },
            { AOM_CDF2(254 * 128) } };
999

1000
static const aom_cdf_prob
1001 1002 1003 1004 1005
    default_interintra_mode_cdf[BLOCK_SIZE_GROUPS][CDF_SIZE(INTERINTRA_MODES)] =
        { { AOM_CDF4(16384, 24576, 28672) },
          { AOM_CDF4(3072, 7016, 18987) },
          { AOM_CDF4(4864, 8461, 17481) },
          { AOM_CDF4(6528, 8681, 19031) } };
1006

1007
static const aom_cdf_prob
1008
    default_wedge_interintra_cdf[BLOCK_SIZES_ALL][CDF_SIZE(2)] = {
1009 1010 1011 1012 1013
      { AOM_CDF2(128 * 128) }, { AOM_CDF2(128 * 128) }, { AOM_CDF2(128 * 128) },
      { AOM_CDF2(194 * 128) }, { AOM_CDF2(213 * 128) }, { AOM_CDF2(217 * 128) },
      { AOM_CDF2(222 * 128) }, { AOM_CDF2(224 * 128) }, { AOM_CDF2(226 * 128) },
      { AOM_CDF2(220 * 128) }, { AOM_CDF2(128 * 128) }, { AOM_CDF2(128 * 128) },
      { AOM_CDF2(128 * 128) },
1014
#if CONFIG_EXT_PARTITION
1015
      { AOM_CDF2(255 * 128) }, { AOM_CDF2(255 * 128) }, { AOM_CDF2(255 * 128) },
1016
#endif  // CONFIG_EXT_PARTITION
1017 1018
      { AOM_CDF2(208 * 128) }, { AOM_CDF2(208 * 128) }, { AOM_CDF2(208 * 128) },
      { AOM_CDF2(208 * 128) }, { AOM_CDF2(255 * 128) }, { AOM_CDF2(255 * 128) },
1019
#if CONFIG_EXT_PARTITION
1020
      { AOM_CDF2(255 * 128) }, { AOM_CDF2(255 * 128) },
1021
#endif  // CONFIG_EXT_PARTITION
1022 1023
    };

Thomas Davies's avatar
Thomas Davies committed
1024
static const aom_cdf_prob
1025
    default_motion_mode_cdf[BLOCK_SIZES_ALL][CDF_SIZE(MOTION_MODES)] = {
1026
      { AOM_CDF3(16384, 24576) }, { AOM_CDF3(16384, 24576) },
1027 1028 1029 1030 1031 1032
      { AOM_CDF3(16384, 24576) }, { AOM_CDF3(7936, 19091) },
      { AOM_CDF3(4991, 19205) },  { AOM_CDF3(4992, 19314) },
      { AOM_CDF3(15104, 21590) }, { AOM_CDF3(9855, 21043) },
      { AOM_CDF3(12800, 22238) }, { AOM_CDF3(24320, 26498) },
      { AOM_CDF3(26496, 28995) }, { AOM_CDF3(25216, 28166) },
      { AOM_CDF3(30592, 31238) },
Thomas Davies's avatar
Thomas Davies committed
1033
#if CONFIG_EXT_PARTITION
1034 1035
      { AOM_CDF3(32256, 32656) }, { AOM_CDF3(32256, 32656) },
      { AOM_CDF3(32256, 32656) },
Thomas Davies's avatar
Thomas Davies committed
1036
#endif
1037 1038 1039
      { AOM_CDF3(32640, 32740) }, { AOM_CDF3(32640, 32740) },
      { AOM_CDF3(32640, 32740) }, { AOM_CDF3(32640, 32740) },
      { AOM_CDF3(32640, 32740) }, { AOM_CDF3(32640, 32740) },
1040
#if CONFIG_EXT_PARTITION
1041
      { AOM_CDF3(32256, 32656) }, { AOM_CDF3(32256, 32656) },
1042
#endif
Thomas Davies's avatar
Thomas Davies committed
1043
    };
Yue Chen's avatar
Yue Chen committed
1044

1045
static const aom_cdf_prob default_obmc_cdf[BLOCK_SIZES_ALL][CDF_SIZE(2)] = {
1046 1047 1048 1049 1050
  { AOM_CDF2(128 * 128) }, { AOM_CDF2(128 * 128) }, { AOM_CDF2(128 * 128) },
  { AOM_CDF2(45 * 128) },  { AOM_CDF2(79 * 128) },  { AOM_CDF2(75 * 128) },
  { AOM_CDF2(130 * 128) }, { AOM_CDF2(141 * 128) }, { AOM_CDF2(144 * 128) },
  { AOM_CDF2(208 * 128) }, { AOM_CDF2(201 * 128) }, { AOM_CDF2(186 * 128) },
  { AOM_CDF2(231 * 128) },
1051
#if CONFIG_EXT_PARTITION
1052
  { AOM_CDF2(252 * 128) }, { AOM_CDF2(252 * 128) }, { AOM_CDF2(252 * 128) },
1053
#endif  // CONFIG_EXT_PARTITION
1054 1055
  { AOM_CDF2(208 * 128) }, { AOM_CDF2(208 * 128) }, { AOM_CDF2(208 * 128) },
  { AOM_CDF2(208 * 128) }, { AOM_CDF2(208 * 128) }, { AOM_CDF2(208 * 128) },
1056
#if CONFIG_EXT_PARTITION
1057
  { AOM_CDF2(252 * 128) }, { AOM_CDF2(252 * 128) },
1058
#endif  // CONFIG_EXT_PARTITION
1059
};
1060

Thomas Davies's avatar
Thomas Davies committed
1061
static const aom_cdf_prob default_delta_q_cdf[CDF_SIZE(DELTA_Q_PROBS + 1)] = {
1062
  AOM_CDF4(28160, 32120, 32677)
Thomas Davies's avatar
Thomas Davies committed
1063
};
Fangwen Fu's avatar
Fangwen Fu committed
1064
#if CONFIG_EXT_DELTA_Q
1065
#if CONFIG_LOOPFILTER_LEVEL
1066 1067 1068 1069 1070
static const aom_cdf_prob default_delta_lf_multi_cdf[FRAME_LF_COUNT][CDF_SIZE(
    DELTA_LF_PROBS + 1)] = { { AOM_CDF4(28160, 32120, 32677) },
                             { AOM_CDF4(28160, 32120, 32677) },
                             { AOM_CDF4(28160, 32120, 32677) },
                             { AOM_CDF4(28160, 32120, 32677) } };
1071
#endif  // CONFIG_LOOPFILTER_LEVEL
Fangwen Fu's avatar
Fangwen Fu committed
1072
static const aom_cdf_prob default_delta_lf_cdf[CDF_SIZE(DELTA_LF_PROBS + 1)] = {
1073
  AOM_CDF4(28160, 32120, 32677)
Fangwen Fu's avatar
Fangwen Fu committed
1074 1075
};
#endif
1076

1077 1078 1079 1080 1081 1082 1083
static const aom_cdf_prob default_intra_inter_cdf[INTRA_INTER_CONTEXTS]
                                                 [CDF_SIZE(2)] = {
                                                   { AOM_CDF2(768) },
                                                   { AOM_CDF2(12416) },
                                                   { AOM_CDF2(19328) },
                                                   { AOM_CDF2(26240) }
                                                 };
1084

1085
static const aom_cdf_prob default_comp_inter_cdf[COMP_INTER_CONTEXTS][CDF_SIZE(
1086 1087 1088 1089 1090
    2)] = { { AOM_CDF2(24290) },
            { AOM_CDF2(19956) },
            { AOM_CDF2(11641) },
            { AOM_CDF2(9804) },
            { AOM_CDF2(2842) } };
Jingning Han's avatar
Jingning Han committed
1091

Zoe Liu's avatar
Zoe Liu committed
1092
#if CONFIG_EXT_COMP_REFS
1093 1094 1095 1096 1097 1098 1099 1100
static const aom_cdf_prob default_comp_ref_type_cdf[COMP_REF_TYPE_CONTEXTS]
                                                   [CDF_SIZE(2)] = {
                                                     { AOM_CDF2(8 * 128) },
                                                     { AOM_CDF2(20 * 128) },
                                                     { AOM_CDF2(78 * 128) },
                                                     { AOM_CDF2(91 * 128) },
                                                     { AOM_CDF2(194 * 128) }
                                                   };
1101 1102
static const aom_cdf_prob
    default_uni_comp_ref_cdf[UNI_COMP_REF_CONTEXTS][UNIDIR_COMP_REFS - 1]
1103 1104 1105 1106 1107 1108 1109 1110 1111
                            [CDF_SIZE(2)] = { { { AOM_CDF2(88 * 128) },
                                                { AOM_CDF2(30 * 128) },
                                                { AOM_CDF2(28 * 128) } },
                                              { { AOM_CDF2(218 * 128) },
                                                { AOM_CDF2(97 * 128) },
                                                { AOM_CDF2(105 * 128) } },
                                              { { AOM_CDF2(254 * 128) },
                                                { AOM_CDF2(180 * 128) },
                                                { AOM_CDF2(196 * 128) } } };
Zoe Liu's avatar
Zoe Liu committed
1112 1113
#endif  // CONFIG_EXT_COMP_REFS

1114 1115
static const aom_cdf_prob
    default_comp_ref_cdf[REF_CONTEXTS][FWD_REFS - 1][CDF_SIZE(2)] = {
1116 1117 1118 1119 1120
      { { AOM_CDF2(3556) }, { AOM_CDF2(1217) }, { AOM_CDF2(988) } },
      { { AOM_CDF2(9857) }, { AOM_CDF2(3394) }, { AOM_CDF2(3303) } },
      { { AOM_CDF2(16237) }, { AOM_CDF2(7946) }, { AOM_CDF2(7195) } },
      { { AOM_CDF2(23826) }, { AOM_CDF2(16124) }, { AOM_CDF2(20536) } },
      { { AOM_CDF2(30195) }, { AOM_CDF2(18344) }, { AOM_CDF2(21980) } }
1121
    };
1122

1123
static const aom_cdf_prob
1124
    default_comp_bwdref_cdf[COMP_BWDREF_CONTEXTS][BWD_REFS - 1][CDF_SIZE(2)] = {
1125 1126 1127
      { { AOM_CDF2(2762) }, { AOM_CDF2(1614) } },
      { { AOM_CDF2(17976) }, { AOM_CDF2(15912) } },
      { { AOM_CDF2(30894) }, { AOM_CDF2(30639) } },
1128
    };
1129

1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149
static const aom_cdf_prob default_single_ref_cdf[REF_CONTEXTS][SINGLE_REFS - 1]
                                                [CDF_SIZE(2)] = {
                                                  { { AOM_CDF2(4623) },
                                                    { AOM_CDF2(2110) },
                                                    { AOM_CDF2(4132) },
                                                    { AOM_CDF2(7309) },
                                                    { AOM_CDF2(1392) },
                                                    { AOM_CDF2(1781) } },
                                                  { { AOM_CDF2(8659) },
                                                    { AOM_CDF2(16372) },
                                                    { AOM_CDF2(9371) },
                                                    { AOM_CDF2(16322) },
                                                    { AOM_CDF2(6216) },
                                                    { AOM_CDF2(15834) } },
                                                  { { AOM_CDF2(17353) },
                                                    { AOM_CDF2(30182) },
                                                    { AOM_CDF2(16300) },
                                                    { AOM_CDF2(21702) },
                                                    { AOM_CDF2(10365) },
                                                    { AOM_CDF2(30486) } },
1150 1151
                                                  { { AOM_CDF2(16384) },
                                                    { AOM_CDF2(16384) },
1152 1153 1154
                                                    { AOM_CDF2(24426) },
                                                    { AOM_CDF2(26972) },
                                                    { AOM_CDF2(14760) },
1155
                                                    { AOM_CDF2(16384) } },
1156
                                                  { { AOM_CDF2(28634) },
1157
                                                    { AOM_CDF2(16384) },
1158 1159 1160
                                                    { AOM_CDF2(29425) },
                                                    { AOM_CDF2(30969) },
                                                    { AOM_CDF2(26676) },
1161
                                                    { AOM_CDF2(16384) } }
1162
                                                };
Jingning Han's avatar
Jingning Han committed
1163

1164
// TODO(huisu): tune these cdfs
1165
const aom_cdf_prob
Hui Su's avatar
Hui Su committed
1166
    default_palette_y_size_cdf[PALATTE_BSIZE_CTXS][CDF_SIZE(PALETTE_SIZES)] = {
1167 1168
      { AOM_CDF7(12288, 19408, 24627, 26662, 28499, 30667) },
      { AOM_CDF7(12288, 19408, 24627, 26662, 28499, 30667) },
1169 1170 1171 1172 1173 1174 1175
      { AOM_CDF7(12288, 19408, 24627, 26662, 28499, 30667) },
      { AOM_CDF7(2815, 4570, 9416, 10875, 13782, 19863) },
      { AOM_CDF7(12032, 14948, 22187, 23138, 24756, 27635) },
      { AOM_CDF7(14847, 20167, 25433, 26751, 28278, 30119) },
      { AOM_CDF7(18816, 25574, 29030, 29877, 30656, 31506) },
      { AOM_CDF7(23039, 27333, 30220, 30708, 31070, 31826) },
      { AOM_CDF7(12543, 20838, 27455, 28762, 29763, 31546) },
1176
    };
clang-format's avatar
clang-format committed
1177

Hui Su's avatar
Hui Su committed
1178 1179
const aom_cdf_prob
    default_palette_uv_size_cdf[PALATTE_BSIZE_CTXS][CDF_SIZE(PALETTE_SIZES)] = {
1180 1181
      { AOM_CDF7(20480, 29888, 32453, 32715, 32751, 32766) },
      { AOM_CDF7(20480, 29888, 32453, 32715, 32751, 32766) },
Hui Su's avatar
Hui Su committed
1182 1183 1184 1185 1186 1187 1188 1189
      { AOM_CDF7(20480, 29888, 32453, 32715, 32751, 32766) },
      { AOM_CDF7(11135, 23641, 31056, 31998, 32496, 32668) },
      { AOM_CDF7(9984, 21999, 29192, 30645, 31640, 32402) },
      { AOM_CDF7(7552, 16614, 24880, 27283, 29254, 31203) },
      { AOM_CDF7(11391, 18656, 23727, 26058, 27788, 30278) },
      { AOM_CDF7(8576, 13585, 17632, 20884, 23948, 27152) },
      { AOM_CDF7(9216, 14276, 19043, 22689, 25799, 28712) },
    };
1190

1191 1192 1193
// When palette mode is enabled, following probability tables indicate the
// probabilities to code the "is_palette" bit (i.e. the bit that indicates
// if this block uses palette mode or DC_PRED mode).
Hui Su's avatar
Hui Su committed
1194
const aom_cdf_prob default_palette_y_mode_cdf[PALATTE_BSIZE_CTXS]
1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209
                                             [PALETTE_Y_MODE_CONTEXTS]
                                             [CDF_SIZE(2)] = {
                                               { { AOM_CDF2(128 * 240) },
                                                 { AOM_CDF2(128 * 180) },
                                                 { AOM_CDF2(128 * 100) } },
                                               { { AOM_CDF2(128 * 240) },
                                                 { AOM_CDF2(128 * 180) },
                                                 { AOM_CDF2(128 * 100) } },
                                               { { AOM_CDF2(128 * 240) },
                                                 { AOM_CDF2(128 * 180) },
                                                 { AOM_CDF2(128 * 100) } },
                                               { { AOM_CDF2(128 * 240) },
                                                 { AOM_CDF2(128 * 180) },
                                                 { AOM_CDF2(128 * 100) } },
                                               { { AOM_CDF2(128 * 240) },
1210 1211 1212 1213 1214 1215
                                                 { AOM_CDF2(128 * 180) },
                                                 { AOM_CDF2(128 * 100) } },
                                               { { AOM_CDF2(128 * 240) },
                                                 { AOM_CDF2(128 * 180) },
                                                 { AOM_CDF2(128 * 100) } },
                                               { { AOM_CDF2(128 * 240) },
1216 1217 1218 1219 1220 1221 1222 1223 1224
                                                 { AOM_CDF2(128 * 180) },
                                                 { AOM_CDF2(128 * 100) } },
                                               { { AOM_CDF2(128 * 240) },
                                                 { AOM_CDF2(128 * 180) },
                                                 { AOM_CDF2(128 * 100) } },
                                               { { AOM_CDF2(128 * 240) },
                                                 { AOM_CDF2(128 * 180) },
                                                 { AOM_CDF2(128 * 100) } },
                                             };
1225 1226 1227

const aom_cdf_prob
    default_palette_uv_mode_cdf[PALETTE_UV_MODE_CONTEXTS][CDF_SIZE(2)] = {
1228
      { AOM_CDF2(128 * 253) }, { AOM_CDF2(128 * 229) }
1229 1230
    <