entropymode.c 154 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"
24
25
26
27
28
29
30
31
32
33
const aom_prob default_txb_skip[TX_SIZES][TXB_SKIP_CONTEXTS] = {
  { 252, 71, 126, 184, 178, 218, 251, 49, 133, 221, 27, 92, 197 },
  { 252, 71, 126, 184, 178, 218, 251, 49, 133, 221, 27, 92, 197 },
  { 252, 71, 126, 184, 178, 218, 251, 49, 133, 221, 27, 92, 197 },
  { 252, 71, 126, 184, 178, 218, 251, 49, 133, 221, 27, 92, 197 },
};
const aom_prob default_dc_sign[PLANE_TYPES][DC_SIGN_CONTEXTS] = {
  { 125, 102, 147 }, { 119, 101, 135 },
};

34
#if CONFIG_LV_MAP_MULTI || TRAIN_INIT_PROB
35
36
const aom_prob default_coeff_base
    [TX_SIZES][PLANE_TYPES][NUM_BASE_LEVELS][COEFF_BASE_CONTEXTS] = {
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
90
91
92
93
94
95
96
97
98
99
100
      { { { 109, 232, 199, 135, 87,  52,  239, 210, 142, 92,  63,  128,
            128, 128, 128, 128, 128, 128, 128, 128, 128, 233, 205, 112,
            75,  62,  226, 200, 122, 60,  29,  241, 204, 126, 70,  42,
            238, 204, 119, 57,  128, 128, 203, 244, 246, 247 },
          { 107, 223, 197, 147, 102, 62,  227, 205, 156, 112, 74,  128,
            128, 128, 128, 128, 128, 128, 128, 128, 128, 212, 200, 138,
            99,  64,  198, 184, 129, 78,  38,  219, 186, 131, 84,  56,
            204, 184, 127, 77,  128, 128, 191, 226, 222, 223 } },
        { { 163, 241, 224, 174, 109, 58,  248, 236, 200, 130, 75,  128,
            128, 128, 128, 128, 128, 128, 128, 128, 128, 249, 244, 213,
            128, 51,  128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
            128, 128, 128, 128, 128, 128, 228, 248, 252, 254 },
          { 153, 231, 211, 165, 113, 66,  236, 221, 180, 127, 88,  128,
            128, 128, 128, 128, 128, 128, 128, 128, 128, 243, 238, 191,
            111, 154, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
            128, 128, 128, 128, 128, 128, 209, 237, 239, 248 } } },
      { { { 91,  228, 196, 134, 88,  48,  242, 213, 157, 107, 63,  239,
            202, 139, 92,  54,  236, 201, 138, 90,  53,  248, 229, 176,
            121, 76,  231, 202, 140, 80,  37,  246, 222, 168, 110, 61,
            248, 221, 151, 97,  60,  128, 199, 249, 252, 252 },
          { 85,  196, 181, 138, 98,  55,  230, 206, 164, 121, 73,  219,
            193, 144, 104, 62,  218, 192, 143, 101, 61,  237, 218, 182,
            140, 90,  213, 191, 140, 94,  44,  224, 200, 159, 115, 68,
            220, 199, 151, 107, 69,  128, 183, 229, 226, 230 } },
        { { 139, 235, 211, 159, 107, 66,  247, 231, 184, 127, 79,  246,
            226, 170, 103, 61,  236, 212, 161, 119, 76,  253, 245, 215,
            156, 96,  128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
            128, 128, 128, 128, 128, 128, 227, 249, 253, 255 },
          { 128, 195, 197, 162, 121, 73,  236, 220, 184, 138, 86,  223,
            208, 158, 107, 64,  222, 204, 167, 132, 86,  246, 234, 205,
            161, 108, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
            128, 128, 128, 128, 128, 128, 198, 228, 239, 244 } } },
      { { { 73,  224, 186, 123, 79,  39,  240, 205, 146, 98,  53,  243,
            209, 147, 98,  52,  241, 207, 145, 93,  44,  252, 236, 188,
            134, 82,  227, 193, 125, 72,  32,  241, 218, 168, 112, 52,
            251, 233, 179, 114, 62,  128, 179, 250, 254, 255 },
          { 69,  200, 171, 127, 86,  41,  224, 193, 150, 107, 58,  218,
            194, 150, 107, 58,  220, 193, 147, 102, 47,  239, 222, 188,
            147, 92,  204, 183, 127, 80,  36,  211, 194, 158, 114, 57,
            231, 209, 167, 120, 70,  128, 171, 226, 235, 232 } },
        { { 117, 225, 196, 146, 107, 68,  246, 225, 177, 128, 81,  243,
            217, 163, 105, 60,  247, 225, 180, 131, 84,  253, 241, 202,
            148, 97,  128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
            128, 128, 128, 128, 128, 128, 219, 251, 255, 255 },
          { 103, 189, 166, 141, 116, 70,  234, 216, 184, 145, 92,  208,
            195, 155, 110, 79,  226, 214, 184, 144, 90,  245, 229, 202,
            164, 113, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
            128, 128, 128, 128, 128, 128, 182, 221, 236, 243 } } },
      { { { 72,  212, 172, 113, 74,  33,  238, 200, 139, 91,  44,  240,
            208, 147, 98,  51,  244, 214, 157, 107, 51,  253, 233, 184,
            132, 74,  128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
            128, 128, 128, 128, 128, 128, 201, 250, 254, 255 },
          { 68,  187, 154, 116, 80,  34,  217, 186, 142, 101, 47,  205,
            187, 148, 106, 56,  218, 201, 163, 118, 55,  236, 215, 181,
            141, 79,  128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
            128, 128, 128, 128, 128, 128, 192, 219, 246, 244 } },
        { { 80,  217, 179, 140, 106, 60,  237, 208, 165, 129, 94,  128,
            128, 128, 128, 128, 128, 128, 128, 128, 128, 253, 240, 205,
            158, 111, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
            128, 128, 128, 128, 128, 128, 205, 250, 255, 254 },
          { 66,  175, 129, 103, 89,  57,  204, 189, 164, 133, 106, 128,
            128, 128, 128, 128, 128, 128, 128, 128, 128, 238, 228, 202,
            166, 124, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
            128, 128, 128, 128, 128, 128, 154, 207, 128, 226 } } }
101
102
103
    };

