Commit 6ab5dbee authored by Yue Chen's avatar Yue Chen Committed by Gerrit Code Review

Merge "Make supertx skip bits observe segment level coding." into nextgenv2

parents 907b5124 7f6518a4
......@@ -1525,14 +1525,18 @@ static PARTITION_TYPE read_partition(VP10_COMMON *cm, MACROBLOCKD *xd,
}
#if CONFIG_SUPERTX
static int read_skip_without_seg(VP10_COMMON *cm, const MACROBLOCKD *xd,
vp10_reader *r) {
const int ctx = vp10_get_skip_context(xd);
const int skip = vp10_read(r, cm->fc->skip_probs[ctx]);
FRAME_COUNTS *counts = xd->counts;
if (counts)
++counts->skip[ctx][skip];
return skip;
static int read_skip(VP10_COMMON *cm, const MACROBLOCKD *xd,
int segment_id, vp10_reader *r) {
if (segfeature_active(&cm->seg, segment_id, SEG_LVL_SKIP)) {
return 1;
} else {
const int ctx = vp10_get_skip_context(xd);
const int skip = vp10_read(r, cm->fc->skip_probs[ctx]);
FRAME_COUNTS *counts = xd->counts;
if (counts)
++counts->skip[ctx][skip];
return skip;
}
}
#endif // CONFIG_SUPERTX
......@@ -1777,14 +1781,15 @@ static void decode_partition(VP10Decoder *const pbi, MACROBLOCKD *const xd,
int dst_stride[3], i;
int offset = mi_row * cm->mi_stride + mi_col;
set_segment_id_supertx(cm, mi_row, mi_col, bsize);
xd->mi = cm->mi_grid_visible + offset;
xd->mi[0] = cm->mi + offset;
set_mi_row_col(xd, tile, mi_row, num_8x8_blocks_high_lookup[bsize],
mi_col, num_8x8_blocks_wide_lookup[bsize],
cm->mi_rows, cm->mi_cols);
set_skip_context(xd, mi_row, mi_col);
// Here skip is read without using any segment level feature
skip = read_skip_without_seg(cm, xd, r);
skip = read_skip(cm, xd, xd->mi[0]->mbmi.segment_id_supertx, r);
if (skip) {
reset_skip_context(xd, bsize);
} else {
......@@ -1808,7 +1813,6 @@ static void decode_partition(VP10Decoder *const pbi, MACROBLOCKD *const xd,
#endif // CONFIG_EXT_TX
}
set_segment_id_supertx(cm, mi_row, mi_col, bsize);
vp10_setup_dst_planes(xd->plane, get_frame_new_buffer(cm), mi_row, mi_col);
for (i = 0; i < MAX_MB_PLANE; i++) {
......
......@@ -1848,16 +1848,20 @@ static void write_modes_sb(VP10_COMP *const cpi,
}
#if CONFIG_SUPERTX
if (partition != PARTITION_NONE && supertx_enabled && pack_token) {
int skip;
xd->mi = cm->mi_grid_visible + mi_offset;
supertx_size = mbmi->tx_size;
set_mi_row_col(xd, tile,
mi_row, num_8x8_blocks_high_lookup[bsize],
mi_col, num_8x8_blocks_wide_lookup[bsize],
cm->mi_rows, cm->mi_cols);
vp10_write(w, mbmi->skip, vp10_get_skip_prob(cm, xd));
assert(IMPLIES(!cm->seg.enabled, mbmi->segment_id_supertx == 0));
assert(mbmi->segment_id_supertx < MAX_SEGMENTS);
skip = write_skip(cm, xd, mbmi->segment_id_supertx, xd->mi[0], w);
#if CONFIG_EXT_TX
if (get_ext_tx_types(supertx_size, bsize, 1) > 1 &&
!mbmi->skip) {
if (get_ext_tx_types(supertx_size, bsize, 1) > 1 && !skip) {
int eset = get_ext_tx_set(supertx_size, bsize, 1);
if (eset > 0) {
vp10_write_token(
......@@ -1867,7 +1871,7 @@ static void write_modes_sb(VP10_COMP *const cpi,
}
}
#else
if (supertx_size < TX_32X32 && !mbmi->skip) {
if (supertx_size < TX_32X32 && !skip) {
vp10_write_token(
w, vp10_ext_tx_tree,
cm->fc->inter_ext_tx_prob[supertx_size],
......@@ -1875,7 +1879,7 @@ static void write_modes_sb(VP10_COMP *const cpi,
}
#endif // CONFIG_EXT_TX
if (!mbmi->skip) {
if (!skip) {
assert(*tok < tok_end);
for (plane = 0; plane < MAX_MB_PLANE; ++plane) {
const int mbmi_txb_size = txsize_to_bsize[mbmi->tx_size];
......
......@@ -453,7 +453,11 @@ static void tokenize_b(int plane, int block, int blk_row, int blk_col,
int eob = p->eobs[block];
const PLANE_TYPE type = pd->plane_type;
const tran_low_t *qcoeff = BLOCK_OFFSET(p->qcoeff, block);
#if CONFIG_SUPERTX
const int segment_id = VPXMIN(mbmi->segment_id, mbmi->segment_id_supertx);
#else
const int segment_id = mbmi->segment_id;
#endif // CONFIG_SUEPRTX
const int16_t *scan, *nb;
const TX_TYPE tx_type = get_tx_type(type, xd, block, tx_size);
const scan_order *const so = get_scan(tx_size, tx_type, is_inter_block(mbmi));
......@@ -713,7 +717,7 @@ void vp10_tokenize_sb_supertx(VP10_COMP *cpi, ThreadData *td, TOKENEXTRA **t,
MB_MODE_INFO *const mbmi = &xd->mi[0]->mbmi;
TOKENEXTRA *t_backup = *t;
const int ctx = vp10_get_skip_context(xd);
const int skip_inc = !segfeature_active(&cm->seg, mbmi->segment_id,
const int skip_inc = !segfeature_active(&cm->seg, mbmi->segment_id_supertx,
SEG_LVL_SKIP);
struct tokenize_b_args arg = {cpi, td, t};
if (mbmi->skip) {
......
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