blob: 9f5c09a505a2f87cdceee04afc60c332714ef9d0 [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 "aom_mem/aom_mem.h"
#include "av1/common/reconinter.h"
#include "av1/common/scan.h"
#include "av1/common/onyxc_int.h"
#include "av1/common/seg_common.h"
#if CONFIG_LV_MAP
const aom_prob default_txb_skip[TX_SIZES][TXB_SKIP_CONTEXTS] = {
#if CONFIG_CHROMA_2X2
{ 252, 71, 126, 184, 178, 218, 251, 49, 133, 221, 27, 92, 197 },
#endif
{ 252, 71, 126, 184, 178, 218, 251, 49, 133, 221, 27, 92, 197 },
{ 252, 71, 126, 184, 178, 218, 251, 49, 133, 221, 27, 92, 197 },
{ 252, 71, 126, 184, 178, 218, 251, 49, 133, 221, 27, 92, 197 },
{ 252, 71, 126, 184, 178, 218, 251, 49, 133, 221, 27, 92, 197 },
};
const aom_prob default_dc_sign[PLANE_TYPES][DC_SIGN_CONTEXTS] = {
{ 125, 102, 147 }, { 119, 101, 135 },
};
const aom_prob default_coeff_base
[TX_SIZES][PLANE_TYPES][NUM_BASE_LEVELS][COEFF_BASE_CONTEXTS] = {
#if CONFIG_CHROMA_2X2
{ // TX_2X2
{
{ 73, 128, 131, 204, 165, 226, 169, 236, 18, 128, 51,
153, 97, 179, 123, 201, 145, 226, 20, 128, 59, 153,
107, 181, 129, 201, 142, 226, 3, 128, 19, 99, 46,
135, 92, 166, 129, 190, 157, 217, 128, 128 },
{ 128, 128, 178, 218, 192, 236, 186, 243, 55, 128, 110,
183, 151, 205, 168, 221, 180, 238, 65, 128, 116, 178,
157, 206, 172, 222, 183, 238, 24, 128, 65, 127, 104,
164, 154, 195, 187, 216, 205, 230, 128, 128 },
},
{
{ 73, 128, 131, 204, 165, 226, 169, 236, 18, 128, 51,
153, 97, 179, 123, 201, 145, 226, 20, 128, 59, 153,
107, 181, 129, 201, 142, 226, 3, 128, 19, 99, 46,
135, 92, 166, 129, 190, 157, 217, 128, 128 },
{ 128, 128, 178, 218, 192, 236, 186, 243, 55, 128, 110,
183, 151, 205, 168, 221, 180, 238, 65, 128, 116, 178,
157, 206, 172, 222, 183, 238, 24, 128, 65, 127, 104,
164, 154, 195, 187, 216, 205, 230, 128, 128 },
} },
#endif
{ // TX_4X4
{
// PLANE_Y
{ 73, 128, 131, 204, 165, 226, 169, 236, 18, 128, 51,
153, 97, 179, 123, 201, 145, 226, 20, 128, 59, 153,
107, 181, 129, 201, 142, 226, 3, 128, 19, 99, 46,
135, 92, 166, 129, 190, 157, 217, 128, 128 },
{ 128, 128, 178, 218, 192, 236, 186, 243, 55, 128, 110,
183, 151, 205, 168, 221, 180, 238, 65, 128, 116, 178,
157, 206, 172, 222, 183, 238, 24, 128, 65, 127, 104,
164, 154, 195, 187, 216, 205, 230, 128, 128 },
},
{
// PLANE_UV
{ 47, 128, 100, 176, 140, 207, 150, 223, 11, 128, 35,
133, 79, 165, 115, 186, 129, 210, 8, 128, 30, 114,
80, 159, 116, 187, 146, 214, 2, 128, 9, 59, 28,
86, 71, 131, 117, 165, 149, 188, 128, 128 },
{ 83, 128, 152, 205, 168, 227, 192, 238, 42, 128, 92,
169, 138, 193, 165, 209, 128, 206, 36, 128, 86, 159,
141, 198, 181, 213, 102, 223, 18, 128, 50, 132, 90,
144, 141, 169, 180, 191, 128, 217, 128, 128 },
} },
{
// TX_8X8
{
// PLANE_Y
{ 82, 128, 143, 203, 177, 225, 186, 237, 7, 128, 37,
109, 78, 151, 110, 182, 139, 213, 25, 128, 51, 115,
86, 146, 111, 175, 125, 205, 3, 128, 12, 55, 32,
78, 63, 111, 96, 148, 123, 185, 146, 206 },
{ 136, 128, 182, 220, 201, 236, 205, 243, 46, 128, 101,
164, 147, 194, 170, 218, 177, 234, 62, 128, 104, 146,
143, 183, 165, 207, 183, 228, 30, 128, 60, 95, 95,
128, 135, 163, 166, 196, 175, 219, 192, 231 },
},
{
// PLANE_UV
{ 47, 128, 112, 189, 164, 202, 163, 218, 8, 128, 32,
110, 68, 151, 102, 179, 134, 195, 5, 128, 22, 76,
54, 103, 80, 146, 101, 182, 1, 128, 5, 39, 17,
53, 46, 93, 79, 127, 112, 161, 64, 195 },
{ 90, 128, 156, 210, 183, 225, 128, 236, 39, 128, 98,
164, 146, 201, 209, 219, 171, 208, 32, 128, 68, 123,
119, 169, 154, 184, 128, 213, 15, 128, 38, 111, 83,
112, 120, 163, 180, 170, 154, 213, 128, 205 },
},
},
{
// TX_16X16
{
// PLANE_Y
{ 96, 128, 169, 218, 208, 233, 187, 244, 10, 128, 34,
101, 82, 153, 113, 184, 137, 212, 6, 128, 34, 104,
81, 145, 109, 176, 147, 202, 1, 128, 3, 43, 15,
53, 43, 89, 79, 129, 108, 168, 110, 194 },
{ 156, 128, 206, 232, 218, 240, 128, 251, 39, 128, 108,
161, 156, 202, 187, 216, 179, 234, 40, 128, 103, 152,
144, 185, 159, 208, 205, 227, 14, 128, 39, 84, 76,
110, 121, 151, 157, 187, 201, 206, 64, 216 },
},
{
// PLANE_UV
{ 42, 128, 139, 211, 180, 230, 199, 238, 3, 128, 32,
96, 69, 145, 102, 186, 117, 212, 4, 128, 25, 72,
55, 111, 81, 159, 116, 198, 1, 128, 4, 22, 16,
34, 35, 68, 63, 116, 89, 165, 102, 199 },
{ 135, 128, 193, 227, 182, 239, 128, 246, 42, 128, 115,
156, 146, 203, 188, 216, 128, 229, 32, 128, 82, 127,
120, 178, 165, 203, 213, 229, 11, 128, 32, 73, 79,
111, 129, 158, 162, 187, 156, 209, 85, 222 },
},
},
{
// TX_32X32
{
// PLANE_Y
{ 97, 128, 163, 232, 191, 246, 219, 252, 3, 128, 41,
108, 91, 147, 104, 183, 118, 225, 6, 128, 45, 91,
83, 125, 92, 160, 99, 215, 1, 128, 11, 36, 28,
46, 43, 59, 57, 86, 73, 145, 91, 210 },
{ 127, 128, 201, 239, 247, 248, 128, 254, 40, 128, 103,
152, 158, 199, 186, 225, 181, 242, 38, 128, 92, 112,
146, 189, 162, 217, 112, 239, 17, 128, 30, 47, 63,
89, 113, 146, 147, 187, 168, 217, 150, 233 },
},
{
// PLANE_UV
{ 65, 128, 155, 223, 166, 235, 154, 244, 15, 128, 57,
154, 110, 199, 159, 224, 149, 239, 9, 128, 57, 140,
97, 185, 148, 218, 176, 236, 1, 128, 3, 43, 19,
42, 64, 98, 117, 167, 154, 199, 128, 158 },
{ 130, 128, 189, 231, 171, 247, 128, 246, 63, 128, 132,
222, 186, 224, 199, 244, 128, 247, 55, 128, 113, 211,
164, 230, 225, 243, 128, 239, 7, 128, 31, 102, 106,
138, 147, 183, 171, 223, 171, 224, 128, 128 },
},
},
};
const aom_prob default_nz_map[TX_SIZES][PLANE_TYPES][SIG_COEF_CONTEXTS] = {
#if CONFIG_CHROMA_2X2
{
{ 34, 103, 61, 106, 62, 160, 112, 54, 173, 121,
75, 157, 92, 75, 157, 129, 94, 65, 52, 37 },
{ 52, 124, 84, 136, 107, 197, 161, 82, 183, 151,
109, 153, 140, 103, 152, 134, 109, 81, 69, 50 },
},
#endif
{
{ 34, 103, 61, 106, 62, 160, 112, 54, 173, 121,
75, 157, 92, 75, 157, 129, 94, 65, 52, 37 },
{ 52, 124, 84, 136, 107, 197, 161, 82, 183, 151,
109, 153, 140, 103, 152, 134, 109, 81, 69, 50 },
},
{
{ 34, 127, 74, 124, 74, 204, 153, 76, 226, 162,
92, 207, 126, 91, 227, 192, 149, 108, 85, 55 },
{ 43, 136, 115, 158, 130, 212, 187, 112, 231, 180,
130, 202, 164, 130, 236, 204, 168, 139, 112, 114 },
},
{
{ 25, 117, 70, 120, 77, 215, 171, 102, 234, 156,
105, 235, 155, 109, 247, 220, 176, 127, 92, 72 },
{ 24, 88, 49, 100, 62, 202, 148, 62, 237, 178,
102, 233, 168, 105, 244, 198, 162, 127, 103, 71 },
},
{
{ 11, 54, 17, 69, 26, 128, 125, 56, 232, 130,
60, 237, 121, 66, 250, 168, 134, 114, 93, 53 },
{ 21, 52, 32, 95, 64, 171, 152, 70, 247, 159,
81, 252, 177, 100, 252, 221, 192, 143, 195, 146 },
},
};
const aom_prob default_eob_flag[TX_SIZES][PLANE_TYPES][EOB_COEF_CONTEXTS] = {
#if CONFIG_CHROMA_2X2
{
{ 229, 236, 231, 222, 239, 236, 214, 201, 236, 226, 195, 134, 228,
210, 150, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128 },
{ 182, 186, 172, 176, 207, 213, 152, 122, 187, 171, 131, 65, 170,
134, 101, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128 },
},
#endif
{
{ 229, 236, 231, 222, 239, 236, 214, 201, 236, 226, 195, 134, 228,
210, 150, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128 },
{ 182, 186, 172, 176, 207, 213, 152, 122, 187, 171, 131, 65, 170,
134, 101, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128 },
},
{
{ 225, 234, 244, 236, 205, 242, 246, 247, 246, 234, 191, 242, 237,
215, 142, 224, 206, 142, 73, 128, 128, 128, 128, 128, 128 },
{ 154, 171, 187, 175, 62, 199, 202, 206, 215, 200, 111, 197, 199,
174, 100, 135, 105, 104, 45, 128, 128, 128, 128, 128, 128 },
},
{
{ 180, 213, 216, 229, 233, 232, 240, 235, 220, 178, 239, 238, 225,
187, 229, 214, 226, 200, 183, 141, 158, 179, 128, 128, 128 },
{ 190, 225, 234, 248, 249, 248, 253, 251, 232, 110, 254, 252, 236,
57, 253, 248, 232, 85, 244, 189, 112, 64, 128, 128, 128 },
},
{
{ 248, 224, 246, 244, 239, 245, 251, 246, 251, 255, 255, 255, 249,
255, 255, 255, 229, 255, 255, 255, 228, 255, 255, 247, 137 },
{ 204, 207, 233, 215, 193, 228, 239, 221, 227, 250, 236, 207, 135,
236, 186, 182, 57, 209, 140, 128, 85, 184, 110, 128, 128 },
},
};
const aom_prob default_coeff_lps[TX_SIZES][PLANE_TYPES][LEVEL_CONTEXTS] = {
#if CONFIG_CHROMA_2X2
{
{ 164, 128, 134, 165, 128, 137, 168, 128, 97, 136, 167, 128,
182, 205, 143, 172, 200, 145, 173, 193, 103, 137, 170, 191,
198, 214, 162, 187, 209, 162, 187, 207, 128, 156, 183, 201,
219, 230, 204, 210, 225, 201, 209, 225, 187, 190, 203, 214 },
{ 106, 128, 98, 126, 128, 87, 122, 128, 54, 89, 131, 128,
142, 180, 123, 154, 189, 115, 149, 175, 79, 115, 157, 182,
175, 197, 147, 174, 199, 145, 174, 201, 89, 135, 173, 194,
212, 222, 206, 203, 223, 188, 201, 220, 128, 144, 202, 206 },
},
#endif
{
{ 164, 128, 134, 165, 128, 137, 168, 128, 97, 136, 167, 128,
182, 205, 143, 172, 200, 145, 173, 193, 103, 137, 170, 191,
198, 214, 162, 187, 209, 162, 187, 207, 128, 156, 183, 201,
219, 230, 204, 210, 225, 201, 209, 225, 187, 190, 203, 214 },
{ 106, 128, 98, 126, 128, 87, 122, 128, 54, 89, 131, 128,
142, 180, 123, 154, 189, 115, 149, 175, 79, 115, 157, 182,
175, 197, 147, 174, 199, 145, 174, 201, 89, 135, 173, 194,
212, 222, 206, 203, 223, 188, 201, 220, 128, 144, 202, 206 },
},
{
{ 171, 128, 123, 169, 128, 121, 165, 128, 82, 125, 168, 128,
191, 213, 143, 177, 199, 136, 170, 194, 95, 135, 171, 195,
206, 222, 166, 191, 212, 154, 184, 207, 115, 149, 180, 204,
223, 237, 196, 215, 231, 186, 209, 228, 158, 178, 201, 222 },
{ 115, 128, 115, 146, 128, 91, 147, 128, 55, 93, 139, 128,
147, 190, 141, 176, 201, 123, 156, 173, 68, 114, 156, 195,
186, 205, 153, 191, 214, 141, 179, 205, 107, 132, 166, 184,
215, 225, 200, 212, 230, 102, 207, 222, 128, 119, 200, 212 },
},
{
{ 185, 128, 134, 198, 128, 128, 195, 128, 58, 110, 162, 128,
208, 227, 154, 196, 206, 144, 188, 209, 83, 130, 168, 198,
219, 232, 167, 205, 222, 158, 196, 216, 107, 143, 178, 204,
233, 244, 202, 226, 238, 191, 217, 234, 153, 178, 200, 223 },
{ 160, 128, 154, 197, 128, 129, 178, 128, 53, 112, 157, 128,
185, 214, 169, 196, 221, 134, 179, 186, 82, 131, 168, 194,
204, 220, 176, 209, 221, 173, 194, 209, 107, 154, 181, 203,
230, 241, 202, 226, 237, 185, 223, 234, 162, 187, 203, 222 },
},
{
{ 177, 128, 165, 226, 128, 152, 219, 128, 45, 129, 188, 128,
198, 218, 179, 220, 228, 163, 214, 220, 72, 134, 181, 206,
216, 225, 177, 218, 231, 158, 213, 223, 112, 150, 185, 210,
245, 251, 204, 234, 247, 195, 231, 243, 163, 186, 213, 235 },
{ 161, 128, 174, 205, 128, 146, 182, 128, 59, 125, 179, 128,
183, 208, 199, 220, 239, 184, 213, 217, 71, 141, 196, 217,
213, 219, 215, 230, 237, 171, 224, 238, 112, 173, 193, 221,
239, 246, 168, 243, 249, 93, 241, 247, 128, 195, 216, 233 },
},
};
#endif // CONFIG_LV_MAP
#if CONFIG_EXT_PARTITION_TYPES
static const aom_prob
default_partition_probs[PARTITION_CONTEXTS][EXT_PARTITION_TYPES - 1] = {
// 8x8 -> 4x4
{ 199, 122, 141, 128, 128, 128, 128 }, // a/l both not split
{ 147, 63, 159, 128, 128, 128, 128 }, // a split, l not split
{ 148, 133, 118, 128, 128, 128, 128 }, // l split, a not split
{ 121, 104, 114, 128, 128, 128, 128 }, // a/l both split
// 16x16 -> 8x8
{ 174, 73, 87, 128, 128, 128, 128 }, // a/l both not split
{ 92, 41, 83, 128, 128, 128, 128 }, // a split, l not split
{ 82, 99, 50, 128, 128, 128, 128 }, // l split, a not split
{ 53, 39, 39, 128, 128, 128, 128 }, // a/l both split
// 32x32 -> 16x16
{ 177, 58, 59, 128, 128, 128, 128 }, // a/l both not split
{ 68, 26, 63, 128, 128, 128, 128 }, // a split, l not split
{ 52, 79, 25, 128, 128, 128, 128 }, // l split, a not split
{ 17, 14, 12, 128, 128, 128, 128 }, // a/l both split
// 64x64 -> 32x32
{ 222, 34, 30, 128, 128, 128, 128 }, // a/l both not split
{ 72, 16, 44, 128, 128, 128, 128 }, // a split, l not split
{ 58, 32, 12, 128, 128, 128, 128 }, // l split, a not split
{ 10, 7, 6, 128, 128, 128, 128 }, // a/l both split
#if CONFIG_EXT_PARTITION
// 128x128 -> 64x64
{ 222, 34, 30, 128, 128, 128, 128 }, // a/l both not split
{ 72, 16, 44, 128, 128, 128, 128 }, // a split, l not split
{ 58, 32, 12, 128, 128, 128, 128 }, // l split, a not split
{ 10, 7, 6, 128, 128, 128, 128 }, // a/l both split
#endif // CONFIG_EXT_PARTITION
#if CONFIG_UNPOISON_PARTITION_CTX
{ 0, 0, 141, 0, 0, 0, 0 }, // 8x8 -> 4x4
{ 0, 0, 87, 0, 0, 0, 0 }, // 16x16 -> 8x8
{ 0, 0, 59, 0, 0, 0, 0 }, // 32x32 -> 16x16
{ 0, 0, 30, 0, 0, 0, 0 }, // 64x64 -> 32x32
#if CONFIG_EXT_PARTITION
{ 0, 0, 30, 0, 0, 0, 0 }, // 128x128 -> 64x64
#endif // CONFIG_EXT_PARTITION
{ 0, 122, 0, 0, 0, 0, 0 }, // 8x8 -> 4x4
{ 0, 73, 0, 0, 0, 0, 0 }, // 16x16 -> 8x8
{ 0, 58, 0, 0, 0, 0, 0 }, // 32x32 -> 16x16
{ 0, 34, 0, 0, 0, 0, 0 }, // 64x64 -> 32x32
#if CONFIG_EXT_PARTITION
{ 0, 34, 0, 0, 0, 0, 0 }, // 128x128 -> 64x64
#endif // CONFIG_EXT_PARTITION
#endif // CONFIG_UNPOISON_PARTITION_CTX
};
#else
static const aom_prob
default_partition_probs[PARTITION_CONTEXTS][PARTITION_TYPES - 1] = {
// 8x8 -> 4x4
{ 199, 122, 141 }, // a/l both not split
{ 147, 63, 159 }, // a split, l not split
{ 148, 133, 118 }, // l split, a not split
{ 121, 104, 114 }, // a/l both split
// 16x16 -> 8x8
{ 174, 73, 87 }, // a/l both not split
{ 92, 41, 83 }, // a split, l not split
{ 82, 99, 50 }, // l split, a not split
{ 53, 39, 39 }, // a/l both split
// 32x32 -> 16x16
{ 177, 58, 59 }, // a/l both not split
{ 68, 26, 63 }, // a split, l not split
{ 52, 79, 25 }, // l split, a not split
{ 17, 14, 12 }, // a/l both split
// 64x64 -> 32x32
{ 222, 34, 30 }, // a/l both not split
{ 72, 16, 44 }, // a split, l not split
{ 58, 32, 12 }, // l split, a not split
{ 10, 7, 6 }, // a/l both split
#if CONFIG_EXT_PARTITION
// 128x128 -> 64x64
{ 222, 34, 30 }, // a/l both not split
{ 72, 16, 44 }, // a split, l not split
{ 58, 32, 12 }, // l split, a not split
{ 10, 7, 6 }, // a/l both split
#endif // CONFIG_EXT_PARTITION
#if CONFIG_UNPOISON_PARTITION_CTX
{ 0, 0, 141 }, // 8x8 -> 4x4
{ 0, 0, 87 }, // 16x16 -> 8x8
{ 0, 0, 59 }, // 32x32 -> 16x16
{ 0, 0, 30 }, // 64x64 -> 32x32
#if CONFIG_EXT_PARTITION
{ 0, 0, 30 }, // 128x128 -> 64x64
#endif // CONFIG_EXT_PARTITION
{ 0, 122, 0 }, // 8x8 -> 4x4
{ 0, 73, 0 }, // 16x16 -> 8x8
{ 0, 58, 0 }, // 32x32 -> 16x16
{ 0, 34, 0 }, // 64x64 -> 32x32
#if CONFIG_EXT_PARTITION
{ 0, 34, 0 }, // 128x128 -> 64x64
#endif // CONFIG_EXT_PARTITION
#endif // CONFIG_UNPOISON_PARTITION_CTX
};
#endif // CONFIG_EXT_PARTITION_TYPES
static const aom_prob default_newmv_prob[NEWMV_MODE_CONTEXTS] = {
155, 116, 94, 32, 96, 56, 30,
};
static const aom_prob default_zeromv_prob[ZEROMV_MODE_CONTEXTS] = {
45, 13,
};
static const aom_prob default_refmv_prob[REFMV_MODE_CONTEXTS] = {
178, 212, 135, 244, 203, 122, 128, 128, 128,
};
static const aom_prob default_drl_prob[DRL_MODE_CONTEXTS] = {
119, 128, 189, 134, 128,
};
#if CONFIG_NEW_MULTISYMBOL
static const aom_cdf_prob default_newmv_cdf[NEWMV_MODE_CONTEXTS][CDF_SIZE(2)] =
{ { AOM_ICDF(128 * 200), AOM_ICDF(32768), 0 },
{ AOM_ICDF(128 * 180), AOM_ICDF(32768), 0 },
{ AOM_ICDF(128 * 150), AOM_ICDF(32768), 0 },
{ AOM_ICDF(128 * 150), AOM_ICDF(32768), 0 },
{ AOM_ICDF(128 * 110), AOM_ICDF(32768), 0 },
{ AOM_ICDF(128 * 70), AOM_ICDF(32768), 0 },
{ AOM_ICDF(128 * 60), AOM_ICDF(32768), 0 } };
static const aom_cdf_prob default_zeromv_cdf[ZEROMV_MODE_CONTEXTS][CDF_SIZE(
2)] = { { AOM_ICDF(128 * 192), AOM_ICDF(32768), 0 },
{ AOM_ICDF(128 * 64), AOM_ICDF(32768), 0 } };
static const aom_cdf_prob default_refmv_cdf[REFMV_MODE_CONTEXTS][CDF_SIZE(2)] =
{ { AOM_ICDF(128 * 220), AOM_ICDF(32768), 0 },
{ AOM_ICDF(128 * 220), AOM_ICDF(32768), 0 },
{ AOM_ICDF(128 * 200), AOM_ICDF(32768), 0 },
{ AOM_ICDF(128 * 200), AOM_ICDF(32768), 0 },
{ AOM_ICDF(128 * 180), AOM_ICDF(32768), 0 },
{ AOM_ICDF(128 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(128 * 30), AOM_ICDF(32768), 0 },
{ AOM_ICDF(128 * 220), AOM_ICDF(32768), 0 },
{ AOM_ICDF(128 * 30), AOM_ICDF(32768), 0 } };
static const aom_cdf_prob default_drl_cdf[DRL_MODE_CONTEXTS][CDF_SIZE(2)] = {
{ AOM_ICDF(128 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(128 * 160), AOM_ICDF(32768), 0 },
{ AOM_ICDF(128 * 180), AOM_ICDF(32768), 0 },
{ AOM_ICDF(128 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(128 * 160), AOM_ICDF(32768), 0 }
};
#endif
#if CONFIG_EXT_INTER
static const aom_prob default_inter_compound_mode_probs
[INTER_MODE_CONTEXTS][INTER_COMPOUND_MODES - 1] = {
{ 154, 167, 233, 165, 143, 170, 167 }, // 0 = both zero mv
{ 75, 168, 237, 155, 135, 176, 172 }, // 1 = 1 zero + 1 predicted
{ 7, 173, 227, 128, 153, 188, 189 }, // 2 = two predicted mvs
{ 8, 120, 214, 113, 154, 178, 174 }, // 3 = 1 pred/zero, 1 new
{ 4, 85, 194, 94, 155, 173, 167 }, // 4 = two new mvs
{ 23, 89, 180, 73, 157, 151, 155 }, // 5 = one intra neighbour
{ 27, 49, 152, 91, 134, 153, 142 }, // 6 = two intra neighbours
};
static const aom_cdf_prob
default_inter_compound_mode_cdf[INTER_MODE_CONTEXTS][CDF_SIZE(
INTER_COMPOUND_MODES)] = {
{ 13056, 4539, 1876, 1331, 1056, 633, 408, 0, 0 },
{ 23168, 7964, 3500, 2445, 1966, 1042, 591, 0, 0 },
{ 31872, 10334, 5753, 3742, 3015, 1654, 1171, 0, 0 },
{ 31744, 16864, 10641, 7347, 5904, 3772, 2767, 0, 0 },
{ 32256, 21546, 15551, 11323, 9295, 6635, 5218, 0, 0 },
{ 29824, 19455, 15554, 12017, 9557, 7268, 5776, 0, 0 },
{ 29312, 23701, 18699, 15861, 13951, 11554, 9629, 0, 0 }
};
#if CONFIG_COMPOUND_SINGLEREF
// TODO(zoeliu): Default values to be further adjusted based on the collected
// stats.
/*
static const aom_prob default_inter_singleref_comp_mode_probs
[INTER_MODE_CONTEXTS][INTER_SINGLEREF_COMP_MODES - 1] = {
{ 2, 173, 68, 180 }, // 0 = both zero mv
{ 7, 145, 160, 180 }, // 1 = 1 zero + 1 predicted
{ 7, 166, 126, 180 }, // 2 = two predicted mvs
{ 7, 94, 132, 180 }, // 3 = 1 pred/zero, 1 new
{ 8, 64, 64, 180 }, // 4 = two new mvs
{ 17, 81, 52, 180 }, // 5 = one intra neighbour
{ 25, 29, 50, 180 }, // 6 = two intra neighbours
};*/
static const aom_prob default_inter_singleref_comp_mode_probs
[INTER_MODE_CONTEXTS][INTER_SINGLEREF_COMP_MODES - 1] = {
{ 2, 173, 68 }, // 0 = both zero mv
{ 7, 145, 160 }, // 1 = 1 zero + 1 predicted
{ 7, 166, 126 }, // 2 = two predicted mvs
{ 7, 94, 132 }, // 3 = 1 pred/zero, 1 new
{ 8, 64, 64 }, // 4 = two new mvs
{ 17, 81, 52 }, // 5 = one intra neighbour
{ 25, 29, 50 }, // 6 = two intra neighbours
};
#endif // CONFIG_COMPOUND_SINGLEREF
#if CONFIG_COMPOUND_SEGMENT && CONFIG_WEDGE
static const aom_prob
default_compound_type_probs[BLOCK_SIZES][COMPOUND_TYPES - 1] = {
#if CONFIG_CHROMA_2X2 || CONFIG_CHROMA_SUB8X8
{ 128, 128 }, { 128, 128 }, { 128, 128 },
#endif
{ 128, 128 }, { 255, 128 }, { 255, 128 }, { 66, 51 }, { 72, 35 },
{ 79, 29 }, { 71, 18 }, { 81, 29 }, { 81, 26 }, { 69, 19 },
{ 104, 1 }, { 99, 1 }, { 75, 1 },
#if CONFIG_EXT_PARTITION
{ 255, 1 }, { 255, 1 }, { 255, 1 },
#endif // CONFIG_EXT_PARTITION
};
#elif !CONFIG_COMPOUND_SEGMENT && CONFIG_WEDGE
static const aom_prob
default_compound_type_probs[BLOCK_SIZES][COMPOUND_TYPES - 1] = {
#if CONFIG_CHROMA_2X2 || CONFIG_CHROMA_SUB8X8
{ 255 }, { 255 }, { 255 },
#endif
{ 208 }, { 208 }, { 208 }, { 208 }, { 208 }, { 208 }, { 216 },
{ 216 }, { 216 }, { 224 }, { 224 }, { 240 }, { 240 },
#if CONFIG_EXT_PARTITION
{ 255 }, { 255 }, { 255 },
#endif // CONFIG_EXT_PARTITION
};
#elif CONFIG_COMPOUND_SEGMENT && !CONFIG_WEDGE
static const aom_prob
default_compound_type_probs[BLOCK_SIZES][COMPOUND_TYPES - 1] = {
#if CONFIG_CHROMA_2X2 || CONFIG_CHROMA_SUB8X8
{ 255 }, { 255 }, { 255 },
#endif
{ 208 }, { 208 }, { 208 }, { 208 }, { 208 }, { 208 }, { 216 },
{ 216 }, { 216 }, { 224 }, { 224 }, { 240 }, { 240 },
#if CONFIG_EXT_PARTITION
{ 255 }, { 255 }, { 255 },
#endif // CONFIG_EXT_PARTITION
};
#else
static const aom_prob default_compound_type_probs[BLOCK_SIZES]
[COMPOUND_TYPES - 1];
#endif // CONFIG_COMPOUND_SEGMENT && CONFIG_WEDGE
#if CONFIG_COMPOUND_SEGMENT && CONFIG_WEDGE
static const aom_cdf_prob
default_compound_type_cdf[BLOCK_SIZES][CDF_SIZE(COMPOUND_TYPES)] = {
#if CONFIG_CHROMA_2X2 || CONFIG_CHROMA_SUB8X8
{ 16384, 8192, 0, 0 },
{ 16384, 8192, 0, 0 },
{ 16384, 8192, 0, 0 },
#endif
{ 16384, 8192, 0, 0 },
{ 128, 64, 0, 0 },
{ 128, 64, 0, 0 },
{ 24320, 19475, 0, 0 },
{ 23552, 20332, 0, 0 },
{ 22656, 20089, 0, 0 },
{ 23680, 22015, 0, 0 },
{ 22400, 19862, 0, 0 },
{ 22400, 20125, 0, 0 },
{ 23936, 22159, 0, 0 },
{ 19456, 19380, 0, 0 },
{ 20096, 20017, 0, 0 },
{ 23168, 23077, 0, 0 },
#if CONFIG_EXT_PARTITION
{ AOM_ICDF(32640), AOM_ICDF(32641), AOM_ICDF(32768), 0 }, // 255, 1
{ AOM_ICDF(32640), AOM_ICDF(32641), AOM_ICDF(32768), 0 },
{ AOM_ICDF(32640), AOM_ICDF(32641), AOM_ICDF(32768), 0 },
#endif // CONFIG_EXT_PARTITION
};
#elif !CONFIG_COMPOUND_SEGMENT && CONFIG_WEDGE
static const aom_cdf_prob
default_compound_type_cdf[BLOCK_SIZES][CDF_SIZE(COMPOUND_TYPES)] = {
#if CONFIG_CHROMA_2X2 || CONFIG_CHROMA_SUB8X8
{ AOM_ICDF(32640), AOM_ICDF(32768), 0 }, // 255
{ AOM_ICDF(32640), AOM_ICDF(32768), 0 },
{ AOM_ICDF(32640), AOM_ICDF(32768), 0 },
#endif
{ AOM_ICDF(26624), AOM_ICDF(32768), 0 }, // 208
{ AOM_ICDF(26624), AOM_ICDF(32768), 0 },
{ AOM_ICDF(26624), AOM_ICDF(32768), 0 },
{ AOM_ICDF(26624), AOM_ICDF(32768), 0 },
{ AOM_ICDF(26624), AOM_ICDF(32768), 0 },
{ AOM_ICDF(26624), AOM_ICDF(32768), 0 },
{ AOM_ICDF(27648), AOM_ICDF(32768), 0 }, // 216
{ AOM_ICDF(27648), AOM_ICDF(32768), 0 },
{ AOM_ICDF(27648), AOM_ICDF(32768), 0 },
{ AOM_ICDF(28672), AOM_ICDF(32768), 0 }, // 224
{ AOM_ICDF(28672), AOM_ICDF(32768), 0 },
{ AOM_ICDF(30720), AOM_ICDF(32768), 0 }, // 240
{ AOM_ICDF(30720), AOM_ICDF(32768), 0 },
#if CONFIG_EXT_PARTITION
{ AOM_ICDF(32640), AOM_ICDF(32768), 0 }, // 255
{ AOM_ICDF(32640), AOM_ICDF(32768), 0 },
{ AOM_ICDF(32640), AOM_ICDF(32768), 0 },
#endif // CONFIG_EXT_PARTITION
};
#elif CONFIG_COMPOUND_SEGMENT && !CONFIG_WEDGE
static const aom_cdf_prob
default_compound_type_cdf[BLOCK_SIZES][CDF_SIZE(COMPOUND_TYPES)] = {
#if CONFIG_CHROMA_2X2 || CONFIG_CHROMA_SUB8X8
{ AOM_ICDF(32640), AOM_ICDF(32768), 0 }, // 255
{ AOM_ICDF(32640), AOM_ICDF(32768), 0 },
{ AOM_ICDF(32640), AOM_ICDF(32768), 0 },
#endif
{ AOM_ICDF(26624), AOM_ICDF(32768), 0 }, // 208
{ AOM_ICDF(26624), AOM_ICDF(32768), 0 },
{ AOM_ICDF(26624), AOM_ICDF(32768), 0 },
{ AOM_ICDF(26624), AOM_ICDF(32768), 0 },
{ AOM_ICDF(26624), AOM_ICDF(32768), 0 },
{ AOM_ICDF(26624), AOM_ICDF(32768), 0 },
{ AOM_ICDF(27648), AOM_ICDF(32768), 0 }, // 216
{ AOM_ICDF(27648), AOM_ICDF(32768), 0 },
{ AOM_ICDF(27648), AOM_ICDF(32768), 0 },
{ AOM_ICDF(28672), AOM_ICDF(32768), 0 }, // 224
{ AOM_ICDF(28672), AOM_ICDF(32768), 0 },
{ AOM_ICDF(30720), AOM_ICDF(32768), 0 }, // 240
{ AOM_ICDF(30720), AOM_ICDF(32768), 0 },
#if CONFIG_EXT_PARTITION
{ AOM_ICDF(32640), AOM_ICDF(32768), 0 }, // 255
{ AOM_ICDF(32640), AOM_ICDF(32768), 0 },
{ AOM_ICDF(32640), AOM_ICDF(32768), 0 },
#endif // CONFIG_EXT_PARTITION
};
#else
static const aom_cdf_prob default_compound_type_cdf[BLOCK_SIZES]
[CDF_SIZE(COMPOUND_TYPES)];
#endif // CONFIG_COMPOUND_SEGMENT && CONFIG_WEDGE
#if CONFIG_INTERINTRA
static const aom_prob default_interintra_prob[BLOCK_SIZE_GROUPS] = {
128, 226, 244, 254,
};
#if CONFIG_NEW_MULTISYMBOL
static const aom_cdf_prob default_interintra_cdf[BLOCK_SIZE_GROUPS][CDF_SIZE(
2)] = { { AOM_ICDF(128 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(226 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(244 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(254 * 128), AOM_ICDF(32768), 0 } };
#endif
static const aom_prob
default_interintra_mode_prob[BLOCK_SIZE_GROUPS][INTERINTRA_MODES - 1] = {
{ 128, 128, 128 }, // block_size < 8x8
{ 24, 34, 119 }, // block_size < 16x16
{ 38, 33, 95 }, // block_size < 32x32
{ 51, 21, 110 }, // block_size >= 32x32
};
static const aom_cdf_prob
default_interintra_mode_cdf[BLOCK_SIZE_GROUPS][CDF_SIZE(INTERINTRA_MODES)] =
{ { 16384, 8192, 4096, 0, 0 },
{ 29696, 25752, 13781, 0, 0 },
{ 27904, 24307, 15287, 0, 0 },
{ 26240, 24087, 13737, 0, 0 } };
static const aom_prob default_wedge_interintra_prob[BLOCK_SIZES] = {
#if CONFIG_CHROMA_2X2 || CONFIG_CHROMA_SUB8X8
128, 128, 128,
#endif
128, 128, 128, 194, 213, 217, 222, 224, 226, 220, 128, 128, 128,
#if CONFIG_EXT_PARTITION
208, 208, 208
#endif // CONFIG_EXT_PARTITION
};
#if CONFIG_NEW_MULTISYMBOL
static const aom_cdf_prob
default_wedge_interintra_cdf[BLOCK_SIZES][CDF_SIZE(2)] = {
#if CONFIG_CHROMA_2X2 || CONFIG_CHROMA_SUB8X8
{ AOM_ICDF(128 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(128 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(128 * 128), AOM_ICDF(32768), 0 },
#endif
{ AOM_ICDF(128 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(128 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(128 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(194 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(213 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(217 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(222 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(224 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(226 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(220 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(128 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(128 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(128 * 128), AOM_ICDF(32768), 0 },
#if CONFIG_EXT_PARTITION
{ AOM_ICDF(208 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(208 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(208 * 128), AOM_ICDF(32768), 0 },
#endif // CONFIG_EXT_PARTITION
};
#endif // CONFIG_NEW_MULTISYMBOL
#endif // CONFIG_INTERINTRA
#endif // CONFIG_EXT_INTER
#if CONFIG_NCOBMC_ADAPT_WEIGHT
const aom_tree_index av1_ncobmc_mode_tree[TREE_SIZE(MAX_NCOBMC_MODES)] = {
-NO_OVERLAP, 2, -NCOBMC_MODE_1, 4,
-NCOBMC_MODE_2, 6, -NCOBMC_MODE_3, 8,
-NCOBMC_MODE_4, 10, -NCOBMC_MODE_5, 12,
-NCOBMC_MODE_6, 14, -NCOBMC_MODE_7, -NCOBMC_MODE_8
};
// TODO(weitinglin): find default prob
static const aom_prob
default_ncobmc_mode_prob[ADAPT_OVERLAP_BLOCKS][MAX_NCOBMC_MODES - 1] = {
{ 23, 37, 37, 38, 65, 71, 81, 86 }, // 8x8
{ 28, 32, 37, 43, 51, 64, 85, 128 }, // 16X16 equal prob
{ 86, 22, 32, 25, 10, 40, 97, 65 }, // 32X32
{ 28, 32, 37, 43, 51, 64, 85, 128 } // 64X64 equal prob
};
#endif
// Change this section appropriately once warped motion is supported
#if CONFIG_MOTION_VAR && !CONFIG_WARPED_MOTION
#if !CONFIG_NCOBMC_ADAPT_WEIGHT
const aom_tree_index av1_motion_mode_tree[TREE_SIZE(MOTION_MODES)] = {
-SIMPLE_TRANSLATION, -OBMC_CAUSAL
};
static const aom_cdf_prob
default_motion_mode_prob[BLOCK_SIZES][MOTION_MODES - 1] = {
#if CONFIG_CHROMA_2X2 || CONFIG_CHROMA_SUB8X8
{ 255 }, { 255 }, { 255 },
#endif
{ 255 }, { 255 }, { 255 }, { 151 }, { 153 }, { 144 }, { 178 },
{ 165 }, { 160 }, { 207 }, { 195 }, { 168 }, { 244 },
#if CONFIG_EXT_PARTITION
{ 252 }, { 252 }, { 252 },
#endif // CONFIG_EXT_PARTITION
};
#else
// TODO(weitinglin): The default probability is copied from warped motion right
// now as a place holder. It needs to be fined tuned after
// NCOBMC_ADAPT_WEIGHT is actually implemented. Also needs to
// change this section appropriately once warped motion is
// supported.
const aom_tree_index av1_motion_mode_tree[TREE_SIZE(MOTION_MODES)] = {
-SIMPLE_TRANSLATION, 2, -OBMC_CAUSAL, -NCOBMC_ADAPT_WEIGHT,
};
static const aom_prob default_motion_mode_prob[BLOCK_SIZES][MOTION_MODES - 1] =
{
#if CONFIG_CHROMA_2X2 || CONFIG_CHROMA_SUB8X8
{ 255, 200 }, { 255, 200 }, { 255, 200 },
#endif
{ 255, 200 }, { 255, 200 }, { 255, 200 }, { 151, 200 }, { 153, 200 },
{ 144, 200 }, { 178, 200 }, { 165, 200 }, { 160, 200 }, { 207, 200 },
{ 195, 200 }, { 168, 200 }, { 244, 200 },
#if CONFIG_EXT_PARTITION
{ 252, 200 }, { 252, 200 }, { 252, 200 },
#endif // CONFIG_EXT_PARTITION
};
#endif
static const aom_cdf_prob
default_motion_mode_cdf[BLOCK_SIZES][CDF_SIZE(MOTION_MODES)] = {
#if CONFIG_CHROMA_2X2 || CONFIG_CHROMA_SUB8X8
{ AOM_ICDF(255 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(255 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(255 * 128), AOM_ICDF(32768), 0 },
#endif
{ AOM_ICDF(255 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(255 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(255 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(151 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(153 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(144 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(178 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(165 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(160 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(207 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(195 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(168 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(244 * 128), AOM_ICDF(32768), 0 },
#if CONFIG_EXT_PARTITION
{ AOM_ICDF(252 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(252 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(252 * 128), AOM_ICDF(32768), 0 },
#endif // CONFIG_EXT_PARTITION
};
#elif !CONFIG_MOTION_VAR && CONFIG_WARPED_MOTION
const aom_tree_index av1_motion_mode_tree[TREE_SIZE(MOTION_MODES)] = {
-SIMPLE_TRANSLATION, -WARPED_CAUSAL
};
static const aom_prob default_motion_mode_prob[BLOCK_SIZES][MOTION_MODES - 1] =
{
#if CONFIG_CHROMA_2X2 || CONFIG_CHROMA_SUB8X8
{ 255 }, { 255 }, { 255 },
#endif
{ 255 }, { 255 }, { 255 }, { 151 }, { 153 }, { 144 }, { 178 },
{ 165 }, { 160 }, { 207 }, { 195 }, { 168 }, { 244 },
#if CONFIG_EXT_PARTITION
{ 252 }, { 252 }, { 252 },
#endif // CONFIG_EXT_PARTITION
};
static const aom_cdf_prob
default_motion_mode_cdf[BLOCK_SIZES][CDF_SIZE(MOTION_MODES)] = {
#if CONFIG_CHROMA_2X2 || CONFIG_CHROMA_SUB8X8
{ AOM_ICDF(255 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(255 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(255 * 128), AOM_ICDF(32768), 0 },
#endif
{ AOM_ICDF(255 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(255 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(255 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(151 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(153 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(144 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(178 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(165 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(160 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(207 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(195 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(168 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(244 * 128), AOM_ICDF(32768), 0 },
#if CONFIG_EXT_PARTITION
{ AOM_ICDF(252 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(252 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(252 * 128), AOM_ICDF(32768), 0 },
#endif // CONFIG_EXT_PARTITION
};
#elif CONFIG_MOTION_VAR && CONFIG_WARPED_MOTION
const aom_tree_index av1_motion_mode_tree[TREE_SIZE(MOTION_MODES)] = {
-SIMPLE_TRANSLATION, 2, -OBMC_CAUSAL, -WARPED_CAUSAL,
};
static const aom_prob default_motion_mode_prob[BLOCK_SIZES][MOTION_MODES - 1] =
{
#if CONFIG_CHROMA_2X2 || CONFIG_CHROMA_SUB8X8
{ 128, 128 }, { 128, 128 }, { 128, 128 },
#endif
{ 128, 128 }, { 128, 128 }, { 128, 128 }, { 62, 115 }, { 39, 131 },
{ 39, 132 }, { 118, 94 }, { 77, 125 }, { 100, 121 }, { 190, 66 },
{ 207, 102 }, { 197, 100 }, { 239, 76 },
#if CONFIG_EXT_PARTITION
{ 252, 200 }, { 252, 200 }, { 252, 200 },
#endif // CONFIG_EXT_PARTITION
};
static const aom_cdf_prob
default_motion_mode_cdf[BLOCK_SIZES][CDF_SIZE(MOTION_MODES)] = {
#if CONFIG_CHROMA_2X2 || CONFIG_CHROMA_SUB8X8
{ AOM_ICDF(32640), AOM_ICDF(32740), AOM_ICDF(32768), 0 },
{ AOM_ICDF(32640), AOM_ICDF(32740), AOM_ICDF(32768), 0 },
{ AOM_ICDF(32640), AOM_ICDF(32740), AOM_ICDF(32768), 0 },
#endif
{ AOM_ICDF(32640), AOM_ICDF(32740), AOM_ICDF(32768), 0 },
{ AOM_ICDF(32640), AOM_ICDF(32740), AOM_ICDF(32768), 0 },
{ AOM_ICDF(32640), AOM_ICDF(32740), AOM_ICDF(32768), 0 },
{ AOM_ICDF(19328), AOM_ICDF(29828), AOM_ICDF(32768), 0 },
{ AOM_ICDF(19584), AOM_ICDF(29884), AOM_ICDF(32768), 0 },
{ AOM_ICDF(18432), AOM_ICDF(29632), AOM_ICDF(32768), 0 },
{ AOM_ICDF(22784), AOM_ICDF(30584), AOM_ICDF(32768), 0 },
{ AOM_ICDF(21120), AOM_ICDF(30220), AOM_ICDF(32768), 0 },
{ AOM_ICDF(20480), AOM_ICDF(30080), AOM_ICDF(32768), 0 },
{ AOM_ICDF(26496), AOM_ICDF(31396), AOM_ICDF(32768), 0 },
{ AOM_ICDF(24960), AOM_ICDF(31060), AOM_ICDF(32768), 0 },
{ AOM_ICDF(21504), AOM_ICDF(30304), AOM_ICDF(32768), 0 },
{ AOM_ICDF(31232), AOM_ICDF(32432), AOM_ICDF(32768), 0 },
#if CONFIG_EXT_PARTITION
{ AOM_ICDF(32256), AOM_ICDF(32656), AOM_ICDF(32768), 0 },
{ AOM_ICDF(32256), AOM_ICDF(32656), AOM_ICDF(32768), 0 },
{ AOM_ICDF(32256), AOM_ICDF(32656), AOM_ICDF(32768), 0 },
#endif
};
// Probability for the case that only 1 additional motion mode is allowed
static const aom_prob default_obmc_prob[BLOCK_SIZES] = {
#if CONFIG_CHROMA_2X2 || CONFIG_CHROMA_SUB8X8
128, 128, 128,
#endif
128, 128, 128, 45, 79, 75, 130, 141, 144, 208, 201, 186, 231,
#if CONFIG_EXT_PARTITION
252, 252, 252,
#endif // CONFIG_EXT_PARTITION
};
#if CONFIG_NEW_MULTISYMBOL
static const aom_cdf_prob default_obmc_cdf[BLOCK_SIZES][CDF_SIZE(2)] = {
#if CONFIG_CHROMA_2X2 || CONFIG_CHROMA_SUB8X8
{ AOM_ICDF(255 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(255 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(255 * 128), AOM_ICDF(32768), 0 },
#endif
{ AOM_ICDF(255 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(255 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(255 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(151 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(153 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(144 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(178 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(165 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(160 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(207 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(195 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(168 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(244 * 128), AOM_ICDF(32768), 0 },
#if CONFIG_EXT_PARTITION
{ AOM_ICDF(252 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(252 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(252 * 128), AOM_ICDF(32768), 0 },
#endif // CONFIG_EXT_PARTITION
};
#endif // CONFIG_NEW_MULTISYMBOL
#endif
#if CONFIG_DELTA_Q
static const aom_prob default_delta_q_probs[DELTA_Q_PROBS] = { 220, 220, 220 };
static const aom_cdf_prob default_delta_q_cdf[CDF_SIZE(DELTA_Q_PROBS + 1)] = {
AOM_ICDF(28160), AOM_ICDF(32120), AOM_ICDF(32677), AOM_ICDF(32768), 0
};
#if CONFIG_EXT_DELTA_Q
static const aom_prob default_delta_lf_probs[DELTA_LF_PROBS] = { 220, 220,
220 };
static const aom_cdf_prob default_delta_lf_cdf[CDF_SIZE(DELTA_LF_PROBS + 1)] = {
AOM_ICDF(28160), AOM_ICDF(32120), AOM_ICDF(32677), AOM_ICDF(32768), 0
};
#endif
#endif
#if CONFIG_EXT_TX
int av1_ext_tx_intra_ind[EXT_TX_SETS_INTRA][TX_TYPES];
int av1_ext_tx_intra_inv[EXT_TX_SETS_INTRA][TX_TYPES];
int av1_ext_tx_inter_ind[EXT_TX_SETS_INTER][TX_TYPES];
int av1_ext_tx_inter_inv[EXT_TX_SETS_INTER][TX_TYPES];
#endif
#if CONFIG_ALT_INTRA
#if CONFIG_SMOOTH_HV
const int av1_intra_mode_ind[INTRA_MODES] = { 0, 2, 3, 6, 4, 5, 8,
9, 7, 10, 11, 12, 1 };
const int av1_intra_mode_inv[INTRA_MODES] = { 0, 12, 1, 2, 4, 5, 3,
8, 6, 7, 9, 10, 11 };
#else
const int av1_intra_mode_ind[INTRA_MODES] = {
0, 2, 3, 6, 4, 5, 8, 9, 7, 10, 1
};
const int av1_intra_mode_inv[INTRA_MODES] = {
0, 10, 1, 2, 4, 5, 3, 8, 6, 7, 9
};
#endif // CONFIG_SMOOTH_HV
#else
const int av1_intra_mode_ind[INTRA_MODES] = { 0, 2, 3, 6, 4, 5, 8, 9, 7, 1 };
const int av1_intra_mode_inv[INTRA_MODES] = { 0, 9, 1, 2, 4, 5, 3, 8, 6, 7 }
#endif // CONFIG_ALT_INTRA
#if CONFIG_EXT_INTER
/* clang-format off */
#if CONFIG_INTERINTRA
const aom_tree_index av1_interintra_mode_tree[TREE_SIZE(INTERINTRA_MODES)] = {
-II_DC_PRED, 2, /* 0 = II_DC_NODE */
#if CONFIG_ALT_INTRA
-II_SMOOTH_PRED, 4, /* 1 = II_SMOOTH_PRED */
#else
-II_TM_PRED, 4, /* 1 = II_TM_NODE */
#endif
-II_V_PRED, -II_H_PRED /* 2 = II_V_NODE */
};
#endif // CONFIG_INTERINTRA
const aom_tree_index av1_inter_compound_mode_tree
[TREE_SIZE(INTER_COMPOUND_MODES)] = {
-INTER_COMPOUND_OFFSET(ZERO_ZEROMV), 2,
-INTER_COMPOUND_OFFSET(NEAREST_NEARESTMV), 4,
6, -INTER_COMPOUND_OFFSET(NEW_NEWMV),
-INTER_COMPOUND_OFFSET(NEAR_NEARMV), 8,
10, 12,
-INTER_COMPOUND_OFFSET(NEAREST_NEWMV), -INTER_COMPOUND_OFFSET(NEW_NEARESTMV),
-INTER_COMPOUND_OFFSET(NEAR_NEWMV), -INTER_COMPOUND_OFFSET(NEW_NEARMV)
};
#if CONFIG_COMPOUND_SINGLEREF
// TODO(zoeliu): To redesign the tree structure once the number of mode changes.
/*
const aom_tree_index av1_inter_singleref_comp_mode_tree
[TREE_SIZE(INTER_SINGLEREF_COMP_MODES)] = {
-INTER_SINGLEREF_COMP_OFFSET(SR_ZERO_NEWMV), 2,
-INTER_SINGLEREF_COMP_OFFSET(SR_NEAREST_NEARMV), 4,
6, -INTER_SINGLEREF_COMP_OFFSET(SR_NEW_NEWMV),
-INTER_SINGLEREF_COMP_OFFSET(SR_NEAREST_NEWMV),
-INTER_SINGLEREF_COMP_OFFSET(SR_NEAR_NEWMV)
};*/
const aom_tree_index av1_inter_singleref_comp_mode_tree
[TREE_SIZE(INTER_SINGLEREF_COMP_MODES)] = {
-INTER_SINGLEREF_COMP_OFFSET(SR_ZERO_NEWMV), 2,
-INTER_SINGLEREF_COMP_OFFSET(SR_NEAREST_NEARMV), 4,
-INTER_SINGLEREF_COMP_OFFSET(SR_NEAR_NEWMV),
-INTER_SINGLEREF_COMP_OFFSET(SR_NEW_NEWMV)
};
#endif // CONFIG_COMPOUND_SINGLEREF
#if CONFIG_COMPOUND_SEGMENT && CONFIG_WEDGE
const aom_tree_index av1_compound_type_tree[TREE_SIZE(COMPOUND_TYPES)] = {
-COMPOUND_AVERAGE, 2, -COMPOUND_WEDGE, -COMPOUND_SEG
};
#elif !CONFIG_COMPOUND_SEGMENT && CONFIG_WEDGE
const aom_tree_index av1_compound_type_tree[TREE_SIZE(COMPOUND_TYPES)] = {
-COMPOUND_AVERAGE, -COMPOUND_WEDGE
};
#elif CONFIG_COMPOUND_SEGMENT && !CONFIG_WEDGE
const aom_tree_index av1_compound_type_tree[TREE_SIZE(COMPOUND_TYPES)] = {
-COMPOUND_AVERAGE, -COMPOUND_SEG
};
#else
const aom_tree_index av1_compound_type_tree[TREE_SIZE(COMPOUND_TYPES)] = {};
#endif // CONFIG_COMPOUND_SEGMENT && CONFIG_WEDGE
/* clang-format on */
#endif // CONFIG_EXT_INTER
const aom_tree_index av1_partition_tree[TREE_SIZE(PARTITION_TYPES)] = {
-PARTITION_NONE, 2, -PARTITION_HORZ, 4, -PARTITION_VERT, -PARTITION_SPLIT
};
#if CONFIG_EXT_PARTITION_TYPES
/* clang-format off */
const aom_tree_index av1_ext_partition_tree[TREE_SIZE(EXT_PARTITION_TYPES)] = {
-PARTITION_NONE, 2,
6, 4,
8, -PARTITION_SPLIT,
-PARTITION_HORZ, 10,
-PARTITION_VERT, 12,
-PARTITION_HORZ_A, -PARTITION_HORZ_B,
-PARTITION_VERT_A, -PARTITION_VERT_B
};
/* clang-format on */
#endif // CONFIG_EXT_PARTITION_TYPES
static const aom_prob default_intra_inter_p[INTRA_INTER_CONTEXTS] = {
6, 97, 151, 205,
};
#if CONFIG_NEW_MULTISYMBOL
static const aom_cdf_prob
default_intra_inter_cdf[INTRA_INTER_CONTEXTS][CDF_SIZE(2)] = {
{ AOM_ICDF(1152), AOM_ICDF(32768), 0 },
{ AOM_ICDF(13056), AOM_ICDF(32768), 0 },
{ AOM_ICDF(23936), AOM_ICDF(32768), 0 },
{ AOM_ICDF(28800), AOM_ICDF(32768), 0 }
};
#endif
static const aom_prob default_comp_inter_p[COMP_INTER_CONTEXTS] = {
216, 170, 131, 92, 42,
};
#if CONFIG_NEW_MULTISYMBOL
static const aom_cdf_prob default_comp_inter_cdf[COMP_INTER_CONTEXTS][CDF_SIZE(
2)] = { { AOM_ICDF(216 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(170 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(131 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(92 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(42 * 128), AOM_ICDF(32768), 0 } };
#endif
#if CONFIG_EXT_COMP_REFS
static const aom_prob default_comp_ref_type_p[COMP_REF_TYPE_CONTEXTS] = {
30, 75, 120, 170, 230
};
static const aom_prob
default_uni_comp_ref_p[UNI_COMP_REF_CONTEXTS][UNIDIR_COMP_REFS - 1] = {
{ 30, 20 }, { 75, 70 }, { 130, 130 }, { 165, 165 }, { 215, 220 }
};
#endif // CONFIG_EXT_COMP_REFS
#if CONFIG_EXT_REFS
static const aom_prob default_comp_ref_p[REF_CONTEXTS][FWD_REFS - 1] = {
// TODO(zoeliu): To adjust the initial prob values.
{ 33, 16, 16 },
{ 77, 74, 74 },
{ 142, 142, 142 },
{ 172, 170, 170 },
{ 238, 247, 247 }
};
static const aom_prob default_comp_bwdref_p[REF_CONTEXTS][BWD_REFS - 1] = {
{ 16 }, { 74 }, { 142 }, { 170 }, { 247 }
};
#if CONFIG_NEW_MULTISYMBOL
static const aom_cdf_prob
default_comp_ref_cdf[REF_CONTEXTS][FWD_REFS - 1][CDF_SIZE(2)] = {
// TODO(zoeliu): To adjust the initial prob values.
{ { AOM_ICDF(33 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(16 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(16 * 128), AOM_ICDF(32768), 0 } },
{ { AOM_ICDF(77 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(74 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(74 * 128), AOM_ICDF(32768), 0 } },
{ { AOM_ICDF(142 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(142 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(142 * 128), AOM_ICDF(32768), 0 } },
{ { AOM_ICDF(172 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(170 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(170 * 128), AOM_ICDF(32768), 0 } },
{ { AOM_ICDF(238 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(247 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(247 * 128), AOM_ICDF(32768), 0 } }
};
static const aom_cdf_prob
default_comp_bwdref_cdf[REF_CONTEXTS][BWD_REFS - 1][CDF_SIZE(2)] = {
{ { AOM_ICDF(16 * 128), AOM_ICDF(32768), 0 } },
{ { AOM_ICDF(74 * 128), AOM_ICDF(32768), 0 } },
{ { AOM_ICDF(142 * 128), AOM_ICDF(32768), 0 } },
{ { AOM_ICDF(170 * 128), AOM_ICDF(32768), 0 } },
{ { AOM_ICDF(247 * 128), AOM_ICDF(32768), 0 } }
};
#endif // CONFIG_NEW_MULTISYMBOL
#else
static const aom_prob default_comp_ref_p[REF_CONTEXTS][COMP_REFS - 1] = {
{ 43 }, { 100 }, { 137 }, { 212 }, { 229 },
};
#if CONFIG_NEW_MULTISYMBOL
static const aom_cdf_prob
default_comp_ref_cdf[REF_CONTEXTS][COMP_REFS - 1][CDF_SIZE(2)] = {
{ { AOM_ICDF(43 * 128), AOM_ICDF(32768), 0 } },
{ { AOM_ICDF(100 * 128), AOM_ICDF(32768), 0 } },
{ { AOM_ICDF(137 * 128), AOM_ICDF(32768), 0 } },
{ { AOM_ICDF(212 * 128), AOM_ICDF(32768), 0 } },
{ { AOM_ICDF(229 * 128), AOM_ICDF(32768), 0 } }
};
#endif // CONFIG_NEW_MULTISYMBOL
#endif // CONFIG_EXT_REFS
static const aom_prob default_single_ref_p[REF_CONTEXTS][SINGLE_REFS - 1] = {
#if CONFIG_EXT_REFS
{ 33, 16, 16, 16, 16 },
{ 77, 74, 74, 74, 74 },
{ 142, 142, 142, 142, 142 },
{ 172, 170, 170, 170, 170 },
{ 238, 247, 247, 247, 247 }
#else
{ 31, 25 }, { 72, 80 }, { 147, 148 }, { 197, 191 }, { 235, 247 },
#endif // CONFIG_EXT_REFS
};
#if CONFIG_NEW_MULTISYMBOL
static const aom_cdf_prob
default_single_ref_cdf[REF_CONTEXTS][SINGLE_REFS - 1][CDF_SIZE(2)] = {
#if CONFIG_EXT_REFS
{ { AOM_ICDF(33 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(16 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(16 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(16 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(16 * 128), AOM_ICDF(32768), 0 } },
{ { AOM_ICDF(77 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(74 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(74 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(74 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(74 * 128), AOM_ICDF(32768), 0 } },
{ { AOM_ICDF(142 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(142 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(142 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(142 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(142 * 128), AOM_ICDF(32768), 0 } },
{ { AOM_ICDF(172 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(170 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(170 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(170 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(170 * 128), AOM_ICDF(32768), 0 } },
{ { AOM_ICDF(238 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(247 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(247 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(247 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(247 * 128), AOM_ICDF(32768), 0 } }
#else
{ { AOM_ICDF(31 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(25 * 128), AOM_ICDF(32768), 0 } },
{ { AOM_ICDF(72 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(80 * 128), AOM_ICDF(32768), 0 } },
{ { AOM_ICDF(147 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(148 * 128), AOM_ICDF(32768), 0 } },
{ { AOM_ICDF(197 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(191 * 128), AOM_ICDF(32768), 0 } },
{ { AOM_ICDF(235 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(247 * 128), AOM_ICDF(32768), 0 } }
#endif // CONFIG_EXT_REFS
};
#endif
#if CONFIG_EXT_INTER && CONFIG_COMPOUND_SINGLEREF
// TODO(zoeliu): Default values to be further adjusted based on the collected
// stats.
static const aom_prob default_comp_inter_mode_p[COMP_INTER_MODE_CONTEXTS] = {
40, 110, 160, 220
};
#endif // CONFIG_EXT_INTER && CONFIG_COMPOUND_SINGLEREF
#if CONFIG_PALETTE
// Tree to code palette size (number of colors in a palette) and the
// corresponding probabilities for Y and UV planes.
const aom_tree_index av1_palette_size_tree[TREE_SIZE(PALETTE_SIZES)] = {
-TWO_COLORS, 2, -THREE_COLORS, 4, -FOUR_COLORS, 6,
-FIVE_COLORS, 8, -SIX_COLORS, 10, -SEVEN_COLORS, -EIGHT_COLORS,
};
// TODO(huisu): tune these probs
const aom_prob
av1_default_palette_y_size_prob[PALETTE_BLOCK_SIZES][PALETTE_SIZES - 1] = {
{ 96, 89, 100, 64, 77, 130 }, { 22, 15, 44, 16, 34, 82 },
{ 30, 19, 57, 18, 38, 86 }, { 94, 36, 104, 23, 43, 92 },
{ 116, 76, 107, 46, 65, 105 }, { 112, 82, 94, 40, 70, 112 },
{ 147, 124, 123, 58, 69, 103 }, { 180, 113, 136, 49, 45, 114 },
{ 107, 70, 87, 49, 154, 156 }, { 98, 105, 142, 63, 64, 152 },
#if CONFIG_EXT_PARTITION
{ 98, 105, 142, 63, 64, 152 }, { 98, 105, 142, 63, 64, 152 },
{ 98, 105, 142, 63, 64, 152 },
#endif // CONFIG_EXT_PARTITION
};
#if CONFIG_NEW_MULTISYMBOL
const aom_cdf_prob
default_palette_y_size_cdf[PALETTE_BLOCK_SIZES][CDF_SIZE(PALETTE_SIZES)] = {
{ AOM_ICDF(12288), AOM_ICDF(19408), AOM_ICDF(24627), AOM_ICDF(26662),
AOM_ICDF(28499), AOM_ICDF(30667), AOM_ICDF(32768), 0 },
{ AOM_ICDF(2815), AOM_ICDF(4570), AOM_ICDF(9416), AOM_ICDF(10875),
AOM_ICDF(13782), AOM_ICDF(19863), AOM_ICDF(32768), 0 },
{ AOM_ICDF(3839), AOM_ICDF(5986), AOM_ICDF(11949), AOM_ICDF(13413),
AOM_ICDF(16286), AOM_ICDF(21823), AOM_ICDF(32768), 0 },
{ AOM_ICDF(12032), AOM_ICDF(14948), AOM_ICDF(22187), AOM_ICDF(23138),
AOM_ICDF(24756), AOM_ICDF(27635), AOM_ICDF(32768), 0 },
{ AOM_ICDF(14847), AOM_ICDF(20167), AOM_ICDF(25433), AOM_ICDF(26751),
AOM_ICDF(28278), AOM_ICDF(30119), AOM_ICDF(32768), 0 },
{ AOM_ICDF(14336), AOM_ICDF(20240), AOM_ICDF(24840), AOM_ICDF(26079),
AOM_ICDF(27908), AOM_ICDF(30034), AOM_ICDF(32768), 0 },
{ AOM_ICDF(18816), AOM_ICDF(25574), AOM_ICDF(29030), AOM_ICDF(29877),
AOM_ICDF(30656), AOM_ICDF(31506), AOM_ICDF(32768), 0 },
{ AOM_ICDF(23039), AOM_ICDF(27333), AOM_ICDF(30220), AOM_ICDF(30708),
AOM_ICDF(31070), AOM_ICDF(31826), AOM_ICDF(32768), 0 },
{ AOM_ICDF(13696), AOM_ICDF(18911), AOM_ICDF(23620), AOM_ICDF(25371),
AOM_ICDF(29821), AOM_ICDF(31617), AOM_ICDF(32768), 0 },
{ AOM_ICDF(12543), AOM_ICDF(20838), AOM_ICDF(27455), AOM_ICDF(28762),
AOM_ICDF(29763), AOM_ICDF(31546), AOM_ICDF(32768), 0 },
#if CONFIG_EXT_PARTITION
{ AOM_ICDF(12543), AOM_ICDF(20838), AOM_ICDF(27455), AOM_ICDF(28762),
AOM_ICDF(29763), AOM_ICDF(31546), AOM_ICDF(32768), 0 },
{ AOM_ICDF(12543), AOM_ICDF(20838), AOM_ICDF(27455), AOM_ICDF(28762),
AOM_ICDF(29763), AOM_ICDF(31546), AOM_ICDF(32768), 0 },
{ AOM_ICDF(12543), AOM_ICDF(20838), AOM_ICDF(27455), AOM_ICDF(28762),
AOM_ICDF(29763), AOM_ICDF(31546), AOM_ICDF(32768), 0 },
#endif
};
#endif // CONFIG_NEW_MULTISYMBOL
const aom_prob
av1_default_palette_uv_size_prob[PALETTE_BLOCK_SIZES][PALETTE_SIZES - 1] = {
{ 160, 196, 228, 213, 175, 230 }, { 87, 148, 208, 141, 166, 163 },
{ 72, 151, 204, 139, 155, 161 }, { 78, 135, 171, 104, 120, 173 },
{ 59, 92, 131, 78, 92, 142 }, { 75, 118, 149, 84, 90, 128 },
{ 89, 87, 92, 66, 66, 128 }, { 67, 53, 54, 55, 66, 93 },
{ 120, 130, 83, 171, 75, 214 }, { 72, 55, 66, 68, 79, 107 },
#if CONFIG_EXT_PARTITION
{ 72, 55, 66, 68, 79, 107 }, { 72, 55, 66, 68, 79, 107 },
{ 72, 55, 66, 68, 79, 107 },
#endif // CONFIG_EXT_PARTITION
};
#if CONFIG_NEW_MULTISYMBOL
const aom_cdf_prob default_palette_uv_size_cdf[PALETTE_BLOCK_SIZES][CDF_SIZE(
PALETTE_SIZES)] = {
{ AOM_ICDF(20480), AOM_ICDF(29888), AOM_ICDF(32453), AOM_ICDF(32715),
AOM_ICDF(32751), AOM_ICDF(32766), AOM_ICDF(32768), 0 },
{ AOM_ICDF(11135), AOM_ICDF(23641), AOM_ICDF(31056), AOM_ICDF(31998),
AOM_ICDF(32496), AOM_ICDF(32668), AOM_ICDF(32768), 0 },
{ AOM_ICDF(9216), AOM_ICDF(23108), AOM_ICDF(30806), AOM_ICDF(31871),
AOM_ICDF(32414), AOM_ICDF(32637), AOM_ICDF(32768), 0 },
{ AOM_ICDF(9984), AOM_ICDF(21999), AOM_ICDF(29192), AOM_ICDF(30645),
AOM_ICDF(31640), AOM_ICDF(32402), AOM_ICDF(32768), 0 },
{ AOM_ICDF(7552), AOM_ICDF(16614), AOM_ICDF(24880), AOM_ICDF(27283),
AOM_ICDF(29254), AOM_ICDF(31203), AOM_ICDF(32768), 0 },
{ AOM_ICDF(9600), AOM_ICDF(20279), AOM_ICDF(27548), AOM_ICDF(29261),
AOM_ICDF(30494), AOM_ICDF(31631), AOM_ICDF(32768), 0 },
{ AOM_ICDF(11391), AOM_ICDF(18656), AOM_ICDF(23727), AOM_ICDF(26058),
AOM_ICDF(27788), AOM_ICDF(30278), AOM_ICDF(32768), 0 },
{ AOM_ICDF(8576), AOM_ICDF(13585), AOM_ICDF(17632), AOM_ICDF(20884),
AOM_ICDF(23948), AOM_ICDF(27152), AOM_ICDF(32768), 0 },
{ AOM_ICDF(15360), AOM_ICDF(24200), AOM_ICDF(26978), AOM_ICDF(30846),
AOM_ICDF(31409), AOM_ICDF(32545), AOM_ICDF(32768), 0 },
{ AOM_ICDF(9216), AOM_ICDF(14276), AOM_ICDF(19043), AOM_ICDF(22689),
AOM_ICDF(25799), AOM_ICDF(28712), AOM_ICDF(32768), 0 },
#if CONFIG_EXT_PARTITION
{ AOM_ICDF(9216), AOM_ICDF(14276), AOM_ICDF(19043), AOM_ICDF(22689),
AOM_ICDF(25799), AOM_ICDF(28712), AOM_ICDF(32768), 0 },
{ AOM_ICDF(9216), AOM_ICDF(14276), AOM_ICDF(19043), AOM_ICDF(22689),
AOM_ICDF(25799), AOM_ICDF(28712), AOM_ICDF(32768), 0 },
{ AOM_ICDF(9216), AOM_ICDF(14276), AOM_ICDF(19043), AOM_ICDF(22689),
AOM_ICDF(25799), AOM_ICDF(28712), AOM_ICDF(32768), 0 },
#endif
};
#endif // CONFIG_NEW_MULTISYMBOL
// When palette mode is enabled, following probability tables indicate the
// probabilities to code the "is_palette" bit (i.e. the bit that indicates
// if this block uses palette mode or DC_PRED mode).
const aom_prob av1_default_palette_y_mode_prob
[PALETTE_BLOCK_SIZES][PALETTE_Y_MODE_CONTEXTS] = {
{ 240, 180, 100 }, { 240, 180, 100 }, { 240, 180, 100 },
{ 240, 180, 100 }, { 240, 180, 100 }, { 240, 180, 100 },
{ 240, 180, 100 }, { 240, 180, 100 }, { 240, 180, 100 },
{ 240, 180, 100 },
#if CONFIG_EXT_PARTITION
{ 240, 180, 100 }, { 240, 180, 100 }, { 240, 180, 100 },
#endif // CONFIG_EXT_PARTITION
};
const aom_prob av1_default_palette_uv_mode_prob[PALETTE_UV_MODE_CONTEXTS] = {
253, 229
};
// Trees to code palette color indices (for various palette sizes), and the
// corresponding probability tables for Y and UV planes.
const aom_tree_index
av1_palette_color_index_tree[PALETTE_SIZES][TREE_SIZE(PALETTE_COLORS)] = {
{ // 2 colors
-PALETTE_COLOR_ONE, -PALETTE_COLOR_TWO },
{ // 3 colors
-PALETTE_COLOR_ONE, 2, -PALETTE_COLOR_TWO, -PALETTE_COLOR_THREE },
{ // 4 colors
-PALETTE_COLOR_ONE, 2, -PALETTE_COLOR_TWO, 4, -PALETTE_COLOR_THREE,
-PALETTE_COLOR_FOUR },
{ // 5 colors
-PALETTE_COLOR_ONE, 2, -PALETTE_COLOR_TWO, 4, -PALETTE_COLOR_THREE, 6,
-PALETTE_COLOR_FOUR, -PALETTE_COLOR_FIVE },
{ // 6 colors
-PALETTE_COLOR_ONE, 2, -PALETTE_COLOR_TWO, 4, -PALETTE_COLOR_THREE, 6,
-PALETTE_COLOR_FOUR, 8, -PALETTE_COLOR_FIVE, -PALETTE_COLOR_SIX },
{ // 7 colors
-PALETTE_COLOR_ONE, 2, -PALETTE_COLOR_TWO, 4, -PALETTE_COLOR_THREE, 6,
-PALETTE_COLOR_FOUR, 8, -PALETTE_COLOR_FIVE, 10, -PALETTE_COLOR_SIX,
-PALETTE_COLOR_SEVEN },
{ // 8 colors
-PALETTE_COLOR_ONE, 2, -PALETTE_COLOR_TWO, 4, -PALETTE_COLOR_THREE, 6,
-PALETTE_COLOR_FOUR, 8, -PALETTE_COLOR_FIVE, 10, -PALETTE_COLOR_SIX, 12,
-PALETTE_COLOR_SEVEN, -PALETTE_COLOR_EIGHT },
};
// Note: Has to be non-zero to avoid any asserts triggering.
#define UNUSED_PROB 128
const aom_prob av1_default_palette_y_color_index_prob
[PALETTE_SIZES][PALETTE_COLOR_INDEX_CONTEXTS][PALETTE_COLORS - 1] = {
{
// 2 colors
{ 231, UNUSED_PROB, UNUSED_PROB, UNUSED_PROB, UNUSED_PROB,
UNUSED_PROB, UNUSED_PROB },
{ UNUSED_PROB, UNUSED_PROB, UNUSED_PROB, UNUSED_PROB, UNUSED_PROB,
UNUSED_PROB, UNUSED_PROB },
{ 69, UNUSED_PROB, UNUSED_PROB, UNUSED_PROB, UNUSED_PROB, UNUSED_PROB,
UNUSED_PROB },
{ 224, UNUSED_PROB, UNUSED_PROB, UNUSED_PROB, UNUSED_PROB,
UNUSED_PROB, UNUSED_PROB },
{ 249, UNUSED_PROB, UNUSED_PROB, UNUSED_PROB, UNUSED_PROB,
UNUSED_PROB, UNUSED_PROB },
},
{
// 3 colors
{ 219, 124, UNUSED_PROB, UNUSED_PROB, UNUSED_PROB, UNUSED_PROB,
UNUSED_PROB },
{ 91, 191, UNUSED_PROB, UNUSED_PROB, UNUSED_PROB, UNUSED_PROB,
UNUSED_PROB },
{ 34, 237, UNUSED_PROB, UNUSED_PROB, UNUSED_PROB, UNUSED_PROB,
UNUSED_PROB },
{ 184, 118, UNUSED_PROB, UNUSED_PROB, UNUSED_PROB, UNUSED_PROB,
UNUSED_PROB },
{ 252, 124, UNUSED_PROB, UNUSED_PROB, UNUSED_PROB, UNUSED_PROB,
UNUSED_PROB },
},
{
// 4 colors
{ 204, 87, 97, UNUSED_PROB, UNUSED_PROB, UNUSED_PROB, UNUSED_PROB },
{ 74, 144, 129, UNUSED_PROB, UNUSED_PROB, UNUSED_PROB, UNUSED_PROB },
{ 52, 191, 134, UNUSED_PROB, UNUSED_PROB, UNUSED_PROB, UNUSED_PROB },
{ 151, 85, 147, UNUSED_PROB, UNUSED_PROB, UNUSED_PROB, UNUSED_PROB },
{ 248, 60, 115, UNUSED_PROB, UNUSED_PROB, UNUSED_PROB, UNUSED_PROB },
},
{
// 5 colors
{ 218, 69, 62, 106, UNUSED_PROB, UNUSED_PROB, UNUSED_PROB },
{ 76, 143, 89, 127, UNUSED_PROB, UNUSED_PROB, UNUSED_PROB },
{ 21, 233, 94, 131, UNUSED_PROB, UNUSED_PROB, UNUSED_PROB },
{ 172, 72, 89, 112, UNUSED_PROB, UNUSED_PROB, UNUSED_PROB },
{ 253, 66, 65, 128, UNUSED_PROB, UNUSED_PROB, UNUSED_PROB },
},
{
// 6 colors
{ 190, 60, 47, 54, 74, UNUSED_PROB, UNUSED_PROB },
{ 62, 106, 51, 95, 110, UNUSED_PROB, UNUSED_PROB },
{ 52, 180, 69, 72, 107, UNUSED_PROB, UNUSED_PROB },
{ 156, 83, 72, 83, 101, UNUSED_PROB, UNUSED_PROB },
{ 245, 45, 37, 52, 91, UNUSED_PROB, UNUSED_PROB },
},
{
// 7 colors
{ 206, 56, 42, 42, 53, 85, UNUSED_PROB },
{ 70, 100, 45, 68, 77, 94, UNUSED_PROB },
{ 57, 169, 51, 62, 74, 119, UNUSED_PROB },
{ 172, 76, 71, 40, 59, 76, UNUSED_PROB },
{ 248, 47, 36, 53, 61, 110, UNUSED_PROB },
},
{
// 8 colors
{ 208, 52, 38, 34, 34, 44, 66 },
{ 52, 107, 34, 73, 69, 82, 87 },
{ 28, 208, 53, 43, 62, 70, 102 },
{ 184, 64, 45, 37, 37, 69, 105 },
{ 251, 18, 31, 45, 47, 61, 104 },
},
};
#if CONFIG_NEW_MULTISYMBOL
const aom_cdf_prob default_palette_y_color_index_cdf
[PALETTE_SIZES][PALETTE_COLOR_INDEX_CONTEXTS][CDF_SIZE(PALETTE_COLORS)] = {
{
{ AOM_ICDF(29568), AOM_ICDF(32768), 0, 0, 0, 0, 0, 0, 0 },
{ AOM_ICDF(16384), AOM_ICDF(32768), 0, 0, 0, 0, 0, 0, 0 },
{ AOM_ICDF(8832), AOM_ICDF(32768), 0, 0, 0, 0, 0, 0, 0 },
{ AOM_ICDF(28672), AOM_ICDF(32768), 0, 0, 0, 0, 0, 0, 0 },
{ AOM_ICDF(31872), AOM_ICDF(32768), 0, 0, 0, 0, 0, 0, 0 },
},
{
{ AOM_ICDF(28032), AOM_ICDF(30326), AOM_ICDF(32768), 0, 0, 0, 0, 0,
0 },
{ AOM_ICDF(11647), AOM_ICDF(27405), AOM_ICDF(32768), 0, 0, 0, 0, 0,
0 },
{ AOM_ICDF(4352), AOM_ICDF(30659), AOM_ICDF(32768), 0, 0, 0, 0, 0,
0 },
{ AOM_ICDF(23552), AOM_ICDF(27800), AOM_ICDF(32768), 0, 0, 0, 0, 0,
0 },
{ AOM_ICDF(32256), AOM_ICDF(32504), AOM_ICDF(32768), 0, 0, 0, 0, 0,
0 },
},
{
{ AOM_ICDF(26112), AOM_ICDF(28374), AOM_ICDF(30039), AOM_ICDF(32768),
0, 0, 0, 0, 0 },
{ AOM_ICDF(9472), AOM_ICDF(22576), AOM_ICDF(27712), AOM_ICDF(32768),
0, 0, 0, 0, 0 },
{ AOM_ICDF(6656), AOM_ICDF(26138), AOM_ICDF(29608), AOM_ICDF(32768),
0, 0, 0, 0, 0 },
{ AOM_ICDF(19328), AOM_ICDF(23791), AOM_ICDF(28946), AOM_ICDF(32768),
0, 0, 0, 0, 0 },
{ AOM_ICDF(31744), AOM_ICDF(31984), AOM_ICDF(32336), AOM_ICDF(32768),
0, 0, 0, 0, 0 },
},
{
{ AOM_ICDF(27904), AOM_ICDF(29215), AOM_ICDF(30075), AOM_ICDF(31190),
AOM_ICDF(32768), 0, 0, 0, 0 },
{ AOM_ICDF(9728), AOM_ICDF(22598), AOM_ICDF(26134), AOM_ICDF(29425),
AOM_ICDF(32768), 0, 0, 0, 0 },
{ AOM_ICDF(2688), AOM_ICDF(30066), AOM_ICDF(31058), AOM_ICDF(31933),
AOM_ICDF(32768), 0, 0, 0, 0 },
{ AOM_ICDF(22015), AOM_ICDF(25039), AOM_ICDF(27726), AOM_ICDF(29932),
AOM_ICDF(32768), 0, 0, 0, 0 },
{ AOM_ICDF(32383), AOM_ICDF(32482), AOM_ICDF(32554), AOM_ICDF(32660),
AOM_ICDF(32768), 0, 0, 0, 0 },
},
{
{ AOM_ICDF(24319), AOM_ICDF(26299), AOM_ICDF(27486), AOM_ICDF(28600),
AOM_ICDF(29804), AOM_ICDF(32768), 0, 0, 0 },
{ AOM_ICDF(7935), AOM_ICDF(18217), AOM_ICDF(21116), AOM_ICDF(25440),
AOM_ICDF(28589), AOM_ICDF(32768), 0, 0, 0 },
{ AOM_ICDF(6656), AOM_ICDF(25016), AOM_ICDF(27105), AOM_ICDF(28698),
AOM_ICDF(30399), AOM_ICDF(32768), 0, 0, 0 },
{ AOM_ICDF(19967), AOM_ICDF(24117), AOM_ICDF(26550), AOM_ICDF(28566),
AOM_ICDF(30224), AOM_ICDF(32768), 0, 0, 0 },
{ AOM_ICDF(31359), AOM_ICDF(31607), AOM_ICDF(31775), AOM_ICDF(31977),
AOM_ICDF(32258), AOM_ICDF(32768), 0, 0, 0 },
},
{
{ AOM_ICDF(26368), AOM_ICDF(27768), AOM_ICDF(28588), AOM_ICDF(29274),
AOM_ICDF(29997), AOM_ICDF(30917), AOM_ICDF(32768), 0, 0 },
{ AOM_ICDF(8960), AOM_ICDF(18260), AOM_ICDF(20810), AOM_ICDF(23986),
AOM_ICDF(26627), AOM_ICDF(28882), AOM_ICDF(32768), 0, 0 },
{ AOM_ICDF(7295), AOM_ICDF(24111), AOM_ICDF(25836), AOM_ICDF(27515),
AOM_ICDF(29033), AOM_ICDF(30769), AOM_ICDF(32768), 0, 0 },
{ AOM_ICDF(22016), AOM_ICDF(25208), AOM_ICDF(27305), AOM_ICDF(28159),
AOM_ICDF(29221), AOM_ICDF(30274), AOM_ICDF(32768), 0, 0 },
{ AOM_ICDF(31744), AOM_ICDF(31932), AOM_ICDF(32050), AOM_ICDF(32199),
AOM_ICDF(32335), AOM_ICDF(32521), AOM_ICDF(32768), 0, 0 },
},
{
{ AOM_ICDF(26624), AOM_ICDF(27872), AOM_ICDF(28599), AOM_ICDF(29153),
AOM_ICDF(29633), AOM_ICDF(30172), AOM_ICDF(30841), AOM_ICDF(32768),
0 },
{ AOM_ICDF(6655), AOM_ICDF(17569), AOM_ICDF(19587), AOM_ICDF(23345),
AOM_ICDF(25884), AOM_ICDF(28088), AOM_ICDF(29678), AOM_ICDF(32768),
0 },
{ AOM_ICDF(3584), AOM_ICDF(27296), AOM_ICDF(28429), AOM_ICDF(29158),
AOM_ICDF(30032), AOM_ICDF(30780), AOM_ICDF(31572), AOM_ICDF(32768),
0 },
{ AOM_ICDF(23551), AOM_ICDF(25855), AOM_ICDF(27070), AOM_ICDF(27893),
AOM_ICDF(28597), AOM_ICDF(29721), AOM_ICDF(30970), AOM_ICDF(32768),
0 },
{ AOM_ICDF(32128), AOM_ICDF(32173), AOM_ICDF(32245), AOM_ICDF(32337),
AOM_ICDF(32416), AOM_ICDF(32500), AOM_ICDF(32609), AOM_ICDF(32768),
0 },
},
};
#endif
const aom_prob av1_default_palette_uv_color_index_prob
[PALETTE_SIZES][PALETTE_COLOR_INDEX_CONTEXTS][PALETTE_COLORS - 1] = {
{
// 2 colors
{ 233, UNUSED_PROB, UNUSED_PROB, UNUSED_PROB, UNUSED_PROB,
UNUSED_PROB, UNUSED_PROB },
{ UNUSED_PROB, UNUSED_PROB, UNUSED_PROB, UNUSED_PROB, UNUSED_PROB,
UNUSED_PROB, UNUSED_PROB },
{ 69, UNUSED_PROB, UNUSED_PROB, UNUSED_PROB, UNUSED_PROB, UNUSED_PROB,
UNUSED_PROB },
{ 240, UNUSED_PROB, UNUSED_PROB, UNUSED_PROB, UNUSED_PROB,
UNUSED_PROB, UNUSED_PROB },
{ 248, UNUSED_PROB, UNUSED_PROB, UNUSED_PROB, UNUSED_PROB,
UNUSED_PROB, UNUSED_PROB },
},
{
// 3 colors
{ 216, 128, UNUSED_PROB, UNUSED_PROB, UNUSED_PROB, UNUSED_PROB,
UNUSED_PROB },
{ 110, 171, UNUSED_PROB, UNUSED_PROB, UNUSED_PROB, UNUSED_PROB,
UNUSED_PROB },
{ 40, 239, UNUSED_PROB, UNUSED_PROB, UNUSED_PROB, UNUSED_PROB,
UNUSED_PROB },
{ 191, 104, UNUSED_PROB, UNUSED_PROB, UNUSED_PROB, UNUSED_PROB,
UNUSED_PROB },
{ 247, 134, UNUSED_PROB, UNUSED_PROB, UNUSED_PROB, UNUSED_PROB,
UNUSED_PROB },
},
{
// 4 colors
{ 202, 89, 132, UNUSED_PROB, UNUSED_PROB, UNUSED_PROB, UNUSED_PROB },
{ 90, 132, 136, UNUSED_PROB, UNUSED_PROB, UNUSED_PROB, UNUSED_PROB },
{ 63, 195, 149, UNUSED_PROB, UNUSED_PROB, UNUSED_PROB, UNUSED_PROB },
{ 152, 84, 152, UNUSED_PROB, UNUSED_PROB, UNUSED_PROB, UNUSED_PROB },
{ 241, 87, 136, UNUSED_PROB, UNUSED_PROB, UNUSED_PROB, UNUSED_PROB },
},
{
// 5 colors
{ 209, 54, 82, 134, UNUSED_PROB, UNUSED_PROB, UNUSED_PROB },
{ 94, 173, 180, 93, UNUSED_PROB, UNUSED_PROB, UNUSED_PROB },
{ 10, 251, 127, 84, UNUSED_PROB, UNUSED_PROB, UNUSED_PROB },
{ 183, 20, 150, 47, UNUSED_PROB, UNUSED_PROB, UNUSED_PROB },
{ 252, 73, 111, 150, UNUSED_PROB, UNUSED_PROB, UNUSED_PROB },
},
{
// 6 colors
{ 192, 67, 59, 46, 184, UNUSED_PROB, UNUSED_PROB },
{ 59, 92, 61, 100, 130, UNUSED_PROB, UNUSED_PROB },
{ 49, 162, 68, 91, 150, UNUSED_PROB, UNUSED_PROB },
{ 133, 29, 36, 153, 101, UNUSED_PROB, UNUSED_PROB },
{ 247, 71, 44, 90, 129, UNUSED_PROB, UNUSED_PROB },
},
{
// 7 colors
{ 182, 62, 80, 78, 46, 116, UNUSED_PROB },
{ 59, 62, 39, 81, 65, 99, UNUSED_PROB },
{ 54, 177, 48, 58, 93, 104, UNUSED_PROB },
{ 137, 79, 54, 55, 44, 134, UNUSED_PROB },
{ 239, 82, 79, 44, 69, 71, UNUSED_PROB },
},
{
// 8 colors
{ 172, 53, 27, 67, 30, 79, 113 },
{ 63, 57, 45, 81, 62, 35, 47 },
{ 51, 200, 36, 47, 82, 165, 129 },
{ 141, 100, 47, 29, 33, 37, 129 },
{ 236, 42, 50, 91, 24, 154, 65 },
},
};
#if CONFIG_NEW_MULTISYMBOL
const aom_cdf_prob default_palette_uv_color_index_cdf
[PALETTE_SIZES][PALETTE_COLOR_INDEX_CONTEXTS][CDF_SIZE(PALETTE_COLORS)] = {
{
{ AOM_ICDF(29824), AOM_ICDF(32768), 0, 0, 0, 0, 0, 0, 0 },
{ AOM_ICDF(16384), AOM_ICDF(32768), 0, 0, 0, 0, 0, 0, 0 },
{ AOM_ICDF(8832), AOM_ICDF(32768), 0, 0, 0, 0, 0, 0, 0 },
{ AOM_ICDF(30720), AOM_ICDF(32768), 0, 0, 0, 0, 0, 0, 0 },
{ AOM_ICDF(31744), AOM_ICDF(32768), 0, 0, 0, 0, 0, 0, 0 },
},
{
{ AOM_ICDF(27648), AOM_ICDF(30208), AOM_ICDF(32768), 0, 0, 0, 0, 0,
0 },
{ AOM_ICDF(14080), AOM_ICDF(26563), AOM_ICDF(32768), 0, 0, 0, 0, 0,
0 },
{ AOM_ICDF(5120), AOM_ICDF(30932), AOM_ICDF(32768), 0, 0, 0, 0, 0,
0 },
{ AOM_ICDF(24448), AOM_ICDF(27828), AOM_ICDF(32768), 0, 0, 0, 0, 0,
0 },
{ AOM_ICDF(31616), AOM_ICDF(32219), AOM_ICDF(32768), 0, 0, 0, 0, 0,
0 },
},
{
{ AOM_ICDF(25856), AOM_ICDF(28259), AOM_ICDF(30584), AOM_ICDF(32768),
0, 0, 0, 0, 0 },
{ AOM_ICDF(11520), AOM_ICDF(22476), AOM_ICDF(27944), AOM_ICDF(32768),
0, 0, 0, 0, 0 },
{ AOM_ICDF(8064), AOM_ICDF(26882), AOM_ICDF(30308), AOM_ICDF(32768),
0, 0, 0, 0, 0 },
{ AOM_ICDF(19455), AOM_ICDF(23823), AOM_ICDF(29134), AOM_ICDF(32768),
0, 0, 0, 0, 0 },
{ AOM_ICDF(30848), AOM_ICDF(31501), AOM_ICDF(32174), AOM_ICDF(32768),
0, 0, 0, 0, 0 },
},
{
{ AOM_ICDF(26751), AOM_ICDF(28020), AOM_ICDF(29541), AOM_ICDF(31230),
AOM_ICDF(32768), 0, 0, 0, 0 },
{ AOM_ICDF(12032), AOM_ICDF(26045), AOM_ICDF(30772), AOM_ICDF(31497),
AOM_ICDF(32768), 0, 0, 0, 0 },
{ AOM_ICDF(1280), AOM_ICDF(32153), AOM_ICDF(32458), AOM_ICDF(32560),
AOM_ICDF(32768), 0, 0, 0, 0 },
{ AOM_ICDF(23424), AOM_ICDF(24154), AOM_ICDF(29201), AOM_ICDF(29856),
AOM_ICDF(32768), 0, 0, 0, 0 },
{ AOM_ICDF(32256), AOM_ICDF(32402), AOM_ICDF(32561), AOM_ICDF(32682),
AOM_ICDF(32768), 0, 0, 0, 0 },
},
{
{ AOM_ICDF(24576), AOM_ICDF(26720), AOM_ICDF(28114), AOM_ICDF(28950),
AOM_ICDF(31694), AOM_ICDF(32768), 0, 0, 0 },
{ AOM_ICDF(7551), AOM_ICDF(16613), AOM_ICDF(20462), AOM_ICDF(25269),
AOM_ICDF(29077), AOM_ICDF(32768), 0, 0, 0 },
{ AOM_ICDF(6272), AOM_ICDF(23039), AOM_ICDF(25623), AOM_ICDF(28163),
AOM_ICDF(30861), AOM_ICDF(32768), 0, 0, 0 },
{ AOM_ICDF(17024), AOM_ICDF(18808), AOM_ICDF(20771), AOM_ICDF(27941),
AOM_ICDF(29845), AOM_ICDF(32768), 0, 0, 0 },
{ AOM_ICDF(31616), AOM_ICDF(31936), AOM_ICDF(32079), AOM_ICDF(32321),
AOM_ICDF(32546), AOM_ICDF(32768), 0, 0, 0 },
},
{
{ AOM_ICDF(23296), AOM_ICDF(25590), AOM_ICDF(27833), AOM_ICDF(29337),
AOM_ICDF(29954), AOM_ICDF(31229), AOM_ICDF(32768), 0, 0 },
{ AOM_ICDF(7552), AOM_ICDF(13659), AOM_ICDF(16570), AOM_ICDF(21695),
AOM_ICDF(24506), AOM_ICDF(27701), AOM_ICDF(32768), 0, 0 },
{ AOM_ICDF(6911), AOM_ICDF(24788), AOM_ICDF(26284), AOM_ICDF(27753),
AOM_ICDF(29575), AOM_ICDF(30872), AOM_ICDF(32768), 0, 0 },
{ AOM_ICDF(17535), AOM_ICDF(22236), AOM_ICDF(24457), AOM_ICDF(26242),
AOM_ICDF(27363), AOM_ICDF(30191), AOM_ICDF(32768), 0, 0 },
{ AOM_ICDF(30592), AOM_ICDF(31289), AOM_ICDF(31745), AOM_ICDF(31921),
AOM_ICDF(32149), AOM_ICDF(32321), AOM_ICDF(32768), 0, 0 },
},
{
{ AOM_ICDF(22016), AOM_ICDF(24242), AOM_ICDF(25141), AOM_ICDF(27137),
AOM_ICDF(27797), AOM_ICDF(29331), AOM_ICDF(30848), AOM_ICDF(32768),
0 },
{ AOM_ICDF(8063), AOM_ICDF(13564), AOM_ICDF(16940), AOM_ICDF(21948),
AOM_ICDF(24568), AOM_ICDF(25689), AOM_ICDF(26989), AOM_ICDF(32768),
0 },
{ AOM_ICDF(6528), AOM_ICDF(27028), AOM_ICDF(27835), AOM_ICDF(28741),
AOM_ICDF(30031), AOM_ICDF(31795), AOM_ICDF(32285), AOM_ICDF(32768),
0 },
{ AOM_ICDF(18047), AOM_ICDF(23797), AOM_ICDF(25444), AOM_ICDF(26274),
AOM_ICDF(27111), AOM_ICDF(27929), AOM_ICDF(30367), AOM_ICDF(32768),
0 },
{ AOM_ICDF(30208), AOM_ICDF(30628), AOM_ICDF(31046), AOM_ICDF(31658),
AOM_ICDF(31762), AOM_ICDF(32367), AOM_ICDF(32469), AOM_ICDF(32768),
0 },
}
};
#endif // CONFIG_NEW_MULTISYMBOL
#undef UNUSED_PROB
#define MAX_COLOR_CONTEXT_HASH 8
// Negative values are invalid
static const int palette_color_index_context_lookup[MAX_COLOR_CONTEXT_HASH +
1] = { -1, -1, 0, -1, -1,
4, 3, 2, 1 };
#endif // CONFIG_PALETTE
// The transform size is coded as an offset to the smallest transform
// block size.
const aom_tree_index av1_tx_size_tree[MAX_TX_DEPTH][TREE_SIZE(TX_SIZES)] = {
{
// Max tx_size is 8X8
-0, -1,
},
{
// Max tx_size is 16X16
-0, 2, -1, -2,
},
{
// Max tx_size is 32X32
-0, 2, -1, 4, -2, -3,
},
#if CONFIG_TX64X64
{
// Max tx_size is 64X64
-0, 2, -1, 4, -2, 6, -3, -4,
},
#endif // CONFIG_TX64X64
};
static const aom_prob default_tx_size_prob[MAX_TX_DEPTH][TX_SIZE_CONTEXTS]
[MAX_TX_DEPTH] = {
{
// Max tx_size is 8X8
{ 100 },
{ 66 },
},
{
// Max tx_size is 16X16
{ 20, 152 },
{ 15, 101 },
},
{
// Max tx_size is 32X32
{ 3, 136, 37 },
{ 5, 52, 13 },
},
#if CONFIG_TX64X64
{
// Max tx_size is 64X64
{ 1, 64, 136, 127 },
{ 1, 32, 52, 67 },
},
#endif // CONFIG_TX64X64
};
#if CONFIG_EXT_TX && CONFIG_RECT_TX && CONFIG_RECT_TX_EXT
static const aom_prob default_quarter_tx_size_prob = 192;
#endif // CONFIG_EXT_TX && CONFIG_RECT_TX && CONFIG_RECT_TX_EXT
#if CONFIG_LOOP_RESTORATION
const aom_tree_index
av1_switchable_restore_tree[TREE_SIZE(RESTORE_SWITCHABLE_TYPES)] = {
-RESTORE_NONE, 2, -RESTORE_WIENER, -RESTORE_SGRPROJ,
};
static const aom_prob
default_switchable_restore_prob[RESTORE_SWITCHABLE_TYPES - 1] = {
32, 128,
};
#endif // CONFIG_LOOP_RESTORATION
#if CONFIG_PALETTE
#define NUM_PALETTE_NEIGHBORS 3 // left, top-left and top.
int av1_get_palette_color_index_context(const uint8_t *color_map, int stride,
int r, int c, int palette_size,
uint8_t *color_order, int *color_idx) {
int i;
// The +10 below should not be needed. But we get a warning "array subscript
// is above array bounds [-Werror=array-bounds]" without it, possibly due to
// this (or similar) bug: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59124
int scores[PALETTE_MAX_SIZE + 10];
const int weights[NUM_PALETTE_NEIGHBORS] = { 2, 1, 2 };
const int hash_multipliers[NUM_PALETTE_NEIGHBORS] = { 1, 2, 2 };
int color_index_ctx_hash;
int color_index_ctx;
int color_neighbors[NUM_PALETTE_NEIGHBORS];
int inverse_color_order[PALETTE_MAX_SIZE];
assert(palette_size <= PALETTE_MAX_SIZE);
assert(r > 0 || c > 0);
// Get color indices of neighbors.
color_neighbors[0] = (c - 1 >= 0) ? color_map[r * stride + c - 1] : -1;
color_neighbors[1] =
(c - 1 >= 0 && r - 1 >= 0) ? color_map[(r - 1) * stride + c - 1] : -1;
color_neighbors[2] = (r - 1 >= 0) ? color_map[(r - 1) * stride + c] : -1;
for (i = 0; i < PALETTE_MAX_SIZE; ++i) {
color_order[i] = i;
inverse_color_order[i] = i;
}
memset(scores, 0, PALETTE_MAX_SIZE * sizeof(scores[0]));
for (i = 0; i < NUM_PALETTE_NEIGHBORS; ++i) {
if (color_neighbors[i] >= 0) {
scores[color_neighbors[i]] += weights[i];
}
}
// Get the top NUM_PALETTE_NEIGHBORS scores (sorted from large to small).
for (i = 0; i < NUM_PALETTE_NEIGHBORS; ++i) {
int max = scores[i];
int max_idx = i;
int j;
for (j = i + 1; j < palette_size; ++j) {
if (scores[j] > max) {
max = scores[j];
max_idx = j;
}