const aom_prob default_nz_map[TX_SIZES][PLANE_TYPES][SIG_COEF_CONTEXTS] = {
104
105
106
107
108
109
110
  { { 59,  183, 130, 76,  47,  29,  203, 154, 85,  55,  35,  128,
      128, 128, 128, 128, 128, 128, 128, 128, 128, 202, 165, 86,
      70,  42,  183, 132, 70,  28,  13,  212, 158, 77,  34,  22,
      222, 172, 74,  30,  128, 128, 1,   1,   1,   1 },
    { 97,  210, 172, 111, 61,  29,  223, 188, 131, 77,  33,  128,
      128, 128, 128, 128, 128, 128, 128, 128, 128, 214, 192, 137,
      63,  51,  128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
111
      128, 128, 128, 128, 128, 128, 1,   1,   1,   1 } },
112
113
114
115
116
117
118
  { { 50,  194, 130, 72,  45,  25,  208, 150, 89,  55,  32,  206,
      142, 80,  49,  28,  191, 137, 79,  47,  27,  224, 180, 108,
      63,  37,  206, 137, 81,  40,  18,  229, 170, 106, 58,  30,
      233, 180, 96,  49,  29,  128, 1,   1,   1,   1 },
    { 84,  210, 159, 89,  55,  33,  223, 181, 114, 67,  36,  227,
      180, 112, 58,  31,  218, 161, 95,  63,  40,  237, 208, 146,
      88,  50,  128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
119
      128, 128, 128, 128, 128, 128, 1,   1,   1,   1 } },
120
121
122
123
124
125
126
  { { 40,  187, 118, 65,  39,  20,  211, 142, 80,  49,  26,  226,
      150, 83,  49,  26,  213, 146, 82,  47,  22,  237, 191, 116,
      68,  39,  204, 124, 68,  35,  15,  226, 167, 104, 58,  26,
      236, 195, 117, 59,  30,  128, 1,   1,   1,   1 },
    { 69,  207, 145, 80,  53,  36,  226, 167, 98,  64,  38,  238,
      174, 95,  54,  32,  228, 169, 103, 67,  41,  243, 201, 123,
      77,  48,  128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
127
      128, 128, 128, 128, 128, 128, 1,   1,   1,   1 } },
128
129
130
  { { 39,  175, 107, 58,  38,  16,  214, 135, 73,  44,  21,  235,
      145, 80,  48,  26,  227, 149, 84,  52,  25,  247, 195, 108,
      65,  35,  128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
131
      128, 128, 128, 128, 128, 128, 1,   1,   1,   1 },
132
133
134
    { 44,  206, 151, 90,  60,  30,  214, 148, 92,  62,  40,  128,
      128, 128, 128, 128, 128, 128, 128, 128, 128, 248, 197, 125,
      80,  52,  128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
135
      128, 128, 128, 128, 128, 128, 1,   1,   1,   1 } }
136
137
};
#else  // CONFIG_LV_MAP_MULTI
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
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
#if USE_CAUSAL_BASE_CTX
const aom_prob default_coeff_base
    [TX_SIZES][PLANE_TYPES][NUM_BASE_LEVELS][COEFF_BASE_CONTEXTS] = {
      { { { 139, 242, 199, 135, 87,  51,  245, 208, 138, 89,  60,
            128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 240,
            200, 108, 70,  56,  230, 199, 126, 66,  32,  242, 204,
            128, 74,  45,  241, 203, 120, 62,  128, 128 },
          { 118, 230, 197, 147, 103, 60,  228, 202, 154, 110, 72,
            128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 213,
            196, 134, 94,  58,  199, 184, 130, 82,  40,  217, 186,
            134, 86,  57,  204, 185, 127, 74,  128, 128 } },
        { { 203, 248, 223, 170, 105, 58,  252, 235, 195, 125, 72,
            128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 253,
            244, 209, 110, 85,  128, 128, 128, 128, 128, 128, 128,
            128, 128, 128, 128, 128, 128, 128, 128, 128 },
          { 170, 239, 210, 163, 112, 68,  239, 219, 175, 127, 84,
            128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 246,
            234, 184, 142, 154, 128, 128, 128, 128, 128, 128, 128,
            128, 128, 128, 128, 128, 128, 128, 128, 128 } } },
      { { { 119, 240, 196, 136, 90,  50,  247, 214, 159, 109, 64,
            241, 201, 137, 91,  53,  239, 199, 136, 89,  52,  251,
            230, 176, 121, 76,  231, 202, 142, 84,  39,  246, 221,
            169, 111, 61,  248, 221, 152, 97,  60,  128 },
          { 98,  209, 182, 140, 100, 56,  234, 207, 166, 122, 73,
            215, 189, 142, 103, 59,  216, 188, 140, 99,  59,  235,
            216, 179, 137, 88,  214, 189, 141, 96,  46,  224, 200,
            159, 117, 68,  221, 199, 152, 108, 68,  128 } },
        { { 195, 245, 212, 159, 108, 64,  251, 231, 186, 131, 80,
            250, 228, 175, 108, 58,  244, 213, 163, 120, 82,  254,
            245, 216, 159, 91,  128, 128, 128, 128, 128, 128, 128,
            128, 128, 128, 128, 128, 128, 128, 128, 128 },
          { 150, 207, 199, 164, 121, 76,  239, 221, 185, 142, 89,
            231, 208, 162, 113, 69,  228, 205, 169, 136, 95,  246,
            235, 204, 157, 110, 128, 128, 128, 128, 128, 128, 128,
            128, 128, 128, 128, 128, 128, 128, 128, 128 } } },
      { { { 93,  232, 185, 124, 81,  38,  244, 206, 147, 98,  53,
            246, 210, 150, 100, 54,  244, 208, 146, 94,  44,  253,
            236, 189, 135, 82,  228, 195, 130, 76,  35,  242, 220,
            170, 114, 59,  253, 235, 184, 122, 68,  128 },
          { 80,  203, 169, 127, 86,  41,  228, 194, 151, 108, 58,
            221, 195, 152, 110, 60,  220, 194, 149, 103, 48,  238,
            221, 188, 147, 92,  205, 184, 130, 85,  41,  208, 195,
            159, 120, 62,  233, 212, 173, 126, 76,  128 } },
        { { 187, 239, 199, 149, 109, 66,  250, 226, 179, 130, 82,
            248, 218, 159, 100, 63,  251, 227, 184, 135, 91,  254,
            241, 202, 150, 99,  128, 128, 128, 128, 128, 128, 128,
            128, 128, 128, 128, 128, 128, 128, 128, 128 },
          { 130, 202, 169, 146, 118, 73,  236, 217, 186, 146, 91,
            215, 194, 154, 102, 77,  234, 216, 188, 145, 98,  245,
            229, 201, 163, 110, 128, 128, 128, 128, 128, 128, 128,
            128, 128, 128, 128, 128, 128, 128, 128, 128 } } },
      { { { 102, 225, 171, 113, 74,  33,  243, 201, 139, 92,  44,
            244, 208, 146, 99,  53,  247, 214, 158, 107, 52,  253,
            233, 183, 131, 73,  128, 128, 128, 128, 128, 128, 128,
            128, 128, 128, 128, 128, 128, 128, 128, 128 },
          { 80,  190, 152, 116, 79,  34,  222, 187, 142, 101, 47,
            211, 187, 148, 106, 56,  221, 200, 163, 118, 56,  236,
            215, 181, 140, 78,  128, 128, 128, 128, 128, 128, 128,
            128, 128, 128, 128, 128, 128, 128, 128, 128 } },
        { { 166, 237, 184, 144, 106, 62,  245, 211, 167, 129, 93,
            128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 254,
            240, 205, 158, 112, 128, 128, 128, 128, 128, 128, 128,
            128, 128, 128, 128, 128, 128, 128, 128, 128 },
          { 91,  185, 133, 105, 95,  60,  213, 190, 164, 131, 107,
            128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 242,
            227, 203, 160, 127, 128, 128, 128, 128, 128, 128, 128,
            128, 128, 128, 128, 128, 128, 128, 128, 128 } } }
    };

const aom_prob default_nz_map[TX_SIZES][PLANE_TYPES][SIG_COEF_CONTEXTS] = {
  { { 59,  183, 130, 76,  48,  28,  202, 153, 84,  54,  34, 128, 128, 128,
      128, 128, 128, 128, 128, 128, 128, 200, 163, 84,  61, 34,  182, 131,
      71,  31,  16,  210, 156, 78,  36,  26,  220, 170, 73, 32,  128, 128 },
    { 96,  209, 171, 109, 59,  28,  223, 187, 128, 71,  35,  128, 128, 128,
      128, 128, 128, 128, 128, 128, 128, 215, 192, 135, 63,  73,  128, 128,
      128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128 } },
  { { 49, 190, 129, 74,  46,  25,  206, 150, 90,  55,  32, 205, 142, 79,
      48, 27,  191, 137, 78,  47,  27,  223, 181, 109, 63, 37,  204, 136,
      82, 42,  19,  226, 169, 106, 58,  30,  231, 180, 96, 49,  29,  128 },
    { 86,  210, 159, 90,  56,  34,  223, 181, 114, 69,  40,  229, 182, 113,
      59,  28,  218, 162, 96,  64,  42,  237, 207, 146, 92,  50,  128, 128,
      128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128 } },
  { { 41, 187, 119, 66,  40,  20,  212, 144, 80,  49,  26,  226, 151, 84,
      49, 27,  214, 146, 82,  47,  22,  237, 190, 115, 68,  40,  206, 126,
      71, 37,  17,  227, 168, 103, 61,  29,  237, 197, 119, 63,  32,  128 },
    { 70,  207, 146, 82,  54,  35,  226, 167, 99,  65,  40,  238, 176, 96,
      57,  29,  229, 171, 108, 69,  47,  244, 201, 124, 78,  48,  128, 128,
      128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128 } },
  { { 40,  176, 107, 57,  37,  16,  216, 136, 73,  44,  22,  235, 145, 79,
      49,  26,  227, 149, 84,  52,  26,  247, 195, 107, 64,  35,  128, 128,
      128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128 },
    { 49,  210, 153, 95,  58,  31,  217, 151, 93,  64,  41,  128, 128, 128,
      128, 128, 128, 128, 128, 128, 128, 248, 197, 123, 79,  53,  128, 128,
      128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128 } }
};

