Commit 29d2f21e authored by Angie Chiang's avatar Angie Chiang

Add get_txw/h_idx functions

Change-Id: Ibace8208109068aae1e93275d28ab8bd8e58c529
parent f4123630
......@@ -93,17 +93,23 @@ const int8_t *inv_txfm_shift_ls[TX_SIZES_ALL] = {
#endif // CONFIG_TX64X64
};
const int8_t inv_cos_bit_col[5 /*row*/][5 /*col*/] = { { 13, 13, 13, 0, 0 },
{ 13, 13, 13, 13, 0 },
{ 13, 13, 13, 13, 13 },
{ 0, 13, 13, 13, 13 },
{ 0, 0, 13, 13, 13 } };
const int8_t inv_cos_bit_row[5 /*row*/][5 /*col*/] = { { 13, 13, 13, 0, 0 },
{ 13, 13, 12, 12, 0 },
{ 12, 12, 12, 12, 12 },
{ 0, 12, 12, 12, 12 },
{ 0, 0, 12, 12, 12 } };
const int8_t inv_cos_bit_col[MAX_TXWH_IDX /*txw_idx*/]
[MAX_TXWH_IDX /*txh_idx*/] = {
{ 13, 13, 13, 0, 0 },
{ 13, 13, 13, 13, 0 },
{ 13, 13, 13, 13, 13 },
{ 0, 13, 13, 13, 13 },
{ 0, 0, 13, 13, 13 }
};
const int8_t inv_cos_bit_row[MAX_TXWH_IDX /*txw_idx*/]
[MAX_TXWH_IDX /*txh_idx*/] = {
{ 13, 13, 13, 0, 0 },
{ 13, 13, 12, 12, 0 },
{ 12, 12, 12, 12, 12 },
{ 0, 12, 12, 12, 12 },
{ 0, 0, 12, 12, 12 }
};
void av1_get_inv_txfm_cfg(TX_TYPE tx_type, TX_SIZE tx_size,
TXFM_2D_FLIP_CFG *cfg) {
......@@ -116,8 +122,8 @@ void av1_get_inv_txfm_cfg(TX_TYPE tx_type, TX_SIZE tx_size,
const TX_TYPE_1D tx_type_1d_col = vtx_tab[tx_type];
const TX_TYPE_1D tx_type_1d_row = htx_tab[tx_type];
cfg->shift = inv_txfm_shift_ls[tx_size];
const int txw_idx = tx_size_wide_log2[tx_size] - tx_size_wide_log2[0];
const int txh_idx = tx_size_high_log2[tx_size] - tx_size_high_log2[0];
const int txw_idx = get_txw_idx(tx_size);
const int txh_idx = get_txh_idx(tx_size);
cfg->cos_bit_col = inv_cos_bit_col[txw_idx][txh_idx];
cfg->cos_bit_row = inv_cos_bit_row[txw_idx][txh_idx];
cfg->txfm_type_col = av1_txfm_type_ls[txh_idx][tx_type_1d_col];
......
......@@ -261,6 +261,13 @@ void av1_get_inv_txfm_cfg(TX_TYPE tx_type, TX_SIZE tx_size,
TXFM_2D_FLIP_CFG *cfg);
extern const TXFM_TYPE av1_txfm_type_ls[5][TX_TYPES_1D];
extern const int8_t av1_txfm_stage_num_list[TXFM_TYPES];
static INLINE int get_txw_idx(TX_SIZE tx_size) {
return tx_size_wide_log2[tx_size] - tx_size_wide_log2[0];
}
static INLINE int get_txh_idx(TX_SIZE tx_size) {
return tx_size_high_log2[tx_size] - tx_size_high_log2[0];
}
#define MAX_TXWH_IDX 5
#ifdef __cplusplus
}
#endif // __cplusplus
......
......@@ -81,8 +81,8 @@ static const int8_t inv_stage_range_row_dct_64[12] = { 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0 };
static void idct64_col_c(const tran_low_t *input, tran_low_t *output) {
int32_t in[64], out[64];
const int txw_idx = tx_size_wide_log2[TX_64X64] - tx_size_wide_log2[0];
const int txh_idx = tx_size_high_log2[TX_64X64] - tx_size_high_log2[0];
const int txw_idx = get_txw_idx(TX_64X64);
const int txh_idx = get_txh_idx(TX_64X64);
for (int i = 0; i < 64; ++i) in[i] = (int32_t)input[i];
av1_idct64_new(in, out, inv_cos_bit_col[txw_idx][txh_idx],
inv_stage_range_col_dct_64);
......
......@@ -602,8 +602,8 @@ void av1_inv_txfm2d_add_32x32_avx2(const int32_t *coeff, uint16_t *output,
int stride, TX_TYPE tx_type, int bd) {
__m256i in[128], out[128];
const int8_t *shift = inv_txfm_shift_ls[TX_32X32];
const int txw_idx = tx_size_wide_log2[TX_32X32] - tx_size_wide_log2[0];
const int txh_idx = tx_size_high_log2[TX_32X32] - tx_size_high_log2[0];
const int txw_idx = get_txw_idx(TX_32X32);
const int txh_idx = get_txh_idx(TX_32X32);
switch (tx_type) {
case DCT_DCT:
......
......@@ -223,8 +223,8 @@ void av1_inv_txfm2d_add_4x4_sse4_1(const int32_t *coeff, uint16_t *output,
int stride, TX_TYPE tx_type, int bd) {
__m128i in[4];
const int8_t *shift = inv_txfm_shift_ls[TX_4X4];
const int txw_idx = tx_size_wide_log2[TX_4X4] - tx_size_wide_log2[0];
const int txh_idx = tx_size_high_log2[TX_4X4] - tx_size_high_log2[0];
const int txw_idx = get_txw_idx(TX_4X4);
const int txh_idx = get_txh_idx(TX_4X4);
switch (tx_type) {
case DCT_DCT:
......@@ -802,8 +802,8 @@ void av1_inv_txfm2d_add_8x8_sse4_1(const int32_t *coeff, uint16_t *output,
int stride, TX_TYPE tx_type, int bd) {
__m128i in[16], out[16];
const int8_t *shift = inv_txfm_shift_ls[TX_8X8];
const int txw_idx = tx_size_wide_log2[TX_8X8] - tx_size_wide_log2[0];
const int txh_idx = tx_size_high_log2[TX_8X8] - tx_size_high_log2[0];
const int txw_idx = get_txw_idx(TX_8X8);
const int txh_idx = get_txh_idx(TX_8X8);
switch (tx_type) {
case DCT_DCT:
......@@ -1534,8 +1534,8 @@ void av1_inv_txfm2d_add_16x16_sse4_1(const int32_t *coeff, uint16_t *output,
int stride, TX_TYPE tx_type, int bd) {
__m128i in[64], out[64];
const int8_t *shift = inv_txfm_shift_ls[TX_16X16];
const int txw_idx = tx_size_wide_log2[TX_16X16] - tx_size_wide_log2[0];
const int txh_idx = tx_size_high_log2[TX_16X16] - tx_size_high_log2[0];
const int txw_idx = get_txw_idx(TX_16X16);
const int txh_idx = get_txh_idx(TX_16X16);
switch (tx_type) {
case DCT_DCT:
......
......@@ -463,17 +463,23 @@ const int8_t *fwd_txfm_shift_ls[TX_SIZES_ALL] = {
#endif // CONFIG_TX64X64
};
const int8_t fwd_cos_bit_col[5 /*row*/][5 /*col*/] = { { 13, 13, 13, 0, 0 },
{ 13, 13, 13, 12, 0 },
{ 13, 13, 13, 12, 13 },
{ 0, 13, 13, 12, 13 },
{ 0, 0, 13, 12, 13 } };
const int8_t fwd_cos_bit_row[5 /*row*/][5 /*col*/] = { { 13, 13, 13, 0, 0 },
{ 13, 13, 13, 12, 0 },
{ 13, 13, 12, 13, 12 },
{ 0, 12, 13, 12, 11 },
{ 0, 0, 12, 11, 10 } };
const int8_t fwd_cos_bit_col[MAX_TXWH_IDX /*txw_idx*/]
[MAX_TXWH_IDX /*txh_idx*/] = {
{ 13, 13, 13, 0, 0 },
{ 13, 13, 13, 12, 0 },
{ 13, 13, 13, 12, 13 },
{ 0, 13, 13, 12, 13 },
{ 0, 0, 13, 12, 13 }
};
const int8_t fwd_cos_bit_row[MAX_TXWH_IDX /*txw_idx*/]
[MAX_TXWH_IDX /*txh_idx*/] = {
{ 13, 13, 13, 0, 0 },
{ 13, 13, 13, 12, 0 },
{ 13, 13, 12, 13, 12 },
{ 0, 12, 13, 12, 11 },
{ 0, 0, 12, 11, 10 }
};
const int8_t fdct4_range_mult2[4] = { 0, 2, 3, 3 };
const int8_t fdct8_range_mult2[6] = { 0, 2, 4, 5, 5, 5 };
......@@ -495,11 +501,13 @@ const int8_t fidtx16_range_mult2[1] = { 3 };
const int8_t fidtx32_range_mult2[1] = { 4 };
const int8_t fidtx64_range_mult2[1] = { 5 };
const int8_t fwd_idtx_range_row[5 /*row*/][5 /*col*/] = { { 2, 4, 5, 0, 0 },
{ 3, 4, 5, 6, 0 },
{ 4, 5, 6, 7, 8 },
{ 0, 5, 6, 7, 8 },
{ 0, 0, 7, 8, 9 } };
const int8_t fwd_idtx_range_row[MAX_TXWH_IDX /*txw_idx*/]
[MAX_TXWH_IDX /*txh_idx*/] = { { 2, 4, 5, 0, 0 },
{ 3, 4, 5, 6, 0 },
{ 4, 5, 6, 7, 8 },
{ 0, 5, 6, 7, 8 },
{ 0, 0, 7, 8,
9 } };
const int8_t *fwd_txfm_range_mult2_list[TXFM_TYPES] = {
fdct4_range_mult2, fdct8_range_mult2, fdct16_range_mult2,
......@@ -510,8 +518,8 @@ const int8_t *fwd_txfm_range_mult2_list[TXFM_TYPES] = {
};
static INLINE void set_fwd_txfm_non_scale_range(TXFM_2D_FLIP_CFG *cfg) {
const int txw_idx = tx_size_wide_log2[cfg->tx_size] - tx_size_wide_log2[0];
const int txh_idx = tx_size_high_log2[cfg->tx_size] - tx_size_high_log2[0];
const int txw_idx = get_txw_idx(cfg->tx_size);
const int txh_idx = get_txh_idx(cfg->tx_size);
av1_zero(cfg->stage_range_col);
av1_zero(cfg->stage_range_row);
......
......@@ -1988,8 +1988,8 @@ static const int8_t fwd_stage_range_row_dct_64[12] = { 6, 7, 8, 9, 10, 11,
static void fdct64_col(const tran_low_t *input, tran_low_t *output) {
int32_t in[64], out[64];
int i;
const int txw_idx = tx_size_wide_log2[TX_64X64] - tx_size_wide_log2[0];
const int txh_idx = tx_size_high_log2[TX_64X64] - tx_size_high_log2[0];
const int txw_idx = get_txw_idx(TX_64X64);
const int txh_idx = get_txh_idx(TX_64X64);
for (i = 0; i < 64; ++i) in[i] = (int32_t)input[i];
av1_fdct64_new(in, out, fwd_cos_bit_col[txw_idx][txh_idx],
fwd_stage_range_col_dct_64);
......@@ -1999,8 +1999,8 @@ static void fdct64_col(const tran_low_t *input, tran_low_t *output) {
static void fdct64_row(const tran_low_t *input, tran_low_t *output) {
int32_t in[64], out[64];
int i;
const int txw_idx = tx_size_wide_log2[TX_64X64] - tx_size_wide_log2[0];
const int txh_idx = tx_size_high_log2[TX_64X64] - tx_size_high_log2[0];
const int txw_idx = get_txw_idx(TX_64X64);
const int txh_idx = get_txh_idx(TX_64X64);
for (i = 0; i < 64; ++i) in[i] = (int32_t)input[i];
av1_fdct64_new(in, out, fwd_cos_bit_row[txw_idx][txh_idx],
fwd_stage_range_row_dct_64);
......
......@@ -183,8 +183,8 @@ void av1_fwd_txfm2d_4x4_sse4_1(const int16_t *input, int32_t *coeff,
int input_stride, TX_TYPE tx_type, int bd) {
__m128i in[4];
const int8_t *shift = fwd_txfm_shift_ls[TX_4X4];
const int txw_idx = tx_size_wide_log2[TX_4X4] - tx_size_wide_log2[0];
const int txh_idx = tx_size_high_log2[TX_4X4] - tx_size_high_log2[0];
const int txw_idx = get_txw_idx(TX_4X4);
const int txh_idx = get_txh_idx(TX_4X4);
switch (tx_type) {
case DCT_DCT:
......@@ -773,8 +773,8 @@ void av1_fwd_txfm2d_8x8_sse4_1(const int16_t *input, int32_t *coeff, int stride,
TX_TYPE tx_type, int bd) {
__m128i in[16], out[16];
const int8_t *shift = fwd_txfm_shift_ls[TX_8X8];
const int txw_idx = tx_size_wide_log2[TX_8X8] - tx_size_wide_log2[0];
const int txh_idx = tx_size_high_log2[TX_8X8] - tx_size_high_log2[0];
const int txw_idx = get_txw_idx(TX_8X8);
const int txh_idx = get_txh_idx(TX_8X8);
switch (tx_type) {
case DCT_DCT:
......@@ -1496,8 +1496,8 @@ void av1_fwd_txfm2d_16x16_sse4_1(const int16_t *input, int32_t *coeff,
int stride, TX_TYPE tx_type, int bd) {
__m128i in[64], out[64];
const int8_t *shift = fwd_txfm_shift_ls[TX_16X16];
const int txw_idx = tx_size_wide_log2[TX_16X16] - tx_size_wide_log2[0];
const int txh_idx = tx_size_high_log2[TX_16X16] - tx_size_high_log2[0];
const int txw_idx = get_txw_idx(TX_16X16);
const int txh_idx = get_txh_idx(TX_16X16);
switch (tx_type) {
case DCT_DCT:
load_buffer_16x16(input, in, stride, 0, 0, shift[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