Commit 9f5cedd1 authored by Thomas Davies's avatar Thomas Davies

Use tile context not frame context for segment_id coding.

BUG=aomedia:629

Change-Id: I929e6e1db8491092f3e165d0990f9e10920fb2d3
parent ce7272d2
......@@ -624,7 +624,12 @@ static int read_intra_segment_id(AV1_COMMON *const cm, MACROBLOCKD *const xd,
aom_reader *r) {
struct segmentation *const seg = &cm->seg;
FRAME_COUNTS *counts = xd->counts;
struct segmentation_probs *const segp = &cm->fc->seg;
#if CONFIG_EC_ADAPT
FRAME_CONTEXT *ec_ctx = xd->tile_ctx;
#else
FRAME_CONTEXT *ec_ctx = cm->fc;
#endif
struct segmentation_probs *const segp = &ec_ctx->seg;
int segment_id;
if (!seg->enabled) return 0; // Default for disabled segmentation
......@@ -654,7 +659,13 @@ static int read_inter_segment_id(AV1_COMMON *const cm, MACROBLOCKD *const xd,
int mi_row, int mi_col, aom_reader *r) {
struct segmentation *const seg = &cm->seg;
FRAME_COUNTS *counts = xd->counts;
struct segmentation_probs *const segp = &cm->fc->seg;
#if CONFIG_EC_ADAPT
FRAME_CONTEXT *ec_ctx = xd->tile_ctx;
#else
FRAME_CONTEXT *ec_ctx = cm->fc;
#endif
struct segmentation_probs *const segp = &ec_ctx->seg;
MB_MODE_INFO *const mbmi = &xd->mi[0]->mbmi;
int predicted_segment_id, segment_id;
const int mi_offset = mi_row * cm->mi_cols + mi_col;
......
......@@ -1942,7 +1942,7 @@ static void pack_inter_mode_mvs(AV1_COMP *cpi, const int mi_row,
const MODE_INFO *mi = xd->mi[0];
const struct segmentation *const seg = &cm->seg;
struct segmentation_probs *const segp = &cm->fc->seg;
struct segmentation_probs *const segp = &ec_ctx->seg;
const MB_MODE_INFO *const mbmi = &mi->mbmi;
const MB_MODE_INFO_EXT *const mbmi_ext = x->mbmi_ext;
const PREDICTION_MODE mode = mbmi->mode;
......@@ -2384,8 +2384,13 @@ static void write_mb_modes_kf(AV1_COMMON *cm,
#endif // CONFIG_INTRABC
const int mi_row, const int mi_col,
aom_writer *w) {
#if CONFIG_EC_ADAPT
FRAME_CONTEXT *ec_ctx = xd->tile_ctx;
#else
FRAME_CONTEXT *ec_ctx = cm->fc;
#endif
const struct segmentation *const seg = &cm->seg;
struct segmentation_probs *const segp = &cm->fc->seg;
struct segmentation_probs *const segp = &ec_ctx->seg;
const MODE_INFO *const mi = xd->mi[0];
const MODE_INFO *const above_mi = xd->above_mi;
const MODE_INFO *const left_mi = xd->left_mi;
......@@ -2399,12 +2404,6 @@ static void write_mb_modes_kf(AV1_COMMON *cm,
(void)mi_row;
(void)mi_col;
#if CONFIG_EC_ADAPT
FRAME_CONTEXT *ec_ctx = xd->tile_ctx;
#else
FRAME_CONTEXT *ec_ctx = cm->fc;
#endif
if (seg->update_map) write_segment_id(w, seg, segp, mbmi->segment_id);
#if CONFIG_DELTA_Q
......
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