#else   // USE_CAUSAL_BASE_CTX

236
const aom_prob default_coeff_base
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
    [TX_SIZES][PLANE_TYPES][NUM_BASE_LEVELS][COEFF_BASE_CONTEXTS] = {
      { { {
              230, 199, 168, 74, 128, 169, 213, 173, 87, 21, 60, 117, 213,
              177, 126, 22,  64, 121, 206, 168, 67,  10, 33, 96, 140,
          },
          {
              236, 218, 201, 124, 185, 219, 223, 196, 128, 65, 127, 176, 224,
              199, 151, 75,  131, 177, 217, 190, 102, 38,  93, 161, 192,
          } },
        { {
              219, 188, 161, 46, 114, 163, 198, 154, 73, 10, 43, 101, 199,
              160, 89,  12,  49, 111, 186, 136, 62,  2,  15, 66, 123,
          },
          {
              228, 210, 191, 108, 177, 215, 213, 183, 125, 58, 112, 169, 212,
              183, 134, 65,  120, 171, 206, 166, 90,  27,  73, 140, 173,
          } } },
254

255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
      { { {
              232, 198, 164, 85, 124, 169, 207, 156, 49, 9,  42, 97,  208,
              160, 90,  11,  45, 101, 198, 145, 50,  2,  15, 66, 120,
          },
          {
              237, 218, 199, 123, 187, 222, 219, 187, 101, 54, 117, 167, 221,
              189, 125, 61,  121, 171, 212, 175, 81,  27,  78, 147, 185,
          } },
        { {
              204, 165, 154, 39, 100, 144, 173, 117, 42, 7,  27, 71,  156,
              108, 52,  9,   32, 78,  165, 117, 46,  2,  12, 55, 102,
          },
          {
              225, 204, 183, 99, 173, 149, 205, 167, 88, 47, 99,  160, 186,
              149, 88,  48,  98, 157, 183, 148, 76,  34, 75, 133, 187,
          } } },
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
304
      { { {
              231, 199, 182, 107, 136, 172, 200, 148, 55, 8, 35, 87,  204,
              150, 72,  10,  37,  89,  184, 127, 36,  1,  9, 47, 103,
          },
          {
              236, 217, 206, 128, 188, 222, 213, 180, 98, 51, 113, 166, 218,
              182, 115, 55,  115, 167, 200, 162, 66,  22, 70, 135, 178,
          } },
        { {
              229, 200, 220, 56, 123, 179, 184, 123, 64, 8,  24, 62,  177,
              118, 55,  8,   27, 70,  158, 101, 8,   1,  12, 54, 107,
          },
          {
              232, 222, 223, 108, 195, 154, 213, 184, 71, 41, 101, 154, 206,
              164, 109, 42,  96,  162, 182, 137, 5,   33, 81, 146, 177,
          } } },
      { { {
              232, 208, 213, 120, 151, 192, 200, 152, 57, 13, 44, 94, 200,
              148, 87,  13,  42,  94,  181, 124, 45,  1,  9,  46, 99,
          },
          {
              241, 226, 222, 129, 197, 179, 213, 184, 133, 57, 119, 168, 214,
              178, 116, 64,  119, 162, 199, 157, 64,  24,  70, 130, 176,
          } },
        { {
              233, 223, 202, 65, 131, 128, 178, 138, 128, 2,  24, 59,  99,
              111, 73,  3,   17, 52,  149, 99,  19,  2,   18, 72, 140,
          },
          {
              240, 199, 230, 79, 181, 128, 192, 198, 128, 64,  121, 171, 192,
              148, 37,  26,  83, 85,  183, 149, 8,   33,  101, 168, 128,
          } } }
    };
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
331
332
333
334
335
336
337
338
339
340
341
342
static const aom_prob default_nz_map[TX_SIZES][PLANE_TYPES][SIG_COEF_CONTEXTS] =
    { { { 40,  157, 108, 70,  34,  19,  168, 98,  60,  32,  20,  128,
          128, 128, 128, 128, 128, 128, 128, 128, 128, 125, 80,  41,
          128, 128, 173, 120, 81,  36,  128, 188, 127, 84,  35,  128,
          183, 128, 60,  128, 128, 128, 170, 122, 82,  35,  128, 186,
          129, 84,  34,  128, 183, 128, 56,  128, 128, 128 },
        { 67,  176, 120, 77,  44,  26,  182, 124, 77,  47,  32,  128,
          128, 128, 128, 128, 128, 128, 128, 128, 128, 163, 127, 74,
          128, 128, 203, 167, 122, 70,  128, 202, 171, 125, 72,  128,
          198, 176, 105, 128, 128, 128, 192, 160, 108, 67,  128, 186,
          160, 113, 74,  128, 188, 173, 121, 128, 128, 128 } },
      { { 55, 192, 143, 93,  43,  17, 201, 155, 101, 50,  22, 171, 124, 76,  38,
          17, 176, 123, 77,  40,  19, 205, 148, 99,  53,  26, 200, 140, 94,  52,
          24, 218, 157, 103, 58,  28, 221, 161, 109, 63,  34, 128, 194, 144, 96,
          52, 24,  212, 160, 104, 59, 26,  216, 161, 105, 57, 27,  128 },
        { 84,  190, 149, 102, 59,  29,  204, 159, 111, 69,  41,  200,
          151, 98,  54,  32,  193, 143, 98,  69,  46,  216, 167, 111,
          65,  37,  211, 174, 123, 62,  23,  222, 184, 137, 79,  43,
          222, 195, 148, 87,  128, 128, 199, 160, 119, 92,  55,  185,
          147, 98,  70,  57,  197, 169, 122, 82,  68,  128 } },
      { { 56, 204, 126, 80,  41,  16, 218, 157, 100, 50,  22, 211, 142, 92,  47,
          21, 212, 150, 98,  50,  22, 230, 172, 118, 65,  32, 223, 134, 91,  50,
          22, 237, 167, 109, 60,  31, 239, 182, 128, 78,  40, 128, 209, 138, 90,
          52, 25,  223, 160, 105, 62, 30,  228, 173, 119, 72, 36,  128 },
        { 79,  201, 140, 99,  64,  37,  225, 175, 128, 78,  35,  215,
          151, 108, 49,  24,  211, 173, 138, 100, 44,  241, 185, 136,
          95,  39,  210, 109, 89,  43,  128, 234, 144, 73,  85,  128,
          252, 212, 121, 64,  128, 128, 216, 167, 127, 99,  102, 211,
          182, 168, 129, 110, 202, 157, 101, 66,  42,  128 } },
      { { 41,  177, 92,  53,  29,  14,  218, 137, 87,  47,  20,  201,
          124, 80,  50,  29,  208, 151, 104, 59,  27,  244, 173, 113,
          66,  36,  233, 105, 76,  53,  23,  249, 163, 97,  98,  128,
          254, 192, 136, 97,  47,  128, 237, 137, 86,  54,  31,  244,
          157, 100, 60,  33,  241, 177, 115, 68,  33,  128 },
        { 73,  231, 149, 83,  63,  64,  242, 192, 132, 113, 114, 128,
          128, 128, 128, 128, 128, 128, 128, 128, 128, 252, 204, 160,
          114, 36,  128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
Dake He's avatar
Dake He committed
343
          128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
344
          128, 128, 128, 128, 128, 128, 128, 128, 128, 128 } } };
