From: Jingning Han Date: Fri, 28 Oct 2016 22:42:44 +0000 (-0700) Subject: Replace num_4x4_blocks_txsize_loopup table X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=32b2028b30b0c94d8b2ddca9b6ebc291bb127fb5;p=libvpx Replace num_4x4_blocks_txsize_loopup table Unify the transform block size access table in preparation for 2x2 transform integration. Change-Id: I308def6729e138ae2b2542175206e3225c0cb392 --- diff --git a/av1/decoder/decodeframe.c b/av1/decoder/decodeframe.c index 7d5a10fe4..2f198f6f9 100644 --- a/av1/decoder/decodeframe.c +++ b/av1/decoder/decodeframe.c @@ -1722,20 +1722,21 @@ static void decode_partition(AV1Decoder *const pbi, MACROBLOCKD *const xd, assert(mbmi->segment_id_supertx != MAX_SEGMENTS); for (i = 0; i < MAX_MB_PLANE; ++i) { const struct macroblockd_plane *const pd = &xd->plane[i]; - const int num_4x4_w = pd->n4_w; - const int num_4x4_h = pd->n4_h; int row, col; const TX_SIZE tx_size = i ? get_uv_tx_size(mbmi, pd) : mbmi->tx_size; - const int stepr = num_4x4_blocks_high_txsize_lookup[tx_size]; - const int stepc = num_4x4_blocks_wide_txsize_lookup[tx_size]; - const int max_blocks_wide = - num_4x4_w + (xd->mb_to_right_edge >= 0 + const int stepr = tx_size_high_unit[tx_size]; + const int stepc = tx_size_wide_unit[tx_size]; + int max_blocks_wide = + pd->width + (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_right_edge >> (3 + pd->subsampling_x)); + int max_blocks_high = + pd->height + (xd->mb_to_bottom_edge >= 0 ? 0 : xd->mb_to_bottom_edge >> - (5 + pd->subsampling_y)); + (3 + pd->subsampling_y)); + + max_blocks_wide >>= tx_size_wide_log2[0]; + max_blocks_high >>= tx_size_wide_log2[0]; for (row = 0; row < max_blocks_high; row += stepr) for (col = 0; col < max_blocks_wide; col += stepc) diff --git a/av1/encoder/encodeframe.c b/av1/encoder/encodeframe.c index 21725d788..bf50bc440 100644 --- a/av1/encoder/encodeframe.c +++ b/av1/encoder/encodeframe.c @@ -1305,8 +1305,8 @@ static void update_state_supertx(const AV1_COMP *const cpi, ThreadData *td, #if CONFIG_VAR_TX { const TX_SIZE mtx = mbmi->tx_size; - const int num_4x4_blocks_wide = num_4x4_blocks_wide_txsize_lookup[mtx] >> 1; - const int num_4x4_blocks_high = num_4x4_blocks_high_txsize_lookup[mtx] >> 1; + const int num_4x4_blocks_wide = tx_size_wide_unit[mtx] >> 1; + const int num_4x4_blocks_high = tx_size_high_unit[mtx] >> 1; int idy, idx; mbmi->inter_tx_size[0][0] = mtx; for (idy = 0; idy < num_4x4_blocks_high; ++idy)