Commit 5d5cd6a7 authored by Jingning Han's avatar Jingning Han
Browse files

Replace tx_size_1d with tx_size_wide/high

This prepares the support to both rectangular and 2x2 transform
block sizes.

Change-Id: I3c2d4e317f6b627bb45d2273c278331bd976ee92
parent 1be18785
...@@ -442,7 +442,37 @@ static const TX_SIZE txsize_vert_map[TX_SIZES_ALL] = { ...@@ -442,7 +442,37 @@ static const TX_SIZE txsize_vert_map[TX_SIZES_ALL] = {
#endif // CONFIG_EXT_TX #endif // CONFIG_EXT_TX
}; };
static const int tx_size_1d[TX_SIZES] = { 4, 8, 16, 32 }; // Transform block width in pixels
static const int tx_size_wide[TX_SIZES_ALL] = {
4, 8, 16, 32,
#if CONFIG_EXT_TX
4, 8, 8, 16, 16, 32,
#endif
};
// Transform block height in pixels
static const int tx_size_high[TX_SIZES_ALL] = {
4, 8, 16, 32,
#if CONFIG_EXT_TX
8, 4, 16, 8, 32, 16,
#endif
};
// Transform block width in unit
static const int tx_size_wide_unit[TX_SIZES_ALL] = {
1, 2, 4, 8,
#if CONFIG_EXT_TX
1, 2, 2, 4, 4, 8,
#endif
};
// Transform block height in unit
static const int tx_size_high_unit[TX_SIZES_ALL] = {
1, 2, 4, 8,
#if CONFIG_EXT_TX
2, 1, 4, 2, 8, 4,
#endif
};
static const int tx_size_2d[TX_SIZES_ALL] = { static const int tx_size_2d[TX_SIZES_ALL] = {
16, 64, 256, 1024, 16, 64, 256, 1024,
...@@ -453,8 +483,6 @@ static const int tx_size_2d[TX_SIZES_ALL] = { ...@@ -453,8 +483,6 @@ static const int tx_size_2d[TX_SIZES_ALL] = {
static const uint8_t tx_size_1d_log2[TX_SIZES] = { 2, 3, 4, 5 }; static const uint8_t tx_size_1d_log2[TX_SIZES] = { 2, 3, 4, 5 };
static const int tx_size_1d_in_unit[TX_SIZES] = { 1, 2, 4, 8 };
// TODO(jingning): Temporary table during the construction. // TODO(jingning): Temporary table during the construction.
static const int tx_size_1d_in_unit_log2[TX_SIZES] = { 0, 1, 2, 3 }; static const int tx_size_1d_in_unit_log2[TX_SIZES] = { 0, 1, 2, 3 };
......
...@@ -4305,7 +4305,7 @@ static void dfs_scan(int tx1d_size, int *scan_idx, int coeff_idx, int16_t *scan, ...@@ -4305,7 +4305,7 @@ static void dfs_scan(int tx1d_size, int *scan_idx, int coeff_idx, int16_t *scan,
void av1_update_neighbors(int tx_size, const int16_t *scan, void av1_update_neighbors(int tx_size, const int16_t *scan,
const int16_t *iscan, int16_t *neighbors) { const int16_t *iscan, int16_t *neighbors) {
const int tx1d_size = tx_size_1d[tx_size]; const int tx1d_size = tx_size_wide[tx_size];
const int tx2d_size = tx_size_2d[tx_size]; const int tx2d_size = tx_size_2d[tx_size];
int scan_idx; int scan_idx;
for (scan_idx = 0; scan_idx < tx2d_size; ++scan_idx) { for (scan_idx = 0; scan_idx < tx2d_size; ++scan_idx) {
...@@ -4336,7 +4336,7 @@ void av1_update_neighbors(int tx_size, const int16_t *scan, ...@@ -4336,7 +4336,7 @@ void av1_update_neighbors(int tx_size, const int16_t *scan,
void av1_update_sort_order(TX_SIZE tx_size, const uint32_t *non_zero_prob, void av1_update_sort_order(TX_SIZE tx_size, const uint32_t *non_zero_prob,
int16_t *sort_order) { int16_t *sort_order) {
uint32_t temp[COEFF_IDX_SIZE]; uint32_t temp[COEFF_IDX_SIZE];
const int tx1d_size = tx_size_1d[tx_size]; const int tx1d_size = tx_size_wide[tx_size];
const int tx2d_size = tx_size_2d[tx_size]; const int tx2d_size = tx_size_2d[tx_size];
int sort_idx; int sort_idx;
assert(tx2d_size <= COEFF_IDX_SIZE); assert(tx2d_size <= COEFF_IDX_SIZE);
...@@ -4354,7 +4354,7 @@ void av1_update_scan_order(TX_SIZE tx_size, int16_t *sort_order, int16_t *scan, ...@@ -4354,7 +4354,7 @@ void av1_update_scan_order(TX_SIZE tx_size, int16_t *sort_order, int16_t *scan,
int coeff_idx; int coeff_idx;
int scan_idx; int scan_idx;
int sort_idx; int sort_idx;
const int tx1d_size = tx_size_1d[tx_size]; const int tx1d_size = tx_size_wide[tx_size];
const int tx2d_size = tx_size_2d[tx_size]; const int tx2d_size = tx_size_2d[tx_size];
for (coeff_idx = 0; coeff_idx < tx2d_size; ++coeff_idx) { for (coeff_idx = 0; coeff_idx < tx2d_size; ++coeff_idx) {
......
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