345
#endif  // USE_CAUSAL_BASE_CTX
346
#endif  // CONFIG_LV_MAP_MULTI
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
388
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
415
416
417
418
#if CONFIG_CTX1D
const aom_prob default_eob_flag[TX_SIZES][PLANE_TYPES][EOB_COEF_CONTEXTS] = {
  { { 220, 225, 220, 216, 233, 225, 189, 178, 222, 199, 164, 112, 207,
      171, 115, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128,

      147, 125, 104, 36,  117, 107, 26,  128, 128, 128, 128, 128, 128,
      128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128,

      156, 124, 128, 128, 146, 68,  128, 128, 131, 17,  128, 128, 64,
      128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128 },

    { 146, 150, 142, 144, 178, 167, 131, 116, 150, 123, 107, 63,  119,
      89,  74,  128, 128, 128, 128, 128, 128, 128, 128, 128, 128,

      117, 127, 105, 69,  53,  56,  30,  128, 128, 128, 128, 128, 128,
      128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128,

      128, 86,  128, 128, 140, 72,  128, 128, 120, 44,  128, 128, 80,
      128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128 } },
  { { 237, 242, 242, 219, 192, 246, 246, 243, 233, 184, 155, 234, 217,
      188, 152, 195, 167, 114, 89,  128, 128, 128, 128, 128, 128,

      180, 173, 154, 133, 112, 147, 145, 142, 102, 128, 128, 128, 128,
      128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128,

      198, 173, 130, 200, 128, 208, 182, 160, 106, 171, 128, 144, 128,
      128, 128, 124, 128, 128, 128, 128, 128, 128, 128, 128, 128 },

    { 140, 170, 162, 111, 94,  182, 195, 165, 153, 110, 81,  178, 169,
      158, 83,  133, 85,  85,  38,  128, 128, 128, 128, 128, 128,

      112, 127, 107, 87,  31,  57,  49,  128, 128, 128, 128, 128, 128,
      128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128,

      160, 143, 99,  126, 128, 164, 133, 126, 59,  71,  128, 138, 128,
      128, 128, 99,  128, 128, 128, 128, 128, 128, 128, 128, 128 } },
  { { 229, 241, 243, 245, 247, 247, 251, 248, 235, 210, 247, 235, 208,
      166, 245, 247, 244, 182, 236, 229, 180, 136, 128, 128, 128,

      191, 197, 96,  70,  199, 128, 128, 191, 174, 117, 128, 128, 128,
      128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128,

      211, 183, 215, 188, 138, 209, 136, 128, 170, 128, 191, 128, 161,
      128, 182, 128, 128, 128, 164, 128, 128, 128, 128, 128, 128 },

    { 106, 153, 182, 191, 186, 202, 211, 203, 166, 147, 205, 205, 195,
      128, 206, 212, 182, 109, 192, 154, 139, 79,  128, 128, 128,

      112, 133, 128, 255, 128, 128, 128, 130, 154, 98,  128, 128, 128,
      128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128,

      144, 185, 169, 199, 85,  183, 128, 128, 64,  128, 146, 128, 128,
      128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128 } },
  { { 169, 203, 224, 222, 220, 228, 229, 223, 234, 247, 242, 230, 222,
      238, 246, 234, 196, 245, 249, 245, 192, 240, 235, 199, 161,

      176, 148, 158, 77,  178, 128, 128, 158, 128, 128, 196, 208, 155,
      128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128,

      232, 187, 191, 221, 116, 217, 154, 128, 203, 128, 128, 192, 128,
      201, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128 },

    { 133, 182, 215, 204, 176, 220, 182, 168, 187, 197, 181, 145, 75,
      164, 136, 51,  57,  156, 128, 128, 128, 85,  128, 128, 128,

      128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
      128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128,

      128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
      128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128 } },
};
Jingning Han's avatar
Jingning Han committed
419
#else   // CONFIG_CTX1D
Dake He's avatar
Dake He committed
420
421
static const aom_prob
    default_eob_flag[TX_SIZES][PLANE_TYPES][EOB_COEF_CONTEXTS] = {
Jingning Han's avatar
Jingning Han committed
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
      { { 225, 240, 225, 200, 128, 128, 128, 128, 128, 128, 128,
          245, 246, 238, 203, 128, 128, 128, 128, 128, 128, 128 },
        { 181, 219, 192, 144, 128, 128, 128, 128, 128, 128, 128,
          218, 231, 199, 152, 128, 128, 128, 128, 128, 128, 128 } },
      { { 233, 247, 240, 234, 211, 194, 128, 128, 128, 128, 128,
          252, 252, 249, 242, 221, 208, 128, 128, 128, 128, 128 },
        { 154, 222, 204, 180, 132, 128, 128, 128, 128, 128, 128,
          216, 235, 206, 181, 121, 112, 128, 128, 128, 128, 128 } },
      { { 233, 246, 241, 238, 231, 216, 186, 171, 128, 128, 128,
          251, 252, 251, 244, 233, 218, 192, 191, 128, 128, 128 },
        { 117, 221, 214, 223, 215, 202, 176, 116, 128, 128, 128,
          205, 234, 219, 183, 195, 126, 76,  128, 128, 128, 128 } },
      { { 194, 231, 213, 215, 207, 200, 183, 169, 135, 168, 128,
          240, 246, 243, 238, 210, 201, 172, 133, 107, 128, 128 },
        { 122, 232, 230, 244, 250, 247, 252, 253, 254, 52,  128,
          128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128 } }
Dake He's avatar
Dake He committed
438
    };
Jingning Han's avatar
Jingning Han committed
439

440
441
442
static const aom_prob
    default_eob_extra[TX_SIZES][PLANE_TYPES][EOB_COEF_CONTEXTS] = {
      { {
Jingning Han's avatar
Jingning Han committed
443
444
            145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145,
            145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145,
445
446
        },
        {
Jingning Han's avatar
Jingning Han committed
447
448
            145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145,
            145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145,
449
450
        } },
      { {
Jingning Han's avatar
Jingning Han committed
451
452
            145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145,
            145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145,
453
454
        },
        {
Jingning Han's avatar
Jingning Han committed
455
456
            145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145,
            145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145,
457
458
        } },
      { {
Jingning Han's avatar
Jingning Han committed
459
460
            145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145,
            145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145,
461
462
        },
        {
Jingning Han's avatar
Jingning Han committed
463
464
            145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145,
            145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145,
465
466
        } },
      { {
Jingning Han's avatar
Jingning Han committed
467
468
            145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145,
            145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145,
469
470
        },
        {
Jingning Han's avatar
Jingning Han committed
471
472
            145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145,
            145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145,
473
474
        } }
    };
475
#endif  // CONFIG_CTX1D
476

477
const aom_prob default_coeff_lps[TX_SIZES][PLANE_TYPES][LEVEL_CONTEXTS] = {
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
  { { 96,  128, 86,  122, 128, 84,  125, 128, 88,  99,  126, 128,
      135, 159, 99,  130, 134, 100, 128, 144, 70,  97,  128, 139,
      157, 168, 127, 148, 162, 121, 149, 157, 118, 127, 143, 157,
      178, 186, 168, 171, 183, 165, 169, 180, 180, 169, 166, 177 },
    { 81,  128, 72,  95,  128, 64,  98,  128, 42,  66,  101, 128,
      129, 163, 97,  122, 130, 91,  119, 141, 70,  94,  118, 166,
      157, 168, 117, 143, 151, 111, 144, 154, 76,  113, 128, 158,
      177, 185, 165, 167, 179, 155, 166, 179, 110, 137, 115, 165 } },
  { { 102, 128, 79,  125, 128, 74,  121, 128, 61,  98,  128, 128,
      141, 164, 96,  132, 150, 90,  128, 153, 62,  100, 128, 153,
      162, 172, 120, 146, 162, 113, 142, 154, 96,  113, 138, 155,
      181, 188, 151, 170, 179, 147, 167, 181, 158, 157, 163, 176 },
    { 103, 128, 80,  116, 128, 66,  94,  128, 35,  65,  109, 128,
      134, 163, 104, 137, 154, 92,  128, 104, 58,  94,  129, 132,
      156, 173, 137, 149, 165, 104, 143, 143, 112, 101, 133, 159,
      176, 186, 134, 172, 175, 155, 169, 177, 255, 107, 137, 168 } },
  { { 125, 128, 85,  157, 128, 82,  155, 128, 42,  83,  116, 128,
      155, 174, 101, 144, 155, 93,  140, 155, 57,  92,  124, 149,
      173, 178, 114, 148, 161, 111, 145, 161, 77,  101, 131, 153,
      190, 191, 140, 169, 183, 140, 169, 179, 108, 122, 150, 171 },
    { 136, 128, 108, 163, 128, 96,  140, 128, 48,  90,  85,  128,
      144, 164, 113, 158, 179, 107, 159, 128, 43,  75,  133, 160,
      157, 184, 144, 160, 189, 154, 152, 184, 128, 124, 137, 140,
      188, 196, 148, 170, 178, 128, 177, 159, 128, 179, 135, 135 } },
  { { 133, 128, 110, 153, 128, 101, 157, 128, 49,  91,  134, 128,
      151, 168, 129, 158, 162, 112, 154, 168, 63,  99,  130, 158,
      171, 178, 128, 160, 173, 111, 155, 171, 86,  108, 143, 159,
      194, 196, 162, 177, 185, 123, 172, 181, 101, 132, 156, 178 },
506
507
508
509
510
511
512
513
514
515
    { 133, 128, 129, 144, 128, 116, 135, 128, 43, 101, 100, 128, 140, 163, 158,
      173, 205, 128, 165, 171, 128, 128, 210, 163, 172, 184, 192, 176, 201, 183,
      177, 190, 128, 192, 199, 144,
#if CONFIG_LV_MAP_MULTI
      // TODO(olah): The 1 causes an assert in av1_cost_tokens_from_cdf.
      // Changing to 10 is a temporary fix until the root cause is found.
      192, 192, 10, 196, 192, 255, 171, 178, 255, 128, 171, 179 } }
#else
      192, 192, 1,   196, 192, 255, 171, 178, 255, 128, 171, 179 } }
