Commit f71808c7 authored by Alex Converse's avatar Alex Converse

intrabc: Elide tx size for intrabc skip

Saves some bits here and there, no effect on reconstruction.
-0.13 BD-RATE PSNR on wikipedia_420

Change-Id: Idfa137fe61b828fd99eaecda84afa2eaaf893d71
parent 4322bc18
......@@ -1014,12 +1014,12 @@ static void read_intra_frame_mode_info(AV1_COMMON *const cm,
mbmi->ref_frame[0] = INTRA_FRAME;
mbmi->ref_frame[1] = NONE_FRAME;
mbmi->tx_size = read_tx_size(cm, xd, 0, 1, r);
#if CONFIG_INTRABC
if (bsize >= BLOCK_8X8 && cm->allow_screen_content_tools) {
mbmi->use_intrabc = aom_read(r, ec_ctx->intrabc_prob, ACCT_STR);
if (mbmi->use_intrabc) {
mbmi->tx_size = read_tx_size(cm, xd, 1, !mbmi->skip, r);
mbmi->mode = mbmi->uv_mode = DC_PRED;
#if CONFIG_DUAL_FILTER
for (int idx = 0; idx < 4; ++idx) mbmi->interp_filter[idx] = BILINEAR;
......@@ -1067,6 +1067,8 @@ static void read_intra_frame_mode_info(AV1_COMMON *const cm,
}
#endif // CONFIG_INTRABC
mbmi->tx_size = read_tx_size(cm, xd, 0, 1, r);
#if CONFIG_CB4X4
(void)i;
mbmi->mode =
......
......@@ -2110,18 +2110,17 @@ static void write_mb_modes_kf(AV1_COMMON *cm,
write_skip(cm, xd, mbmi->segment_id, mi, w);
#endif
if (cm->tx_mode == TX_MODE_SELECT &&
int enable_tx_size = cm->tx_mode == TX_MODE_SELECT &&
#if CONFIG_CB4X4 && (CONFIG_VAR_TX || CONFIG_RECT_TX)
#if CONFIG_RECT_TX
bsize > BLOCK_4X4 &&
bsize > BLOCK_4X4 &&
#else
bsize >= BLOCK_8X8 &&
bsize >= BLOCK_8X8 &&
#endif // CONFIG_RECT_TX
#else
bsize >= BLOCK_8X8 &&
bsize >= BLOCK_8X8 &&
#endif
!xd->lossless[mbmi->segment_id])
write_selected_tx_size(cm, xd, w);
!xd->lossless[mbmi->segment_id];
#if CONFIG_INTRABC
if (bsize >= BLOCK_8X8 && cm->allow_screen_content_tools) {
......@@ -2130,6 +2129,7 @@ static void write_mb_modes_kf(AV1_COMMON *cm,
if (use_intrabc) {
assert(mbmi->mode == DC_PRED);
assert(mbmi->uv_mode == DC_PRED);
if (enable_tx_size && !mbmi->skip) write_selected_tx_size(cm, xd, w);
int_mv dv_ref = mbmi_ext->ref_mvs[INTRA_FRAME][0];
av1_encode_dv(w, &mbmi->mv[0].as_mv, &dv_ref.as_mv, &ec_ctx->ndvc);
#if CONFIG_EXT_TX && !CONFIG_TXK_SEL
......@@ -2143,6 +2143,7 @@ static void write_mb_modes_kf(AV1_COMMON *cm,
}
}
#endif // CONFIG_INTRABC
if (enable_tx_size) write_selected_tx_size(cm, xd, w);
if (bsize >= BLOCK_8X8 || unify_bsize) {
write_intra_mode_kf(cm, ec_ctx, mi, above_mi, left_mi, 0, mbmi->mode, w);
......
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