From: Debargha Mukherjee Date: Tue, 23 Aug 2016 07:17:00 +0000 (-0700) Subject: Missing fixes for rect-tx X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=49b85d3965e154b5af8ce0c4401a89bab6a4578a;p=libvpx Missing fixes for rect-tx Reintroducing some fixes that were dropped inadvertently in course of rebasing. Change-Id: I5f51160c586010590d4bfd5cf225fb21347b0a40 --- diff --git a/vp10/common/entropymode.h b/vp10/common/entropymode.h index 5df080b58..d1eea891d 100644 --- a/vp10/common/entropymode.h +++ b/vp10/common/entropymode.h @@ -172,7 +172,6 @@ typedef struct FRAME_COUNTS { unsigned int comp_ref[REF_CONTEXTS][COMP_REFS - 1][2]; #endif // CONFIG_EXT_REFS unsigned int tx_size_totals[TX_SIZES]; - unsigned int tx_size_implied[TX_SIZES][TX_SIZES]; unsigned int tx_size[TX_SIZES - 1][TX_SIZE_CONTEXTS][TX_SIZES]; #if CONFIG_VAR_TX unsigned int txfm_partition[TXFM_PARTITION_CONTEXTS][2]; @@ -184,6 +183,9 @@ typedef struct FRAME_COUNTS { nmv_context_counts mv; #endif #if CONFIG_EXT_TX +#if CONFIG_RECT_TX + unsigned int tx_size_implied[TX_SIZES][TX_SIZES]; +#endif // CONFIG_RECT_TX unsigned int inter_ext_tx[EXT_TX_SETS_INTER][EXT_TX_SIZES][TX_TYPES]; unsigned int intra_ext_tx[EXT_TX_SETS_INTRA][EXT_TX_SIZES][INTRA_MODES][TX_TYPES]; diff --git a/vp10/encoder/encodeframe.c b/vp10/encoder/encodeframe.c index 24fc6e18f..0efd6fb41 100644 --- a/vp10/encoder/encodeframe.c +++ b/vp10/encoder/encodeframe.c @@ -4279,7 +4279,7 @@ static void reset_skip_tx_size(VP10_COMMON *cm, TX_SIZE max_tx_size) { for (mi_row = 0; mi_row < cm->mi_rows; ++mi_row, mi_ptr += mis) { for (mi_col = 0; mi_col < cm->mi_cols; ++mi_col) { - if (mi_ptr[mi_col]->mbmi.tx_size > max_tx_size) + if (txsize_sqr_up_map[mi_ptr[mi_col]->mbmi.tx_size] > max_tx_size) mi_ptr[mi_col]->mbmi.tx_size = max_tx_size; } } @@ -4688,6 +4688,18 @@ void vp10_encode_frame(VP10_COMP *cpi) { count16x16_lp += counts->tx_size[2][i][TX_16X16]; count32x32 += counts->tx_size[2][i][TX_32X32]; } +#if CONFIG_EXT_TX && CONFIG_RECT_TX + count4x4 += counts->tx_size_implied[0][TX_4X4]; + count4x4 += counts->tx_size_implied[1][TX_4X4]; + count4x4 += counts->tx_size_implied[2][TX_4X4]; + count4x4 += counts->tx_size_implied[3][TX_4X4]; + count8x8_lp += counts->tx_size_implied[2][TX_8X8]; + count8x8_lp += counts->tx_size_implied[3][TX_8X8]; + count8x8_8x8p += counts->tx_size_implied[1][TX_8X8]; + count16x16_lp += counts->tx_size_implied[3][TX_16X16]; + count16x16_16x16p += counts->tx_size_implied[2][TX_16X16]; + count32x32 += counts->tx_size_implied[3][TX_32X32]; +#endif // CONFIG_EXT_TX && CONFIG_RECT_TX if (count4x4 == 0 && count16x16_lp == 0 && count16x16_16x16p == 0 && #if CONFIG_SUPERTX cm->counts.supertx_size[TX_16X16] == 0 && @@ -5031,7 +5043,7 @@ static void encode_superblock(VP10_COMP *cpi, ThreadData *td, TOKENEXTRA **t, if (is_inter_block(mbmi)) tx_partition_count_update(cm, xd, bsize, mi_row, mi_col, td->counts); #endif - ++td->counts->tx_size[tx_size_cat][ctx][mbmi->tx_size]; + ++td->counts->tx_size[tx_size_cat][ctx][txsize_sqr_up_map[mbmi->tx_size]]; } else { int x, y; TX_SIZE tx_size; @@ -5042,6 +5054,11 @@ static void encode_superblock(VP10_COMP *cpi, ThreadData *td, TOKENEXTRA **t, #if CONFIG_EXT_TX && CONFIG_RECT_TX if (txsize_sqr_map[max_txsize_rect_lookup[bsize]] <= tx_size) tx_size = max_txsize_rect_lookup[bsize]; +#endif // CONFIG_EXT_TX && CONFIG_RECT_TX + if (xd->lossless[mbmi->segment_id]) tx_size = TX_4X4; +#if CONFIG_EXT_TX && CONFIG_RECT_TX + ++td->counts->tx_size_implied[max_txsize_lookup[bsize]] + [txsize_sqr_up_map[mbmi->tx_size]]; #endif // CONFIG_EXT_TX && CONFIG_RECT_TX } else { tx_size = (bsize >= BLOCK_8X8) ? mbmi->tx_size : TX_4X4;