Commit c2ec0e4e authored by Thomas Davies's avatar Thomas Davies

EC_ADAPT: use tile context for partition type.

Change-Id: I4b53dab674390496d8fe7299970c5fb327b5a7be
parent 489dad8f
......@@ -1854,17 +1854,28 @@ static PARTITION_TYPE read_partition(AV1_COMMON *cm, MACROBLOCKD *xd,
FRAME_COUNTS *const counts = xd->counts;
#endif
PARTITION_TYPE p;
#if CONFIG_EC_ADAPT
FRAME_CONTEXT *ec_ctx = xd->tile_ctx;
(void)cm;
#elif CONFIG_EC_MULTISYMBOL
FRAME_CONTEXT *ec_ctx = cm->fc;
#endif
if (has_rows && has_cols)
#if CONFIG_EXT_PARTITION_TYPES
if (bsize <= BLOCK_8X8)
#if CONFIG_EC_MULTISYMBOL
p = (PARTITION_TYPE)aom_read_symbol(r, ec_ctx->partition_cdf[ctx],
PARTITION_TYPES, ACCT_STR);
#else
p = (PARTITION_TYPE)aom_read_tree(r, av1_partition_tree, probs, ACCT_STR);
#endif
else
p = (PARTITION_TYPE)aom_read_tree(r, av1_ext_partition_tree, probs,
ACCT_STR);
#else
#if CONFIG_EC_MULTISYMBOL
p = (PARTITION_TYPE)aom_read_symbol(r, cm->fc->partition_cdf[ctx],
p = (PARTITION_TYPE)aom_read_symbol(r, ec_ctx->partition_cdf[ctx],
PARTITION_TYPES, ACCT_STR);
#else
p = (PARTITION_TYPE)aom_read_tree(r, av1_partition_tree, probs, ACCT_STR);
......
......@@ -2315,18 +2315,29 @@ static void write_partition(const AV1_COMMON *const cm,
const aom_prob *const probs = cm->fc->partition_prob[ctx];
#endif
#if CONFIG_EC_ADAPT
FRAME_CONTEXT *ec_ctx = xd->tile_ctx;
(void)cm;
#elif CONFIG_EC_MULTISYMBOL
FRAME_CONTEXT *ec_ctx = cm->fc;
#endif
if (!is_partition_point) return;
if (has_rows && has_cols) {
#if CONFIG_EXT_PARTITION_TYPES
if (bsize <= BLOCK_8X8)
#if CONFIG_EC_MULTISYMBOL
aom_write_symbol(w, p, ec_ctx->partition_cdf[ctx], PARTITION_TYPES);
#else
av1_write_token(w, av1_partition_tree, probs, &partition_encodings[p]);
#endif
else
av1_write_token(w, av1_ext_partition_tree, probs,
&ext_partition_encodings[p]);
#else
#if CONFIG_EC_MULTISYMBOL
aom_write_symbol(w, p, cm->fc->partition_cdf[ctx], PARTITION_TYPES);
aom_write_symbol(w, p, ec_ctx->partition_cdf[ctx], PARTITION_TYPES);
#else
av1_write_token(w, av1_partition_tree, probs, &partition_encodings[p]);
#endif
......
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