Commit 490477ab authored by Thomas Davies's avatar Thomas Davies

EC_MULTISYMBOL: always send the EOB_TOKEN after a non-zero value.

This will allow EOB_TOKEN to be merged with that value.

Change-Id: I82ba5e8d38e235d07894e43b5fec53968f84ab6c
parent ab78067c
......@@ -191,7 +191,7 @@ static int decode_coefs(MACROBLOCKD *xd, PLANE_TYPE type, tran_low_t *dqcoeff,
*max_scan_line = AOMMAX(*max_scan_line, scan[c]);
token_cache[scan[c]] = av1_pt_energy_class[token];
ctx_eob = get_coef_context(nb, token_cache, c + 1);
ctx_eob = get_coef_context(nb, token_cache, AOMMIN(c + 1, max_eob - 1));
band_eob = c < max_eob - 1 ? *band_translate : band_eob;
prob_eob = coef_probs[band_eob][ctx_eob];
......@@ -260,7 +260,7 @@ static int decode_coefs(MACROBLOCKD *xd, PLANE_TYPE type, tran_low_t *dqcoeff,
if (v) dqcoeff[scan[c]] = aom_read_bit(r, ACCT_STR) ? -v : v;
#endif // CONFIG_COEFFICIENT_RANGE_CHECKING
if (c + 1 < max_eob && token) {
if (token) {
if (counts) ++eob_branch_count[band_eob][ctx_eob];
if (!aom_read(r, prob_eob[EOB_CONTEXT_NODE], ACCT_STR)) {
// INCREMENT_COUNT(EOB_MODEL_TOKEN);
......
......@@ -480,11 +480,12 @@ static void tokenize_b(int plane, int block, int blk_row, int blk_col,
ec_ctx->coef_tail_cdfs[tx_size][type][ref];
unsigned int(*const blockz_count)[2] =
td->counts->blockz_count[txsize_sqr_map[tx_size]][type][ref];
int c2;
#endif
const int seg_eob = get_tx_eob(&cpi->common.seg, segment_id, tx_size);
unsigned int(*const eob_branch)[COEFF_CONTEXTS] =
td->counts->eob_branch[txsize_sqr_map[tx_size]][type][ref];
const uint8_t *const band = get_band_translate(tx_size);
const int seg_eob = get_tx_eob(&cpi->common.seg, segment_id, tx_size);
int skip_eob = 0;
int16_t token;
EXTRABIT extra;
......@@ -509,15 +510,13 @@ static void tokenize_b(int plane, int block, int blk_row, int blk_col,
token_cache[scan[c]] = av1_pt_energy_class[token];
++c;
pt = get_coef_context(nb, token_cache, c);
pt = get_coef_context(nb, token_cache, AOMMIN(c, seg_eob - 1));
skip_eob = (token == ZERO_TOKEN);
}
if (c < seg_eob) {
assert(!skip_eob); // The last token must be non-zero.
add_token(&t, coef_probs[band[c]][pt], NULL, NULL, 0, EOB_TOKEN, 0,
counts[band[c]][pt]);
++eob_branch[band[c]][pt];
}
c2 = AOMMIN(c, seg_eob - 1);
add_token(&t, coef_probs[band[c2]][pt], NULL, NULL, 0, EOB_TOKEN, 0,
counts[band[c2]][pt]);
++eob_branch[band[c2]][pt];
#else
while (c < eob) {
const int v = qcoeff[scan[c]];
......
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