Move the supertx skip bit and transform type past the recursive
prediction blocks. This is in preparation for using the segment level
skip feature for supertx blocks.

Change-Id: I8319414b0734144a9264e8a4a60940b6716b12a8
This commit is contained in:
Geza Lore 2016-06-16 17:13:55 +01:00
Родитель 8192010e32
Коммит 984cc04a22
2 изменённых файлов: 79 добавлений и 73 удалений

Просмотреть файл

@ -1584,41 +1584,9 @@ static void decode_partition(VP10Decoder *const pbi, MACROBLOCKD *const xd,
r, cm->fc->supertx_prob[supertx_context][supertx_size]);
if (xd->counts)
xd->counts->supertx[supertx_context][supertx_size][supertx_enabled]++;
}
if (supertx_enabled && read_token) {
int offset = mi_row * cm->mi_stride + mi_col;
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);
if (skip) {
reset_skip_context(xd, bsize);
} else {
#if CONFIG_EXT_TX
if (get_ext_tx_types(supertx_size, bsize, 1) > 1) {
int eset = get_ext_tx_set(supertx_size, bsize, 1);
if (eset > 0) {
txfm = vp10_read_tree(r, vp10_ext_tx_inter_tree[eset],
cm->fc->inter_ext_tx_prob[eset][supertx_size]);
if (xd->counts)
++xd->counts->inter_ext_tx[eset][supertx_size][txfm];
}
}
#else
if (supertx_size < TX_32X32) {
txfm = vp10_read_tree(r, vp10_ext_tx_tree,
cm->fc->inter_ext_tx_prob[supertx_size]);
if (xd->counts)
++xd->counts->inter_ext_tx[supertx_size][txfm];
}
#endif // CONFIG_EXT_TX
}
#if CONFIG_VAR_TX
xd->supertx_size = supertx_size;
if (supertx_enabled)
xd->supertx_size = supertx_size;
#endif
}
#endif // CONFIG_SUPERTX
@ -1807,6 +1775,38 @@ static void decode_partition(VP10Decoder *const pbi, MACROBLOCKD *const xd,
if (supertx_enabled && read_token) {
uint8_t *dst_buf[3];
int dst_stride[3], i;
int offset = mi_row * cm->mi_stride + mi_col;
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);
if (skip) {
reset_skip_context(xd, bsize);
} else {
#if CONFIG_EXT_TX
if (get_ext_tx_types(supertx_size, bsize, 1) > 1) {
int eset = get_ext_tx_set(supertx_size, bsize, 1);
if (eset > 0) {
txfm = vp10_read_tree(r, vp10_ext_tx_inter_tree[eset],
cm->fc->inter_ext_tx_prob[eset][supertx_size]);
if (xd->counts)
++xd->counts->inter_ext_tx[eset][supertx_size][txfm];
}
}
#else
if (supertx_size < TX_32X32) {
txfm = vp10_read_tree(r, vp10_ext_tx_tree,
cm->fc->inter_ext_tx_prob[supertx_size]);
if (xd->counts)
++xd->counts->inter_ext_tx[supertx_size][txfm];
}
#endif // CONFIG_EXT_TX
}
set_segment_id_supertx(cm, mi_row, mi_col, bsize);

Просмотреть файл

@ -1773,28 +1773,6 @@ static void write_modes_sb(VP10_COMP *const cpi,
[supertx_size];
supertx_enabled = (xd->mi[0]->mbmi.tx_size == supertx_size);
vp10_write(w, supertx_enabled, prob);
if (supertx_enabled) {
vp10_write(w, xd->mi[0]->mbmi.skip, vp10_get_skip_prob(cm, xd));
#if CONFIG_EXT_TX
if (get_ext_tx_types(supertx_size, bsize, 1) > 1 &&
!xd->mi[0]->mbmi.skip) {
int eset = get_ext_tx_set(supertx_size, bsize, 1);
if (eset > 0) {
vp10_write_token(
w, vp10_ext_tx_inter_tree[eset],
cm->fc->inter_ext_tx_prob[eset][supertx_size],
&ext_tx_inter_encodings[eset][xd->mi[0]->mbmi.tx_type]);
}
}
#else
if (supertx_size < TX_32X32 && !xd->mi[0]->mbmi.skip) {
vp10_write_token(
w, vp10_ext_tx_tree,
cm->fc->inter_ext_tx_prob[supertx_size],
&ext_tx_encodings[xd->mi[0]->mbmi.tx_type]);
}
#endif // CONFIG_EXT_TX
}
}
#endif // CONFIG_SUPERTX
if (subsize < BLOCK_8X8) {
@ -1869,24 +1847,52 @@ static void write_modes_sb(VP10_COMP *const cpi,
}
}
#if CONFIG_SUPERTX
if (partition != PARTITION_NONE && supertx_enabled && pack_token &&
!mbmi->skip) {
assert(*tok < tok_end);
for (plane = 0; plane < MAX_MB_PLANE; ++plane) {
const int mbmi_txb_size = txsize_to_bsize[mbmi->tx_size];
const int num_4x4_w = num_4x4_blocks_wide_lookup[mbmi_txb_size];
const int num_4x4_h = num_4x4_blocks_high_lookup[mbmi_txb_size];
int row, col;
TX_SIZE tx = plane ? get_uv_tx_size(mbmi, &xd->plane[plane])
: mbmi->tx_size;
BLOCK_SIZE txb_size = txsize_to_bsize[tx];
int bw = num_4x4_blocks_wide_lookup[txb_size];
if (partition != PARTITION_NONE && supertx_enabled && pack_token) {
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));
#if CONFIG_EXT_TX
if (get_ext_tx_types(supertx_size, bsize, 1) > 1 &&
!mbmi->skip) {
int eset = get_ext_tx_set(supertx_size, bsize, 1);
if (eset > 0) {
vp10_write_token(
w, vp10_ext_tx_inter_tree[eset],
cm->fc->inter_ext_tx_prob[eset][supertx_size],
&ext_tx_inter_encodings[eset][mbmi->tx_type]);
}
}
#else
if (supertx_size < TX_32X32 && !mbmi->skip) {
vp10_write_token(
w, vp10_ext_tx_tree,
cm->fc->inter_ext_tx_prob[supertx_size],
&ext_tx_encodings[mbmi->tx_type]);
}
#endif // CONFIG_EXT_TX
for (row = 0; row < num_4x4_h; row += bw)
for (col = 0; col < num_4x4_w; col += bw)
pack_mb_tokens(w, tok, tok_end, cm->bit_depth, tx);
assert(*tok < tok_end && (*tok)->token == EOSB_TOKEN);
(*tok)++;
if (!mbmi->skip) {
assert(*tok < tok_end);
for (plane = 0; plane < MAX_MB_PLANE; ++plane) {
const int mbmi_txb_size = txsize_to_bsize[mbmi->tx_size];
const int num_4x4_w = num_4x4_blocks_wide_lookup[mbmi_txb_size];
const int num_4x4_h = num_4x4_blocks_high_lookup[mbmi_txb_size];
int row, col;
TX_SIZE tx = plane ? get_uv_tx_size(mbmi, &xd->plane[plane])
: mbmi->tx_size;
BLOCK_SIZE txb_size = txsize_to_bsize[tx];
int bw = num_4x4_blocks_wide_lookup[txb_size];
for (row = 0; row < num_4x4_h; row += bw)
for (col = 0; col < num_4x4_w; col += bw)
pack_mb_tokens(w, tok, tok_end, cm->bit_depth, tx);
assert(*tok < tok_end && (*tok)->token == EOSB_TOKEN);
(*tok)++;
}
}
}
#endif // CONFIG_SUPERTX