blob: e03a8d5ddced1712f2668a600eddde8d3a8b0769 [file] [log] [blame]
/*
* Copyright (c) 2016, Alliance for Open Media. All rights reserved
*
* 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.
*/
#include "av1/common/common.h"
#include "av1/common/onyxc_int.h"
#include "av1/common/quant_common.h"
#include "av1/common/seg_common.h"
#if CONFIG_AOM_QM
static void make_qmatrices(qm_val_t* wmatrix[NUM_QM_LEVELS][2][2][TX_SIZES],
qm_val_t* iwmatrix[NUM_QM_LEVELS][2][2][TX_SIZES]);
#endif
static const int16_t dc_qlookup[QINDEX_RANGE] = {
4, 8, 8, 9, 10, 11, 12, 12, 13, 14, 15, 16, 17, 18,
19, 19, 20, 21, 22, 23, 24, 25, 26, 26, 27, 28, 29, 30,
31, 32, 32, 33, 34, 35, 36, 37, 38, 38, 39, 40, 41, 42,
43, 43, 44, 45, 46, 47, 48, 48, 49, 50, 51, 52, 53, 53,
54, 55, 56, 57, 57, 58, 59, 60, 61, 62, 62, 63, 64, 65,
66, 66, 67, 68, 69, 70, 70, 71, 72, 73, 74, 74, 75, 76,
77, 78, 78, 79, 80, 81, 81, 82, 83, 84, 85, 85, 87, 88,
90, 92, 93, 95, 96, 98, 99, 101, 102, 104, 105, 107, 108, 110,
111, 113, 114, 116, 117, 118, 120, 121, 123, 125, 127, 129, 131, 134,
136, 138, 140, 142, 144, 146, 148, 150, 152, 154, 156, 158, 161, 164,
166, 169, 172, 174, 177, 180, 182, 185, 187, 190, 192, 195, 199, 202,
205, 208, 211, 214, 217, 220, 223, 226, 230, 233, 237, 240, 243, 247,
250, 253, 257, 261, 265, 269, 272, 276, 280, 284, 288, 292, 296, 300,
304, 309, 313, 317, 322, 326, 330, 335, 340, 344, 349, 354, 359, 364,
369, 374, 379, 384, 389, 395, 400, 406, 411, 417, 423, 429, 435, 441,
447, 454, 461, 467, 475, 482, 489, 497, 505, 513, 522, 530, 539, 549,
559, 569, 579, 590, 602, 614, 626, 640, 654, 668, 684, 700, 717, 736,
755, 775, 796, 819, 843, 869, 896, 925, 955, 988, 1022, 1058, 1098, 1139,
1184, 1232, 1282, 1336,
};
#if CONFIG_AOM_HIGHBITDEPTH
static const int16_t dc_qlookup_10[QINDEX_RANGE] = {
4, 9, 10, 13, 15, 17, 20, 22, 25, 28, 31, 34, 37,
40, 43, 47, 50, 53, 57, 60, 64, 68, 71, 75, 78, 82,
86, 90, 93, 97, 101, 105, 109, 113, 116, 120, 124, 128, 132,
136, 140, 143, 147, 151, 155, 159, 163, 166, 170, 174, 178, 182,
185, 189, 193, 197, 200, 204, 208, 212, 215, 219, 223, 226, 230,
233, 237, 241, 244, 248, 251, 255, 259, 262, 266, 269, 273, 276,
280, 283, 287, 290, 293, 297, 300, 304, 307, 310, 314, 317, 321,
324, 327, 331, 334, 337, 343, 350, 356, 362, 369, 375, 381, 387,
394, 400, 406, 412, 418, 424, 430, 436, 442, 448, 454, 460, 466,
472, 478, 484, 490, 499, 507, 516, 525, 533, 542, 550, 559, 567,
576, 584, 592, 601, 609, 617, 625, 634, 644, 655, 666, 676, 687,
698, 708, 718, 729, 739, 749, 759, 770, 782, 795, 807, 819, 831,
844, 856, 868, 880, 891, 906, 920, 933, 947, 961, 975, 988, 1001,
1015, 1030, 1045, 1061, 1076, 1090, 1105, 1120, 1137, 1153, 1170, 1186, 1202,
1218, 1236, 1253, 1271, 1288, 1306, 1323, 1342, 1361, 1379, 1398, 1416, 1436,
1456, 1476, 1496, 1516, 1537, 1559, 1580, 1601, 1624, 1647, 1670, 1692, 1717,
1741, 1766, 1791, 1817, 1844, 1871, 1900, 1929, 1958, 1990, 2021, 2054, 2088,
2123, 2159, 2197, 2236, 2276, 2319, 2363, 2410, 2458, 2508, 2561, 2616, 2675,
2737, 2802, 2871, 2944, 3020, 3102, 3188, 3280, 3375, 3478, 3586, 3702, 3823,
3953, 4089, 4236, 4394, 4559, 4737, 4929, 5130, 5347,
};
static const int16_t dc_qlookup_12[QINDEX_RANGE] = {
4, 12, 18, 25, 33, 41, 50, 60, 70, 80, 91,
103, 115, 127, 140, 153, 166, 180, 194, 208, 222, 237,
251, 266, 281, 296, 312, 327, 343, 358, 374, 390, 405,
421, 437, 453, 469, 484, 500, 516, 532, 548, 564, 580,
596, 611, 627, 643, 659, 674, 690, 706, 721, 737, 752,
768, 783, 798, 814, 829, 844, 859, 874, 889, 904, 919,
934, 949, 964, 978, 993, 1008, 1022, 1037, 1051, 1065, 1080,
1094, 1108, 1122, 1136, 1151, 1165, 1179, 1192, 1206, 1220, 1234,
1248, 1261, 1275, 1288, 1302, 1315, 1329, 1342, 1368, 1393, 1419,
1444, 1469, 1494, 1519, 1544, 1569, 1594, 1618, 1643, 1668, 1692,
1717, 1741, 1765, 1789, 1814, 1838, 1862, 1885, 1909, 1933, 1957,
1992, 2027, 2061, 2096, 2130, 2165, 2199, 2233, 2267, 2300, 2334,
2367, 2400, 2434, 2467, 2499, 2532, 2575, 2618, 2661, 2704, 2746,
2788, 2830, 2872, 2913, 2954, 2995, 3036, 3076, 3127, 3177, 3226,
3275, 3324, 3373, 3421, 3469, 3517, 3565, 3621, 3677, 3733, 3788,
3843, 3897, 3951, 4005, 4058, 4119, 4181, 4241, 4301, 4361, 4420,
4479, 4546, 4612, 4677, 4742, 4807, 4871, 4942, 5013, 5083, 5153,
5222, 5291, 5367, 5442, 5517, 5591, 5665, 5745, 5825, 5905, 5984,
6063, 6149, 6234, 6319, 6404, 6495, 6587, 6678, 6769, 6867, 6966,
7064, 7163, 7269, 7376, 7483, 7599, 7715, 7832, 7958, 8085, 8214,
8352, 8492, 8635, 8788, 8945, 9104, 9275, 9450, 9639, 9832, 10031,
10245, 10465, 10702, 10946, 11210, 11482, 11776, 12081, 12409, 12750, 13118,
13501, 13913, 14343, 14807, 15290, 15812, 16356, 16943, 17575, 18237, 18949,
19718, 20521, 21387,
};
#endif
static const int16_t ac_qlookup[QINDEX_RANGE] = {
4, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19,
20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32,
33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45,
46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58,
59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71,
72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84,
85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97,
98, 99, 100, 101, 102, 104, 106, 108, 110, 112, 114, 116, 118,
120, 122, 124, 126, 128, 130, 132, 134, 136, 138, 140, 142, 144,
146, 148, 150, 152, 155, 158, 161, 164, 167, 170, 173, 176, 179,
182, 185, 188, 191, 194, 197, 200, 203, 207, 211, 215, 219, 223,
227, 231, 235, 239, 243, 247, 251, 255, 260, 265, 270, 275, 280,
285, 290, 295, 300, 305, 311, 317, 323, 329, 335, 341, 347, 353,
359, 366, 373, 380, 387, 394, 401, 408, 416, 424, 432, 440, 448,
456, 465, 474, 483, 492, 501, 510, 520, 530, 540, 550, 560, 571,
582, 593, 604, 615, 627, 639, 651, 663, 676, 689, 702, 715, 729,
743, 757, 771, 786, 801, 816, 832, 848, 864, 881, 898, 915, 933,
951, 969, 988, 1007, 1026, 1046, 1066, 1087, 1108, 1129, 1151, 1173, 1196,
1219, 1243, 1267, 1292, 1317, 1343, 1369, 1396, 1423, 1451, 1479, 1508, 1537,
1567, 1597, 1628, 1660, 1692, 1725, 1759, 1793, 1828,
};
#if CONFIG_AOM_HIGHBITDEPTH
static const int16_t ac_qlookup_10[QINDEX_RANGE] = {
4, 9, 11, 13, 16, 18, 21, 24, 27, 30, 33, 37, 40,
44, 48, 51, 55, 59, 63, 67, 71, 75, 79, 83, 88, 92,
96, 100, 105, 109, 114, 118, 122, 127, 131, 136, 140, 145, 149,
154, 158, 163, 168, 172, 177, 181, 186, 190, 195, 199, 204, 208,
213, 217, 222, 226, 231, 235, 240, 244, 249, 253, 258, 262, 267,
271, 275, 280, 284, 289, 293, 297, 302, 306, 311, 315, 319, 324,
328, 332, 337, 341, 345, 349, 354, 358, 362, 367, 371, 375, 379,
384, 388, 392, 396, 401, 409, 417, 425, 433, 441, 449, 458, 466,
474, 482, 490, 498, 506, 514, 523, 531, 539, 547, 555, 563, 571,
579, 588, 596, 604, 616, 628, 640, 652, 664, 676, 688, 700, 713,
725, 737, 749, 761, 773, 785, 797, 809, 825, 841, 857, 873, 889,
905, 922, 938, 954, 970, 986, 1002, 1018, 1038, 1058, 1078, 1098, 1118,
1138, 1158, 1178, 1198, 1218, 1242, 1266, 1290, 1314, 1338, 1362, 1386, 1411,
1435, 1463, 1491, 1519, 1547, 1575, 1603, 1631, 1663, 1695, 1727, 1759, 1791,
1823, 1859, 1895, 1931, 1967, 2003, 2039, 2079, 2119, 2159, 2199, 2239, 2283,
2327, 2371, 2415, 2459, 2507, 2555, 2603, 2651, 2703, 2755, 2807, 2859, 2915,
2971, 3027, 3083, 3143, 3203, 3263, 3327, 3391, 3455, 3523, 3591, 3659, 3731,
3803, 3876, 3952, 4028, 4104, 4184, 4264, 4348, 4432, 4516, 4604, 4692, 4784,
4876, 4972, 5068, 5168, 5268, 5372, 5476, 5584, 5692, 5804, 5916, 6032, 6148,
6268, 6388, 6512, 6640, 6768, 6900, 7036, 7172, 7312,
};
static const int16_t ac_qlookup_12[QINDEX_RANGE] = {
4, 13, 19, 27, 35, 44, 54, 64, 75, 87, 99,
112, 126, 139, 154, 168, 183, 199, 214, 230, 247, 263,
280, 297, 314, 331, 349, 366, 384, 402, 420, 438, 456,
475, 493, 511, 530, 548, 567, 586, 604, 623, 642, 660,
679, 698, 716, 735, 753, 772, 791, 809, 828, 846, 865,
884, 902, 920, 939, 957, 976, 994, 1012, 1030, 1049, 1067,
1085, 1103, 1121, 1139, 1157, 1175, 1193, 1211, 1229, 1246, 1264,
1282, 1299, 1317, 1335, 1352, 1370, 1387, 1405, 1422, 1440, 1457,
1474, 1491, 1509, 1526, 1543, 1560, 1577, 1595, 1627, 1660, 1693,
1725, 1758, 1791, 1824, 1856, 1889, 1922, 1954, 1987, 2020, 2052,
2085, 2118, 2150, 2183, 2216, 2248, 2281, 2313, 2346, 2378, 2411,
2459, 2508, 2556, 2605, 2653, 2701, 2750, 2798, 2847, 2895, 2943,
2992, 3040, 3088, 3137, 3185, 3234, 3298, 3362, 3426, 3491, 3555,
3619, 3684, 3748, 3812, 3876, 3941, 4005, 4069, 4149, 4230, 4310,
4390, 4470, 4550, 4631, 4711, 4791, 4871, 4967, 5064, 5160, 5256,
5352, 5448, 5544, 5641, 5737, 5849, 5961, 6073, 6185, 6297, 6410,
6522, 6650, 6778, 6906, 7034, 7162, 7290, 7435, 7579, 7723, 7867,
8011, 8155, 8315, 8475, 8635, 8795, 8956, 9132, 9308, 9484, 9660,
9836, 10028, 10220, 10412, 10604, 10812, 11020, 11228, 11437, 11661, 11885,
12109, 12333, 12573, 12813, 13053, 13309, 13565, 13821, 14093, 14365, 14637,
14925, 15213, 15502, 15806, 16110, 16414, 16734, 17054, 17390, 17726, 18062,
18414, 18766, 19134, 19502, 19886, 20270, 20670, 21070, 21486, 21902, 22334,
22766, 23214, 23662, 24126, 24590, 25070, 25551, 26047, 26559, 27071, 27599,
28143, 28687, 29247,
};
#endif
int16_t av1_dc_quant(int qindex, int delta, aom_bit_depth_t bit_depth) {
#if CONFIG_AOM_HIGHBITDEPTH
switch (bit_depth) {
case AOM_BITS_8: return dc_qlookup[clamp(qindex + delta, 0, MAXQ)];
case AOM_BITS_10: return dc_qlookup_10[clamp(qindex + delta, 0, MAXQ)];
case AOM_BITS_12: return dc_qlookup_12[clamp(qindex + delta, 0, MAXQ)];
default:
assert(0 && "bit_depth should be AOM_BITS_8, AOM_BITS_10 or AOM_BITS_12");
return -1;
}
#else
(void)bit_depth;
return dc_qlookup[clamp(qindex + delta, 0, MAXQ)];
#endif
}
int16_t av1_ac_quant(int qindex, int delta, aom_bit_depth_t bit_depth) {
#if CONFIG_AOM_HIGHBITDEPTH
switch (bit_depth) {
case AOM_BITS_8: return ac_qlookup[clamp(qindex + delta, 0, MAXQ)];
case AOM_BITS_10: return ac_qlookup_10[clamp(qindex + delta, 0, MAXQ)];
case AOM_BITS_12: return ac_qlookup_12[clamp(qindex + delta, 0, MAXQ)];
default:
assert(0 && "bit_depth should be AOM_BITS_8, AOM_BITS_10 or AOM_BITS_12");
return -1;
}
#else
(void)bit_depth;
return ac_qlookup[clamp(qindex + delta, 0, MAXQ)];
#endif
}
int av1_get_qindex(const struct segmentation* seg, int segment_id,
int base_qindex) {
if (segfeature_active(seg, segment_id, SEG_LVL_ALT_Q)) {
const int data = get_segdata(seg, segment_id, SEG_LVL_ALT_Q);
const int seg_qindex =
seg->abs_delta == SEGMENT_ABSDATA ? data : base_qindex + data;
return clamp(seg_qindex, 0, MAXQ);
} else {
return base_qindex;
}
}
#if CONFIG_AOM_QM
qm_val_t* aom_iqmatrix(AV1_COMMON* cm, int qmlevel, int is_chroma,
int log2sizem2, int is_intra) {
return &cm->giqmatrix[qmlevel][!!is_chroma][!!is_intra][log2sizem2][0];
}
qm_val_t* aom_qmatrix(AV1_COMMON* cm, int qmlevel, int is_chroma,
int log2sizem2, int is_intra) {
return &cm->gqmatrix[qmlevel][!!is_chroma][!!is_intra][log2sizem2][0];
}
static uint16_t
iwt_matrix_ref[NUM_QM_LEVELS][2][2][4 * 4 + 8 * 8 + 16 * 16 + 32 * 32];
static uint16_t
wt_matrix_ref[NUM_QM_LEVELS][2][2][4 * 4 + 8 * 8 + 16 * 16 + 32 * 32];
void aom_qm_init(AV1_COMMON* cm) {
int q, c, f, t, size;
int current;
for (q = 0; q < NUM_QM_LEVELS; ++q) {
for (c = 0; c < 2; ++c) {
for (f = 0; f < 2; ++f) {
current = 0;
for (t = 0; t < TX_SIZES; ++t) {
size = 1 << (t + 2);
cm->gqmatrix[q][c][f][t] = &wt_matrix_ref[q][c][f][current];
cm->giqmatrix[q][c][f][t] = &iwt_matrix_ref[q][c][f][current];
current += size * size;
}
}
}
}
}
static uint16_t iwt_matrix_ref[NUM_QM_LEVELS][2][2][4 * 4 + 8 * 8 + 16 * 16 +
32 * 32] = {
{ { /* Luma matrices */
{ /* Inter matrices */
/* Size 4 */
64, 71, 124, 214, 71, 112, 165, 241, 124, 165, 254, 331, 214, 241, 331,
414,
/* Size 8 */
64, 47, 51, 69, 97, 132, 173, 218, 47, 54, 52, 62, 81, 109, 142, 181,
51, 52, 75, 90, 108, 133, 165, 201, 69, 62, 90, 119, 144, 169, 198, 232,
97, 81, 108, 144, 178, 208, 238, 268, 132, 109, 133, 169, 208, 244, 276,
305, 173, 142, 165, 198, 238, 276, 309, 338, 218, 181, 201, 232, 268,
305, 338, 367,
/* Size 16 */
64, 54, 47, 49, 51, 59, 69, 81, 97, 111, 132, 150, 173, 193, 218, 218,
54, 52, 50, 51, 51, 58, 65, 75, 88, 101, 119, 135, 156, 175, 198, 198,
47, 50, 54, 53, 52, 56, 62, 70, 81, 93, 109, 123, 142, 159, 181, 181,
49, 51, 53, 57, 61, 67, 73, 82, 93, 104, 120, 134, 153, 170, 191, 191,
51, 51, 52, 61, 75, 82, 90, 98, 108, 119, 133, 147, 165, 181, 201, 201,
59, 58, 56, 67, 82, 91, 102, 112, 123, 135, 149, 163, 180, 196, 215,
215, 69, 65, 62, 73, 90, 102, 119, 130, 144, 155, 169, 182, 198, 214,
232, 232, 81, 75, 70, 82, 98, 112, 130, 143, 159, 172, 186, 200, 216,
231, 249, 249, 97, 88, 81, 93, 108, 123, 144, 159, 178, 192, 208, 222,
238, 252, 268, 268, 111, 101, 93, 104, 119, 135, 155, 172, 192, 207,
225, 239, 255, 269, 285, 285, 132, 119, 109, 120, 133, 149, 169, 186,
208, 225, 244, 259, 276, 290, 305, 305, 150, 135, 123, 134, 147, 163,
182, 200, 222, 239, 259, 274, 291, 305, 321, 321, 173, 156, 142, 153,
165, 180, 198, 216, 238, 255, 276, 291, 309, 323, 338, 338, 193, 175,
159, 170, 181, 196, 214, 231, 252, 269, 290, 305, 323, 337, 352, 352,
218, 198, 181, 191, 201, 215, 232, 249, 268, 285, 305, 321, 338, 352,
367, 367, 218, 198, 181, 191, 201, 215, 232, 249, 268, 285, 305, 321,
338, 352, 367, 367,
/* Size 32 */
64, 59, 54, 50, 47, 48, 49, 50, 51, 55, 59, 63, 69, 74, 81, 88, 97, 104,
111, 121, 132, 140, 150, 161, 173, 183, 193, 205, 218, 218, 218, 218,
59, 56, 53, 51, 49, 49, 50, 51, 51, 54, 58, 62, 67, 72, 78, 84, 92, 99,
106, 115, 125, 133, 142, 152, 164, 173, 183, 195, 208, 208, 208, 208,
54, 53, 52, 51, 50, 51, 51, 51, 51, 54, 58, 61, 65, 70, 75, 81, 88, 94,
101, 110, 119, 127, 135, 145, 156, 165, 175, 186, 198, 198, 198, 198,
50, 51, 51, 52, 52, 52, 52, 52, 52, 54, 57, 60, 63, 68, 72, 78, 85, 90,
97, 105, 114, 121, 129, 138, 149, 157, 167, 177, 189, 189, 189, 189, 47,
49, 50, 52, 54, 54, 53, 52, 52, 54, 56, 59, 62, 66, 70, 75, 81, 87, 93,
100, 109, 115, 123, 132, 142, 150, 159, 170, 181, 181, 181, 181, 48, 49,
51, 52, 54, 54, 55, 56, 56, 59, 61, 64, 67, 71, 76, 81, 87, 92, 98, 105,
114, 121, 128, 137, 147, 155, 164, 174, 186, 186, 186, 186, 49, 50, 51,
52, 53, 55, 57, 59, 61, 64, 67, 70, 73, 77, 82, 87, 93, 98, 104, 111,
120, 126, 134, 143, 153, 161, 170, 179, 191, 191, 191, 191, 50, 51, 51,
52, 52, 56, 59, 63, 68, 71, 74, 77, 81, 85, 89, 94, 100, 105, 111, 118,
126, 133, 140, 149, 158, 166, 175, 185, 196, 196, 196, 196, 51, 51, 51,
52, 52, 56, 61, 68, 75, 79, 82, 86, 90, 94, 98, 103, 108, 113, 119, 126,
133, 140, 147, 155, 165, 172, 181, 191, 201, 201, 201, 201, 55, 54, 54,
54, 54, 59, 64, 71, 79, 82, 86, 91, 96, 100, 105, 110, 115, 120, 126,
133, 140, 147, 155, 163, 172, 180, 188, 198, 208, 208, 208, 208, 59, 58,
58, 57, 56, 61, 67, 74, 82, 86, 91, 96, 102, 107, 112, 117, 123, 129,
135, 141, 149, 156, 163, 171, 180, 188, 196, 205, 215, 215, 215, 215,
63, 62, 61, 60, 59, 64, 70, 77, 86, 91, 96, 103, 110, 115, 120, 126,
133, 138, 144, 151, 158, 165, 172, 180, 189, 196, 204, 213, 223, 223,
223, 223, 69, 67, 65, 63, 62, 67, 73, 81, 90, 96, 102, 110, 119, 124,
130, 137, 144, 149, 155, 162, 169, 175, 182, 190, 198, 206, 214, 222,
232, 232, 232, 232, 74, 72, 70, 68, 66, 71, 77, 85, 94, 100, 107, 115,
124, 130, 136, 143, 151, 157, 163, 170, 177, 184, 191, 199, 207, 214,
222, 231, 240, 240, 240, 240, 81, 78, 75, 72, 70, 76, 82, 89, 98, 105,
112, 120, 130, 136, 143, 151, 159, 165, 172, 179, 186, 193, 200, 208,
216, 223, 231, 240, 249, 249, 249, 249, 88, 84, 81, 78, 75, 81, 87, 94,
103, 110, 117, 126, 137, 143, 151, 159, 168, 174, 181, 189, 197, 203,
211, 218, 226, 234, 241, 249, 258, 258, 258, 258, 97, 92, 88, 85, 81,
87, 93, 100, 108, 115, 123, 133, 144, 151, 159, 168, 178, 184, 192, 200,
208, 215, 222, 229, 238, 245, 252, 260, 268, 268, 268, 268, 104, 99, 94,
90, 87, 92, 98, 105, 113, 120, 129, 138, 149, 157, 165, 174, 184, 191,
199, 207, 216, 223, 230, 238, 246, 253, 260, 268, 276, 276, 276, 276,
111, 106, 101, 97, 93, 98, 104, 111, 119, 126, 135, 144, 155, 163, 172,
181, 192, 199, 207, 215, 225, 232, 239, 247, 255, 262, 269, 277, 285,
285, 285, 285, 121, 115, 110, 105, 100, 105, 111, 118, 126, 133, 141,
151, 162, 170, 179, 189, 200, 207, 215, 224, 234, 241, 248, 256, 265,
272, 279, 287, 295, 295, 295, 295, 132, 125, 119, 114, 109, 114, 120,
126, 133, 140, 149, 158, 169, 177, 186, 197, 208, 216, 225, 234, 244,
251, 259, 267, 276, 282, 290, 297, 305, 305, 305, 305, 140, 133, 127,
121, 115, 121, 126, 133, 140, 147, 156, 165, 175, 184, 193, 203, 215,
223, 232, 241, 251, 258, 266, 275, 283, 290, 297, 305, 313, 313, 313,
313, 150, 142, 135, 129, 123, 128, 134, 140, 147, 155, 163, 172, 182,
191, 200, 211, 222, 230, 239, 248, 259, 266, 274, 283, 291, 298, 305,
313, 321, 321, 321, 321, 161, 152, 145, 138, 132, 137, 143, 149, 155,
163, 171, 180, 190, 199, 208, 218, 229, 238, 247, 256, 267, 275, 283,
291, 300, 307, 314, 322, 329, 329, 329, 329, 173, 164, 156, 149, 142,
147, 153, 158, 165, 172, 180, 189, 198, 207, 216, 226, 238, 246, 255,
265, 276, 283, 291, 300, 309, 316, 323, 331, 338, 338, 338, 338, 183,
173, 165, 157, 150, 155, 161, 166, 172, 180, 188, 196, 206, 214, 223,
234, 245, 253, 262, 272, 282, 290, 298, 307, 316, 323, 330, 337, 345,
345, 345, 345, 193, 183, 175, 167, 159, 164, 170, 175, 181, 188, 196,
204, 214, 222, 231, 241, 252, 260, 269, 279, 290, 297, 305, 314, 323,
330, 337, 345, 352, 352, 352, 352, 205, 195, 186, 177, 170, 174, 179,
185, 191, 198, 205, 213, 222, 231, 240, 249, 260, 268, 277, 287, 297,
305, 313, 322, 331, 337, 345, 352, 360, 360, 360, 360, 218, 208, 198,
189, 181, 186, 191, 196, 201, 208, 215, 223, 232, 240, 249, 258, 268,
276, 285, 295, 305, 313, 321, 329, 338, 345, 352, 360, 367, 367, 367,
367, 218, 208, 198, 189, 181, 186, 191, 196, 201, 208, 215, 223, 232,
240, 249, 258, 268, 276, 285, 295, 305, 313, 321, 329, 338, 345, 352,
360, 367, 367, 367, 367, 218, 208, 198, 189, 181, 186, 191, 196, 201,
208, 215, 223, 232, 240, 249, 258, 268, 276, 285, 295, 305, 313, 321,
329, 338, 345, 352, 360, 367, 367, 367, 367, 218, 208, 198, 189, 181,
186, 191, 196, 201, 208, 215, 223, 232, 240, 249, 258, 268, 276, 285,
295, 305, 313, 321, 329, 338, 345, 352, 360, 367, 367, 367, 367 },
{ /* Intra matrices */
/* Size 4 */
16, 18, 33, 60, 18, 29, 45, 68, 33, 45, 72, 98, 60, 68, 98, 129,
/* Size 8 */
20, 14, 16, 21, 31, 43, 58, 75, 14, 17, 16, 19, 25, 35, 46, 61, 16, 16,
24, 28, 34, 43, 54, 68, 21, 19, 28, 38, 47, 56, 67, 80, 31, 25, 34, 47,
59, 71, 83, 95, 43, 35, 43, 56, 71, 85, 99, 112, 58, 46, 54, 67, 83, 99,
113, 127, 75, 61, 68, 80, 95, 112, 127, 141,
/* Size 16 */
19, 16, 14, 14, 15, 17, 20, 24, 29, 34, 41, 47, 55, 62, 71, 71, 16, 15,
15, 15, 15, 17, 19, 22, 26, 31, 36, 42, 49, 55, 64, 64, 14, 15, 16, 16,
15, 17, 18, 21, 24, 28, 33, 38, 44, 50, 58, 58, 14, 15, 16, 17, 18, 20,
22, 24, 28, 32, 37, 41, 48, 54, 61, 61, 15, 15, 15, 18, 22, 24, 27, 30,
33, 36, 41, 46, 52, 58, 65, 65, 17, 17, 17, 20, 24, 27, 31, 34, 38, 42,
46, 51, 57, 63, 70, 70, 20, 19, 18, 22, 27, 31, 36, 40, 45, 49, 53, 58,
64, 70, 76, 76, 24, 22, 21, 24, 30, 34, 40, 44, 50, 54, 60, 65, 71, 76,
83, 83, 29, 26, 24, 28, 33, 38, 45, 50, 56, 61, 67, 73, 79, 84, 91, 91,
34, 31, 28, 32, 36, 42, 49, 54, 61, 67, 74, 79, 86, 91, 98, 98, 41, 36,
33, 37, 41, 46, 53, 60, 67, 74, 81, 87, 94, 100, 106, 106, 47, 42, 38,
41, 46, 51, 58, 65, 73, 79, 87, 93, 100, 106, 113, 113, 55, 49, 44, 48,
52, 57, 64, 71, 79, 86, 94, 100, 108, 114, 121, 121, 62, 55, 50, 54, 58,
63, 70, 76, 84, 91, 100, 106, 114, 120, 127, 127, 71, 64, 58, 61, 65,
70, 76, 83, 91, 98, 106, 113, 121, 127, 134, 134, 71, 64, 58, 61, 65,
70, 76, 83, 91, 98, 106, 113, 121, 127, 134, 134,
/* Size 32 */
18, 17, 15, 14, 13, 14, 14, 14, 15, 16, 17, 18, 20, 22, 23, 26, 28, 30,
33, 36, 40, 42, 45, 49, 53, 57, 60, 65, 69, 69, 69, 69, 17, 16, 15, 14,
14, 14, 14, 14, 15, 16, 17, 18, 19, 21, 23, 25, 27, 29, 31, 34, 37, 40,
43, 46, 50, 53, 57, 61, 66, 66, 66, 66, 15, 15, 15, 15, 14, 14, 14, 15,
15, 15, 16, 18, 19, 20, 22, 24, 26, 28, 30, 32, 35, 38, 41, 44, 48, 51,
54, 58, 62, 62, 62, 62, 14, 14, 15, 15, 15, 15, 15, 15, 15, 15, 16, 17,
18, 19, 21, 23, 25, 26, 28, 31, 34, 36, 39, 42, 45, 48, 51, 55, 59, 59,
59, 59, 13, 14, 14, 15, 16, 15, 15, 15, 15, 15, 16, 17, 18, 19, 20, 22,
24, 25, 27, 29, 32, 34, 37, 40, 43, 46, 49, 52, 56, 56, 56, 56, 14, 14,
14, 15, 15, 16, 16, 16, 16, 17, 18, 18, 19, 20, 22, 23, 25, 27, 29, 31,
34, 36, 38, 41, 45, 47, 50, 54, 58, 58, 58, 58, 14, 14, 14, 15, 15, 16,
16, 17, 18, 18, 19, 20, 21, 22, 24, 25, 27, 29, 31, 33, 36, 38, 40, 43,
46, 49, 52, 56, 60, 60, 60, 60, 14, 14, 15, 15, 15, 16, 17, 18, 19, 20,
21, 22, 23, 25, 26, 28, 29, 31, 33, 35, 38, 40, 42, 45, 48, 51, 54, 57,
61, 61, 61, 61, 15, 15, 15, 15, 15, 16, 18, 19, 22, 23, 24, 25, 26, 27,
29, 30, 32, 34, 35, 38, 40, 42, 45, 47, 50, 53, 56, 59, 63, 63, 63, 63,
16, 16, 15, 15, 15, 17, 18, 20, 23, 24, 25, 27, 28, 29, 31, 32, 34, 36,
38, 40, 42, 45, 47, 50, 53, 56, 59, 62, 66, 66, 66, 66, 17, 17, 16, 16,
16, 18, 19, 21, 24, 25, 27, 28, 30, 32, 33, 35, 37, 39, 41, 43, 45, 47,
50, 53, 56, 58, 61, 65, 68, 68, 68, 68, 18, 18, 18, 17, 17, 18, 20, 22,
25, 27, 28, 30, 33, 34, 36, 38, 40, 42, 44, 46, 48, 51, 53, 56, 59, 62,
64, 68, 71, 71, 71, 71, 20, 19, 19, 18, 18, 19, 21, 23, 26, 28, 30, 33,
35, 37, 39, 41, 43, 45, 47, 50, 52, 54, 57, 59, 62, 65, 68, 71, 74, 74,
74, 74, 22, 21, 20, 19, 19, 20, 22, 25, 27, 29, 32, 34, 37, 39, 41, 43,
46, 48, 50, 52, 55, 57, 60, 62, 65, 68, 71, 74, 77, 77, 77, 77, 23, 23,
22, 21, 20, 22, 24, 26, 29, 31, 33, 36, 39, 41, 43, 46, 49, 51, 53, 55,
58, 60, 63, 66, 69, 71, 74, 77, 81, 81, 81, 81, 26, 25, 24, 23, 22, 23,
25, 28, 30, 32, 35, 38, 41, 43, 46, 48, 52, 54, 56, 59, 62, 64, 67, 69,
72, 75, 78, 81, 84, 84, 84, 84, 28, 27, 26, 25, 24, 25, 27, 29, 32, 34,
37, 40, 43, 46, 49, 52, 55, 57, 60, 63, 66, 68, 71, 74, 77, 79, 82, 85,
88, 88, 88, 88, 30, 29, 28, 26, 25, 27, 29, 31, 34, 36, 39, 42, 45, 48,
51, 54, 57, 60, 62, 65, 69, 71, 74, 77, 80, 83, 85, 88, 92, 92, 92, 92,
33, 31, 30, 28, 27, 29, 31, 33, 35, 38, 41, 44, 47, 50, 53, 56, 60, 62,
65, 68, 72, 74, 77, 80, 83, 86, 89, 92, 95, 95, 95, 95, 36, 34, 32, 31,
29, 31, 33, 35, 38, 40, 43, 46, 50, 52, 55, 59, 63, 65, 68, 72, 75, 78,
81, 84, 87, 90, 93, 96, 99, 99, 99, 99, 40, 37, 35, 34, 32, 34, 36, 38,
40, 42, 45, 48, 52, 55, 58, 62, 66, 69, 72, 75, 79, 82, 85, 88, 91, 94,
97, 100, 103, 103, 103, 103, 42, 40, 38, 36, 34, 36, 38, 40, 42, 45, 47,
51, 54, 57, 60, 64, 68, 71, 74, 78, 82, 85, 88, 91, 94, 97, 100, 103,
107, 107, 107, 107, 45, 43, 41, 39, 37, 38, 40, 42, 45, 47, 50, 53, 57,
60, 63, 67, 71, 74, 77, 81, 85, 88, 91, 94, 98, 101, 104, 107, 110, 110,
110, 110, 49, 46, 44, 42, 40, 41, 43, 45, 47, 50, 53, 56, 59, 62, 66,
69, 74, 77, 80, 84, 88, 91, 94, 98, 101, 104, 107, 110, 114, 114, 114,
114, 53, 50, 48, 45, 43, 45, 46, 48, 50, 53, 56, 59, 62, 65, 69, 72, 77,
80, 83, 87, 91, 94, 98, 101, 105, 108, 111, 114, 118, 118, 118, 118, 57,
53, 51, 48, 46, 47, 49, 51, 53, 56, 58, 62, 65, 68, 71, 75, 79, 83, 86,
90, 94, 97, 101, 104, 108, 111, 114, 117, 121, 121, 121, 121, 60, 57,
54, 51, 49, 50, 52, 54, 56, 59, 61, 64, 68, 71, 74, 78, 82, 85, 89, 93,
97, 100, 104, 107, 111, 114, 117, 120, 124, 124, 124, 124, 65, 61, 58,
55, 52, 54, 56, 57, 59, 62, 65, 68, 71, 74, 77, 81, 85, 88, 92, 96, 100,
103, 107, 110, 114, 117, 120, 124, 127, 127, 127, 127, 69, 66, 62, 59,
56, 58, 60, 61, 63, 66, 68, 71, 74, 77, 81, 84, 88, 92, 95, 99, 103,
107, 110, 114, 118, 121, 124, 127, 130, 130, 130, 130, 69, 66, 62, 59,
56, 58, 60, 61, 63, 66, 68, 71, 74, 77, 81, 84, 88, 92, 95, 99, 103,
107, 110, 114, 118, 121, 124, 127, 130, 130, 130, 130, 69, 66, 62, 59,
56, 58, 60, 61, 63, 66, 68, 71, 74, 77, 81, 84, 88, 92, 95, 99, 103,
107, 110, 114, 118, 121, 124, 127, 130, 130, 130, 130, 69, 66, 62, 59,
56, 58, 60, 61, 63, 66, 68, 71, 74, 77, 81, 84, 88, 92, 95, 99, 103,
107, 110, 114, 118, 121, 124, 127, 130, 130, 130, 130 } },
{ /* Chroma matrices */
{ /* Inter matrices */
/* Size 4 */
64, 106, 117, 154, 106, 131, 141, 167, 117, 141, 191, 225, 154, 167,
225, 279,
/* Size 8 */
64, 51, 98, 104, 113, 128, 148, 172, 51, 76, 100, 89, 92, 103, 118, 136,
98, 100, 119, 115, 114, 121, 134, 151, 104, 89, 115, 132, 140, 147, 158,
173, 113, 92, 114, 140, 160, 174, 186, 201, 128, 103, 121, 147, 174,
195, 213, 229, 148, 118, 134, 158, 186, 213, 236, 256, 172, 136, 151,
173, 201, 229, 256, 280,
/* Size 16 */
64, 57, 51, 67, 98, 101, 104, 108, 113, 120, 128, 137, 148, 159, 172,
172, 57, 59, 61, 75, 99, 97, 96, 99, 101, 107, 114, 122, 131, 141, 152,
152, 51, 61, 76, 86, 100, 94, 89, 91, 92, 97, 103, 110, 118, 126, 136,
136, 67, 75, 86, 96, 109, 104, 100, 101, 102, 106, 111, 118, 125, 134,
143, 143, 98, 99, 100, 109, 119, 117, 115, 115, 114, 118, 121, 127, 134,
142, 151, 151, 101, 97, 94, 104, 117, 120, 123, 124, 126, 129, 133, 139,
145, 153, 161, 161, 104, 96, 89, 100, 115, 123, 132, 136, 140, 144, 147,
153, 158, 165, 173, 173, 108, 99, 91, 101, 115, 124, 136, 142, 149, 154,
160, 165, 171, 178, 186, 186, 113, 101, 92, 102, 114, 126, 140, 149,
160, 167, 174, 180, 186, 193, 201, 201, 120, 107, 97, 106, 118, 129,
144, 154, 167, 175, 184, 191, 199, 206, 214, 214, 128, 114, 103, 111,
121, 133, 147, 160, 174, 184, 195, 204, 213, 221, 229, 229, 137, 122,
110, 118, 127, 139, 153, 165, 180, 191, 204, 213, 224, 233, 242, 242,
148, 131, 118, 125, 134, 145, 158, 171, 186, 199, 213, 224, 236, 246,
256, 256, 159, 141, 126, 134, 142, 153, 165, 178, 193, 206, 221, 233,
246, 256, 267, 267, 172, 152, 136, 143, 151, 161, 173, 186, 201, 214,
229, 242, 256, 267, 280, 280, 172, 152, 136, 143, 151, 161, 173, 186,
201, 214, 229, 242, 256, 267, 280, 280,
/* Size 32 */
64, 60, 57, 54, 51, 58, 67, 79, 98, 99, 101, 103, 104, 106, 108, 110,
113, 116, 120, 124, 128, 133, 137, 143, 148, 153, 159, 165, 172, 172,
172, 172, 60, 59, 58, 56, 55, 62, 71, 82, 98, 99, 99, 100, 100, 102,
103, 105, 107, 110, 113, 117, 121, 125, 129, 134, 139, 144, 149, 155,
161, 161, 161, 161, 57, 58, 59, 60, 61, 67, 75, 85, 99, 98, 97, 97, 96,
97, 99, 100, 101, 104, 107, 110, 114, 118, 122, 126, 131, 136, 141, 146,
152, 152, 152, 152, 54, 56, 60, 63, 67, 73, 80, 89, 99, 97, 96, 94, 93,
94, 94, 95, 97, 99, 102, 105, 108, 112, 115, 120, 124, 128, 133, 138,
144, 144, 144, 144, 51, 55, 61, 67, 76, 81, 86, 92, 100, 97, 94, 92, 89,
90, 91, 91, 92, 95, 97, 100, 103, 106, 110, 113, 118, 122, 126, 131,
136, 136, 136, 136, 58, 62, 67, 73, 81, 85, 91, 97, 104, 101, 99, 97,
94, 95, 96, 96, 97, 99, 101, 104, 107, 110, 113, 117, 121, 125, 130,
134, 140, 140, 140, 140, 67, 71, 75, 80, 86, 91, 96, 102, 109, 106, 104,
102, 100, 101, 101, 102, 102, 104, 106, 109, 111, 114, 118, 121, 125,
129, 134, 138, 143, 143, 143, 143, 79, 82, 85, 89, 92, 97, 102, 108,
114, 112, 110, 109, 107, 107, 107, 108, 108, 110, 112, 114, 116, 119,
122, 126, 129, 133, 138, 142, 147, 147, 147, 147, 98, 98, 99, 99, 100,
104, 109, 114, 119, 118, 117, 116, 115, 115, 115, 114, 114, 116, 118,
119, 121, 124, 127, 130, 134, 138, 142, 146, 151, 151, 151, 151, 99, 99,
98, 97, 97, 101, 106, 112, 118, 118, 118, 119, 119, 119, 119, 120, 120,
122, 123, 125, 127, 130, 133, 136, 139, 143, 147, 151, 156, 156, 156,
156, 101, 99, 97, 96, 94, 99, 104, 110, 117, 118, 120, 121, 123, 124,
124, 125, 126, 128, 129, 131, 133, 136, 139, 142, 145, 149, 153, 157,
161, 161, 161, 161, 103, 100, 97, 94, 92, 97, 102, 109, 116, 119, 121,
124, 127, 129, 130, 131, 133, 134, 136, 138, 140, 143, 145, 148, 151,
155, 159, 163, 167, 167, 167, 167, 104, 100, 96, 93, 89, 94, 100, 107,
115, 119, 123, 127, 132, 134, 136, 138, 140, 142, 144, 146, 147, 150,
153, 155, 158, 162, 165, 169, 173, 173, 173, 173, 106, 102, 97, 94, 90,
95, 101, 107, 115, 119, 124, 129, 134, 137, 139, 142, 145, 147, 149,
151, 153, 156, 159, 162, 164, 168, 172, 175, 179, 179, 179, 179, 108,
103, 99, 94, 91, 96, 101, 107, 115, 119, 124, 130, 136, 139, 142, 146,
149, 152, 154, 157, 160, 162, 165, 168, 171, 175, 178, 182, 186, 186,
186, 186, 110, 105, 100, 95, 91, 96, 102, 108, 114, 120, 125, 131, 138,
142, 146, 150, 154, 157, 160, 163, 166, 169, 172, 175, 178, 182, 185,
189, 193, 193, 193, 193, 113, 107, 101, 97, 92, 97, 102, 108, 114, 120,
126, 133, 140, 145, 149, 154, 160, 163, 167, 170, 174, 177, 180, 183,
186, 190, 193, 197, 201, 201, 201, 201, 116, 110, 104, 99, 95, 99, 104,
110, 116, 122, 128, 134, 142, 147, 152, 157, 163, 167, 171, 175, 179,
182, 185, 189, 192, 196, 199, 203, 207, 207, 207, 207, 120, 113, 107,
102, 97, 101, 106, 112, 118, 123, 129, 136, 144, 149, 154, 160, 167,
171, 175, 179, 184, 187, 191, 195, 199, 202, 206, 210, 214, 214, 214,
214, 124, 117, 110, 105, 100, 104, 109, 114, 119, 125, 131, 138, 146,
151, 157, 163, 170, 175, 179, 184, 190, 193, 197, 201, 206, 209, 213,
217, 221, 221, 221, 221, 128, 121, 114, 108, 103, 107, 111, 116, 121,
127, 133, 140, 147, 153, 160, 166, 174, 179, 184, 190, 195, 200, 204,
208, 213, 217, 221, 225, 229, 229, 229, 229, 133, 125, 118, 112, 106,
110, 114, 119, 124, 130, 136, 143, 150, 156, 162, 169, 177, 182, 187,
193, 200, 204, 209, 213, 218, 222, 227, 231, 235, 235, 235, 235, 137,
129, 122, 115, 110, 113, 118, 122, 127, 133, 139, 145, 153, 159, 165,
172, 180, 185, 191, 197, 204, 209, 213, 219, 224, 228, 233, 237, 242,
242, 242, 242, 143, 134, 126, 120, 113, 117, 121, 126, 130, 136, 142,
148, 155, 162, 168, 175, 183, 189, 195, 201, 208, 213, 219, 224, 230,
234, 239, 244, 249, 249, 249, 249, 148, 139, 131, 124, 118, 121, 125,
129, 134, 139, 145, 151, 158, 164, 171, 178, 186, 192, 199, 206, 213,
218, 224, 230, 236, 241, 246, 251, 256, 256, 256, 256, 153, 144, 136,
128, 122, 125, 129, 133, 138, 143, 149, 155, 162, 168, 175, 182, 190,
196, 202, 209, 217, 222, 228, 234, 241, 246, 251, 256, 262, 262, 262,
262, 159, 149, 141, 133, 126, 130, 134, 138, 142, 147, 153, 159, 165,
172, 178, 185, 193, 199, 206, 213, 221, 227, 233, 239, 246, 251, 256,
262, 267, 267, 267, 267, 165, 155, 146, 138, 131, 134, 138, 142, 146,
151, 157, 163, 169, 175, 182, 189, 197, 203, 210, 217, 225, 231, 237,
244, 251, 256, 262, 267, 273, 273, 273, 273, 172, 161, 152, 144, 136,
140, 143, 147, 151, 156, 161, 167, 173, 179, 186, 193, 201, 207, 214,
221, 229, 235, 242, 249, 256, 262, 267, 273, 280, 280, 280, 280, 172,
161, 152, 144, 136, 140, 143, 147, 151, 156, 161, 167, 173, 179, 186,
193, 201, 207, 214, 221, 229, 235, 242, 249, 256, 262, 267, 273, 280,
280, 280, 280, 172, 161, 152, 144, 136, 140, 143, 147, 151, 156, 161,
167, 173, 179, 186, 193, 201, 207, 214, 221, 229, 235, 242, 249, 256,
262, 267, 273, 280, 280, 280, 280, 172, 161, 152, 144, 136, 140, 143,
147, 151, 156, 161, 167, 173, 179, 186, 193, 201, 207, 214, 221, 229,
235, 242, 249, 256, 262, 267, 273, 280, 280, 280, 280 },
{ /* Intra matrices */
/* Size 4 */
23, 40, 44, 59, 40, 50, 54, 64, 44, 54, 74, 89, 59, 64, 89, 114,
/* Size 8 */
25, 20, 39, 42, 46, 52, 61, 72, 20, 30, 40, 36, 37, 41, 48, 56, 39, 40,
49, 47, 46, 49, 55, 62, 42, 36, 47, 54, 58, 61, 66, 73, 46, 37, 46, 58,
67, 73, 79, 85, 52, 41, 49, 61, 73, 83, 91, 99, 61, 48, 55, 66, 79, 91,
103, 113, 72, 56, 62, 73, 85, 99, 113, 125,
/* Size 16 */
24, 22, 19, 26, 38, 39, 41, 42, 44, 47, 51, 55, 59, 64, 69, 69, 22, 22,
23, 29, 38, 38, 37, 38, 39, 42, 45, 48, 52, 56, 61, 61, 19, 23, 29, 33,
39, 37, 34, 35, 36, 38, 40, 43, 46, 50, 54, 54, 26, 29, 33, 37, 42, 41,
39, 39, 40, 42, 43, 46, 49, 53, 57, 57, 38, 38, 39, 42, 47, 46, 45, 45,
45, 46, 48, 50, 53, 56, 60, 60, 39, 38, 37, 41, 46, 47, 48, 49, 50, 51,
53, 55, 58, 61, 65, 65, 41, 37, 34, 39, 45, 48, 52, 54, 56, 57, 59, 61,
64, 67, 70, 70, 42, 38, 35, 39, 45, 49, 54, 57, 60, 62, 64, 67, 69, 72,
76, 76, 44, 39, 36, 40, 45, 50, 56, 60, 64, 67, 70, 73, 76, 79, 82, 82,
47, 42, 38, 42, 46, 51, 57, 62, 67, 71, 75, 78, 82, 85, 89, 89, 51, 45,
40, 43, 48, 53, 59, 64, 70, 75, 80, 84, 88, 92, 96, 96, 55, 48, 43, 46,
50, 55, 61, 67, 73, 78, 84, 88, 93, 97, 102, 102, 59, 52, 46, 49, 53,
58, 64, 69, 76, 82, 88, 93, 99, 104, 109, 109, 64, 56, 50, 53, 56, 61,
67, 72, 79, 85, 92, 97, 104, 109, 114, 114, 69, 61, 54, 57, 60, 65, 70,
76, 82, 89, 96, 102, 109, 114, 120, 120, 69, 61, 54, 57, 60, 65, 70, 76,
82, 89, 96, 102, 109, 114, 120, 120,
/* Size 32 */
24, 22, 21, 20, 19, 22, 25, 30, 37, 38, 39, 39, 40, 41, 42, 42, 43, 45,
46, 48, 50, 51, 54, 56, 58, 60, 63, 65, 68, 68, 68, 68, 22, 22, 22, 21,
21, 23, 27, 31, 37, 38, 38, 38, 38, 39, 40, 40, 41, 42, 44, 45, 47, 48,
50, 52, 54, 56, 59, 61, 64, 64, 64, 64, 21, 22, 22, 22, 23, 25, 28, 32,
38, 37, 37, 37, 37, 37, 38, 38, 39, 40, 41, 42, 44, 45, 47, 49, 51, 53,
55, 57, 60, 60, 60, 60, 20, 21, 22, 24, 25, 28, 30, 34, 38, 37, 36, 36,
35, 36, 36, 36, 37, 38, 39, 40, 41, 43, 44, 46, 48, 50, 52, 54, 56, 56,
56, 56, 19, 21, 23, 25, 29, 30, 33, 35, 38, 37, 36, 35, 34, 34, 34, 35,
35, 36, 37, 38, 39, 41, 42, 44, 45, 47, 49, 51, 53, 53, 53, 53, 22, 23,
25, 28, 30, 32, 34, 37, 40, 39, 38, 37, 36, 36, 36, 37, 37, 38, 39, 40,
41, 42, 44, 45, 47, 49, 50, 52, 54, 54, 54, 54, 25, 27, 28, 30, 33, 34,
37, 39, 42, 41, 40, 39, 38, 38, 39, 39, 39, 40, 41, 42, 43, 44, 45, 47,
48, 50, 52, 54, 56, 56, 56, 56, 30, 31, 32, 34, 35, 37, 39, 41, 44, 43,
42, 42, 41, 41, 41, 41, 41, 42, 43, 44, 45, 46, 47, 49, 50, 52, 54, 55,
57, 57, 57, 57, 37, 37, 38, 38, 38, 40, 42, 44, 46, 46, 45, 45, 44, 44,
44, 44, 44, 45, 45, 46, 47, 48, 49, 51, 52, 54, 55, 57, 59, 59, 59, 59,
38, 38, 37, 37, 37, 39, 41, 43, 46, 46, 46, 46, 46, 46, 46, 46, 46, 47,
48, 48, 49, 50, 52, 53, 54, 56, 58, 59, 61, 61, 61, 61, 39, 38, 37, 36,
36, 38, 40, 42, 45, 46, 46, 47, 48, 48, 48, 48, 49, 49, 50, 51, 52, 53,
54, 55, 57, 58, 60, 62, 64, 64, 64, 64, 39, 38, 37, 36, 35, 37, 39, 42,
45, 46, 47, 48, 49, 50, 50, 51, 52, 52, 53, 54, 55, 56, 57, 58, 59, 61,
63, 64, 66, 66, 66, 66, 40, 38, 37, 35, 34, 36, 38, 41, 44, 46, 48, 49,
51, 52, 53, 54, 55, 55, 56, 57, 58, 59, 60, 61, 62, 64, 65, 67, 69, 69,
69, 69, 41, 39, 37, 36, 34, 36, 38, 41, 44, 46, 48, 50, 52, 53, 54, 55,
57, 57, 58, 59, 60, 61, 63, 64, 65, 67, 68, 70, 71, 71, 71, 71, 42, 40,
38, 36, 34, 36, 39, 41, 44, 46, 48, 50, 53, 54, 56, 57, 59, 60, 61, 62,
63, 64, 65, 67, 68, 69, 71, 73, 74, 74, 74, 74, 42, 40, 38, 36, 35, 37,
39, 41, 44, 46, 48, 51, 54, 55, 57, 59, 61, 62, 63, 64, 66, 67, 68, 70,
71, 73, 74, 76, 78, 78, 78, 78, 43, 41, 39, 37, 35, 37, 39, 41, 44, 46,
49, 52, 55, 57, 59, 61, 63, 64, 66, 67, 69, 70, 72, 73, 75, 76, 78, 79,
81, 81, 81, 81, 45, 42, 40, 38, 36, 38, 40, 42, 45, 47, 49, 52, 55, 57,
60, 62, 64, 66, 68, 69, 71, 73, 74, 76, 77, 79, 80, 82, 84, 84, 84, 84,
46, 44, 41, 39, 37, 39, 41, 43, 45, 48, 50, 53, 56, 58, 61, 63, 66, 68,
70, 71, 74, 75, 77, 78, 80, 82, 83, 85, 87, 87, 87, 87, 48, 45, 42, 40,
38, 40, 42, 44, 46, 48, 51, 54, 57, 59, 62, 64, 67, 69, 71, 74, 76, 78,
79, 81, 83, 85, 87, 89, 90, 90, 90, 90, 50, 47, 44, 41, 39, 41, 43, 45,
47, 49, 52, 55, 58, 60, 63, 66, 69, 71, 74, 76, 79, 80, 82, 84, 87, 88,
90, 92, 94, 94, 94, 94, 51, 48, 45, 43, 41, 42, 44, 46, 48, 50, 53, 56,
59, 61, 64, 67, 70, 73, 75, 78, 80, 82, 85, 87, 89, 91, 93, 95, 97, 97,
97, 97, 54, 50, 47, 44, 42, 44, 45, 47, 49, 52, 54, 57, 60, 63, 65, 68,
72, 74, 77, 79, 82, 85, 87, 89, 92, 94, 96, 98, 100, 100, 100, 100, 56,
52, 49, 46, 44, 45, 47, 49, 51, 53, 55, 58, 61, 64, 67, 70, 73, 76, 78,
81, 84, 87, 89, 92, 94, 96, 99, 101, 103, 103, 103, 103, 58, 54, 51, 48,
45, 47, 48, 50, 52, 54, 57, 59, 62, 65, 68, 71, 75, 77, 80, 83, 87, 89,
92, 94, 97, 99, 102, 104, 107, 107, 107, 107, 60, 56, 53, 50, 47, 49,
50, 52, 54, 56, 58, 61, 64, 67, 69, 73, 76, 79, 82, 85, 88, 91, 94, 96,
99, 102, 104, 107, 109, 109, 109, 109, 63, 59, 55, 52, 49, 50, 52, 54,
55, 58, 60, 63, 65, 68, 71, 74, 78, 80, 83, 87, 90, 93, 96, 99, 102,
104, 107, 109, 112, 112, 112, 112, 65, 61, 57, 54, 51, 52, 54, 55, 57,
59, 62, 64, 67, 70, 73, 76, 79, 82, 85, 89, 92, 95, 98, 101, 104, 107,
109, 112, 115, 115, 115, 115, 68, 64, 60, 56, 53, 54, 56, 57, 59, 61,
64, 66, 69, 71, 74, 78, 81, 84, 87, 90, 94, 97, 100, 103, 107, 109, 112,
115, 118, 118, 118, 118, 68, 64, 60, 56, 53, 54, 56, 57, 59, 61, 64, 66,
69, 71, 74, 78, 81, 84, 87, 90, 94, 97, 100, 103, 107, 109, 112, 115,
118, 118, 118, 118, 68, 64, 60, 56, 53, 54, 56, 57, 59, 61, 64, 66, 69,
71, 74, 78, 81, 84, 87, 90, 94, 97, 100, 103, 107, 109, 112, 115, 118,
118, 118, 118, 68, 64, 60, 56, 53, 54, 56, 57, 59, 61, 64, 66, 69, 71,
74, 78, 81, 84, 87, 90, 94, 97, 100, 103, 107, 109, 112, 115, 118, 118,
118, 118 } } },
{ { /* Luma matrices */
{ /* Inter matrices */
/* Size 4 */
64, 70, 120, 197, 70, 109, 156, 218, 120, 156, 229, 287, 197, 218, 287,
344,
/* Size 8 */
64, 47, 51, 69, 94, 126, 161, 197, 47, 55, 52, 62, 80, 105, 135, 167,
51, 52, 75, 88, 105, 127, 154, 183, 69, 62, 88, 115, 136, 157, 181, 207,
94, 80, 105, 136, 165, 189, 212, 234, 126, 105, 127, 157, 189, 216, 240,
261, 161, 135, 154, 181, 212, 240, 264, 284, 197, 167, 183, 207, 234,
261, 284, 303,
/* Size 16 */
64, 54, 47, 49, 51, 59, 69, 80, 94, 108, 126, 141, 161, 177, 197, 197,
54, 53, 51, 51, 52, 58, 65, 74, 87, 99, 115, 129, 147, 162, 181, 181,
47, 51, 55, 53, 52, 57, 62, 70, 80, 91, 105, 118, 135, 149, 167, 167,
49, 51, 53, 57, 62, 67, 73, 81, 91, 102, 115, 128, 144, 158, 175, 175,
51, 52, 52, 62, 75, 81, 88, 96, 105, 115, 127, 139, 154, 167, 183, 183,
59, 58, 57, 67, 81, 89, 100, 108, 118, 128, 140, 152, 166, 179, 195,
195, 69, 65, 62, 73, 88, 100, 115, 124, 136, 146, 157, 168, 181, 193,
207, 207, 80, 74, 70, 81, 96, 108, 124, 136, 149, 159, 172, 183, 195,
207, 220, 220, 94, 87, 80, 91, 105, 118, 136, 149, 165, 176, 189, 200,
212, 222, 234, 234, 108, 99, 91, 102, 115, 128, 146, 159, 176, 188, 202,
213, 225, 235, 247, 247, 126, 115, 105, 115, 127, 140, 157, 172, 189,
202, 216, 228, 240, 250, 261, 261, 141, 129, 118, 128, 139, 152, 168,
183, 200, 213, 228, 239, 251, 261, 272, 272, 161, 147, 135, 144, 154,
166, 181, 195, 212, 225, 240, 251, 264, 273, 284, 284, 177, 162, 149,
158, 167, 179, 193, 207, 222, 235, 250, 261, 273, 283, 293, 293, 197,
181, 167, 175, 183, 195, 207, 220, 234, 247, 261, 272, 284, 293, 303,
303, 197, 181, 167, 175, 183, 195, 207, 220, 234, 247, 261, 272, 284,
293, 303, 303,
/* Size 32 */
64, 59, 54, 51, 47, 48, 49, 50, 51, 55, 59, 64, 69, 74, 80, 86, 94, 101,
108, 116, 126, 133, 141, 150, 161, 169, 177, 186, 197, 197, 197, 197,
59, 56, 54, 51, 49, 50, 50, 51, 52, 55, 58, 62, 67, 72, 77, 83, 90, 96,
103, 111, 120, 127, 135, 143, 153, 161, 169, 178, 189, 189, 189, 189,
54, 54, 53, 52, 51, 51, 51, 52, 52, 55, 58, 61, 65, 69, 74, 80, 87, 92,
99, 106, 115, 121, 129, 137, 147, 154, 162, 171, 181, 181, 181, 181, 51,
51, 52, 52, 53, 53, 52, 52, 52, 55, 57, 60, 63, 67, 72, 77, 83, 89, 95,
102, 110, 116, 123, 131, 141, 148, 155, 164, 174, 174, 174, 174, 47, 49,
51, 53, 55, 54, 53, 53, 52, 54, 57, 59, 62, 66, 70, 75, 80, 85, 91, 98,
105, 111, 118, 126, 135, 142, 149, 158, 167, 167, 167, 167, 48, 50, 51,
53, 54, 55, 55, 56, 57, 59, 61, 64, 67, 71, 75, 80, 85, 90, 96, 102,
110, 116, 123, 130, 139, 146, 153, 162, 171, 171, 171, 171, 49, 50, 51,
52, 53, 55, 57, 59, 62, 64, 67, 70, 73, 77, 81, 86, 91, 96, 102, 108,
115, 121, 128, 135, 144, 150, 158, 166, 175, 175, 175, 175, 50, 51, 52,
52, 53, 56, 59, 63, 68, 70, 73, 76, 80, 84, 88, 92, 97, 102, 108, 114,
121, 127, 133, 140, 148, 155, 162, 170, 179, 179, 179, 179, 51, 52, 52,
52, 52, 57, 62, 68, 75, 78, 81, 84, 88, 92, 96, 100, 105, 109, 115, 120,
127, 133, 139, 146, 154, 160, 167, 175, 183, 183, 183, 183, 55, 55, 55,
55, 54, 59, 64, 70, 78, 81, 85, 89, 94, 98, 102, 106, 111, 116, 121,
127, 133, 139, 145, 152, 160, 166, 173, 181, 189, 189, 189, 189, 59, 58,
58, 57, 57, 61, 67, 73, 81, 85, 89, 94, 100, 104, 108, 113, 118, 123,
128, 134, 140, 146, 152, 159, 166, 173, 179, 187, 195, 195, 195, 195,
64, 62, 61, 60, 59, 64, 70, 76, 84, 89, 94, 100, 107, 111, 116, 121,
126, 131, 137, 142, 148, 154, 160, 166, 173, 180, 186, 193, 201, 201,
201, 201, 69, 67, 65, 63, 62, 67, 73, 80, 88, 94, 100, 107, 115, 119,
124, 130, 136, 141, 146, 151, 157, 163, 168, 175, 181, 187, 193, 200,
207, 207, 207, 207, 74, 72, 69, 67, 66, 71, 77, 84, 92, 98, 104, 111,
119, 124, 130, 136, 142, 147, 152, 158, 164, 170, 175, 181, 188, 194,
200, 206, 213, 213, 213, 213, 80, 77, 74, 72, 70, 75, 81, 88, 96, 102,
108, 116, 124, 130, 136, 142, 149, 154, 159, 165, 172, 177, 183, 189,
195, 201, 207, 213, 220, 220, 220, 220, 86, 83, 80, 77, 75, 80, 86, 92,
100, 106, 113, 121, 130, 136, 142, 149, 156, 162, 167, 173, 180, 185,
191, 197, 203, 209, 214, 220, 227, 227, 227, 227, 94, 90, 87, 83, 80,
85, 91, 97, 105, 111, 118, 126, 136, 142, 149, 156, 165, 170, 176, 182,
189, 194, 200, 205, 212, 217, 222, 228, 234, 234, 234, 234, 101, 96, 92,
89, 85, 90, 96, 102, 109, 116, 123, 131, 141, 147, 154, 162, 170, 176,
182, 188, 195, 200, 206, 212, 218, 223, 229, 234, 240, 240, 240, 240,
108, 103, 99, 95, 91, 96, 102, 108, 115, 121, 128, 137, 146, 152, 159,
167, 176, 182, 188, 195, 202, 207, 213, 219, 225, 230, 235, 241, 247,
247, 247, 247, 116, 111, 106, 102, 98, 102, 108, 114, 120, 127, 134,
142, 151, 158, 165, 173, 182, 188, 195, 201, 209, 214, 220, 226, 232,
237, 242, 248, 254, 254, 254, 254, 126, 120, 115, 110, 105, 110, 115,
121, 127, 133, 140, 148, 157, 164, 172, 180, 189, 195, 202, 209, 216,
222, 228, 234, 240, 245, 250, 255, 261, 261, 261, 261, 133, 127, 121,
116, 111, 116, 121, 127, 133, 139, 146, 154, 163, 170, 177, 185, 194,
200, 207, 214, 222, 227, 233, 239, 245, 250, 255, 261, 266, 266, 266,
266, 141, 135, 129, 123, 118, 123, 128, 133, 139, 145, 152, 160, 168,
175, 183, 191, 200, 206, 213, 220, 228, 233, 239, 245, 251, 256, 261,
266, 272, 272, 272, 272, 150, 143, 137, 131, 126, 130, 135, 140, 146,
152, 159, 166, 175, 181, 189, 197, 205, 212, 219, 226, 234, 239, 245,
251, 257, 262, 267, 272, 278, 278, 278, 278, 161, 153, 147, 141, 135,
139, 144, 148, 154, 160, 166, 173, 181, 188, 195, 203, 212, 218, 225,
232, 240, 245, 251, 257, 264, 268, 273, 278, 284, 284, 284, 284, 169,
161, 154, 148, 142, 146, 150, 155, 160, 166, 173, 180, 187, 194, 201,
209, 217, 223, 230, 237, 245, 250, 256, 262, 268, 273, 278, 283, 288,
288, 288, 288, 177, 169, 162, 155, 149, 153, 158, 162, 167, 173, 179,
186, 193, 200, 207, 214, 222, 229, 235, 242, 250, 255, 261, 267, 273,
278, 283, 288, 293, 293, 293, 293, 186, 178, 171, 164, 158, 162, 166,
170, 175, 181, 187, 193, 200, 206, 213, 220, 228, 234, 241, 248, 255,
261, 266, 272, 278, 283, 288, 293, 298, 298, 298, 298, 197, 189, 181,
174, 167, 171, 175, 179, 183, 189, 195, 201, 207, 213, 220, 227, 234,
240, 247, 254, 261, 266, 272, 278, 284, 288, 293, 298, 303, 303, 303,
303, 197, 189, 181, 174, 167, 171, 175, 179, 183, 189, 195, 201, 207,
213, 220, 227, 234, 240, 247, 254, 261, 266, 272, 278, 284, 288, 293,
298, 303, 303, 303, 303, 197, 189, 181, 174, 167, 171, 175, 179, 183,
189, 195, 201, 207, 213, 220, 227, 234, 240, 247, 254, 261, 266, 272,
278, 284, 288, 293, 298, 303, 303, 303, 303, 197, 189, 181, 174, 167,
171, 175, 179, 183, 189, 195, 201, 207, 213, 220, 227, 234, 240, 247,
254, 261, 266, 272, 278, 284, 288, 293, 298, 303, 303, 303, 303 },
{ /* Intra matrices */
/* Size 4 */
19, 21, 37, 63, 21, 33, 49, 70, 37, 49, 74, 96, 63, 70, 96, 119,
/* Size 8 */
23, 17, 18, 25, 34, 47, 61, 77, 17, 19, 18, 22, 29, 38, 50, 64, 18, 18,
27, 32, 38, 47, 58, 71, 25, 22, 32, 42, 51, 60, 70, 81, 34, 29, 38, 51,
63, 73, 83, 94, 47, 38, 47, 60, 73, 85, 96, 106, 61, 50, 58, 70, 83, 96,
108, 118, 77, 64, 71, 81, 94, 106, 118, 127,
/* Size 16 */
22, 18, 16, 17, 17, 20, 23, 27, 33, 38, 45, 51, 58, 65, 73, 73, 18, 18,
17, 17, 18, 20, 22, 25, 30, 34, 40, 46, 53, 59, 67, 67, 16, 17, 19, 18,
18, 19, 21, 24, 28, 32, 37, 42, 48, 54, 61, 61, 17, 17, 18, 19, 21, 23,
25, 28, 31, 35, 40, 45, 52, 57, 64, 64, 17, 18, 18, 21, 26, 28, 31, 33,
37, 40, 45, 50, 55, 61, 68, 68, 20, 20, 19, 23, 28, 31, 35, 38, 42, 46,
50, 55, 61, 66, 72, 72, 23, 22, 21, 25, 31, 35, 40, 44, 48, 52, 57, 61,
67, 72, 78, 78, 27, 25, 24, 28, 33, 38, 44, 48, 54, 58, 63, 67, 73, 78,
83, 83, 33, 30, 28, 31, 37, 42, 48, 54, 60, 64, 70, 74, 80, 84, 90, 90,
38, 34, 32, 35, 40, 46, 52, 58, 64, 69, 75, 80, 85, 90, 95, 95, 45, 40,
37, 40, 45, 50, 57, 63, 70, 75, 82, 87, 92, 97, 102, 102, 51, 46, 42,
45, 50, 55, 61, 67, 74, 80, 87, 92, 97, 102, 107, 107, 58, 53, 48, 52,
55, 61, 67, 73, 80, 85, 92, 97, 103, 107, 112, 112, 65, 59, 54, 57, 61,
66, 72, 78, 84, 90, 97, 102, 107, 112, 117, 117, 73, 67, 61, 64, 68, 72,
78, 83, 90, 95, 102, 107, 112, 117, 122, 122, 73, 67, 61, 64, 68, 72,
78, 83, 90, 95, 102, 107, 112, 117, 122, 122,
/* Size 32 */
21, 19, 18, 17, 16, 16, 16, 17, 17, 18, 20, 21, 23, 25, 27, 29, 32, 34,
37, 40, 44, 46, 49, 53, 57, 60, 63, 67, 72, 72, 72, 72, 19, 19, 18, 17,
16, 16, 17, 17, 17, 18, 19, 21, 22, 24, 26, 28, 31, 33, 35, 38, 41, 44,
47, 50, 54, 57, 60, 64, 68, 68, 68, 68, 18, 18, 17, 17, 17, 17, 17, 17,
17, 18, 19, 20, 22, 23, 25, 27, 29, 31, 34, 36, 39, 42, 45, 48, 52, 54,
57, 61, 65, 65, 65, 65, 17, 17, 17, 17, 17, 17, 17, 17, 17, 18, 19, 20,
21, 22, 24, 26, 28, 30, 32, 35, 38, 40, 43, 46, 49, 52, 55, 58, 62, 62,
62, 62, 16, 16, 17, 17, 18, 18, 18, 17, 17, 18, 19, 20, 21, 22, 23, 25,
27, 29, 31, 33, 36, 38, 41, 44, 47, 50, 53, 56, 60, 60, 60, 60, 16, 16,
17, 17, 18, 18, 18, 18, 19, 19, 20, 21, 22, 24, 25, 27, 29, 31, 33, 35,
38, 40, 42, 45, 49, 51, 54, 57, 61, 61, 61, 61, 16, 17, 17, 17, 18, 18,
19, 20, 20, 21, 22, 23, 24, 26, 27, 29, 31, 33, 35, 37, 40, 42, 44, 47,
50, 53, 56, 59, 63, 63, 63, 63, 17, 17, 17, 17, 17, 18, 20, 21, 22, 23,
24, 26, 27, 28, 30, 31, 33, 35, 37, 39, 42, 44, 46, 49, 52, 55, 58, 61,
64, 64, 64, 64, 17, 17, 17, 17, 17, 19, 20, 22, 25, 26, 27, 28, 30, 31,
32, 34, 36, 37, 39, 42, 44, 46, 49, 51, 54, 57, 60, 63, 66, 66, 66, 66,
18, 18, 18, 18, 18, 19, 21, 23, 26, 27, 29, 30, 32, 33, 35, 36, 38, 40,
42, 44, 46, 49, 51, 54, 57, 59, 62, 65, 68, 68, 68, 68, 20, 19, 19, 19,
19, 20, 22, 24, 27, 29, 30, 32, 34, 35, 37, 39, 41, 43, 45, 47, 49, 51,
54, 56, 59, 62, 64, 67, 71, 71, 71, 71, 21, 21, 20, 20, 20, 21, 23, 26,
28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 57, 59, 62, 64,
67, 70, 73, 73, 73, 73, 23, 22, 22, 21, 21, 22, 24, 27, 30, 32, 34, 36,
39, 41, 43, 45, 47, 49, 51, 53, 56, 58, 60, 62, 65, 68, 70, 73, 76, 76,
76, 76, 25, 24, 23, 22, 22, 24, 26, 28, 31, 33, 35, 38, 41, 43, 45, 47,
50, 52, 54, 56, 58, 60, 63, 65, 68, 70, 73, 76, 78, 78, 78, 78, 27, 26,
25, 24, 23, 25, 27, 30, 32, 35, 37, 40, 43, 45, 47, 50, 52, 54, 56, 59,
61, 63, 66, 68, 71, 73, 76, 78, 81, 81, 81, 81, 29, 28, 27, 26, 25, 27,
29, 31, 34, 36, 39, 42, 45, 47, 50, 52, 55, 57, 60, 62, 65, 67, 69, 72,
74, 76, 79, 82, 84, 84, 84, 84, 32, 31, 29, 28, 27, 29, 31, 33, 36, 38,
41, 44, 47, 50, 52, 55, 58, 61, 63, 66, 68, 70, 73, 75, 78, 80, 82, 85,
88, 88, 88, 88, 34, 33, 31, 30, 29, 31, 33, 35, 37, 40, 43, 46, 49, 52,
54, 57, 61, 63, 65, 68, 71, 73, 75, 78, 80, 83, 85, 88, 90, 90, 90, 90,
37, 35, 34, 32, 31, 33, 35, 37, 39, 42, 45, 48, 51, 54, 56, 60, 63, 65,
68, 71, 74, 76, 78, 81, 83, 86, 88, 90, 93, 93, 93, 93, 40, 38, 36, 35,
33, 35, 37, 39, 42, 44, 47, 50, 53, 56, 59, 62, 66, 68, 71, 73, 77, 79,
81, 84, 87, 89, 91, 93, 96, 96, 96, 96, 44, 41, 39, 38, 36, 38, 40, 42,
44, 46, 49, 52, 56, 58, 61, 65, 68, 71, 74, 77, 80, 82, 85, 87, 90, 92,
94, 97, 99, 99, 99, 99, 46, 44, 42, 40, 38, 40, 42, 44, 46, 49, 51, 54,
58, 60, 63, 67, 70, 73, 76, 79, 82, 84, 87, 90, 92, 95, 97, 99, 102,
102, 102, 102, 49, 47, 45, 43, 41, 42, 44, 46, 49, 51, 54, 57, 60, 63,
66, 69, 73, 75, 78, 81, 85, 87, 89, 92, 95, 97, 99, 102, 104, 104, 104,
104, 53, 50, 48, 46, 44, 45, 47, 49, 51, 54, 56, 59, 62, 65, 68, 72, 75,
78, 81, 84, 87, 90, 92, 95, 98, 100, 102, 105, 107, 107, 107, 107, 57,
54, 52, 49, 47, 49, 50, 52, 54, 57, 59, 62, 65, 68, 71, 74, 78, 80, 83,
87, 90, 92, 95, 98, 101, 103, 105, 107, 110, 110, 110, 110, 60, 57, 54,
52, 50, 51, 53, 55, 57, 59, 62, 64, 68, 70, 73, 76, 80, 83, 86, 89, 92,
95, 97, 100, 103, 105, 107, 110, 112, 112, 112, 112, 63, 60, 57, 55, 53,
54, 56, 58, 60, 62, 64, 67, 70, 73, 76, 79, 82, 85, 88, 91, 94, 97, 99,
102, 105, 107, 109, 112, 114, 114, 114, 114, 67, 64, 61, 58, 56, 57, 59,
61, 63, 65, 67, 70, 73, 76, 78, 82, 85, 88, 90, 93, 97, 99, 102, 105,
107, 110, 112, 114, 117, 117, 117, 117, 72, 68, 65, 62, 60, 61, 63, 64,
66, 68, 71, 73, 76, 78, 81, 84, 88, 90, 93, 96, 99, 102, 104, 107, 110,
112, 114, 117, 119, 119, 119, 119, 72, 68, 65, 62, 60, 61, 63, 64, 66,
68, 71, 73, 76, 78, 81, 84, 88, 90, 93, 96, 99, 102, 104, 107, 110, 112,
114, 117, 119, 119, 119, 119, 72, 68, 65, 62, 60, 61, 63, 64, 66, 68,
71, 73, 76, 78, 81, 84, 88, 90, 93, 96, 99, 102, 104, 107, 110, 112,
114, 117, 119, 119, 119, 119, 72, 68, 65, 62, 60, 61, 63, 64, 66, 68,
71, 73, 76, 78, 81, 84, 88, 90, 93, 96, 99, 102, 104, 107, 110, 112,
114, 117, 119, 119, 119, 119 } },
{ /* Chroma matrices */
{ /* Inter matrices */
/* Size 4 */
64, 104, 114, 146, 104, 126, 136, 158, 114, 136, 178, 207, 146, 158,
207, 250,
/* Size 8 */
64, 51, 96, 102, 109, 123, 141, 161, 51, 75, 98, 88, 91, 100, 114, 131,
96, 98, 116, 111, 111, 117, 128, 143, 102, 88, 111, 127, 134, 140, 150,
163, 109, 91, 111, 134, 151, 163, 174, 186, 123, 100, 117, 140, 163,
181, 196, 209, 141, 114, 128, 150, 174, 196, 214, 230, 161, 131, 143,
163, 186, 209, 230, 248,
/* Size 16 */
64, 57, 51, 67, 96, 99, 102, 106, 109, 116, 123, 132, 141, 151, 161,
161, 57, 59, 61, 75, 97, 96, 94, 97, 99, 105, 111, 118, 126, 135, 144,
144, 51, 61, 75, 85, 98, 92, 88, 89, 91, 95, 100, 107, 114, 122, 131,
131, 67, 75, 85, 94, 106, 102, 98, 99, 100, 104, 108, 114, 121, 128,
137, 137, 96, 97, 98, 106, 116, 113, 111, 111, 111, 114, 117, 123, 128,
135, 143, 143, 99, 96, 92, 102, 113, 116, 119, 120, 121, 125, 128, 133,
138, 145, 152, 152, 102, 94, 88, 98, 111, 119, 127, 131, 134, 137, 140,
145, 150, 156, 163, 163, 106, 97, 89, 99, 111, 120, 131, 136, 142, 146,
151, 156, 161, 167, 173, 173, 109, 99, 91, 100, 111, 121, 134, 142, 151,
157, 163, 168, 174, 179, 186, 186, 116, 105, 95, 104, 114, 125, 137,
146, 157, 164, 172, 178, 184, 190, 196, 196, 123, 111, 100, 108, 117,
128, 140, 151, 163, 172, 181, 188, 196, 202, 209, 209, 132, 118, 107,
114, 123, 133, 145, 156, 168, 178, 188, 196, 205, 211, 219, 219, 141,
126, 114, 121, 128, 138, 150, 161, 174, 184, 196, 205, 214, 222, 230,
230, 151, 135, 122, 128, 135, 145, 156, 167, 179, 190, 202, 211, 222,
230, 238, 238, 161, 144, 131, 137, 143, 152, 163, 173, 186, 196, 209,
219, 230, 238, 248, 248, 161, 144, 131, 137, 143, 152, 163, 173, 186,
196, 209, 219, 230, 238, 248, 248,
/* Size 32 */
64, 60, 57, 54, 51, 58, 67, 79, 96, 97, 99, 100, 102, 104, 106, 107,
109, 113, 116, 120, 123, 127, 132, 136, 141, 146, 151, 156, 161, 161,
161, 161, 60, 59, 58, 57, 56, 62, 70, 81, 96, 97, 97, 98, 98, 99, 101,
102, 104, 107, 110, 113, 117, 120, 124, 129, 133, 137, 142, 147, 152,
152, 152, 152, 57, 58, 59, 60, 61, 67, 75, 84, 97, 96, 96, 95, 94, 96,
97, 98, 99, 102, 105, 107, 111, 114, 118, 122, 126, 130, 135, 139, 144,
144, 144, 144, 54, 57, 60, 63, 67, 73, 79, 87, 97, 96, 94, 92, 91, 92,
93, 94, 95, 97, 100, 102, 105, 108, 112, 116, 120, 124, 128, 132, 137,
137, 137, 137, 51, 56, 61, 67, 75, 80, 85, 91, 98, 95, 92, 90, 88, 89,
89, 90, 91, 93, 95, 98, 100, 103, 107, 110, 114, 118, 122, 126, 131,
131, 131, 131, 58, 62, 67, 73, 80, 84, 89, 95, 102, 99, 97, 95, 93, 93,
94, 94, 95, 97, 99, 102, 104, 107, 110, 114, 117, 121, 125, 129, 134,
134, 134, 134, 67, 70, 75, 79, 85, 89, 94, 100, 106, 104, 102, 100, 98,
99, 99, 99, 100, 102, 104, 106, 108, 111, 114, 117, 121, 124, 128, 132,
137, 137, 137, 137, 79, 81, 84, 87, 91, 95, 100, 105, 110, 109, 107,
106, 104, 105, 105, 105, 105, 107, 109, 111, 112, 115, 118, 121, 125,
128, 132, 136, 140, 140, 140, 140, 96, 96, 97, 97, 98, 102, 106, 110,
116, 114, 113, 112, 111, 111, 111, 111, 111, 112, 114, 116, 117, 120,
123, 125, 128, 132, 135, 139, 143, 143, 143, 143, 97, 97, 96, 96, 95,
99, 104, 109, 114, 115, 115, 115, 115, 115, 115, 116, 116, 117, 119,
121, 122, 125, 128, 130, 133, 137, 140, 144, 148, 148, 148, 148, 99, 97,
96, 94, 92, 97, 102, 107, 113, 115, 116, 117, 119, 119, 120, 121, 121,
123, 125, 126, 128, 130, 133, 136, 138, 142, 145, 149, 152, 152, 152,
152, 100, 98, 95, 92, 90, 95, 100, 106, 112, 115, 117, 120, 123, 124,
125, 126, 127, 129, 131, 132, 134, 136, 139, 141, 144, 147, 150, 154,
157, 157, 157, 157, 102, 98, 94, 91, 88, 93, 98, 104, 111, 115, 119,
123, 127, 129, 131, 132, 134, 136, 137, 139, 140, 143, 145, 147, 150,
153, 156, 159, 163, 163, 163, 163, 104, 99, 96, 92, 89, 93, 99, 105,
111, 115, 119, 124, 129, 131, 133, 136, 138, 140, 142, 144, 146, 148,
150, 153, 155, 158, 161, 164, 168, 168, 168, 168, 106, 101, 97, 93, 89,
94, 99, 105, 111, 115, 120, 125, 131, 133, 136, 139, 142, 144, 146, 149,
151, 153, 156, 158, 161, 164, 167, 170, 173, 173, 173, 173, 107, 102,
98, 94, 90, 94, 99, 105, 111, 116, 121, 126, 132, 136, 139, 143, 147,
149, 151, 154, 157, 159, 162, 164, 167, 170, 173, 176, 179, 179, 179,
179, 109, 104, 99, 95, 91, 95, 100, 105, 111, 116, 121, 127, 134, 138,
142, 147, 151, 154, 157, 160, 163, 166, 168, 171, 174, 177, 179, 182,
186, 186, 186, 186, 113, 107, 102, 97, 93, 97, 102, 107, 112, 117, 123,
129, 136, 140, 144, 149, 154, 157, 160, 164, 167, 170, 173, 176, 179,
182, 185, 188, 191, 191, 191, 191, 116, 110, 105, 100, 95, 99, 104, 109,
114, 119, 125, 131, 137, 142, 146, 151, 157, 160, 164, 168, 172, 175,
178, 181, 184, 187, 190, 193, 196, 196, 196, 196, 120, 113, 107, 102,
98, 102,