Update 8x8 tokenizer to not encode an EOB if seg_eob is active.
Change-Id: Id2bac0597b6dd1ce41bd78cbd9e9d876b71cd8a2
This commit is contained in:
@@ -250,48 +250,47 @@ static void tokenize1st_order_b_8x8
|
|||||||
) {
|
) {
|
||||||
int pt; /* near block/prev token context index */
|
int pt; /* near block/prev token context index */
|
||||||
int c = type ? 0 : 1; /* start at DC unless type 0 */
|
int c = type ? 0 : 1; /* start at DC unless type 0 */
|
||||||
const int eob = b->eob; /* one beyond last nonzero coeff */
|
|
||||||
TOKENEXTRA *t = *tp; /* store tokens starting here */
|
TOKENEXTRA *t = *tp; /* store tokens starting here */
|
||||||
int x;
|
|
||||||
const short *qcoeff_ptr = b->qcoeff;
|
const short *qcoeff_ptr = b->qcoeff;
|
||||||
|
|
||||||
int seg_eob = 64;
|
int seg_eob = 64;
|
||||||
int segment_id = xd->mode_info_context->mbmi.segment_id;
|
int segment_id = xd->mode_info_context->mbmi.segment_id;
|
||||||
|
|
||||||
if (segfeature_active(xd, segment_id, SEG_LVL_EOB)) {
|
if (segfeature_active(xd, segment_id, SEG_LVL_EOB))
|
||||||
seg_eob = get_segdata(xd, segment_id, SEG_LVL_EOB);
|
seg_eob = get_segdata(xd, segment_id, SEG_LVL_EOB);
|
||||||
}
|
|
||||||
|
|
||||||
VP8_COMBINEENTROPYCONTEXTS(pt, *a, *l);
|
VP8_COMBINEENTROPYCONTEXTS(pt, *a, *l);
|
||||||
|
|
||||||
do {
|
for (; c < b->eob; ++c) {
|
||||||
const int band = vp8_coef_bands_8x8[c];
|
const int band = vp8_coef_bands_8x8[c];
|
||||||
int v;
|
|
||||||
|
|
||||||
x = DCT_EOB_TOKEN;
|
|
||||||
|
|
||||||
if (c < eob) {
|
|
||||||
int rc = vp8_default_zig_zag1d_8x8[c];
|
int rc = vp8_default_zig_zag1d_8x8[c];
|
||||||
v = qcoeff_ptr[rc];
|
int v = qcoeff_ptr[rc], x;
|
||||||
|
|
||||||
assert(-DCT_MAX_VALUE <= v && v < (DCT_MAX_VALUE));
|
assert(-DCT_MAX_VALUE <= v && v < (DCT_MAX_VALUE));
|
||||||
|
|
||||||
t->Extra = vp8_dct_value_tokens_ptr[v].Extra;
|
t->Extra = vp8_dct_value_tokens_ptr[v].Extra;
|
||||||
x = vp8_dct_value_tokens_ptr[v].Token;
|
x = vp8_dct_value_tokens_ptr[v].Token;
|
||||||
}
|
|
||||||
|
|
||||||
t->Token = x;
|
t->Token = x;
|
||||||
t->context_tree = cpi->common.fc.coef_probs_8x8[type][band][pt];
|
t->context_tree = cpi->common.fc.coef_probs_8x8[type][band][pt];
|
||||||
|
|
||||||
t->skip_eob_node = pt == 0 && ((band > 0 && type > 0) || (band > 1 && type == 0));
|
t->skip_eob_node = pt == 0 && ((band > 0 && type > 0) || (band > 1 && type == 0));
|
||||||
|
|
||||||
#ifdef ENC_DEBUG
|
|
||||||
if (t->skip_eob_node && vp8_coef_encodings[x].Len == 1)
|
|
||||||
printf("Trouble 1 x=%d Len=%d skip=%d eob=%d c=%d band=%d type=%d: [%d %d %d]\n", x, vp8_coef_encodings[x].Len, t->skip_eob_node, eob, c, band, type, cpi->count, mb_row_debug, mb_col_debug);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
++cpi->coef_counts_8x8[type][band][pt][x];
|
++cpi->coef_counts_8x8[type][band][pt][x];
|
||||||
} while (pt = vp8_prev_token_class[x], ++t, c < eob && ++c < seg_eob);
|
|
||||||
|
pt = vp8_prev_token_class[x];
|
||||||
|
++t;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (c < seg_eob) {
|
||||||
|
const int band = vp8_coef_bands_8x8[c];
|
||||||
|
t->Token = DCT_EOB_TOKEN;
|
||||||
|
|
||||||
|
t->context_tree = cpi->common.fc.coef_probs_8x8 [type] [band] [pt];
|
||||||
|
t->skip_eob_node = pt == 0 && ((band > 0 && type > 0) || (band > 1 && type == 0));
|
||||||
|
|
||||||
|
++cpi->coef_counts_8x8[type][band][pt][DCT_EOB_TOKEN];
|
||||||
|
++t;
|
||||||
|
}
|
||||||
|
|
||||||
*tp = t;
|
*tp = t;
|
||||||
pt = (c != !type); /* 0 <-> all coeff data is zero */
|
pt = (c != !type); /* 0 <-> all coeff data is zero */
|
||||||
|
Reference in New Issue
Block a user