1 /*
2  * Copyright © 2014 Intel Corporation
3  *
4  * Permission is hereby granted, free of charge, to any person obtaining a
5  * copy of this software and associated documentation files (the
6  * "Software"), to deal in the Software without restriction, including
7  * without limitation the rights to use, copy, modify, merge, publish,
8  * distribute, sub license, and/or sell copies of the Software, and to
9  * permit persons to whom the Software is furnished to do so, subject to
10  * the following conditions:
11  *
12  * The above copyright notice and this permission notice (including the
13  * next paragraph) shall be included in all copies or substantial portions
14  * of the Software.
15  *
16  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
17  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
19  * IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
20  * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
21  * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22  * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23  *
24  * Authors:
25  *     Zhao Yakui <yakui.zhao@intel.com>
26  *
27  */
28 
29 /*
30  * Copyright (c) 2010, The WebM Project authors. All rights reserved.
31  *
32  * An additional intellectual property rights grant can be found
33  * in the file LIBVPX_PATENTS.  All contributing project authors may
34  * be found in the LIBVPX_AUTHORS file.
35  *
36  * Redistribution and use in source and binary forms, with or without
37  * modification, are permitted provided that the following conditions are met:
38 
39  * Redistributions of source code must retain the above copyright
40  * notice, this list of conditions and the following disclaimer.
41  *
42  * Redistributions in binary form must reproduce the above copyright
43  * notice, this list of conditions and the following disclaimer in
44  * the documentation and/or other materials provided with the distribution.
45 
46  * Neither the name of Google, nor the WebM Project, nor the names
47  * of its contributors may be used to endorse or promote products
48  * derived from this software without specific prior written permission.
49  *
50  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
51  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
52  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
53  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
54  * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
55  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
56  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
57  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
58  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
59  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
60  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
61  *
62  */
63 
64 #ifndef __INTEL_HOSTVLD_VP9_CONTEXT_TABLES_H__
65 #define __INTEL_HOSTVLD_VP9_CONTEXT_TABLES_H__
66 
67 #include "intel_hybrid_hostvld_vp9_internal.h"
68 
69 static const INTEL_HOSTVLD_VP9_TX_SIZE g_Vp9TxMode2MaxTxSize[TX_MODES] = {
70     TX_4X4,     // ONLY_4X4
71     TX_8X8,     // ALLOW_8X8
72     TX_16X16,   // ALLOW_16X16
73     TX_32X32,   // ALLOW_32X32
74     TX_32X32,   // TX_MODE_SELECT
75 };
76 
77 static const INT g_Vp9InverseMapTable[VP9_MAX_PROB - 1] =
78 {
79     7,   20,  33,  46,  59,  72,  85,  98, 111, 124, 137, 150, 163, 176, 189,
80     202, 215, 228, 241, 254,  1,   2,   3,   4,   5,   6,   8,   9,  10,  11,
81     12,  13,  14,  15,  16,  17,  18,  19,  21,  22,  23,  24,  25,  26,  27,
82     28,  29,  30,  31,  32,  34,  35,  36,  37,  38,  39,  40,  41,  42,  43,
83     44,  45,  47,  48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,  60,
84     61,  62,  63,  64,  65,  66,  67,  68,  69,  70,  71,  73,  74,  75,  76,
85     77,  78,  79,  80,  81,  82,  83,  84,  86,  87,  88,  89,  90,  91,  92,
86     93,  94,  95,  96,  97,  99,  100, 101, 102, 103, 104, 105, 106, 107, 108,
87     109, 110, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 125,
88     126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 138, 139, 140, 141,
89     142, 143, 144, 145, 146, 147, 148, 149, 151, 152, 153, 154, 155, 156, 157,
90     158, 159, 160, 161, 162, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173,
91     174, 175, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 190,
92     191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 203, 204, 205, 206,
93     207, 208, 209, 210, 211, 212, 213, 214, 216, 217, 218, 219, 220, 221, 222,
94     223, 224, 225, 226, 227, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238,
95     239, 240, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253
96 };
97 
98 static const INTEL_HOSTVLD_VP9_INTRA_MODE_TREE g_Vp9DefaultIntraInInterProbTreeY[VP9_BLK_SIZE_GROUPS] =
99 {
100     INTEL_HOSTVLD_VP9_INTRA_MODE_PROB_TREE(  65,  32,  18, 144, 162, 194,  41,  51,  98 ),  // block_size < 8x8
101     INTEL_HOSTVLD_VP9_INTRA_MODE_PROB_TREE( 132,  68,  18, 165, 217, 196,  45,  40,  78 ),  // block_size < 16x16
102     INTEL_HOSTVLD_VP9_INTRA_MODE_PROB_TREE( 173,  80,  19, 176, 240, 193,  64,  35,  46 ),  // block_size < 32x32
103     INTEL_HOSTVLD_VP9_INTRA_MODE_PROB_TREE( 221, 135,  38, 194, 248, 121,  96,  85,  29 )   // block_size >= 32x32
104 };
105 
106 static const INTEL_HOSTVLD_VP9_INTRA_MODE_TREE g_Vp9DefaultIntraInInterProbTreeUV[INTRA_MODE_COUNT] =
107 {
108     INTEL_HOSTVLD_VP9_INTRA_MODE_PROB_TREE( 120,   7,  76, 176, 208, 126,  28,  54, 103 ),  // y = dc
109     INTEL_HOSTVLD_VP9_INTRA_MODE_PROB_TREE(  48,  12, 154, 155, 139,  90,  34, 117, 119 ),  // y = v
110     INTEL_HOSTVLD_VP9_INTRA_MODE_PROB_TREE(  67,   6,  25, 204, 243, 158,  13,  21,  96 ),  // y = h
111     INTEL_HOSTVLD_VP9_INTRA_MODE_PROB_TREE(  97,   5,  44, 131, 176, 139,  48,  68,  97 ),  // y = d45
112     INTEL_HOSTVLD_VP9_INTRA_MODE_PROB_TREE(  83,   5,  42, 156, 111, 152,  26,  49, 152 ),  // y = d135
113     INTEL_HOSTVLD_VP9_INTRA_MODE_PROB_TREE(  80,   5,  58, 178,  74,  83,  33,  62, 145 ),  // y = d117
114     INTEL_HOSTVLD_VP9_INTRA_MODE_PROB_TREE(  86,   5,  32, 154, 192, 168,  14,  22, 163 ),  // y = d153
115     INTEL_HOSTVLD_VP9_INTRA_MODE_PROB_TREE(  85,   5,  32, 156, 216, 148,  19,  29,  73 ),  // y = d207
116     INTEL_HOSTVLD_VP9_INTRA_MODE_PROB_TREE(  77,   7,  64, 116, 132, 122,  37, 126, 120 ),  // y = d63
117     INTEL_HOSTVLD_VP9_INTRA_MODE_PROB_TREE( 101,  21, 107, 181, 192, 103,  19,  67, 125 )   // y = tm
118 };
119 
120 static const INTEL_HOSTVLD_VP9_PARTITION_PROBS g_Vp9DefaultPartitionProbs[VP9_PARTITION_CONTEXTS] =
121 {
122     // 8x8 -> 4x4
123     { { 199, 122, 141 } },  // a/l both not split
124     { { 147,  63, 159 } },  // a split, l not split
125     { { 148, 133, 118 } },  // l split, a not split
126     { { 121, 104, 114 } },  // a/l both split
127     // 16x16 -> 8x8
128     { { 174,  73,  87 } },  // a/l both not split
129     { {  92,  41,  83 } },  // a split, l not split
130     { {  82,  99,  50 } },  // l split, a not split
131     { {  53,  39,  39 } },  // a/l both split
132     // 32x32 -> 16x16
133     { { 177,  58,  59 } },  // a/l both not split
134     { {  68,  26,  63 } },  // a split, l not split
135     { {  52,  79,  25 } },  // l split, a not split
136     { {  17,  14,  12 } },  // a/l both split
137     // 64x64 -> 32x32
138     { { 222,  34,  30 } },  // a/l both not split
139     { {  72,  16,  44 } },  // a split, l not split
140     { {  58,  32,  12 } },  // l split, a not split
141     { {  10,   7,   6 } },  // a/l both split
142 };
143 
144 static const PROBABILITY g_Vp9DefaultMbSkipProbs[VP9_MBSKIP_CONTEXTS] =
145 {
146     192, 128, 64
147 };
148 
149 static const PROBABILITY g_Vp9DefaultInterModeProbs[VP9_INTER_MODE_CONTEXTS][INTER_MODE_COUNT - 1] =
150 {
151     {2,     173,    34},  // 0 = both zero mv
152     {7,     145,    85},  // 1 = one zero mv + one a predicted mv
153     {7,     166,    63},  // 2 = two predicted mvs
154     {7,     94,     66},  // 3 = one predicted/zero and one new mv
155     {8,     64,     46},  // 4 = two new mvs
156     {17,    81,     31},  // 5 = one intra neighbour + x
157     {25,    29,     30},  // 6 = two intra neighbours
158 };
159 
160 static const PROBABILITY g_Vp9DefaultSwitchableInterpProbs[VP9_SWITCHABLE_FILTER_CONTEXTS][VP9_SWITCHABLE_FILTERS - 1] =
161 {
162     { 235, 162, },
163     { 36, 255, },
164     { 34, 3, },
165     { 149, 144, },
166 };
167 
168 static const PROBABILITY g_Vp9DefaultIntraInterProbs[VP9_INTRA_INTER_CONTEXTS] =
169 {
170     9, 102, 187, 225
171 };
172 
173 static const PROBABILITY g_Vp9DefaultCompoundInterProbs[VP9_COMPOUND_INTER_CONTEXTS] =
174 {
175     239, 183, 119,  96,  41
176 };
177 
178 static const PROBABILITY g_Vp9DefaultSingleRefProbs[VP9_REF_CONTEXTS][2] = {
179     {  33,  16 },
180     {  77,  74 },
181     { 142, 142 },
182     { 172, 170 },
183     { 238, 247 }
184 };
185 
186 static const PROBABILITY g_Vp9DefaultCompoundRefProbs[VP9_REF_CONTEXTS] =
187 {
188     50, 126, 123, 221, 226
189 };
190 
191 static const INTEL_HOSTVLD_VP9_TX_PROB_TABLE_SET g_Vp9DefaultTxProbs =
192 {
193     {
194         { 3, 136, 37 },
195         { 5, 52,  13 }
196     },
197     {
198         { 20, 152 },
199         { 15, 101 }
200     },
201     {
202         { 100 },
203         { 66  }
204     }
205 };
206 
207 static const PROBABILITY g_Vp9DefaultMvJointProbs[VP9_MV_JOINTS - 1] =
208 {
209     32, 64, 96
210 };
211 
212 static const INTEL_HOSTVLD_VP9_MV_PROB_SET g_Vp9DefaultMvProbSet[VP9_MV_COMPONENTS] =
213 {
214     { /* vert component */ // NOLINT
215         128,                                                  /* sign */
216         {224, 144, 192, 168, 192, 176, 192, 198, 198, 245},   /* class */
217         {216},                                                /* class0 */
218         {136, 140, 148, 160, 176, 192, 224, 234, 234, 240},   /* bits */
219         {{128, 128, 64}, {96, 112, 64}},                      /* class0_fp */
220         {64, 96, 64},                                         /* fp */
221         160,                                                  /* class0_hp bit */
222         128,                                                  /* hp */
223     },
224     { /* hor component */ // NOLINT
225         128,                                                  /* sign */
226         {216, 128, 176, 160, 176, 176, 192, 198, 198, 208},   /* class */
227         {208},                                                /* class0 */
228         {136, 140, 148, 160, 176, 192, 224, 234, 234, 240},   /* bits */
229         {{128, 128, 64}, {96, 112, 64}},                      /* class0_fp */
230         {64, 96, 64},                                         /* fp */
231         160,                                                  /* class0_hp bit */
232         128,                                                  /* hp */
233     }
234 };
235 
236 static const PROBABILITY g_Vp9DefaultCoeffProbs[TX_SIZES]
237                                                [INTEL_HOSTVLD_VP9_YUV_PLANE_NUMBER]
238                                                [REF_TYPES]
239                                                [VP9_COEF_BANDS]
240                                                [VP9_PREV_COEF_CONTEXTS]
241                                                [VP9_UNCONSTRAINED_NODES] =
242 {
243     { // 4x4 block
244         { // Luma block
245             { // Intra
246                 { // Coeff Band 0
247                     { 195,  29, 183 },
248                     {  84,  49, 136 },
249                     {   8,  42,  71 }
250                 },
251                 { // Coeff Band 1
252                     {  31, 107, 169 },
253                     {  35,  99, 159 },
254                     {  17,  82, 140 },
255                     {   8,  66, 114 },
256                     {   2,  44,  76 },
257                     {   1,  19,  32 }
258                 },
259                 { // Coeff Band 2
260                     {  40, 132, 201 },
261                     {  29, 114, 187 },
262                     {  13,  91, 157 },
263                     {   7,  75, 127 },
264                     {   3,  58,  95 },
265                     {   1,  28,  47 }
266                 },
267                 { // Coeff Band 3
268                     {  69, 142, 221 },
269                     {  42, 122, 201 },
270                     {  15,  91, 159 },
271                     {   6,  67, 121 },
272                     {   1,  42,  77 },
273                     {   1,  17,  31 }
274                 },
275                 { // Coeff Band 4
276                     { 102, 148, 228 },
277                     {  67, 117, 204 },
278                     {  17,  82, 154 },
279                     {   6,  59, 114 },
280                     {   2,  39,  75 },
281                     {   1,  15,  29 }
282                 },
283                 { // Coeff Band 5
284                     { 156,  57, 233 },
285                     { 119,  57, 212 },
286                     {  58,  48, 163 },
287                     {  29,  40, 124 },
288                     {  12,  30,  81 },
289                     {   3,  12,  31 }
290                 }
291             }, { // Inter
292                 { // Coeff Band 0
293                     { 191, 107, 226 },
294                     { 124, 117, 204 },
295                     {  25,  99, 155 }
296                 },
297                 { // Coeff Band 1
298                     {  29, 148, 210 },
299                     {  37, 126, 194 },
300                     {   8,  93, 157 },
301                     {   2,  68, 118 },
302                     {   1,  39,  69 },
303                     {   1,  17,  33 }
304                 },
305                 { // Coeff Band 2
306                     {  41, 151, 213 },
307                     {  27, 123, 193 },
308                     {   3,  82, 144 },
309                     {   1,  58, 105 },
310                     {   1,  32,  60 },
311                     {   1,  13,  26 }
312                 },
313                 { // Coeff Band 3
314                     {  59, 159, 220 },
315                     {  23, 126, 198 },
316                     {   4,  88, 151 },
317                     {   1,  66, 114 },
318                     {   1,  38,  71 },
319                     {   1,  18,  34 }
320                 },
321                 { // Coeff Band 4
322                     { 114, 136, 232 },
323                     {  51, 114, 207 },
324                     {  11,  83, 155 },
325                     {   3,  56, 105 },
326                     {   1,  33,  65 },
327                     {   1,  17,  34 }
328                 },
329                 { // Coeff Band 5
330                     { 149,  65, 234 },
331                     { 121,  57, 215 },
332                     {  61,  49, 166 },
333                     {  28,  36, 114 },
334                     {  12,  25,  76 },
335                     {   3,  16,  42 }
336                 }
337             }
338         }, { // block Type 1
339             { // Intra
340                 { // Coeff Band 0
341                     { 214,  49, 220 },
342                     { 132,  63, 188 },
343                     {  42,  65, 137 }
344                 },
345                 { // Coeff Band 1
346                     {  85, 137, 221 },
347                     { 104, 131, 216 },
348                     {  49, 111, 192 },
349                     {  21,  87, 155 },
350                     {   2,  49,  87 },
351                     {   1,  16,  28 }
352                 },
353                 { // Coeff Band 2
354                     {  89, 163, 230 },
355                     {  90, 137, 220 },
356                     {  29, 100, 183 },
357                     {  10,  70, 135 },
358                     {   2,  42,  81 },
359                     {   1,  17,  33 }
360                 },
361                 { // Coeff Band 3
362                     { 108, 167, 237 },
363                     {  55, 133, 222 },
364                     {  15,  97, 179 },
365                     {   4,  72, 135 },
366                     {   1,  45,  85 },
367                     {   1,  19,  38 }
368                 },
369                 { // Coeff Band 4
370                     { 124, 146, 240 },
371                     {  66, 124, 224 },
372                     {  17,  88, 175 },
373                     {   4,  58, 122 },
374                     {   1,  36,  75 },
375                     {   1,  18,  37 }
376                 },
377                 { // Coeff Band 5
378                     { 141,  79, 241 },
379                     { 126,  70, 227 },
380                     {  66,  58, 182 },
381                     {  30,  44, 136 },
382                     {  12,  34,  96 },
383                     {   2,  20,  47 }
384                 }
385             },
386             { // Inter
387                 { // Coeff Band 0
388                     { 229,  99, 249 },
389                     { 143, 111, 235 },
390                     {  46, 109, 192 }
391                 },
392                 { // Coeff Band 1
393                     {  82, 158, 236 },
394                     {  94, 146, 224 },
395                     {  25, 117, 191 },
396                     {   9,  87, 149 },
397                     {   3,  56,  99 },
398                     {   1,  33,  57 }
399                 },
400                 { // Coeff Band 2
401                     {  83, 167, 237 },
402                     {  68, 145, 222 },
403                     {  10, 103, 177 },
404                     {   2,  72, 131 },
405                     {   1,  41,  79 },
406                     {   1,  20,  39 }
407                 },
408                 { // Coeff Band 3
409                     {  99, 167, 239 },
410                     {  47, 141, 224 },
411                     {  10, 104, 178 },
412                     {   2,  73, 133 },
413                     {   1,  44,  85 },
414                     {   1,  22,  47 }
415                 },
416                 { // Coeff Band 4
417                     { 127, 145, 243 },
418                     {  71, 129, 228 },
419                     {  17,  93, 177 },
420                     {   3,  61, 124 },
421                     {   1,  41,  84 },
422                     {   1,  21,  52 }
423                 },
424                 { // Coeff Band 5
425                     { 157,  78, 244 },
426                     { 140,  72, 231 },
427                     {  69,  58, 184 },
428                     {  31,  44, 137 },
429                     {  14,  38, 105 },
430                     {   8,  23,  61 }
431                 }
432             }
433         }
434     },
435     { // 8x8 block
436         { // block Type 0
437             { // Intra
438                 { // Coeff Band 0
439                     { 125,  34, 187 },
440                     {  52,  41, 133 },
441                     {   6,  31,  56 }
442                 },
443                 { // Coeff Band 1
444                     {  37, 109, 153 },
445                     {  51, 102, 147 },
446                     {  23,  87, 128 },
447                     {   8,  67, 101 },
448                     {   1,  41,  63 },
449                     {   1,  19,  29 }
450                 },
451                 { // Coeff Band 2
452                     {  31, 154, 185 },
453                     {  17, 127, 175 },
454                     {   6,  96, 145 },
455                     {   2,  73, 114 },
456                     {   1,  51,  82 },
457                     {   1,  28,  45 }
458                 },
459                 { // Coeff Band 3
460                     {  23, 163, 200 },
461                     {  10, 131, 185 },
462                     {   2,  93, 148 },
463                     {   1,  67, 111 },
464                     {   1,  41,  69 },
465                     {   1,  14,  24 }
466                 },
467                 { // Coeff Band 4
468                     {  29, 176, 217 },
469                     {  12, 145, 201 },
470                     {   3, 101, 156 },
471                     {   1,  69, 111 },
472                     {   1,  39,  63 },
473                     {   1,  14,  23 }
474                 },
475                 { // Coeff Band 5
476                     {  57, 192, 233 },
477                     {  25, 154, 215 },
478                     {   6, 109, 167 },
479                     {   3,  78, 118 },
480                     {   1,  48,  69 },
481                     {   1,  21,  29 }
482                 }
483             },
484             { // Inter
485                 { // Coeff Band 0
486                     { 202, 105, 245 },
487                     { 108, 106, 216 },
488                     {  18,  90, 144 }
489                 },
490                 { // Coeff Band 1
491                     {  33, 172, 219 },
492                     {  64, 149, 206 },
493                     {  14, 117, 177 },
494                     {   5,  90, 141 },
495                     {   2,  61,  95 },
496                     {   1,  37,  57 }
497                 },
498                 { // Coeff Band 2
499                     {  33, 179, 220 },
500                     {  11, 140, 198 },
501                     {   1,  89, 148 },
502                     {   1,  60, 104 },
503                     {   1,  33,  57 },
504                     {   1,  12,  21 }
505                 },
506                 { // Coeff Band 3
507                     {  30, 181, 221 },
508                     {   8, 141, 198 },
509                     {   1,  87, 145 },
510                     {   1,  58, 100 },
511                     {   1,  31,  55 },
512                     {   1,  12,  20 }
513                 },
514                 { // Coeff Band 4
515                     {  32, 186, 224 },
516                     {   7, 142, 198 },
517                     {   1,  86, 143 },
518                     {   1,  58, 100 },
519                     {   1,  31,  55 },
520                     {   1,  12,  22 }
521                 },
522                 { // Coeff Band 5
523                     {  57, 192, 227 },
524                     {  20, 143, 204 },
525                     {   3,  96, 154 },
526                     {   1,  68, 112 },
527                     {   1,  42,  69 },
528                     {   1,  19,  32 }
529                 }
530             }
531         }, { // block Type 1
532             { // Intra
533                 { // Coeff Band 0
534                     { 212,  35, 215 },
535                     { 113,  47, 169 },
536                     {  29,  48, 105 }
537                 },
538                 { // Coeff Band 1
539                     {  74, 129, 203 },
540                     { 106, 120, 203 },
541                     {  49, 107, 178 },
542                     {  19,  84, 144 },
543                     {   4,  50,  84 },
544                     {   1,  15,  25 }
545                 },
546                 { // Coeff Band 2
547                     {  71, 172, 217 },
548                     {  44, 141, 209 },
549                     {  15, 102, 173 },
550                     {   6,  76, 133 },
551                     {   2,  51,  89 },
552                     {   1,  24,  42 }
553                 },
554                 { // Coeff Band 3
555                     {  64, 185, 231 },
556                     {  31, 148, 216 },
557                     {   8, 103, 175 },
558                     {   3,  74, 131 },
559                     {   1,  46,  81 },
560                     {   1,  18,  30 }
561                 },
562                 { // Coeff Band 4
563                     {  65, 196, 235 },
564                     {  25, 157, 221 },
565                     {   5, 105, 174 },
566                     {   1,  67, 120 },
567                     {   1,  38,  69 },
568                     {   1,  15,  30 }
569                 },
570                 { // Coeff Band 5
571                     {  65, 204, 238 },
572                     {  30, 156, 224 },
573                     {   7, 107, 177 },
574                     {   2,  70, 124 },
575                     {   1,  42,  73 },
576                     {   1,  18,  34 }
577                 }
578             },
579             { // Inter
580                 { // Coeff Band 0
581                     { 225,  86, 251 },
582                     { 144, 104, 235 },
583                     {  42,  99, 181 }
584                 },
585                 { // Coeff Band 1
586                     {  85, 175, 239 },
587                     { 112, 165, 229 },
588                     {  29, 136, 200 },
589                     {  12, 103, 162 },
590                     {   6,  77, 123 },
591                     {   2,  53,  84 }
592                 },
593                 { // Coeff Band 2
594                     {  75, 183, 239 },
595                     {  30, 155, 221 },
596                     {   3, 106, 171 },
597                     {   1,  74, 128 },
598                     {   1,  44,  76 },
599                     {   1,  17,  28 }
600                 },
601                 { // Coeff Band 3
602                     {  73, 185, 240 },
603                     {  27, 159, 222 },
604                     {   2, 107, 172 },
605                     {   1,  75, 127 },
606                     {   1,  42,  73 },
607                     {   1,  17,  29 }
608                 },
609                 { // Coeff Band 4
610                     {  62, 190, 238 },
611                     {  21, 159, 222 },
612                     {   2, 107, 172 },
613                     {   1,  72, 122 },
614                     {   1,  40,  71 },
615                     {   1,  18,  32 }
616                 },
617                 { // Coeff Band 5
618                     {  61, 199, 240 },
619                     {  27, 161, 226 },
620                     {   4, 113, 180 },
621                     {   1,  76, 129 },
622                     {   1,  46,  80 },
623                     {   1,  23,  41 }
624                 }
625             }
626         }
627     },
628 
629     // 16x16 block
630     {
631         { // block Type 0
632             { // Intra
633                 { // Coeff Band 0
634                     {   7,  27, 153 },
635                     {   5,  30,  95 },
636                     {   1,  16,  30 }
637                 },
638                 { // Coeff Band 1
639                     {  50,  75, 127 },
640                     {  57,  75, 124 },
641                     {  27,  67, 108 },
642                     {  10,  54,  86 },
643                     {   1,  33,  52 },
644                     {   1,  12,  18 }
645                 },
646                 { // Coeff Band 2
647                     {  43, 125, 151 },
648                     {  26, 108, 148 },
649                     {   7,  83, 122 },
650                     {   2,  59,  89 },
651                     {   1,  38,  60 },
652                     {   1,  17,  27 }
653                 },
654                 { // Coeff Band 3
655                     {  23, 144, 163 },
656                     {  13, 112, 154 },
657                     {   2,  75, 117 },
658                     {   1,  50,  81 },
659                     {   1,  31,  51 },
660                     {   1,  14,  23 }
661                 },
662                 { // Coeff Band 4
663                     {  18, 162, 185 },
664                     {   6, 123, 171 },
665                     {   1,  78, 125 },
666                     {   1,  51,  86 },
667                     {   1,  31,  54 },
668                     {   1,  14,  23 }
669                 },
670                 { // Coeff Band 5
671                     {  15, 199, 227 },
672                     {   3, 150, 204 },
673                     {   1,  91, 146 },
674                     {   1,  55,  95 },
675                     {   1,  30,  53 },
676                     {   1,  11,  20 }
677                 }
678             },
679             { // Inter
680                 { // Coeff Band 0
681                     {  19,  55, 240 },
682                     {  19,  59, 196 },
683                     {   3,  52, 105 }
684                 },
685                 { // Coeff Band 1
686                     {  41, 166, 207 },
687                     { 104, 153, 199 },
688                     {  31, 123, 181 },
689                     {  14, 101, 152 },
690                     {   5,  72, 106 },
691                     {   1,  36,  52 }
692                 },
693                 { // Coeff Band 2
694                     {  35, 176, 211 },
695                     {  12, 131, 190 },
696                     {   2,  88, 144 },
697                     {   1,  60, 101 },
698                     {   1,  36,  60 },
699                     {   1,  16,  28 }
700                 },
701                 { // Coeff Band 3
702                     {  28, 183, 213 },
703                     {   8, 134, 191 },
704                     {   1,  86, 142 },
705                     {   1,  56,  96 },
706                     {   1,  30,  53 },
707                     {   1,  12,  20 }
708                 },
709                 { // Coeff Band 4
710                     {  20, 190, 215 },
711                     {   4, 135, 192 },
712                     {   1,  84, 139 },
713                     {   1,  53,  91 },
714                     {   1,  28,  49 },
715                     {   1,  11,  20 }
716                 },
717                 { // Coeff Band 5
718                     {  13, 196, 216 },
719                     {   2, 137, 192 },
720                     {   1,  86, 143 },
721                     {   1,  57,  99 },
722                     {   1,  32,  56 },
723                     {   1,  13,  24 }
724                 }
725             }
726         },
727         { // block Type 1
728             { // Intra
729                 { // Coeff Band 0
730                     { 211,  29, 217 },
731                     {  96,  47, 156 },
732                     {  22,  43,  87 }
733                 },
734                 { // Coeff Band 1
735                     {  78, 120, 193 },
736                     { 111, 116, 186 },
737                     {  46, 102, 164 },
738                     {  15,  80, 128 },
739                     {   2,  49,  76 },
740                     {   1,  18,  28 }
741                 },
742                 { // Coeff Band 2
743                     {  71, 161, 203 },
744                     {  42, 132, 192 },
745                     {  10,  98, 150 },
746                     {   3,  69, 109 },
747                     {   1,  44,  70 },
748                     {   1,  18,  29 }
749                 },
750                 { // Coeff Band 3
751                     {  57, 186, 211 },
752                     {  30, 140, 196 },
753                     {   4,  93, 146 },
754                     {   1,  62, 102 },
755                     {   1,  38,  65 },
756                     {   1,  16,  27 }
757                 },
758                 { // Coeff Band 4
759                     {  47, 199, 217 },
760                     {  14, 145, 196 },
761                     {   1,  88, 142 },
762                     {   1,  57,  98 },
763                     {   1,  36,  62 },
764                     {   1,  15,  26 }
765                 },
766                 { // Coeff Band 5
767                     {  26, 219, 229 },
768                     {   5, 155, 207 },
769                     {   1,  94, 151 },
770                     {   1,  60, 104 },
771                     {   1,  36,  62 },
772                     {   1,  16,  28 }
773                 }
774             },
775             { // Inter
776                 { // Coeff Band 0
777                     { 233,  29, 248 },
778                     { 146,  47, 220 },
779                     {  43,  52, 140 }
780                 },
781                 { // Coeff Band 1
782                     { 100, 163, 232 },
783                     { 179, 161, 222 },
784                     {  63, 142, 204 },
785                     {  37, 113, 174 },
786                     {  26,  89, 137 },
787                     {  18,  68,  97 }
788                 },
789                 { // Coeff Band 2
790                     {  85, 181, 230 },
791                     {  32, 146, 209 },
792                     {   7, 100, 164 },
793                     {   3,  71, 121 },
794                     {   1,  45,  77 },
795                     {   1,  18,  30 }
796                 },
797                 { // Coeff Band 3
798                     {  65, 187, 230 },
799                     {  20, 148, 207 },
800                     {   2,  97, 159 },
801                     {   1,  68, 116 },
802                     {   1,  40,  70 },
803                     {   1,  14,  29 }
804                 },
805                 { // Coeff Band 4
806                     {  40, 194, 227 },
807                     {   8, 147, 204 },
808                     {   1,  94, 155 },
809                     {   1,  65, 112 },
810                     {   1,  39,  66 },
811                     {   1,  14,  26 }
812                 },
813                 { // Coeff Band 5
814                     {  16, 208, 228 },
815                     {   3, 151, 207 },
816                     {   1,  98, 160 },
817                     {   1,  67, 117 },
818                     {   1,  41,  74 },
819                     {   1,  17,  31 }
820                 }
821             }
822         }
823     },
824     { // 32x32 block
825         { // block Type 0
826             { // Intra
827                 { // Coeff Band 0
828                     {  17,  38, 140 },
829                     {   7,  34,  80 },
830                     {   1,  17,  29 }
831                 },
832                 { // Coeff Band 1
833                     {  37,  75, 128 },
834                     {  41,  76, 128 },
835                     {  26,  66, 116 },
836                     {  12,  52,  94 },
837                     {   2,  32,  55 },
838                     {   1,  10,  16 }
839                 },
840                 { // Coeff Band 2
841                     {  50, 127, 154 },
842                     {  37, 109, 152 },
843                     {  16,  82, 121 },
844                     {   5,  59,  85 },
845                     {   1,  35,  54 },
846                     {   1,  13,  20 }
847                 },
848                 { // Coeff Band 3
849                     {  40, 142, 167 },
850                     {  17, 110, 157 },
851                     {   2,  71, 112 },
852                     {   1,  44,  72 },
853                     {   1,  27,  45 },
854                     {   1,  11,  17 }
855                 },
856                 { // Coeff Band 4
857                     {  30, 175, 188 },
858                     {   9, 124, 169 },
859                     {   1,  74, 116 },
860                     {   1,  48,  78 },
861                     {   1,  30,  49 },
862                     {   1,  11,  18 }
863                 },
864                 { // Coeff Band 5
865                     {  10, 222, 223 },
866                     {   2, 150, 194 },
867                     {   1,  83, 128 },
868                     {   1,  48,  79 },
869                     {   1,  27,  45 },
870                     {   1,  11,  17 }
871                 }
872             },
873             { // Inter
874                 { // Coeff Band 0
875                     {  36,  41, 235 },
876                     {  29,  36, 193 },
877                     {  10,  27, 111 }
878                 },
879                 { // Coeff Band 1
880                     {  85, 165, 222 },
881                     { 177, 162, 215 },
882                     { 110, 135, 195 },
883                     {  57, 113, 168 },
884                     {  23,  83, 120 },
885                     {  10,  49,  61 }
886                 },
887                 { // Coeff Band 2
888                     {  85, 190, 223 },
889                     {  36, 139, 200 },
890                     {   5,  90, 146 },
891                     {   1,  60, 103 },
892                     {   1,  38,  65 },
893                     {   1,  18,  30 }
894                 },
895                 { // Coeff Band 3
896                     {  72, 202, 223 },
897                     {  23, 141, 199 },
898                     {   2,  86, 140 },
899                     {   1,  56,  97 },
900                     {   1,  36,  61 },
901                     {   1,  16,  27 }
902                 },
903                 { // Coeff Band 4
904                     {  55, 218, 225 },
905                     {  13, 145, 200 },
906                     {   1,  86, 141 },
907                     {   1,  57,  99 },
908                     {   1,  35,  61 },
909                     {   1,  13,  22 }
910                 },
911                 { // Coeff Band 5
912                     {  15, 235, 212 },
913                     {   1, 132, 184 },
914                     {   1,  84, 139 },
915                     {   1,  57,  97 },
916                     {   1,  34,  56 },
917                     {   1,  14,  23 }
918                 }
919             }
920         },
921         { // block Type 1
922             { // Intra
923                 { // Coeff Band 0
924                     { 181,  21, 201 },
925                     {  61,  37, 123 },
926                     {  10,  38,  71 }
927                 },
928                 { // Coeff Band 1
929                     {  47, 106, 172 },
930                     {  95, 104, 173 },
931                     {  42,  93, 159 },
932                     {  18,  77, 131 },
933                     {   4,  50,  81 },
934                     {   1,  17,  23 }
935                 },
936                 { // Coeff Band 2
937                     {  62, 147, 199 },
938                     {  44, 130, 189 },
939                     {  28, 102, 154 },
940                     {  18,  75, 115 },
941                     {   2,  44,  65 },
942                     {   1,  12,  19 }
943                 },
944                 { // Coeff Band 3
945                     {  55, 153, 210 },
946                     {  24, 130, 194 },
947                     {   3,  93, 146 },
948                     {   1,  61,  97 },
949                     {   1,  31,  50 },
950                     {   1,  10,  16 }
951                 },
952                 { // Coeff Band 4
953                     {  49, 186, 223 },
954                     {  17, 148, 204 },
955                     {   1,  96, 142 },
956                     {   1,  53,  83 },
957                     {   1,  26,  44 },
958                     {   1,  11,  17 }
959                 },
960                 { // Coeff Band 5
961                     {  13, 217, 212 },
962                     {   2, 136, 180 },
963                     {   1,  78, 124 },
964                     {   1,  50,  83 },
965                     {   1,  29,  49 },
966                     {   1,  14,  23 }
967                 }
968             },
969             { // Inter
970                 { // Coeff Band 0
971                     { 197,  13, 247 },
972                     {  82,  17, 222 },
973                     {  25,  17, 162 }
974                 },
975                 { // Coeff Band 1
976                     { 126, 186, 247 },
977                     { 234, 191, 243 },
978                     { 176, 177, 234 },
979                     { 104, 158, 220 },
980                     {  66, 128, 186 },
981                     {  55,  90, 137 }
982                 },
983                 { // Coeff Band 2
984                     { 111, 197, 242 },
985                     {  46, 158, 219 },
986                     {   9, 104, 171 },
987                     {   2,  65, 125 },
988                     {   1,  44,  80 },
989                     {   1,  17,  91 }
990                 },
991                 { // Coeff Band 3
992                     { 104, 208, 245 },
993                     {  39, 168, 224 },
994                     {   3, 109, 162 },
995                     {   1,  79, 124 },
996                     {   1,  50, 102 },
997                     {   1,  43, 102 }
998                 },
999                 { // Coeff Band 4
1000                     {  84, 220, 246 },
1001                     {  31, 177, 231 },
1002                     {   2, 115, 180 },
1003                     {   1,  79, 134 },
1004                     {   1,  55,  77 },
1005                     {   1,  60,  79 }
1006                 },
1007                 { // Coeff Band 5
1008                     {  43, 243, 240 },
1009                     {   8, 180, 217 },
1010                     {   1, 115, 166 },
1011                     {   1,  84, 121 },
1012                     {   1,  51,  67 },
1013                     {   1,  16,   6 }
1014                 }
1015             }
1016         }
1017     }
1018 };
1019 
1020 
1021 #endif // __INTEL_HOSTVLD_VP9_CONTEXT_TABLES_H__
1022