#endif
516
};
Jingning Han's avatar
Jingning Han committed
517

518
#if !CONFIG_LV_MAP_MULTI
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
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
606
607
608
609
610
611
612
613
614
615
616
617
const aom_prob
    default_coeff_br[TX_SIZES][PLANE_TYPES][BASE_RANGE_SETS][LEVEL_CONTEXTS] = {
      { { { 62,  128, 54,  116, 128, 51,  97,  128, 59,  68,  107, 128,
            119, 158, 68,  115, 131, 65,  112, 138, 34,  71,  118, 137,
            171, 184, 110, 152, 178, 105, 146, 172, 89,  111, 145, 173,
            214, 226, 201, 198, 214, 196, 193, 210, 239, 196, 186, 202 },
          { 41,  128, 58,  52,  128, 51,  61,  128, 92,  54,  48,  128,
            67,  113, 36,  55,  75,  30,  56,  72,  12,  25,  50,  79,
            94,  131, 37,  75,  108, 42,  78,  103, 5,   31,  67,  103,
            172, 192, 131, 135, 167, 129, 136, 165, 149, 144, 120, 149 },
          { 35, 128, 74, 50, 128, 63, 59, 128, 87,  74,  38, 128,
            32, 53,  23, 34, 50,  18, 30, 41,  15,  13,  18, 18,
            52, 74,  18, 29, 36,  18, 31, 47,  51,  9,   15, 27,
            96, 134, 85, 70, 93,  96, 79, 100, 108, 100, 55, 65 } },
        { { 52,  128, 35,  79,  128, 29,  66,  128, 12,  30, 57,  128,
            113, 156, 64,  107, 172, 54,  103, 145, 23,  57, 96,  110,
            165, 184, 95,  138, 166, 95,  141, 184, 55,  80, 133, 165,
            212, 222, 134, 175, 206, 158, 177, 197, 102, 61, 154, 190 },
          { 36,  128, 18, 26,  128, 15, 29,  128, 4, 6,  30, 128,
            63,  113, 25, 44,  66,  22, 40,  67,  9, 14, 34, 55,
            90,  125, 26, 66,  82,  29, 73,  88,  1, 26, 34, 67,
            158, 179, 70, 121, 134, 69, 111, 129, 1, 85, 54, 105 },
          { 24, 128, 8,  31, 128, 15, 16, 128, 1,   1, 1,  128,
            32, 39,  16, 18, 43,  5,  17, 13,  1,   1, 22, 1,
            37, 65,  26, 20, 28,  16, 15, 24,  128, 1, 1,  1,
            83, 107, 57, 56, 74,  34, 29, 73,  128, 1, 37, 47 } } },
      { { { 72,  128, 45,  113, 128, 38,  100, 128, 26,  63,  112, 128,
            134, 177, 65,  121, 148, 57,  111, 143, 27,  68,  116, 152,
            181, 198, 98,  148, 173, 84,  136, 168, 53,  89,  134, 170,
            218, 230, 173, 194, 216, 160, 188, 213, 199, 177, 183, 204 },
          { 54,  128, 34,  55,  128, 32,  53,  128, 66,  45,  54,  128,
            81,  128, 33,  59,  102, 26,  55,  80,  7,   23,  49,  91,
            116, 145, 36,  79,  107, 35,  73,  102, 12,  28,  57,  95,
            170, 201, 102, 133, 173, 105, 127, 173, 166, 132, 114, 149 },
          { 40,  128, 25, 30, 128, 21, 31, 128, 24, 17, 24, 128,
            51,  67,  19, 28, 40,  17, 25, 42,  15, 13, 19, 19,
            61,  77,  19, 30, 48,  13, 33, 50,  11, 15, 21, 30,
            103, 147, 37, 69, 111, 37, 66, 105, 18, 18, 36, 76 } },
        { { 74,  128, 42,  99,  128, 32,  57,  128, 9,  28, 76,  128,
            115, 187, 70,  118, 120, 52,  109, 128, 19, 60, 93,  100,
            178, 197, 119, 147, 179, 92,  137, 178, 37, 87, 110, 158,
            216, 227, 169, 186, 201, 128, 178, 204, 1,  96, 155, 217 },
          { 59,  128, 26, 34,  128, 11, 20,  128, 7,   8, 24, 128,
            73,  125, 38, 74,  96,  23, 61,  79,  15,  9, 23, 110,
            96,  151, 49, 79,  164, 22, 70,  65,  1,   1, 9,  69,
            156, 196, 73, 105, 181, 17, 126, 155, 128, 1, 90, 111 },
          { 42, 128, 10, 11, 128, 13, 1,  128, 1,   1,   1, 128,
            55, 63,  13, 17, 85,  1,  16, 64,  1,   1,   1, 1,
            62, 58,  32, 21, 53,  1,  37, 91,  128, 128, 1, 1,
            81, 133, 51, 48, 79,  1,  25, 81,  128, 128, 1, 54 } } },
      { { { 103, 128, 52,  163, 128, 46,  155, 128, 12, 45,  97,  128,
            162, 196, 69,  140, 170, 60,  130, 158, 21, 58,  109, 150,
            205, 214, 93,  149, 178, 79,  143, 179, 38, 71,  120, 159,
            231, 240, 150, 192, 218, 140, 188, 220, 84, 112, 159, 196 },
          { 93,  128, 42, 143, 128, 41, 132, 128, 6,  15, 40, 128,
            113, 172, 39, 99,  113, 33, 91,  94,  5,  15, 42, 83,
            148, 172, 37, 91,  130, 28, 81,  121, 9,  20, 47, 87,
            201, 223, 75, 139, 183, 77, 132, 176, 23, 41, 82, 147 },
          { 92,  128, 45, 123, 128, 28, 88, 128, 1,  8,  20, 128,
            85,  94,  39, 95,  83,  33, 81, 61,  4,  5,  17, 25,
            84,  109, 17, 59,  76,  11, 46, 62,  1,  4,  13, 35,
            139, 184, 25, 86,  129, 25, 71, 123, 26, 13, 31, 84 } },
        { { 123, 128, 82,  169, 128, 62,  139, 128, 1,   28,  77,  128,
            139, 167, 92,  170, 146, 76,  149, 255, 19,  68,  160, 73,
            190, 209, 171, 165, 218, 57,  152, 209, 128, 61,  122, 164,
            237, 240, 146, 210, 227, 128, 224, 220, 128, 128, 196, 199 },
          { 130, 128, 52,  141, 128, 32,  101, 128, 128, 1,  85,  128,
            94,  155, 71,  121, 255, 30,  116, 85,  1,   8,  58,  255,
            105, 169, 110, 101, 132, 1,   77,  142, 128, 1,  54,  96,
            166, 214, 224, 154, 198, 255, 153, 230, 128, 85, 100, 146 },
          { 103, 128, 26, 83, 128, 20,  47,  128, 128, 128, 1,  128,
            91,  90,  19, 76, 128, 1,   42,  1,   128, 255, 64, 128,
            74,  77,  1,  72, 68,  128, 13,  77,  128, 128, 64, 1,
            71,  147, 37, 99, 171, 1,   104, 151, 128, 1,   1,  96 } } },
      { { { 113, 128, 79,  165, 128, 69,  149, 128, 14, 55,  116, 128,
            163, 202, 104, 169, 205, 82,  159, 180, 22, 64,  121, 165,
            207, 216, 113, 177, 215, 95,  166, 195, 35, 77,  132, 179,
            241, 244, 173, 207, 233, 128, 202, 227, 92, 121, 169, 209 },
          { 114, 128, 67, 136, 128, 54, 132, 128, 6,  26, 62,  128,
            85,  129, 85, 146, 173, 64, 129, 140, 7,  19, 65,  92,
            139, 169, 42, 147, 186, 40, 129, 170, 18, 18, 65,  117,
            213, 230, 74, 172, 213, 69, 165, 196, 1,  40, 103, 170 },
          { 101, 128, 61, 134, 128, 52, 97,  128, 1,   14, 26, 128,
            79,  72,  71, 135, 152, 56, 114, 117, 1,   10, 24, 58,
            64,  66,  60, 133, 148, 16, 126, 123, 1,   32, 26, 56,
            143, 197, 51, 141, 176, 59, 132, 162, 128, 17, 47, 106 } },
        { { 115, 128, 112, 135, 128, 89,  130, 128, 15,  49,  89,  128,
            143, 238, 154, 203, 255, 138, 172, 255, 1,   98,  196, 255,
            185, 203, 255, 211, 255, 192, 217, 235, 128, 128, 171, 255,
            233, 233, 255, 247, 255, 1,   239, 245, 1,   128, 255, 255 },
          { 75,  128, 76,  118, 128, 35,  74,  128, 1,   13,  23,  128,
            63,  138, 114, 164, 140, 91,  128, 128, 128, 1,   138, 64,
            96,  128, 255, 175, 236, 85,  166, 209, 128, 1,   128, 146,
            196, 217, 1,   204, 206, 128, 212, 221, 128, 128, 128, 219 },
          { 49,  128, 36,  62,  128, 37,  56, 128, 128, 1,   1,   128,
            45,  37,  68,  102, 128, 90,  56, 1,   128, 128, 37,  1,
            26,  27,  128, 126, 128, 255, 63, 142, 128, 128, 1,   1,
            125, 159, 128, 173, 212, 128, 85, 189, 128, 128, 255, 171 } } }
    };
