Commit 4e18d403 authored by Alex Converse's avatar Alex Converse

ext_partition_types: Make update tree shape match

Update the first PARTITION_PLOFFSET (4) contexts with the four classic
partitions. The extended partitions are only codable above 8x8, but
there are PARTITION_PLOFFSET (4) contexts for dropping below 8x8.

Change-Id: Ib3291dded6dc24103222e8f470504c20e29adb88
parent 1c05c635
......@@ -2528,13 +2528,14 @@ void av1_adapt_intra_frame_probs(AV1_COMMON *cm) {
counts->uv_mode[i], fc->uv_mode_prob[i]);
#if CONFIG_EXT_PARTITION_TYPES
aom_tree_merge_probs(av1_partition_tree, pre_fc->partition_prob[0],
counts->partition[0], fc->partition_prob[0]);
for (i = 1; i < PARTITION_CONTEXTS_PRIMARY; i++)
for (i = 0; i < PARTITION_PLOFFSET; ++i)
aom_tree_merge_probs(av1_partition_tree, pre_fc->partition_prob[i],
counts->partition[i], fc->partition_prob[i]);
for (; i < PARTITION_CONTEXTS_PRIMARY; ++i)
aom_tree_merge_probs(av1_ext_partition_tree, pre_fc->partition_prob[i],
counts->partition[i], fc->partition_prob[i]);
#else
for (i = 0; i < PARTITION_CONTEXTS_PRIMARY; i++) {
for (i = 0; i < PARTITION_CONTEXTS_PRIMARY; ++i) {
aom_tree_merge_probs(av1_partition_tree, pre_fc->partition_prob[i],
counts->partition[i], fc->partition_prob[i]);
}
......
......@@ -4611,9 +4611,10 @@ static int read_compressed_header(AV1Decoder *pbi, const uint8_t *data,
}
#if CONFIG_EXT_PARTITION_TYPES
for (i = 0; i < PARTITION_TYPES - 1; ++i)
av1_diff_update_prob(&r, &fc->partition_prob[0][i], ACCT_STR);
for (j = 1; j < PARTITION_CONTEXTS_PRIMARY; ++j)
for (j = 0; j < PARTITION_PLOFFSET; ++j)
for (i = 0; i < PARTITION_TYPES - 1; ++i)
av1_diff_update_prob(&r, &fc->partition_prob[j][i], ACCT_STR);
for (; j < PARTITION_CONTEXTS_PRIMARY; ++j)
for (i = 0; i < EXT_PARTITION_TYPES - 1; ++i)
av1_diff_update_prob(&r, &fc->partition_prob[j][i], ACCT_STR);
#else
......
......@@ -4666,17 +4666,17 @@ static uint32_t write_compressed_header(AV1_COMP *cpi, uint8_t *data) {
}
#if CONFIG_EXT_PARTITION_TYPES
prob_diff_update(av1_partition_tree, fc->partition_prob[0],
counts->partition[0], PARTITION_TYPES, probwt, header_bc);
for (i = 1; i < PARTITION_CONTEXTS_PRIMARY; ++i)
for (i = 0; i < PARTITION_PLOFFSET; ++i)
prob_diff_update(av1_partition_tree, fc->partition_prob[i],
counts->partition[i], PARTITION_TYPES, probwt, header_bc);
for (; i < PARTITION_CONTEXTS_PRIMARY; ++i)
prob_diff_update(av1_ext_partition_tree, fc->partition_prob[i],
counts->partition[i], EXT_PARTITION_TYPES, probwt,
header_bc);
#else
for (i = 0; i < PARTITION_CONTEXTS_PRIMARY; ++i) {
for (i = 0; i < PARTITION_CONTEXTS_PRIMARY; ++i)
prob_diff_update(av1_partition_tree, fc->partition_prob[i],
counts->partition[i], PARTITION_TYPES, probwt, header_bc);
}
#endif // CONFIG_EXT_PARTITION_TYPES
#if CONFIG_UNPOISON_PARTITION_CTX
for (; i < PARTITION_CONTEXTS_PRIMARY + PARTITION_BLOCK_SIZES; ++i) {
......
......@@ -405,9 +405,10 @@ void av1_initialize_rd_consts(AV1_COMP *cpi) {
cpi->partition_cost[0][PARTITION_SPLIT] = 0;
#endif
#if CONFIG_EXT_PARTITION_TYPES
av1_cost_tokens(cpi->partition_cost[CONFIG_UNPOISON_PARTITION_CTX],
cm->fc->partition_prob[0], av1_partition_tree);
for (i = 1; i < PARTITION_CONTEXTS_PRIMARY; ++i)
for (i = 0; i < PARTITION_PLOFFSET; ++i)
av1_cost_tokens(cpi->partition_cost[CONFIG_UNPOISON_PARTITION_CTX + i],
cm->fc->partition_prob[i], av1_partition_tree);
for (; i < PARTITION_CONTEXTS_PRIMARY; ++i)
av1_cost_tokens(cpi->partition_cost[CONFIG_UNPOISON_PARTITION_CTX + i],
cm->fc->partition_prob[i], av1_ext_partition_tree);
#else
......
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