Using CDFs for read_partition special case
Test results:
akiyo -0.05%
bowing -0.072%
bridge -0.042%
bus -0.156%
coastguard -0.645%
container -0.087%
deadline 0.007%
flower 0.02%
football -0.009%
foreman 0.03%
hall 0.087%
highway -0.041%
husky -0.031%
mad900 0.015%
mobile -0.007%
mother 0.012%
news 0.039%
pamphlet 0.061%
paris -0.003%
sign -0.148%
silent 0.003%
students -0.009%
tempete -0.061%
waterfall 0.666
Change-Id: I96c2fd3a6fbc5f8e5cf7f3b881ef89335e58d5ac
diff --git a/av1/decoder/decodeframe.c b/av1/decoder/decodeframe.c
index e0fb51b..39368e0 100644
--- a/av1/decoder/decodeframe.c
+++ b/av1/decoder/decodeframe.c
@@ -2139,13 +2139,8 @@
#if CONFIG_UNPOISON_PARTITION_CTX
const int ctx =
partition_plane_context(xd, mi_row, mi_col, has_rows, has_cols, bsize);
- const aom_prob *const probs =
- ctx < PARTITION_CONTEXTS ? cm->fc->partition_prob[ctx] : NULL;
- FRAME_COUNTS *const counts = ctx < PARTITION_CONTEXTS ? xd->counts : NULL;
#else
const int ctx = partition_plane_context(xd, mi_row, mi_col, bsize);
- const aom_prob *const probs = cm->fc->partition_prob[ctx];
- FRAME_COUNTS *const counts = xd->counts;
#endif
PARTITION_TYPE p;
FRAME_CONTEXT *ec_ctx = xd->tile_ctx;
@@ -2164,15 +2159,22 @@
ACCT_STR);
#endif // CONFIG_EXT_PARTITION_TYPES
} else if (!has_rows && has_cols) {
- p = aom_read(r, probs[1], ACCT_STR) ? PARTITION_SPLIT : PARTITION_HORZ;
+ assert(bsize > BLOCK_8X8);
+ aom_cdf_prob cdf[2];
+ partition_gather_vert_alike(cdf, partition_cdf);
+ assert(cdf[1] == AOM_ICDF(CDF_PROB_TOP));
+ p = aom_read_cdf(r, cdf, 2, ACCT_STR) ? PARTITION_SPLIT : PARTITION_HORZ;
+ // gather cols
} else if (has_rows && !has_cols) {
- p = aom_read(r, probs[2], ACCT_STR) ? PARTITION_SPLIT : PARTITION_VERT;
+ assert(bsize > BLOCK_8X8);
+ aom_cdf_prob cdf[2];
+ partition_gather_horz_alike(cdf, partition_cdf);
+ assert(cdf[1] == AOM_ICDF(CDF_PROB_TOP));
+ p = aom_read_cdf(r, cdf, 2, ACCT_STR) ? PARTITION_SPLIT : PARTITION_VERT;
} else {
p = PARTITION_SPLIT;
}
- if (counts) ++counts->partition[ctx][p];
-
return p;
}