Commit 1d7db728 authored by Thomas Davies's avatar Thomas Davies
Browse files

Use default CDF tables when initialising mode probs.

No change in BDR.

Change-Id: I77551120a2e94dcbf818b039154495f0f9b21755
parent e6862004
......@@ -16,10 +16,6 @@
#include "av1/common/onyxc_int.h"
#include "av1/common/seg_common.h"
#if CONFIG_EC_MULTISYMBOL
aom_cdf_prob av1_kf_y_mode_cdf[INTRA_MODES][INTRA_MODES][CDF_SIZE(INTRA_MODES)];
#endif
#if CONFIG_ALT_INTRA
const aom_prob av1_kf_y_mode_prob[INTRA_MODES][INTRA_MODES][INTRA_MODES - 1] = {
......@@ -1552,6 +1548,213 @@ static const aom_prob default_segment_pred_probs[PREDICTION_PROBS] = {
};
// clang-format on
#if CONFIG_EC_MULTISYMBOL
static const aom_cdf_prob
default_switchable_interp_cdf[SWITCHABLE_FILTER_CONTEXTS]
[CDF_SIZE(SWITCHABLE_FILTERS)] = {
{ 30080, 31781, 32768, 0 },
{ 4608, 32658, 32768, 0 },
{ 4352, 4685, 32768, 0 },
{ 19072, 26776, 32768, 0 },
};
static const aom_cdf_prob default_seg_tree_cdf[CDF_SIZE(MAX_SEGMENTS)] = {
4096, 8192, 12288, 16384, 20480, 24576, 28672, 32768, 0
};
static const aom_cdf_prob
default_tx_size_cdf[MAX_TX_DEPTH][TX_SIZE_CONTEXTS][CDF_SIZE(MAX_TX_DEPTH +
1)] = {
{ { 12800, 32768, 0 }, { 8448, 32768, 0 } },
{ { 2560, 20496, 32768, 0 }, { 1920, 14091, 32768, 0 } },
{ { 384, 17588, 19782, 32768, 0 }, { 640, 7166, 8466, 32768, 0 } },
#if CONFIG_TX64X64
{ { 128, 8288, 21293, 26986, 32768, 0 },
{ 128, 4208, 10009, 15965, 32768, 0 } },
#endif
};
static const aom_cdf_prob default_if_y_mode_cdf[BLOCK_SIZE_GROUPS][CDF_SIZE(
INTRA_MODES)] = {
{ 8320, 11376, 12880, 19959, 23072, 24067, 25461, 26917, 29157, 32768, 0 },
{ 16896, 21112, 21932, 27852, 28667, 28916, 29593, 30089, 30905, 32768, 0 },
{ 22144, 25464, 26006, 30364, 30583, 30655, 31183, 31400, 31646, 32768, 0 },
{ 28288, 30650, 30964, 32288, 32308, 32331, 32495, 32586, 32607, 32768, 0 },
};
static const aom_cdf_prob default_uv_mode_cdf[INTRA_MODES][CDF_SIZE(
INTRA_MODES)] = {
{ 15360, 15836, 20863, 27513, 28269, 29048, 29455, 30154, 31206, 32768, 0 },
{ 6144, 7392, 22657, 25981, 26965, 28779, 29309, 30890, 31763, 32768, 0 },
{ 8576, 9143, 11450, 27575, 28108, 28438, 28658, 28995, 30410, 32768, 0 },
{ 12416, 12814, 16244, 22057, 23492, 24700, 26213, 27954, 29778, 32768, 0 },
{ 10624, 11057, 14619, 19415, 23134, 25679, 26399, 27618, 30676, 32768, 0 },
{ 10240, 10680, 15684, 19118, 21856, 27563, 28234, 29332, 31278, 32768, 0 },
{ 11008, 11433, 14100, 22522, 24365, 25330, 25737, 26341, 30433, 32768, 0 },
{ 10880, 11308, 13991, 23645, 24679, 25433, 25977, 26746, 28463, 32768, 0 },
{ 9856, 10483, 16054, 19959, 21708, 23628, 24949, 28797, 30658, 32768, 0 },
{ 12928, 14556, 22168, 27789, 28543, 29663, 29893, 30645, 31682, 32768, 0 },
};
static const aom_cdf_prob
default_partition_cdf[PARTITION_CONTEXTS][CDF_SIZE(PARTITION_TYPES)] = {
{ 25472, 28949, 31052, 32768, 0 }, { 18816, 22250, 28783, 32768, 0 },
{ 18944, 26126, 29188, 32768, 0 }, { 15488, 22508, 27077, 32768, 0 },
{ 22272, 25265, 27815, 32768, 0 }, { 11776, 15138, 20854, 32768, 0 },
{ 10496, 19109, 21777, 32768, 0 }, { 6784, 10743, 14098, 32768, 0 },
{ 22656, 24947, 26749, 32768, 0 }, { 8704, 11148, 16469, 32768, 0 },
{ 6656, 14714, 16477, 32768, 0 }, { 2176, 3849, 5205, 32768, 0 },
{ 28416, 28994, 29436, 32768, 0 }, { 9216, 10688, 14483, 32768, 0 },
{ 7424, 10592, 11632, 32768, 0 }, { 1280, 2141, 2859, 32768, 0 },
};
static const aom_cdf_prob
default_inter_mode_cdf[INTER_MODE_CONTEXTS][CDF_SIZE(INTER_MODES)] = {
{ 256, 22227, 23627, 32768, 0 }, { 896, 18948, 23537, 32768, 0 },
{ 896, 21563, 24320, 32768, 0 }, { 896, 12599, 17799, 32768, 0 },
{ 1024, 8960, 13238, 32768, 0 }, { 2176, 11856, 14388, 32768, 0 },
{ 3200, 6550, 9622, 32768, 0 },
};
#if !CONFIG_EXT_TX
static const aom_cdf_prob
default_intra_ext_tx_cdf[EXT_TX_SIZES][TX_TYPES][CDF_SIZE(TX_TYPES)] = {
{ { 30720, 31400, 32084, 32768, 0 },
{ 512, 638, 31764, 32768, 0 },
{ 512, 638, 1642, 32768, 0 },
{ 512, 31760, 32264, 32768, 0 } },
{ { 31232, 31742, 32255, 32768, 0 },
{ 1024, 1272, 31784, 32768, 0 },
{ 1024, 1272, 2256, 32768, 0 },
{ 1024, 31776, 32272, 32768, 0 } },
{ { 31744, 32084, 32426, 32768, 0 },
{ 2048, 2528, 31823, 32768, 0 },
{ 2048, 2528, 3473, 32768, 0 },
{ 2048, 31808, 32288, 32768, 0 } },
};
static const aom_cdf_prob
default_inter_ext_tx_cdf[EXT_TX_SIZES][CDF_SIZE(TX_TYPES)] = {
{ 20480, 24560, 28664, 32768, 0 },
{ 22528, 25928, 29348, 32768, 0 },
{ 24576, 27296, 30032, 32768, 0 },
};
#endif
// CDF version of 'av1_kf_y_mode_prob'.
const aom_cdf_prob av1_kf_y_mode_cdf[INTRA_MODES][INTRA_MODES][CDF_SIZE(
INTRA_MODES)] = {
{ { 17536, 19321, 21527, 25360, 27516, 28026, 29323, 30023, 30999, 32768, 0 },
{ 11776, 15466, 22360, 24865, 26991, 27889, 29299, 30519, 31398, 32768, 0 },
{ 9344, 12272, 13793, 25813, 27359, 27654, 28573, 29130, 30551, 32768, 0 },
{ 11648, 14123, 16454, 19948, 22780, 23846, 27087, 28995, 30380, 32768, 0 },
{ 9216, 12436, 15295, 17996, 24006, 25465, 27405, 28725, 30383, 32768, 0 },
{ 9344, 12181, 14433, 16634, 20355, 24317, 26133, 29295, 31344, 32768, 0 },
{ 8576, 10750, 12556, 17996, 22315, 23609, 25040, 26157, 30573, 32768, 0 },
{ 11008, 13303, 15432, 20646, 23506, 24100, 25624, 26824, 28055, 32768, 0 },
{ 9472, 12384, 14534, 17094, 20257, 22155, 24767, 28955, 30474, 32768, 0 },
{ 7552, 14152, 17352, 22654, 25123, 25783, 27911, 29182, 30849, 32768,
0 } },
{ { 8064, 11538, 21987, 24941, 26913, 28136, 29222, 30469, 31331, 32768, 0 },
{ 5504, 10403, 25080, 26762, 27933, 29104, 30092, 31576, 32004, 32768, 0 },
{ 5632, 8706, 15097, 23714, 25344, 26072, 27380, 28580, 29840, 32768, 0 },
{ 7424, 11186, 17593, 20154, 22974, 24351, 26916, 29956, 30967, 32768, 0 },
{ 5888, 10193, 16895, 19031, 23735, 25576, 27514, 29813, 30471, 32768, 0 },
{ 4864, 8352, 16459, 18062, 21263, 25378, 26937, 30376, 31619, 32768, 0 },
{ 4992, 7922, 13842, 18004, 21779, 23527, 25115, 27357, 30232, 32768, 0 },
{ 6656, 9716, 16379, 20053, 22487, 23613, 25437, 27270, 28516, 32768, 0 },
{ 6016, 9674, 16891, 18684, 21147, 23093, 25512, 30132, 30894, 32768, 0 },
{ 4608, 11318, 21038, 23650, 25303, 26262, 28295, 30479, 31212, 32768,
0 } },
{ { 10496, 12758, 14790, 24547, 26342, 26799, 27825, 28443, 30217, 32768, 0 },
{ 7040, 11462, 17121, 24215, 26504, 27267, 28492, 29444, 30846, 32768, 0 },
{ 5376, 8158, 9215, 26451, 27407, 27524, 27995, 28275, 29767, 32768, 0 },
{ 8704, 12652, 14145, 20101, 22879, 23675, 25629, 27079, 28923, 32768, 0 },
{ 7424, 12374, 14366, 18855, 23842, 24358, 25639, 27087, 29706, 32768, 0 },
{ 6400, 10005, 12939, 17753, 22206, 24790, 26785, 28164, 30520, 32768, 0 },
{ 5632, 8176, 9713, 19053, 22343, 23222, 24453, 25070, 29761, 32768, 0 },
{ 7040, 9754, 10833, 21229, 23540, 23943, 24839, 25675, 27033, 32768, 0 },
{ 6784, 11758, 13481, 17236, 20210, 21768, 24303, 26948, 28676, 32768, 0 },
{ 4864, 12712, 14201, 23863, 25952, 26386, 27632, 28635, 30362, 32768,
0 } },
{ { 13184, 15173, 17647, 21576, 24474, 25267, 27699, 29283, 30549, 32768, 0 },
{ 7552, 11295, 18257, 20811, 23213, 24606, 27731, 30407, 31237, 32768, 0 },
{ 7936, 10846, 12816, 22436, 24614, 25130, 26890, 28199, 29091, 32768, 0 },
{ 8576, 11411, 13830, 15918, 18996, 20044, 25114, 27835, 28972, 32768, 0 },
{ 7680, 10816, 13646, 15966, 21162, 22012, 24701, 27506, 29644, 32768, 0 },
{ 6784, 9423, 12524, 14773, 19447, 22804, 26073, 29211, 30642, 32768, 0 },
{ 6784, 8916, 11059, 15861, 21174, 22338, 24620, 27071, 30899, 32768, 0 },
{ 9856, 11557, 13960, 18525, 21788, 22189, 24462, 26603, 27470, 32768, 0 },
{ 7808, 10636, 13143, 15844, 18698, 20272, 24323, 30096, 31787, 32768, 0 },
{ 6016, 10928, 14596, 18926, 21586, 22688, 26626, 29001, 30399, 32768,
0 } },
{ { 8832, 10983, 13451, 16582, 21656, 23109, 24845, 26207, 28796, 32768, 0 },
{ 6784, 10844, 15554, 18073, 22954, 24901, 26776, 28649, 30419, 32768, 0 },
{ 5120, 8252, 10072, 20108, 23535, 24346, 25761, 26418, 28675, 32768, 0 },
{ 7680, 11012, 12627, 14595, 19462, 20888, 23348, 25703, 28159, 32768, 0 },
{ 6656, 9818, 11790, 13813, 22731, 24737, 26557, 28061, 29697, 32768, 0 },
{ 5632, 8918, 11620, 13802, 19950, 23764, 25734, 28537, 31809, 32768, 0 },
{ 4480, 6580, 7808, 12281, 19375, 20970, 22860, 24602, 29929, 32768, 0 },
{ 7040, 9553, 11457, 15102, 20291, 21280, 22985, 24475, 26613, 32768, 0 },
{ 6528, 10423, 12605, 14621, 19031, 21505, 24585, 27558, 29532, 32768, 0 },
{ 6016, 11659, 14463, 18867, 23653, 24903, 27115, 29389, 31382, 32768,
0 } },
{ { 8192, 10016, 13304, 16362, 21107, 25165, 26620, 28901, 30910, 32768, 0 },
{ 5888, 8723, 16237, 18318, 22002, 25923, 27394, 29934, 31428, 32768, 0 },
{ 4608, 7138, 9841, 18442, 22447, 24618, 26337, 27945, 30168, 32768, 0 },
{ 6784, 8916, 12270, 14851, 19886, 22759, 25105, 28368, 29760, 32768, 0 },
{ 5120, 7928, 11324, 13340, 21205, 24224, 25926, 28518, 30560, 32768, 0 },
{ 4480, 6580, 10058, 11237, 16807, 25937, 27218, 30015, 31348, 32768, 0 },
{ 4608, 6808, 9445, 12446, 18461, 21835, 23244, 26109, 30115, 32768, 0 },
{ 5760, 7659, 10798, 14720, 19157, 21955, 23645, 26460, 28702, 32768, 0 },
{ 5760, 8503, 11157, 13071, 17594, 22047, 24099, 29077, 30850, 32768, 0 },
{ 4864, 9660, 14264, 17105, 21528, 24094, 26025, 28580, 30559, 32768, 0 } },
{ { 9600, 11139, 12998, 18660, 22158, 23501, 24659, 25736, 30296, 32768, 0 },
{ 7168, 11068, 15984, 19969, 23169, 24704, 26216, 27572, 31368, 32768, 0 },
{ 4480, 6801, 8018, 20908, 23071, 23583, 24301, 25062, 29427, 32768, 0 },
{ 7168, 10068, 11753, 15843, 19742, 21358, 23809, 26189, 29067, 32768, 0 },
{ 6016, 9047, 10622, 13931, 22462, 23858, 25911, 27277, 29722, 32768, 0 },
{ 5888, 7568, 9931, 13533, 18431, 22063, 23777, 26025, 30555, 32768, 0 },
{ 4352, 6239, 7379, 13739, 16917, 18090, 18835, 19651, 30360, 32768, 0 },
{ 6528, 8988, 10288, 15534, 19495, 20386, 21934, 23034, 26988, 32768, 0 },
{ 7040, 10055, 11652, 14757, 19622, 21715, 23615, 26761, 29483, 32768, 0 },
{ 4736, 10102, 12315, 19078, 21348, 22621, 24246, 26044, 29931, 32768,
0 } },
{ { 10496, 12410, 14955, 19891, 23137, 23792, 25159, 26378, 28125, 32768, 0 },
{ 7936, 12204, 17104, 20191, 23468, 24630, 26156, 27628, 28913, 32768, 0 },
{ 6016, 8629, 10232, 23591, 25349, 25637, 26306, 27063, 28980, 32768, 0 },
{ 8704, 12088, 13461, 16646, 20516, 21455, 24062, 26579, 28368, 32768, 0 },
{ 7296, 11177, 13117, 16196, 23378, 24708, 26440, 27997, 29078, 32768, 0 },
{ 6272, 9377, 12575, 15616, 20919, 23697, 26603, 27566, 29903, 32768, 0 },
{ 6528, 9091, 10478, 16445, 21081, 22320, 23871, 25087, 29258, 32768, 0 },
{ 8704, 11148, 12499, 17340, 20656, 21288, 22588, 23701, 24693, 32768, 0 },
{ 7552, 11394, 12980, 15562, 19942, 21792, 25093, 28211, 28959, 32768, 0 },
{ 5120, 11708, 13847, 19377, 22421, 23160, 25449, 27136, 29182, 32768,
0 } },
{ { 9984, 12031, 15190, 18673, 21422, 22812, 25690, 29118, 30458, 32768, 0 },
{ 6144, 9680, 17436, 19610, 21820, 23485, 26313, 30826, 31843, 32768, 0 },
{ 6016, 8315, 10607, 19333, 21572, 22553, 25266, 27288, 28551, 32768, 0 },
{ 7168, 9668, 12646, 16257, 19648, 20899, 25304, 30465, 31625, 32768, 0 },
{ 6144, 9368, 11836, 14130, 19153, 21157, 24876, 28452, 29396, 32768, 0 },
{ 5504, 8486, 11996, 14412, 17968, 21814, 24424, 30682, 32059, 32768, 0 },
{ 5376, 7195, 9592, 13331, 17569, 19460, 22371, 25458, 28942, 32768, 0 },
{ 7424, 9206, 11783, 16456, 19253, 20390, 23775, 27007, 28425, 32768, 0 },
{ 5888, 8303, 11361, 13440, 15848, 17549, 21532, 29564, 30665, 32768, 0 },
{ 4608, 8788, 13284, 16621, 18983, 20286, 24577, 28960, 30314, 32768, 0 } },
{ { 8320, 15005, 19168, 24282, 26707, 27402, 28681, 29639, 30629, 32768, 0 },
{ 5632, 13900, 22376, 24867, 26804, 27734, 29130, 30722, 31465, 32768, 0 },
{ 4992, 9115, 11055, 24893, 26316, 26661, 27663, 28301, 29418, 32768, 0 },
{ 7424, 12077, 14987, 19596, 22615, 23600, 26465, 28484, 29789, 32768, 0 },
{ 6272, 11447, 14362, 18204, 23418, 24715, 26697, 28547, 29520, 32768, 0 },
{ 5248, 10946, 15379, 18167, 22197, 25432, 27295, 30031, 30576, 32768, 0 },
{ 5120, 9008, 11607, 18210, 22327, 23427, 24887, 26580, 29892, 32768, 0 },
{ 6656, 10124, 12689, 19922, 22480, 22807, 24441, 25579, 26787, 32768, 0 },
{ 5376, 10084, 13983, 17113, 19996, 21614, 24403, 28651, 29938, 32768, 0 },
{ 5504, 14131, 17989, 23324, 25513, 26071, 27850, 29464, 30393, 32768,
0 } },
};
#endif // CONFIG_EC_MULTISYMBOL
static void init_mode_probs(FRAME_CONTEXT *fc) {
av1_copy(fc->uv_mode_prob, default_uv_probs);
av1_copy(fc->y_mode_prob, default_if_y_probs);
......@@ -1611,29 +1814,17 @@ static void init_mode_probs(FRAME_CONTEXT *fc) {
av1_copy(fc->switchable_restore_prob, default_switchable_restore_prob);
#endif // CONFIG_LOOP_RESTORATION
#if CONFIG_EC_MULTISYMBOL
av1_tree_to_cdf_1D(av1_intra_mode_tree, fc->y_mode_prob, fc->y_mode_cdf,
BLOCK_SIZE_GROUPS);
av1_tree_to_cdf_1D(av1_intra_mode_tree, fc->uv_mode_prob, fc->uv_mode_cdf,
INTRA_MODES);
av1_tree_to_cdf_1D(av1_switchable_interp_tree, fc->switchable_interp_prob,
fc->switchable_interp_cdf, SWITCHABLE_FILTER_CONTEXTS);
av1_tree_to_cdf_1D(av1_partition_tree, fc->partition_prob, fc->partition_cdf,
PARTITION_CONTEXTS);
av1_tree_to_cdf_1D(av1_inter_mode_tree, fc->inter_mode_probs,
fc->inter_mode_cdf, INTER_MODE_CONTEXTS);
av1_copy(fc->y_mode_cdf, default_if_y_mode_cdf);
av1_copy(fc->uv_mode_cdf, default_uv_mode_cdf);
av1_copy(fc->switchable_interp_cdf, default_switchable_interp_cdf);
av1_copy(fc->partition_cdf, default_partition_cdf);
av1_copy(fc->inter_mode_cdf, default_inter_mode_cdf);
#if !CONFIG_EXT_TX
av1_tree_to_cdf_2D(av1_ext_tx_tree, fc->intra_ext_tx_prob,
fc->intra_ext_tx_cdf, EXT_TX_SIZES, TX_TYPES);
av1_tree_to_cdf_1D(av1_ext_tx_tree, fc->inter_ext_tx_prob,
fc->inter_ext_tx_cdf, EXT_TX_SIZES);
av1_copy(fc->intra_ext_tx_cdf, default_intra_ext_tx_cdf);
av1_copy(fc->inter_ext_tx_cdf, default_inter_ext_tx_cdf);
#endif
av1_tree_to_cdf_2D(av1_intra_mode_tree, av1_kf_y_mode_prob, av1_kf_y_mode_cdf,
INTRA_MODES, INTRA_MODES);
av1_tree_to_cdf(av1_segment_tree, fc->seg.tree_probs, fc->seg.tree_cdf);
for (int k = 0; k < MAX_TX_DEPTH; k++) {
av1_tree_to_cdf_1D(av1_tx_size_tree[k], fc->tx_size_probs[k],
fc->tx_size_cdf[k], TX_SIZE_CONTEXTS);
}
av1_copy(fc->seg.tree_cdf, default_seg_tree_cdf);
av1_copy(fc->tx_size_cdf, default_tx_size_cdf);
#endif
#if CONFIG_DELTA_Q
av1_copy(fc->delta_q_prob, default_delta_q_probs);
......
......@@ -375,9 +375,10 @@ extern const aom_prob av1_kf_y_mode_prob[INTRA_MODES][INTRA_MODES]
[INTRA_MODES - 1];
#if CONFIG_EC_MULTISYMBOL
// CDF version of 'av1_kf_y_mode_prob'.
extern aom_cdf_prob av1_kf_y_mode_cdf[INTRA_MODES][INTRA_MODES]
extern const aom_cdf_prob av1_kf_y_mode_cdf[INTRA_MODES][INTRA_MODES]
[CDF_SIZE(INTRA_MODES)];
#endif
#if CONFIG_PALETTE
extern const aom_prob av1_default_palette_y_mode_prob[PALETTE_BLOCK_SIZES]
[PALETTE_Y_MODE_CONTEXTS];
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment