Unify set_contexts() function for encoder and decoder

Remove the separate implementations of set_contexts() in encoder
and decoder.

Change-Id: I9f6e9b075532faae0f74f885d9443589254258a7
This commit is contained in:
Jingning Han
2016-07-15 08:50:14 -07:00
committed by Yaowu Xu
parent 045d413ca2
commit a6923f7f97
7 changed files with 35 additions and 79 deletions

View File

@@ -369,8 +369,8 @@ static void cost_coeffs_b(int plane, int block, int blk_row, int blk_col,
int rate = av1_cost_coeffs(cm, x, plane, block, pt, tx_size, scan_order->scan,
scan_order->neighbors, 0);
args->this_rate += rate;
av1_set_contexts(xd, pd, plane_bsize, tx_size, p->eobs[block] > 0, blk_col,
blk_row);
(void)plane_bsize;
av1_set_contexts(xd, pd, tx_size, p->eobs[block] > 0, blk_col, blk_row);
}
static void set_entropy_context_b(int plane, int block, int blk_row,
@@ -382,8 +382,8 @@ static void set_entropy_context_b(int plane, int block, int blk_row,
MACROBLOCKD *const xd = &x->e_mbd;
struct macroblock_plane *p = &x->plane[plane];
struct macroblockd_plane *pd = &xd->plane[plane];
av1_set_contexts(xd, pd, plane_bsize, tx_size, p->eobs[block] > 0, blk_col,
blk_row);
(void)plane_bsize;
av1_set_contexts(xd, pd, tx_size, p->eobs[block] > 0, blk_col, blk_row);
}
static INLINE void add_token(TOKENEXTRA **t, const aom_prob *context_tree,
@@ -501,6 +501,7 @@ static void tokenize_b(int plane, int block, int blk_row, int blk_col,
int skip_eob = 0;
int16_t token;
EXTRABIT extra;
(void)plane_bsize;
pt = get_entropy_context(tx_size, pd->above_context + blk_col,
pd->left_context + blk_row);
scan = scan_order->scan;
@@ -535,7 +536,7 @@ static void tokenize_b(int plane, int block, int blk_row, int blk_col,
*tp = t;
av1_set_contexts(xd, pd, plane_bsize, tx_size, c > 0, blk_col, blk_row);
av1_set_contexts(xd, pd, tx_size, c > 0, blk_col, blk_row);
}
struct is_skippable_args {