Commit 3d855c5e authored by Jingning Han's avatar Jingning Han

Refactor tx_size to pixel number in decodeframe.c

Use the table access to retrieve pixel numbers from tx_size.

Change-Id: I9459f2c3292c2f9ddf963f16b79e142de7432031
parent c53f8ca6
......@@ -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 };
......
......@@ -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]));
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment