Commit 942c820d authored by Dmitry Kovalev's avatar Dmitry Kovalev
Browse files

Cleanup of decode_coefs() function.

Moving entropy context calculation to outer scope and adding consts to

Change-Id: I25d0987e97495326ab1e8046e3fa3082c0584485
parent bee4abc3
......@@ -88,22 +88,20 @@ static const vp9_prob cat6_prob[15] = {
static int decode_coefs(VP9_COMMON *cm, const MACROBLOCKD *xd,
vp9_reader *r, int block_idx,
PLANE_TYPE type, int seg_eob, int16_t *qcoeff_ptr,
TX_SIZE tx_size, const int16_t *dq,
FRAME_CONTEXT *const fc = &cm->fc;
TX_SIZE tx_size, const int16_t *dq, int pt) {
const FRAME_CONTEXT *const fc = &cm->fc;
FRAME_COUNTS *const counts = &cm->counts;
const int ref = is_inter_block(&xd->this_mi->mbmi);
int band, c = 0;
const vp9_prob (*coef_probs)[PREV_COEF_CONTEXTS][UNCONSTRAINED_NODES] =
uint8_t load_map[COEF_BANDS][PREV_COEF_CONTEXTS] = { { 0 } };
vp9_prob *prob;
const vp9_prob *prob;
vp9_coeff_count_model *coef_counts = counts->coef[tx_size];
const int16_t *scan, *nb;
const uint8_t *band_translate;
uint8_t token_cache[1024];
int pt = get_entropy_context(tx_size, A, L);
get_scan_and_band(xd, tx_size, type, block_idx, &scan, &nb, &band_translate);
while (1) {
......@@ -222,14 +220,15 @@ static void decode_block(int plane, int block, BLOCK_SIZE plane_bsize,
struct macroblockd_plane* pd = &xd->plane[plane];
const int segment_id = xd->this_mi->mbmi.segment_id;
const int seg_eob = get_tx_eob(seg, segment_id, tx_size);
int aoff, loff, eob;
int aoff, loff, eob, pt;
txfrm_block_to_raster_xy(plane_bsize, tx_size, block, &aoff, &loff);
pt = get_entropy_context(tx_size, pd->above_context + aoff,
pd->left_context + loff);
eob = decode_coefs(&arg->pbi->common, xd, arg->r, block,
pd->plane_type, seg_eob, BLOCK_OFFSET(pd->qcoeff, block),
tx_size, pd->dequant,
pd->above_context + aoff, pd->left_context + loff);
tx_size, pd->dequant, pt);
set_contexts(xd, pd, plane_bsize, tx_size, eob > 0, aoff, loff);
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