From 2d64f12595d1098099e0b74254f816ae2678b7a3 Mon Sep 17 00:00:00 2001 From: Jingning Han Date: Fri, 21 Oct 2016 12:44:29 -0700 Subject: [PATCH] Refactor tx_size step use cases in decoder Use lookup table to replace the arithmetic computation for transform block step. Change-Id: I1318d81bda9d7ffaf9d550acd19354b0615ede36 --- av1/decoder/decodeframe.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/av1/decoder/decodeframe.c b/av1/decoder/decodeframe.c index d63afe560..4cb7d8233 100644 --- a/av1/decoder/decodeframe.c +++ b/av1/decoder/decodeframe.c @@ -1223,8 +1223,8 @@ static void decode_block(AV1Decoder *const pbi, MACROBLOCKD *const xd, const TX_SIZE tx_size = plane ? get_uv_tx_size(mbmi, pd) : mbmi->tx_size; const int num_4x4_w = pd->n4_w; const int num_4x4_h = pd->n4_h; - const int stepr = num_4x4_blocks_high_txsize_lookup[tx_size]; - const int stepc = num_4x4_blocks_wide_txsize_lookup[tx_size]; + const int stepr = tx_size_high_unit[tx_size]; + const int stepc = tx_size_wide_unit[tx_size]; int row, col; const int max_blocks_wide = num_4x4_w + (xd->mb_to_right_edge >= 0 @@ -1306,16 +1306,16 @@ static void decode_block(AV1Decoder *const pbi, MACROBLOCKD *const xd, const BLOCK_SIZE plane_bsize = get_plane_block_size(AOMMAX(bsize, BLOCK_8X8), pd); const TX_SIZE max_tx_size = max_txsize_lookup[plane_bsize]; - const int bw_var_tx = num_4x4_blocks_wide_txsize_lookup[max_tx_size]; - const int bh_var_tx = num_4x4_blocks_high_txsize_lookup[max_tx_size]; + const int bw_var_tx = tx_size_high_unit[max_tx_size]; + const int bh_var_tx = tx_size_wide_unit[max_tx_size]; const int step = num_4x4_blocks_txsize_lookup[max_tx_size]; int block = 0; #if CONFIG_EXT_TX && CONFIG_RECT_TX if (is_rect_tx(mbmi->tx_size)) { const TX_SIZE tx_size = plane ? 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 stepr = tx_size_high_unit[tx_size]; + const int stepc = tx_size_wide_unit[tx_size]; const int max_blocks_wide = num_4x4_w + (xd->mb_to_right_edge >= 0 ? 0 : xd->mb_to_right_edge >> @@ -1344,8 +1344,8 @@ static void decode_block(AV1Decoder *const pbi, MACROBLOCKD *const xd, #else const TX_SIZE tx_size = plane ? 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 stepr = tx_size_high_unit[tx_size]; + const int stepc = tx_size_wide_unit[tx_size]; const int max_blocks_wide = num_4x4_w + (xd->mb_to_right_edge >= 0 ? 0