From 9662fde980cf602f62a79cb676b1791f558f3bbd Mon Sep 17 00:00:00 2001 From: Jingning Han Date: Thu, 1 Sep 2016 12:09:20 -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: Ie7cb33e75e3b90aa9e9b46f8d11fa1d03e1ebe85 --- av1/decoder/decodeframe.c | 4 ++-- av1/decoder/detokenize.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/av1/decoder/decodeframe.c b/av1/decoder/decodeframe.c index 594141c82..ceb9bbf95 100644 --- a/av1/decoder/decodeframe.c +++ b/av1/decoder/decodeframe.c @@ -507,7 +507,7 @@ static void decode_block(AV1Decoder *const pbi, MACROBLOCKD *const xd, : mbmi->tx_size; const int num_4x4_w = pd->n4_w; const int num_4x4_h = pd->n4_h; - const int step = (1 << tx_size); + const int step = tx_size_1d_in_unit[tx_size]; int row, col; const int max_blocks_wide = num_4x4_w + (xd->mb_to_right_edge >= 0 @@ -542,7 +542,7 @@ static void decode_block(AV1Decoder *const pbi, MACROBLOCKD *const xd, : mbmi->tx_size; const int num_4x4_w = pd->n4_w; const int num_4x4_h = pd->n4_h; - const int step = (1 << tx_size); + const int step = tx_size_1d_in_unit[tx_size]; int row, col; const int max_blocks_wide = num_4x4_w + (xd->mb_to_right_edge >= 0 diff --git a/av1/decoder/detokenize.c b/av1/decoder/detokenize.c index abf619927..1a43596c7 100644 --- a/av1/decoder/detokenize.c +++ b/av1/decoder/detokenize.c @@ -57,7 +57,7 @@ static int decode_coefs(const MACROBLOCKD *xd, PLANE_TYPE type, #endif { FRAME_COUNTS *counts = xd->counts; - const int max_eob = 16 << (tx_size << 1); + const int max_eob = 1 << (tx_size_1d_log2[tx_size] * 2); const FRAME_CONTEXT *const fc = xd->fc; const int ref = is_inter_block(&xd->mi[0]->mbmi); #if CONFIG_AOM_QM -- GitLab