Commit c2ec0e4e authored by Thomas Davies's avatar Thomas Davies
Browse files

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