From 3d855c5e758e1779d8eda4a963b0a7324245d867 Mon Sep 17 00:00:00 2001 From: Jingning Han Date: Fri, 21 Oct 2016 10:51:31 -0700 Subject: [PATCH] Refactor tx_size to pixel number in decodeframe.c Use the table access to retrieve pixel numbers from tx_size. Change-Id: I9459f2c3292c2f9ddf963f16b79e142de7432031 --- av1/common/common_data.h | 7 ++++++- av1/decoder/decodeframe.c | 20 +++++--------------- 2 files changed, 11 insertions(+), 16 deletions(-) diff --git a/av1/common/common_data.h b/av1/common/common_data.h index 4165e3577..f068ee7e9 100644 --- a/av1/common/common_data.h +++ b/av1/common/common_data.h @@ -444,7 +444,12 @@ static const TX_SIZE txsize_vert_map[TX_SIZES_ALL] = { static const int tx_size_1d[TX_SIZES] = { 4, 8, 16, 32 }; -static const int tx_size_2d[TX_SIZES] = { 16, 64, 256, 1024 }; +static const int tx_size_2d[TX_SIZES_ALL] = { + 16, 64, 256, 1024, +#if CONFIG_EXT_TX + 32, 32, 128, 128, 512, 512, +#endif +}; static const uint8_t tx_size_1d_log2[TX_SIZES] = { 2, 3, 4, 5 }; diff --git a/av1/decoder/decodeframe.c b/av1/decoder/decodeframe.c index 402dc0612..27640b73b 100644 --- a/av1/decoder/decodeframe.c +++ b/av1/decoder/decodeframe.c @@ -253,22 +253,12 @@ static void inverse_transform_block(MACROBLOCKD *xd, int plane, } #endif // CONFIG_AOM_HIGHBITDEPTH - if (eob == 1) { + // TODO(jingning): This cleans up different reset requests from various + // experiments, but incurs unnecessary memset size. + if (eob == 1) dqcoeff[0] = 0; - } else { - if (tx_type == DCT_DCT && tx_size <= TX_16X16 && eob <= 10) - memset(dqcoeff, 0, 4 * 4 * num_4x4_blocks_wide_txsize_lookup[tx_size] * - sizeof(dqcoeff[0])); -#if CONFIG_EXT_TX - else - memset(dqcoeff, 0, get_tx2d_size(tx_size) * sizeof(dqcoeff[0])); -#else - else if (tx_size == TX_32X32 && eob <= 34) - memset(dqcoeff, 0, 256 * sizeof(dqcoeff[0])); - else - memset(dqcoeff, 0, get_tx2d_size(tx_size) * sizeof(dqcoeff[0])); -#endif - } + else + memset(dqcoeff, 0, tx_size_2d[tx_size] * sizeof(dqcoeff[0])); } }