618
#endif
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
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
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
#if CONFIG_CTX1D
static const aom_prob default_eob_mode[TX_SIZES][PLANE_TYPES][TX_CLASSES] = {
  { { 128, 176, 157 }, { 128, 222, 198 } },
  { { 128, 35, 56 }, { 128, 203, 225 } },
  { { 128, 55, 136 }, { 128, 230, 253 } },
  { { 128, 101, 188 }, { 128, 128, 128 } }
};
static const aom_prob default_empty_line[TX_SIZES][PLANE_TYPES][TX_CLASSES]
                                        [EMPTY_LINE_CONTEXTS] = {
                                          { { { 128, 128, 128, 128, 128 },
                                              { 142, 153, 211, 205, 128 },
                                              { 162, 142, 203, 197, 128 } },
                                            { { 128, 128, 128, 128, 128 },
                                              { 133, 116, 178, 123, 128 },
                                              { 139, 109, 159, 115, 128 } } },
                                          { { { 128, 128, 128, 128, 128 },
                                              { 185, 130, 183, 204, 227 },
                                              { 171, 81, 177, 200, 221 } },
                                            { { 128, 128, 128, 128, 128 },
                                              { 180, 127, 175, 189, 213 },
                                              { 120, 74, 129, 134, 156 } } },
                                          { { { 128, 128, 128, 128, 128 },
                                              { 202, 82, 183, 214, 248 },
                                              { 144, 41, 163, 185, 203 } },
                                            { { 128, 128, 128, 128, 128 },
                                              { 151, 93, 171, 224, 160 },
                                              { 128, 51, 171, 128, 1 } } },
                                          { { { 128, 128, 128, 128, 128 },
                                              { 154, 48, 174, 210, 233 },
                                              { 123, 16, 148, 189, 197 } },
                                            { { 128, 128, 128, 128, 128 },
                                              { 128, 128, 128, 128, 128 },
                                              { 128, 128, 128, 128, 128 } } }
                                        };
static const aom_prob
    default_hv_eob[TX_SIZES][PLANE_TYPES][TX_CLASSES][HV_EOB_CONTEXTS] = {
      { { { 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
            128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128 },
          { 151, 173, 114, 128, 128, 128, 128, 128, 128, 162, 198, 128,
            128, 128, 128, 128, 182, 198, 109, 128, 128, 128, 128, 128 },
          { 152, 173, 119, 128, 128, 128, 128, 128, 128, 164, 193, 128,
            128, 128, 128, 128, 198, 209, 121, 128, 128, 128, 128, 128 } },
        { { 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
            128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128 },
          { 123, 143, 70,  128, 128, 128, 128, 128, 128, 127, 154, 128,
            128, 128, 128, 128, 176, 148, 36,  128, 128, 128, 128, 128 },
          { 132, 152, 73,  128, 128, 128, 128, 128, 128, 127, 159, 128,
            128, 128, 128, 128, 186, 181, 48,  128, 128, 128, 128, 128 } } },
      { { { 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
            128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128 },
          { 109, 105, 78,  44,  128, 128, 128, 128, 128, 146, 185, 221,
            128, 128, 128, 128, 199, 188, 134, 69,  128, 128, 128, 128 },
          { 124, 127, 115, 82,  128, 128, 128, 128, 128, 162, 198, 224,
            128, 128, 128, 128, 206, 214, 177, 135, 128, 128, 128, 128 } },
        { { 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
            128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128 },
          { 95,  102, 65,  14,  128, 128, 128, 128, 128, 132, 164, 199,
            128, 128, 128, 128, 162, 163, 66,  27,  128, 128, 128, 128 },
          { 83,  141, 97,  38,  128, 128, 128, 128, 128, 154, 132, 184,
            128, 128, 128, 128, 194, 218, 112, 63,  128, 128, 128, 128 } } },
      { { { 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
            128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128 },
          { 117, 107, 86,  61,  51,  104, 128, 128, 128, 160, 198, 238,
            252, 251, 128, 128, 221, 223, 209, 186, 99,  81,  128, 128 },
          { 118, 122, 121, 100, 91,  97,  128, 128, 128, 168, 190, 214,
            233, 235, 128, 128, 197, 216, 177, 165, 147, 126, 128, 128 } },
        { { 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
            128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128 },
          { 109, 102, 63,  51,  255, 85,  128, 128, 128, 163, 131, 175,
            128, 128, 128, 128, 183, 102, 40,  1,   128, 128, 128, 128 },
          { 255, 255, 1,   1,   128, 1, 128, 128, 128, 1,   128, 128,
            128, 128, 128, 128, 255, 1, 128, 128, 128, 128, 128, 128 } } },
      { { { 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
            128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128 },
          { 114, 108, 83,  61,  53,  28,  77,  177, 128, 161, 187, 218,
            240, 237, 228, 234, 200, 207, 167, 136, 98,  78,  183, 128 },
          { 117, 138, 116, 77,  75,  85,  26,  1,   128, 197, 162, 200,
            184, 212, 225, 236, 189, 225, 168, 124, 144, 171, 128, 128 } },
        { { 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
            128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128 },
          { 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
            128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128 },
          { 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
            128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128 } } }
    };
#endif  // CONFIG_CTX1D
705
706
#endif  // CONFIG_LV_MAP

