From 599003969d4521fb896a8bff603c35c241ebc10e Mon Sep 17 00:00:00 2001 From: Geza Lore Date: Tue, 9 Feb 2016 13:18:31 +0000 Subject: [PATCH] Further supertx costing fixes. Change-Id: I85897168c7fda3fd79daaba985b6607fd7df476b --- vp10/encoder/encodeframe.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/vp10/encoder/encodeframe.c b/vp10/encoder/encodeframe.c index 898b18f5b..185dcbb41 100644 --- a/vp10/encoder/encodeframe.c +++ b/vp10/encoder/encodeframe.c @@ -5152,8 +5152,8 @@ static void rd_supertx_sb(VP10_COMP *cpi, ThreadData *td, uint8_t *dst_buf[3]; int dst_stride[3]; TX_SIZE tx_size; - MB_MODE_INFO *mbmi = &xd->mi[0]->mbmi; - TX_TYPE tx_type, best_tx_nostx = xd->mi[0]->mbmi.tx_type; + MB_MODE_INFO *mbmi; + TX_TYPE tx_type, best_tx_nostx; #if CONFIG_EXT_TX int ext_tx_set; #endif // CONFIG_EXT_TX @@ -5161,7 +5161,10 @@ static void rd_supertx_sb(VP10_COMP *cpi, ThreadData *td, int64_t tmp_dist_tx = 0, rd_tx, bestrd_tx = INT64_MAX; uint8_t tmp_zcoeff_blk = 0; - update_state_sb_supertx(cpi, td, tile, mi_row, mi_col, bsize, 0, pc_tree); + set_skip_context(xd, mi_row, mi_col); + set_mode_info_offsets(cpi, x, xd, mi_row, mi_col); + update_state_sb_supertx(cpi, td, tile, mi_row, mi_col, bsize, + 0, pc_tree); vp10_setup_dst_planes(xd->plane, get_frame_new_buffer(cm), mi_row, mi_col); for (plane = 0; plane < MAX_MB_PLANE; plane++) { @@ -5171,6 +5174,8 @@ static void rd_supertx_sb(VP10_COMP *cpi, ThreadData *td, predict_sb_complex(cpi, td, tile, mi_row, mi_col, mi_row, mi_col, 0, bsize, bsize, dst_buf, dst_stride, pc_tree); + set_offsets(cpi, tile, x, mi_row, mi_col, bsize); + // These skip_txfm flags are previously set by the non-supertx RD search. // vp10_txfm_rd_in_plane_supertx calls block_rd_txfm, which checks these // to reuse distortion values from the RD estimation, so we reset these @@ -5178,7 +5183,9 @@ static void rd_supertx_sb(VP10_COMP *cpi, ThreadData *td, for (plane = 0 ; plane < MAX_MB_PLANE ; plane++) x->skip_txfm[plane << 2] = SKIP_TXFM_NONE; - set_offsets(cpi, tile, x, mi_row, mi_col, bsize); + mbmi = &xd->mi[0]->mbmi; + best_tx_nostx = mbmi->tx_type; + *best_tx = DCT_DCT; // chroma @@ -5278,7 +5285,7 @@ static void rd_supertx_sb(VP10_COMP *cpi, ThreadData *td, if (tx_size < TX_32X32 && !xd->lossless[xd->mi[0]->mbmi.segment_id] && this_rate != INT_MAX) { - this_rate += cpi->inter_tx_type_costs[mbmi->tx_size][mbmi->tx_type]; + this_rate += cpi->inter_tx_type_costs[tx_size][mbmi->tx_type]; } #endif // CONFIG_EXT_TX *tmp_rate = rate_uv + this_rate; -- 2.40.0