Commit e57b1a5e authored by Yue Chen's avatar Yue Chen

Make rectangular txfm in EXT_TX work with VAR_TX

Adapt rectangular txfm experiment to syntax/tokenization/loopfilter
framework of VAR_TX

Change-Id: Idcb005ecf5b3712de3e1cccb0d811ca16d87af24
parent 7fed5044
...@@ -368,6 +368,36 @@ static const TX_SIZE max_txsize_rect_lookup[BLOCK_SIZES] = { ...@@ -368,6 +368,36 @@ static const TX_SIZE max_txsize_rect_lookup[BLOCK_SIZES] = {
#endif // CONFIG_EXT_TX #endif // CONFIG_EXT_TX
/* clang-format on */ /* clang-format on */
static const TX_SIZE txsize_horz_map[TX_SIZES_ALL] = {
TX_4X4, // TX_4X4
TX_8X8, // TX_8X8
TX_16X16, // TX_16X16
TX_32X32, // TX_32X32
#if CONFIG_EXT_TX
TX_4X4, // TX_4X8
TX_8X8, // TX_8X4
TX_8X8, // TX_8X16
TX_16X16, // TX_16X8
TX_16X16, // TX_16X32
TX_32X32 // TX_32X16
#endif // CONFIG_EXT_TX
};
static const TX_SIZE txsize_vert_map[TX_SIZES_ALL] = {
TX_4X4, // TX_4X4
TX_8X8, // TX_8X8
TX_16X16, // TX_16X16
TX_32X32, // TX_32X32
#if CONFIG_EXT_TX
TX_8X8, // TX_4X8
TX_4X4, // TX_8X4
TX_16X16, // TX_8X16
TX_8X8, // TX_16X8
TX_32X32, // TX_16X32
TX_16X16 // TX_32X16
#endif // CONFIG_EXT_TX
};
static const BLOCK_SIZE txsize_to_bsize[TX_SIZES_ALL] = { static const BLOCK_SIZE txsize_to_bsize[TX_SIZES_ALL] = {
BLOCK_4X4, // TX_4X4 BLOCK_4X4, // TX_4X4
BLOCK_8X8, // TX_8X8 BLOCK_8X8, // TX_8X8
......
...@@ -1252,12 +1252,23 @@ void vp10_filter_block_plane_non420(VP10_COMMON *cm, ...@@ -1252,12 +1252,23 @@ void vp10_filter_block_plane_non420(VP10_COMMON *cm,
sb_type, ss_x, ss_y) sb_type, ss_x, ss_y)
: mbmi->inter_tx_size[blk_row][blk_col]; : mbmi->inter_tx_size[blk_row][blk_col];
#if CONFIG_EXT_TX && CONFIG_RECT_TX
tx_size_r =
VPXMIN(txsize_horz_map[tx_size], cm->above_txfm_context[mi_col + c]);
tx_size_c = VPXMIN(txsize_vert_map[tx_size],
cm->left_txfm_context[(mi_row + r) & MAX_MIB_MASK]);
cm->above_txfm_context[mi_col + c] = txsize_horz_map[tx_size];
cm->left_txfm_context[(mi_row + r) & MAX_MIB_MASK] =
txsize_vert_map[tx_size];
#else
tx_size_r = VPXMIN(tx_size, cm->above_txfm_context[mi_col + c]); tx_size_r = VPXMIN(tx_size, cm->above_txfm_context[mi_col + c]);
tx_size_c = tx_size_c =
VPXMIN(tx_size, cm->left_txfm_context[(mi_row + r) & MAX_MIB_MASK]); VPXMIN(tx_size, cm->left_txfm_context[(mi_row + r) & MAX_MIB_MASK]);
cm->above_txfm_context[mi_col + c] = tx_size; cm->above_txfm_context[mi_col + c] = tx_size;
cm->left_txfm_context[(mi_row + r) & MAX_MIB_MASK] = tx_size; cm->left_txfm_context[(mi_row + r) & MAX_MIB_MASK] = tx_size;
#endif
#endif #endif
// Build masks based on the transform size of each block // Build masks based on the transform size of each block
......
...@@ -661,6 +661,12 @@ static INLINE void set_txfm_ctx(TXFM_CONTEXT *txfm_ctx, TX_SIZE tx_size, ...@@ -661,6 +661,12 @@ static INLINE void set_txfm_ctx(TXFM_CONTEXT *txfm_ctx, TX_SIZE tx_size,
for (i = 0; i < len; ++i) txfm_ctx[i] = tx_size; for (i = 0; i < len; ++i) txfm_ctx[i] = tx_size;
} }
static INLINE void set_txfm_ctxs(TX_SIZE tx_size, int n8_w, int n8_h,
const MACROBLOCKD *xd) {
set_txfm_ctx(xd->above_txfm_context, txsize_horz_map[tx_size], n8_w);
set_txfm_ctx(xd->left_txfm_context, txsize_vert_map[tx_size], n8_h);
}
static INLINE void txfm_partition_update(TXFM_CONTEXT *above_ctx, static INLINE void txfm_partition_update(TXFM_CONTEXT *above_ctx,
TXFM_CONTEXT *left_ctx, TXFM_CONTEXT *left_ctx,
TX_SIZE tx_size) { TX_SIZE tx_size) {
......
...@@ -324,11 +324,7 @@ static void decode_reconstruct_tx(MACROBLOCKD *const xd, vp10_reader *r, ...@@ -324,11 +324,7 @@ static void decode_reconstruct_tx(MACROBLOCKD *const xd, vp10_reader *r,
if (blk_row >= max_blocks_high || blk_col >= max_blocks_wide) return; if (blk_row >= max_blocks_high || blk_col >= max_blocks_wide) return;
if (tx_size == plane_tx_size if (tx_size == plane_tx_size) {
#if CONFIG_EXT_TX && CONFIG_RECT_TX
|| plane_tx_size >= TX_SIZES
#endif // CONFIG_EXT_TX && CONFIG_RECT_TX
) {
PLANE_TYPE plane_type = (plane == 0) ? PLANE_TYPE_Y : PLANE_TYPE_UV; PLANE_TYPE plane_type = (plane == 0) ? PLANE_TYPE_Y : PLANE_TYPE_UV;
TX_TYPE tx_type = get_tx_type(plane_type, xd, block, plane_tx_size); TX_TYPE tx_type = get_tx_type(plane_type, xd, block, plane_tx_size);
const scan_order *sc = get_scan(plane_tx_size, tx_type, 1); const scan_order *sc = get_scan(plane_tx_size, tx_type, 1);
...@@ -361,7 +357,7 @@ static void decode_reconstruct_tx(MACROBLOCKD *const xd, vp10_reader *r, ...@@ -361,7 +357,7 @@ static void decode_reconstruct_tx(MACROBLOCKD *const xd, vp10_reader *r,
} }
#endif // CONFIG_VAR_TX #endif // CONFIG_VAR_TX
#if !CONFIG_VAR_TX || CONFIG_SUPERTX #if !CONFIG_VAR_TX || CONFIG_SUPERTX || (CONFIG_EXT_TX && CONFIG_RECT_TX)
static int reconstruct_inter_block(MACROBLOCKD *const xd, static int reconstruct_inter_block(MACROBLOCKD *const xd,
#if CONFIG_ANS #if CONFIG_ANS
struct AnsDecoder *const r, struct AnsDecoder *const r,
...@@ -533,8 +529,7 @@ static void set_param_topblock(VP10_COMMON *const cm, MACROBLOCKD *const xd, ...@@ -533,8 +529,7 @@ static void set_param_topblock(VP10_COMMON *const cm, MACROBLOCKD *const xd,
xd->above_txfm_context = cm->above_txfm_context + mi_col; xd->above_txfm_context = cm->above_txfm_context + mi_col;
xd->left_txfm_context = xd->left_txfm_context =
xd->left_txfm_context_buffer + (mi_row & MAX_MIB_MASK); xd->left_txfm_context_buffer + (mi_row & MAX_MIB_MASK);
set_txfm_ctx(xd->left_txfm_context, xd->mi[0]->mbmi.tx_size, bh); set_txfm_ctxs(xd->mi[0]->mbmi.tx_size, bw, bh, xd);
set_txfm_ctx(xd->above_txfm_context, xd->mi[0]->mbmi.tx_size, bw);
#endif #endif
} }
...@@ -1324,24 +1319,44 @@ static void decode_block(VP10Decoder *const pbi, MACROBLOCKD *const xd, ...@@ -1324,24 +1319,44 @@ static void decode_block(VP10Decoder *const pbi, MACROBLOCKD *const xd,
// TODO(jingning): This can be simplified for decoder performance. // TODO(jingning): This can be simplified for decoder performance.
const BLOCK_SIZE plane_bsize = const BLOCK_SIZE plane_bsize =
get_plane_block_size(VPXMAX(bsize, BLOCK_8X8), pd); get_plane_block_size(VPXMAX(bsize, BLOCK_8X8), pd);
#if CONFIG_EXT_TX && CONFIG_RECT_TX
const TX_SIZE max_tx_size = plane ? max_txsize_lookup[plane_bsize]
: max_txsize_rect_lookup[plane_bsize];
#else
const TX_SIZE max_tx_size = max_txsize_lookup[plane_bsize]; const TX_SIZE max_tx_size = max_txsize_lookup[plane_bsize];
#endif // CONFIG_EXT_TX && CONFIG_RECT_TX
int bw = num_4x4_blocks_wide_txsize_lookup[max_tx_size]; int bw = num_4x4_blocks_wide_txsize_lookup[max_tx_size];
int bh = num_4x4_blocks_high_txsize_lookup[max_tx_size]; int bh = num_4x4_blocks_high_txsize_lookup[max_tx_size];
const int step = num_4x4_blocks_txsize_lookup[max_tx_size]; const int step = num_4x4_blocks_txsize_lookup[max_tx_size];
int block = 0; int block = 0;
#if CONFIG_EXT_TX && CONFIG_RECT_TX
const TX_SIZE tx_size =
plane ? dec_get_uv_tx_size(mbmi, pd->n4_wl, pd->n4_hl)
: mbmi->tx_size;
for (row = 0; row < num_4x4_h; row += bh) { if (tx_size >= TX_SIZES) { // rect txsize is used
for (col = 0; col < num_4x4_w; col += bw) { const int stepr = num_4x4_blocks_high_txsize_lookup[tx_size];
decode_reconstruct_tx(xd, r, mbmi, plane, plane_bsize, block, row, const int stepc = num_4x4_blocks_wide_txsize_lookup[tx_size];
col, max_tx_size, &eobtotal); const int max_blocks_wide =
block += step; num_4x4_w +
(xd->mb_to_right_edge >= 0 ? 0 : xd->mb_to_right_edge >>
(5 + pd->subsampling_x));
const int max_blocks_high =
num_4x4_h +
(xd->mb_to_bottom_edge >= 0 ? 0 : xd->mb_to_bottom_edge >>
(5 + pd->subsampling_y));
for (row = 0; row < max_blocks_high; row += stepr)
for (col = 0; col < max_blocks_wide; col += stepc)
eobtotal += reconstruct_inter_block(xd, r, mbmi->segment_id,
plane, row, col, tx_size);
} else {
#endif
for (row = 0; row < num_4x4_h; row += bh) {
for (col = 0; col < num_4x4_w; col += bw) {
decode_reconstruct_tx(xd, r, mbmi, plane, plane_bsize, block, row,
col, max_tx_size, &eobtotal);
block += step;
}
} }
#if CONFIG_EXT_TX && CONFIG_RECT_TX
} }
#endif
#else #else
const TX_SIZE tx_size = const TX_SIZE tx_size =
plane ? dec_get_uv_tx_size(mbmi, pd->n4_wl, pd->n4_hl) plane ? dec_get_uv_tx_size(mbmi, pd->n4_wl, pd->n4_hl)
......
...@@ -315,12 +315,12 @@ static TX_SIZE read_tx_size_inter(VP10_COMMON *cm, MACROBLOCKD *xd, ...@@ -315,12 +315,12 @@ static TX_SIZE read_tx_size_inter(VP10_COMMON *cm, MACROBLOCKD *xd,
return tx_size; return tx_size;
} }
} else { } else {
#if CONFIG_EXT_TX && CONFIG_RECT_TX && !CONFIG_VAR_TX #if CONFIG_EXT_TX && CONFIG_RECT_TX
assert(IMPLIES(tx_mode == ONLY_4X4, bsize == BLOCK_4X4)); assert(IMPLIES(tx_mode == ONLY_4X4, bsize == BLOCK_4X4));
return max_txsize_rect_lookup[bsize]; return max_txsize_rect_lookup[bsize];
#else #else
return TX_4X4; return TX_4X4;
#endif // CONFIG_EXT_TX && CONFIG_RECT_TX && !CONFIG_VAR_TX #endif
} }
} }
...@@ -1642,8 +1642,7 @@ static void read_inter_frame_mode_info(VP10Decoder *const pbi, ...@@ -1642,8 +1642,7 @@ static void read_inter_frame_mode_info(VP10Decoder *const pbi,
mbmi->inter_tx_size[idy >> 1][idx >> 1] = mbmi->tx_size; mbmi->inter_tx_size[idy >> 1][idx >> 1] = mbmi->tx_size;
} }
set_txfm_ctx(xd->left_txfm_context, mbmi->tx_size, xd->n8_h); set_txfm_ctxs(mbmi->tx_size, xd->n8_w, xd->n8_h, xd);
set_txfm_ctx(xd->above_txfm_context, mbmi->tx_size, xd->n8_w);
} }
#else #else
if (inter_block) if (inter_block)
......
...@@ -1118,14 +1118,11 @@ static void pack_inter_mode_mvs(VP10_COMP *cpi, const MODE_INFO *mi, ...@@ -1118,14 +1118,11 @@ static void pack_inter_mode_mvs(VP10_COMP *cpi, const MODE_INFO *mi,
for (idx = 0; idx < width; idx += bs) for (idx = 0; idx < width; idx += bs)
write_tx_size_vartx(cm, xd, mbmi, max_tx_size, idy, idx, w); write_tx_size_vartx(cm, xd, mbmi, max_tx_size, idy, idx, w);
} else { } else {
set_txfm_ctx(xd->left_txfm_context, mbmi->tx_size, xd->n8_h); set_txfm_ctxs(mbmi->tx_size, xd->n8_w, xd->n8_h, xd);
set_txfm_ctx(xd->above_txfm_context, mbmi->tx_size, xd->n8_w);
write_selected_tx_size(cm, xd, w); write_selected_tx_size(cm, xd, w);
} }
} else { } else {
set_txfm_ctx(xd->left_txfm_context, mbmi->tx_size, xd->n8_h); set_txfm_ctxs(mbmi->tx_size, xd->n8_w, xd->n8_h, xd);
set_txfm_ctx(xd->above_txfm_context, mbmi->tx_size, xd->n8_w);
#else #else
write_selected_tx_size(cm, xd, w); write_selected_tx_size(cm, xd, w);
#endif #endif
...@@ -1640,8 +1637,14 @@ static void write_modes_b(VP10_COMP *cpi, const TileInfo *const tile, ...@@ -1640,8 +1637,14 @@ static void write_modes_b(VP10_COMP *cpi, const TileInfo *const tile,
const int num_4x4_w = num_4x4_blocks_wide_lookup[plane_bsize]; const int num_4x4_w = num_4x4_blocks_wide_lookup[plane_bsize];
const int num_4x4_h = num_4x4_blocks_high_lookup[plane_bsize]; const int num_4x4_h = num_4x4_blocks_high_lookup[plane_bsize];
int row, col; int row, col;
#if CONFIG_EXT_TX && CONFIG_RECT_TX
TX_SIZE tx_size =
plane ? get_uv_tx_size(mbmi, &xd->plane[plane]) : mbmi->tx_size;
if (is_inter_block(mbmi) && tx_size < TX_SIZES) {
#else
if (is_inter_block(mbmi)) { if (is_inter_block(mbmi)) {
#endif
const TX_SIZE max_tx_size = max_txsize_lookup[plane_bsize]; const TX_SIZE max_tx_size = max_txsize_lookup[plane_bsize];
const BLOCK_SIZE txb_size = txsize_to_bsize[max_tx_size]; const BLOCK_SIZE txb_size = txsize_to_bsize[max_tx_size];
int bw = num_4x4_blocks_wide_lookup[txb_size]; int bw = num_4x4_blocks_wide_lookup[txb_size];
...@@ -1659,8 +1662,9 @@ static void write_modes_b(VP10_COMP *cpi, const TileInfo *const tile, ...@@ -1659,8 +1662,9 @@ static void write_modes_b(VP10_COMP *cpi, const TileInfo *const tile,
: m->mbmi.tx_size; : m->mbmi.tx_size;
BLOCK_SIZE txb_size = txsize_to_bsize[tx]; BLOCK_SIZE txb_size = txsize_to_bsize[tx];
int bw = num_4x4_blocks_wide_lookup[txb_size]; int bw = num_4x4_blocks_wide_lookup[txb_size];
int bh = num_4x4_blocks_high_lookup[txb_size];
for (row = 0; row < num_4x4_h; row += bw) for (row = 0; row < num_4x4_h; row += bh)
for (col = 0; col < num_4x4_w; col += bw) for (col = 0; col < num_4x4_w; col += bw)
pack_mb_tokens(w, tok, tok_end, cm->bit_depth, tx); pack_mb_tokens(w, tok, tok_end, cm->bit_depth, tx);
} }
......
...@@ -2229,8 +2229,7 @@ static void encode_sb(VP10_COMP *cpi, ThreadData *td, ...@@ -2229,8 +2229,7 @@ static void encode_sb(VP10_COMP *cpi, ThreadData *td,
update_partition_context(xd, mi_row, mi_col, subsize, bsize); update_partition_context(xd, mi_row, mi_col, subsize, bsize);
#endif #endif
#if CONFIG_VAR_TX #if CONFIG_VAR_TX
set_txfm_ctx(xd->left_txfm_context, supertx_size, xd->n8_h); set_txfm_ctxs(supertx_size, mi_width, mi_height, xd);
set_txfm_ctx(xd->above_txfm_context, supertx_size, mi_height);
#endif // CONFIG_VAR_TX #endif // CONFIG_VAR_TX
return; return;
} else { } else {
...@@ -5027,8 +5026,13 @@ static void encode_superblock(VP10_COMP *cpi, ThreadData *td, TOKENEXTRA **t, ...@@ -5027,8 +5026,13 @@ static void encode_superblock(VP10_COMP *cpi, ThreadData *td, TOKENEXTRA **t,
vp10_encode_sb(x, VPXMAX(bsize, BLOCK_8X8)); vp10_encode_sb(x, VPXMAX(bsize, BLOCK_8X8));
#if CONFIG_VAR_TX #if CONFIG_VAR_TX
vp10_tokenize_sb_inter(cpi, td, t, !output_enabled, mi_row, mi_col, #if CONFIG_EXT_TX && CONFIG_RECT_TX
VPXMAX(bsize, BLOCK_8X8)); if (mbmi->tx_size >= TX_SIZES)
vp10_tokenize_sb(cpi, td, t, !output_enabled, VPXMAX(bsize, BLOCK_8X8));
else
#endif
vp10_tokenize_sb_inter(cpi, td, t, !output_enabled, mi_row, mi_col,
VPXMAX(bsize, BLOCK_8X8));
#else #else
vp10_tokenize_sb(cpi, td, t, !output_enabled, VPXMAX(bsize, BLOCK_8X8)); vp10_tokenize_sb(cpi, td, t, !output_enabled, VPXMAX(bsize, BLOCK_8X8));
#endif #endif
...@@ -5108,13 +5112,22 @@ static void encode_superblock(VP10_COMP *cpi, ThreadData *td, TOKENEXTRA **t, ...@@ -5108,13 +5112,22 @@ static void encode_superblock(VP10_COMP *cpi, ThreadData *td, TOKENEXTRA **t,
TX_SIZE tx_size; TX_SIZE tx_size;
// The new intra coding scheme requires no change of transform size // The new intra coding scheme requires no change of transform size
if (is_inter_block(mbmi)) if (is_inter_block(mbmi))
#if CONFIG_EXT_TX && CONFIG_RECT_TX
{
tx_size = VPXMIN(tx_mode_to_biggest_tx_size[cm->tx_mode], tx_size = VPXMIN(tx_mode_to_biggest_tx_size[cm->tx_mode],
max_txsize_lookup[bsize]); max_txsize_lookup[bsize]);
if (txsize_sqr_map[max_txsize_rect_lookup[bsize]] <= tx_size)
tx_size = max_txsize_rect_lookup[bsize];
if (xd->lossless[mbmi->segment_id]) tx_size = TX_4X4;
}
#else
tx_size = VPXMIN(tx_mode_to_biggest_tx_size[cm->tx_mode],
max_txsize_lookup[bsize]);
#endif
else else
tx_size = (bsize >= BLOCK_8X8) ? mbmi->tx_size : TX_4X4; tx_size = (bsize >= BLOCK_8X8) ? mbmi->tx_size : TX_4X4;
mbmi->tx_size = tx_size; mbmi->tx_size = tx_size;
set_txfm_ctx(xd->left_txfm_context, tx_size, xd->n8_h); set_txfm_ctxs(tx_size, xd->n8_w, xd->n8_h, xd);
set_txfm_ctx(xd->above_txfm_context, tx_size, xd->n8_w);
} }
#endif #endif
} }
......
...@@ -980,6 +980,9 @@ void vp10_encode_sb(MACROBLOCK *x, BLOCK_SIZE bsize) { ...@@ -980,6 +980,9 @@ void vp10_encode_sb(MACROBLOCK *x, BLOCK_SIZE bsize) {
int idx, idy; int idx, idy;
int block = 0; int block = 0;
int step = num_4x4_blocks_txsize_lookup[max_tx_size]; int step = num_4x4_blocks_txsize_lookup[max_tx_size];
#if CONFIG_EXT_TX && CONFIG_RECT_TX
const TX_SIZE tx_size = plane ? get_uv_tx_size(mbmi, pd) : mbmi->tx_size;
#endif
vp10_get_entropy_contexts(bsize, TX_4X4, pd, ctx.ta[plane], ctx.tl[plane]); vp10_get_entropy_contexts(bsize, TX_4X4, pd, ctx.ta[plane], ctx.tl[plane]);
#else #else
const struct macroblockd_plane *const pd = &xd->plane[plane]; const struct macroblockd_plane *const pd = &xd->plane[plane];
...@@ -991,13 +994,22 @@ void vp10_encode_sb(MACROBLOCK *x, BLOCK_SIZE bsize) { ...@@ -991,13 +994,22 @@ void vp10_encode_sb(MACROBLOCK *x, BLOCK_SIZE bsize) {
arg.tl = ctx.tl[plane]; arg.tl = ctx.tl[plane];
#if CONFIG_VAR_TX #if CONFIG_VAR_TX
for (idy = 0; idy < mi_height; idy += bh) { #if CONFIG_EXT_TX && CONFIG_RECT_TX
for (idx = 0; idx < mi_width; idx += bh) { if (tx_size >= TX_SIZES) {
encode_block_inter(plane, block, idy, idx, plane_bsize, max_tx_size, vp10_foreach_transformed_block_in_plane(xd, bsize, plane, encode_block,
&arg); &arg);
block += step; } else {
#endif
for (idy = 0; idy < mi_height; idy += bh) {
for (idx = 0; idx < mi_width; idx += bh) {
encode_block_inter(plane, block, idy, idx, plane_bsize, max_tx_size,
&arg);
block += step;
}
} }
#if CONFIG_EXT_TX && CONFIG_RECT_TX
} }
#endif
#else #else
vp10_foreach_transformed_block_in_plane(xd, bsize, plane, encode_block, vp10_foreach_transformed_block_in_plane(xd, bsize, plane, encode_block,
&arg); &arg);
......
...@@ -2584,7 +2584,7 @@ static void configure_buffer_updates(VP10_COMP *cpi) { ...@@ -2584,7 +2584,7 @@ static void configure_buffer_updates(VP10_COMP *cpi) {
cpi->rc.is_bwd_ref_frame = 1; cpi->rc.is_bwd_ref_frame = 1;
cpi->bwd_fb_idx = cpi->alt_fb_idx; cpi->bwd_fb_idx = cpi->alt_fb_idx;
cpi->alt_fb_idx = cpi->arf_map[0];; cpi->alt_fb_idx = cpi->arf_map[0];
cpi->arf_map[0] = tmp; cpi->arf_map[0] = tmp;
} else { } else {
cpi->rc.is_bwd_ref_frame = 0; cpi->rc.is_bwd_ref_frame = 0;
......
...@@ -4220,13 +4220,13 @@ static int64_t encode_inter_mb_segment(VP10_COMP *cpi, MACROBLOCK *x, ...@@ -4220,13 +4220,13 @@ static int64_t encode_inter_mb_segment(VP10_COMP *cpi, MACROBLOCK *x,
const int num_4x4_w = num_4x4_blocks_wide_txsize_lookup[tx_size]; const int num_4x4_w = num_4x4_blocks_wide_txsize_lookup[tx_size];
const int num_4x4_h = num_4x4_blocks_high_txsize_lookup[tx_size]; const int num_4x4_h = num_4x4_blocks_high_txsize_lookup[tx_size];
#if CONFIG_EXT_TX && CONFIG_RECT_TX && !CONFIG_VAR_TX #if CONFIG_EXT_TX && CONFIG_RECT_TX
assert(IMPLIES(xd->lossless[mi->mbmi.segment_id], tx_size == TX_4X4)); assert(IMPLIES(xd->lossless[mi->mbmi.segment_id], tx_size == TX_4X4));
assert(IMPLIES(!xd->lossless[mi->mbmi.segment_id], assert(IMPLIES(!xd->lossless[mi->mbmi.segment_id],
tx_size == max_txsize_rect_lookup[mi->mbmi.sb_type])); tx_size == max_txsize_rect_lookup[mi->mbmi.sb_type]));
#else #else
assert(tx_size == TX_4X4); assert(tx_size == TX_4X4);
#endif // CONFIG_EXT_TX && CONFIG_RECT_TX && !CONFIG_VAR_TX #endif
assert(tx_type == DCT_DCT); assert(tx_type == DCT_DCT);
vp10_build_inter_predictor_sub8x8(xd, 0, i, ir, ic, mi_row, mi_col); vp10_build_inter_predictor_sub8x8(xd, 0, i, ir, ic, mi_row, mi_col);
...@@ -4746,12 +4746,12 @@ static int64_t rd_pick_best_sub8x8_mode( ...@@ -4746,12 +4746,12 @@ static int64_t rd_pick_best_sub8x8_mode(
const int has_second_rf = has_second_ref(mbmi); const int has_second_rf = has_second_ref(mbmi);
const int inter_mode_mask = cpi->sf.inter_mode_mask[bsize]; const int inter_mode_mask = cpi->sf.inter_mode_mask[bsize];
MB_MODE_INFO_EXT *const mbmi_ext = x->mbmi_ext; MB_MODE_INFO_EXT *const mbmi_ext = x->mbmi_ext;
#if CONFIG_EXT_TX && CONFIG_RECT_TX && !CONFIG_VAR_TX #if CONFIG_EXT_TX && CONFIG_RECT_TX
mbmi->tx_size = mbmi->tx_size =
xd->lossless[mbmi->segment_id] ? TX_4X4 : max_txsize_rect_lookup[bsize]; xd->lossless[mbmi->segment_id] ? TX_4X4 : max_txsize_rect_lookup[bsize];
#else #else
mbmi->tx_size = TX_4X4; mbmi->tx_size = TX_4X4;
#endif // CONFIG_EXT_TX && CONFIG_RECT_TX && !CONFIG_VAR_TX #endif
vp10_zero(*bsi); vp10_zero(*bsi);
...@@ -10512,6 +10512,10 @@ void vp10_rd_pick_inter_mode_sub8x8(struct VP10_COMP *cpi, ...@@ -10512,6 +10512,10 @@ void vp10_rd_pick_inter_mode_sub8x8(struct VP10_COMP *cpi,
// macroblock modes // macroblock modes
*mbmi = best_mbmode; *mbmi = best_mbmode;
#if CONFIG_VAR_TX && CONFIG_EXT_TX && CONFIG_RECT_TX
mbmi->inter_tx_size[0][0] = mbmi->tx_size;
#endif
x->skip |= best_skip2; x->skip |= best_skip2;
if (!is_inter_block(&best_mbmode)) { if (!is_inter_block(&best_mbmode)) {
for (i = 0; i < 4; i++) xd->mi[0]->bmi[i].as_mode = best_bmodes[i].as_mode; for (i = 0; i < 4; i++) xd->mi[0]->bmi[i].as_mode = best_bmodes[i].as_mode;
......
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