707
static const aom_cdf_prob default_newmv_cdf[NEWMV_MODE_CONTEXTS][CDF_SIZE(2)] =
708
709
710
    { { 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
711
static const aom_cdf_prob default_zeromv_cdf[GLOBALMV_MODE_CONTEXTS][CDF_SIZE(
712
    2)] = { { AOM_CDF2(128 * 45) }, { AOM_CDF2(128 * 13) } };
713
static const aom_cdf_prob default_refmv_cdf[REFMV_MODE_CONTEXTS][CDF_SIZE(2)] =
714
715
716
717
718
    {
      { 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) }
    };
719
static const aom_cdf_prob default_drl_cdf[DRL_MODE_CONTEXTS][CDF_SIZE(2)] = {
720
721
722
723
724
  { AOM_CDF2(128 * 119) },
  { AOM_CDF2(128 * 128) },
  { AOM_CDF2(128 * 189) },
  { AOM_CDF2(128 * 134) },
  { AOM_CDF2(128 * 128) }
725
};
726

727
728
729
static const aom_cdf_prob
    default_inter_compound_mode_cdf[INTER_MODE_CONTEXTS][CDF_SIZE(
        INTER_COMPOUND_MODES)] = {
730
731
732
733
734
735
736
      { 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) }
737
738
    };

739
static const aom_cdf_prob
740
    default_compound_type_cdf[BLOCK_SIZES_ALL][CDF_SIZE(COMPOUND_TYPES)] = {
741
742
743
744
745
746
747
748
      { AOM_CDF3(16384, 24576) }, { AOM_CDF3(16384, 24576) },
      { AOM_CDF3(16384, 24576) }, { 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) },
749
#if CONFIG_EXT_PARTITION
750
751
      { AOM_CDF3(32640, 32641) },  // 255, 1
      { AOM_CDF3(32640, 32641) }, { AOM_CDF3(32640, 32641) },
752
#endif  // CONFIG_EXT_PARTITION
753
754
755
756
      { 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) },
757
#if CONFIG_EXT_PARTITION
758
      { AOM_CDF3(26624, 26648) }, { AOM_CDF3(26624, 26648) },
759
#endif
760
761
    };

762
static const aom_cdf_prob default_interintra_cdf[BLOCK_SIZE_GROUPS][CDF_SIZE(
763
764
765
766
    2)] = { { AOM_CDF2(128 * 128) },
            { AOM_CDF2(226 * 128) },
            { AOM_CDF2(244 * 128) },
            { AOM_CDF2(254 * 128) } };
767

768
static const aom_cdf_prob
769
770
771
772
773
    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) } };
774

775
static const aom_cdf_prob
776
    default_wedge_interintra_cdf[BLOCK_SIZES_ALL][CDF_SIZE(2)] = {
777
778
779
780
781
782
      { 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(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) },
783
#if CONFIG_EXT_PARTITION
784
      { AOM_CDF2(255 * 128) }, { AOM_CDF2(255 * 128) }, { AOM_CDF2(255 * 128) },
785
#endif  // CONFIG_EXT_PARTITION
786
787
      { AOM_CDF2(208 * 128) }, { AOM_CDF2(208 * 128) }, { AOM_CDF2(208 * 128) },
      { AOM_CDF2(208 * 128) }, { AOM_CDF2(255 * 128) }, { AOM_CDF2(255 * 128) },
788
#if CONFIG_EXT_PARTITION
789
      { AOM_CDF2(255 * 128) }, { AOM_CDF2(255 * 128) },
790
#endif  // CONFIG_EXT_PARTITION
791
792
    };

Yue Chen's avatar
Yue Chen committed
793
const aom_tree_index av1_motion_mode_tree[TREE_SIZE(MOTION_MODES)] = {
clang-format's avatar
clang-format committed
794
  -SIMPLE_TRANSLATION, 2, -OBMC_CAUSAL, -WARPED_CAUSAL,
795
};
796
797
798

static const aom_prob
    default_motion_mode_prob[BLOCK_SIZES_ALL][MOTION_MODES - 1] = {
799
800
801
802
      { 128, 128 }, { 128, 128 }, { 128, 128 }, { 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 },
803
#if CONFIG_EXT_PARTITION
clang-format's avatar
clang-format committed
804
      { 252, 200 }, { 252, 200 }, { 252, 200 },
805
#endif  // CONFIG_EXT_PARTITION
806
807
      { 208, 200 }, { 208, 200 }, { 208, 200 }, { 208, 200 },
      { 208, 200 }, { 208, 200 },
808
809
810
#if CONFIG_EXT_PARTITION
      { 252, 200 }, { 252, 200 }
#endif  // CONFIG_EXT_PARTITION
clang-format's avatar
clang-format committed
811
    };
Thomas Davies's avatar
Thomas Davies committed
812
static const aom_cdf_prob
813
    default_motion_mode_cdf[BLOCK_SIZES_ALL][CDF_SIZE(MOTION_MODES)] = {
814
815
816
817
818
819
820
821
      { AOM_CDF3(16384, 24576) }, { AOM_CDF3(16384, 24576) },
      { AOM_CDF3(16384, 24576) }, { AOM_CDF3(16384, 24576) },
      { AOM_CDF3(16384, 24576) }, { 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
822
#if CONFIG_EXT_PARTITION
823
824
      { AOM_CDF3(32256, 32656) }, { AOM_CDF3(32256, 32656) },
      { AOM_CDF3(32256, 32656) },
Thomas Davies's avatar
Thomas Davies committed
825
#endif
826
827
828
      { AOM_CDF3(32640, 32740) }, { AOM_CDF3(32640, 32740) },
      { AOM_CDF3(32640, 32740) }, { AOM_CDF3(32640, 32740) },
      { AOM_CDF3(32640, 32740) }, { AOM_CDF3(32640, 32740) },
829
#if CONFIG_EXT_PARTITION
830
      { AOM_CDF3(32256, 32656) }, { AOM_CDF3(32256, 32656) },
831
#endif
Thomas Davies's avatar
Thomas Davies committed
832
    };
Yue Chen's avatar
Yue Chen committed
833

834
static const aom_cdf_prob default_obmc_cdf[BLOCK_SIZES_ALL][CDF_SIZE(2)] = {
835
836
837
838
839
840
  { 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(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) },
841
#if CONFIG_EXT_PARTITION
842
  { AOM_CDF2(252 * 128) }, { AOM_CDF2(252 * 128) }, { AOM_CDF2(252 * 128) },
843
#endif  // CONFIG_EXT_PARTITION
844
845
  { AOM_CDF2(208 * 128) }, { AOM_CDF2(208 * 128) }, { AOM_CDF2(208 * 128) },
  { AOM_CDF2(208 * 128) }, { AOM_CDF2(208 * 128) }, { AOM_CDF2(208 * 128) },
846
#if CONFIG_EXT_PARTITION
847
  { AOM_CDF2(252 * 128) }, { AOM_CDF2(252 * 128) },
848
#endif  // CONFIG_EXT_PARTITION
849
};
850

Thomas Davies's avatar
Thomas Davies committed
851
static const aom_cdf_prob default_delta_q_cdf[CDF_SIZE(DELTA_Q_PROBS + 1)] = {
852
  AOM_CDF4(28160, 32120, 32677)
Thomas Davies's avatar
Thomas Davies committed
853
};
Fangwen Fu's avatar
Fangwen Fu committed
854
#if CONFIG_EXT_DELTA_Q
855
#if CONFIG_LOOPFILTER_LEVEL
856
857
858
859
860
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) } };
861
#endif  // CONFIG_LOOPFILTER_LEVEL
Fangwen Fu's avatar
Fangwen Fu committed
862
static const aom_cdf_prob default_delta_lf_cdf[CDF_SIZE(DELTA_LF_PROBS + 1)] = {
863
  AOM_CDF4(28160, 32120, 32677)
Fangwen Fu's avatar
Fangwen Fu committed
864
865
};
#endif
866

clang-format's avatar
clang-format committed
867
/* clang-format off */
868
869
870
871
872
const aom_tree_index av1_interintra_mode_tree[TREE_SIZE(INTERINTRA_MODES)] = {
  -II_DC_PRED, 2,        /* 0 = II_DC_NODE     */
  -II_SMOOTH_PRED, 4,    /* 1 = II_SMOOTH_PRED */
  -II_V_PRED, -II_H_PRED /* 2 = II_V_NODE      */
};
873

Yaowu Xu's avatar
Yaowu Xu committed
874
const aom_tree_index av1_inter_compound_mode_tree
clang-format's avatar
clang-format committed
875
    [TREE_SIZE(INTER_COMPOUND_MODES)] = {
Sarah Parker's avatar
Sarah Parker committed
876
  -INTER_COMPOUND_OFFSET(GLOBAL_GLOBALMV), 2,
877
878
  -INTER_COMPOUND_OFFSET(NEAREST_NEARESTMV), 4,
  6, -INTER_COMPOUND_OFFSET(NEW_NEWMV),
879
880
  -INTER_COMPOUND_OFFSET(NEAR_NEARMV), 8,
  10, 12,
881
882
883
  -INTER_COMPOUND_OFFSET(NEAREST_NEWMV), -INTER_COMPOUND_OFFSET(NEW_NEARESTMV),
  -INTER_COMPOUND_OFFSET(NEAR_NEWMV), -INTER_COMPOUND_OFFSET(NEW_NEARMV)
};
884

885

886
887
888
const aom_tree_index av1_compound_type_tree[TREE_SIZE(COMPOUND_TYPES)] = {
  -COMPOUND_AVERAGE, 2, -COMPOUND_WEDGE, -COMPOUND_SEG
};
clang-format's avatar
clang-format committed
889
/* clang-format on */
890

891
892
893
894
895
896
897
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) }
                                                 };
898

Yaowu Xu's avatar
Yaowu Xu committed
899
static const aom_prob default_comp_inter_p[COMP_INTER_CONTEXTS] = {
900
  190, 156, 91, 77, 22
Jingning Han's avatar
Jingning Han committed
901
};
902

903
static const aom_cdf_prob default_comp_inter_cdf[COMP_INTER_CONTEXTS][CDF_SIZE(
904
905
906
907
908
    2)] = { { AOM_CDF2(24290) },
            { AOM_CDF2(19956) },
            { AOM_CDF2(11641) },
            { AOM_CDF2(9804) },
            { AOM_CDF2(2842) } };
Jingning Han's avatar
Jingning Han committed
909

Zoe Liu's avatar
Zoe Liu committed
910
911
#if CONFIG_EXT_COMP_REFS
static const aom_prob default_comp_ref_type_p[COMP_REF_TYPE_CONTEXTS] = {
912
  8, 20, 78, 91, 194
Zoe Liu's avatar
Zoe Liu committed
913
914
915
};
static const aom_prob
    default_uni_comp_ref_p[UNI_COMP_REF_CONTEXTS][UNIDIR_COMP_REFS - 1] = {
916
      { 88, 30, 28 }, { 218, 97, 105 }, { 254, 180, 196 }
Zoe Liu's avatar
Zoe Liu committed
917
    };
918

919
920
921
922
923
924
925
926
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) }
                                                   };
927
928
static const aom_cdf_prob
    default_uni_comp_ref_cdf[UNI_COMP_REF_CONTEXTS][UNIDIR_COMP_REFS - 1]
929
930
931
932
933
934
935
936
937
                            [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
938
939
#endif  // CONFIG_EXT_COMP_REFS

Yaowu Xu's avatar
Yaowu Xu committed
940
static const aom_prob default_comp_ref_p[REF_CONTEXTS][FWD_REFS - 1] = {
941
942
943
944
945
  { 28, 10, 8 },
  { 77, 27, 26 },
  { 127, 62, 56 },
  { 186, 126, 160 },
  { 236, 143, 172 }
946
};
947

Yaowu Xu's avatar
Yaowu Xu committed
948
static const aom_prob default_comp_bwdref_p[REF_CONTEXTS][BWD_REFS - 1] = {
949
  { 22, 13 }, { 140, 124 }, { 241, 239 }, { 128, 128 }, { 128, 128 }
950
};
951

952
953
static const aom_cdf_prob
    default_comp_ref_cdf[REF_CONTEXTS][FWD_REFS - 1][CDF_SIZE(2)] = {
954
955
956
957
958
      { { 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) } }
959
    };
960

961
962
static const aom_cdf_prob
    default_comp_bwdref_cdf[REF_CONTEXTS][BWD_REFS - 1][CDF_SIZE(2)] = {
963
964
965
966
967
      { { AOM_CDF2(2762) }, { AOM_CDF2(1614) } },
      { { AOM_CDF2(17976) }, { AOM_CDF2(15912) } },
      { { AOM_CDF2(30894) }, { AOM_CDF2(30639) } },
      { { AOM_CDF2(32768) }, { AOM_CDF2(32768) } },
      { { AOM_CDF2(32768) }, { AOM_CDF2(32768) } }
968
    };
969

Yaowu Xu's avatar
Yaowu Xu committed
970
static const aom_prob default_single_ref_p[REF_CONTEXTS][SINGLE_REFS - 1] = {
971
972
973
974
975
  { 36, 16, 32, 57, 11, 14 },
  { 68, 128, 73, 128, 49, 124 },
  { 136, 236, 127, 170, 81, 238 },
  { 128, 128, 191, 211, 115, 128 },
  { 224, 128, 230, 242, 208, 128 }
Jingning Han's avatar
Jingning Han committed
976
};
977

978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
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) } },
                                                  { { AOM_CDF2(32768) },
                                                    { AOM_CDF2(32768) },
                                                    { AOM_CDF2(24426) },
                                                    { AOM_CDF2(26972) },
                                                    { AOM_CDF2(14760) },
                                                    { AOM_CDF2(32768) } },
                                                  { { AOM_CDF2(28634) },
                                                    { AOM_CDF2(32768) },
                                                    { AOM_CDF2(29425) },
                                                    { AOM_CDF2(30969) },
                                                    { AOM_CDF2(26676) },
                                                    { AOM_CDF2(32768) } }
                                                };
Jingning Han's avatar
Jingning Han committed
1011

1012
// TODO(huisu): tune these cdfs
1013
1014
const aom_cdf_prob
    default_palette_y_size_cdf[PALETTE_BLOCK_SIZES][CDF_SIZE(PALETTE_SIZES)] = {
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
      { AOM_CDF7(12288, 19408, 24627, 26662, 28499, 30667) },
      { AOM_CDF7(2815, 4570, 9416, 10875, 13782, 19863) },
      { AOM_CDF7(3839, 5986, 11949, 13413, 16286, 21823) },
      { AOM_CDF7(12032, 14948, 22187, 23138, 24756, 27635) },
      { AOM_CDF7(14847, 20167, 25433, 26751, 28278, 30119) },
      { AOM_CDF7(14336, 20240, 24840, 26079, 27908, 30034) },
      { AOM_CDF7(18816, 25574, 29030, 29877, 30656, 31506) },
      { AOM_CDF7(23039, 27333, 30220, 30708, 31070, 31826) },
      { AOM_CDF7(13696, 18911, 23620, 25371, 29821, 31617) },
      { AOM_CDF7(12543, 20838, 27455, 28762, 29763, 31546) },
1025
    };
clang-format's avatar
clang-format committed
1026

1027
1028
const aom_cdf_prob default_palette_uv_size_cdf[PALETTE_BLOCK_SIZES][CDF_SIZE(
    PALETTE_SIZES)] = {
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
  { AOM_CDF7(20480, 29888, 32453, 32715, 32751, 32766) },
  { AOM_CDF7(11135, 23641, 31056, 31998, 32496, 32668) },
  { AOM_CDF7(9216, 23108, 30806, 31871, 32414, 32637) },
  { AOM_CDF7(9984, 21999, 29192, 30645, 31640, 32402) },
  { AOM_CDF7(7552, 16614, 24880, 27283, 29254, 31203) },
  { AOM_CDF7(9600, 20279, 27548, 29261, 30494, 31631) },
  { AOM_CDF7(11391, 18656, 23727, 26058, 27788, 30278) },
  { AOM_CDF7(8576, 13585, 17632, 20884, 23948, 27152) },
  { AOM_CDF7(15360, 24200, 26978, 30846, 31409, 32545) },
  { AOM_CDF7(9216, 14276, 19043, 22689, 25799, 28712) },
1039
1040
};

1041
1042
1043
// 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).