Commit 5e982003 authored by Urvang Joshi's avatar Urvang Joshi Committed by Sebastien Alaiwan

Remove special functions to get fwd/inv configs.

Reuse the existing ones to support the 64x64, 64x32 and 32x64 configs
instead.

Change-Id: Ibadc65eb03518d19146f32657ccfd6949c0071cc
parent 8b1732ad
......@@ -358,4 +358,17 @@ static const TXFM_1D_CFG fwd_txfm_1d_cfg_identity_32 = {
NULL, // .cos_bit
TXFM_TYPE_IDENTITY32, // .txfm_type
};
#if CONFIG_TX64X64
// ---------------- row/col config fwd_identity_64 ----------------
static const TXFM_1D_CFG fwd_txfm_1d_cfg_identity_64 = {
64, // .txfm_size
1, // .stage_num
// 1, // .log_scale
fwd_shift_64, // .shift
fwd_stage_range_idx_64, // .stage_range
NULL, // .cos_bit
TXFM_TYPE_IDENTITY64, // .txfm_type
};
#endif // CONFIG_TX64X64
#endif // AV1_FWD_TXFM2D_CFG_H_
......@@ -342,7 +342,7 @@ void av1_fwd_txfm2d_32x32_c(const int16_t *input, int32_t *output, int stride,
void av1_fwd_txfm2d_64x64_c(const int16_t *input, int32_t *output, int stride,
TX_TYPE tx_type, int bd) {
int32_t txfm_buf[64 * 64];
TXFM_2D_FLIP_CFG cfg = av1_get_fwd_txfm_64x64_cfg(tx_type);
TXFM_2D_FLIP_CFG cfg = av1_get_fwd_txfm_cfg(tx_type, TX_64X64);
fwd_txfm2d_c(input, output, stride, &cfg, txfm_buf, bd);
// Zero out top-right 32x32 area.
......@@ -360,7 +360,7 @@ void av1_fwd_txfm2d_64x64_c(const int16_t *input, int32_t *output, int stride,
void av1_fwd_txfm2d_32x64_c(const int16_t *input, int32_t *output, int stride,
TX_TYPE tx_type, int bd) {
int32_t txfm_buf[32 * 64];
TXFM_2D_FLIP_CFG cfg = av1_get_fwd_txfm_32x64_cfg(tx_type);
TXFM_2D_FLIP_CFG cfg = av1_get_fwd_txfm_cfg(tx_type, TX_32X64);
fwd_txfm2d_c(input, output, stride, &cfg, txfm_buf, bd);
// Zero out the bottom 32x32 area.
......@@ -371,7 +371,7 @@ void av1_fwd_txfm2d_32x64_c(const int16_t *input, int32_t *output, int stride,
void av1_fwd_txfm2d_64x32_c(const int16_t *input, int32_t *output, int stride,
TX_TYPE tx_type, int bd) {
int32_t txfm_buf[64 * 32];
TXFM_2D_FLIP_CFG cfg = av1_get_fwd_txfm_64x32_cfg(tx_type);
TXFM_2D_FLIP_CFG cfg = av1_get_fwd_txfm_cfg(tx_type, TX_64X32);
fwd_txfm2d_c(input, output, stride, &cfg, txfm_buf, bd);
// Zero out right 32x32 area.
......@@ -388,31 +388,63 @@ void av1_fwd_txfm2d_64x32_c(const int16_t *input, int32_t *output, int stride,
static const TXFM_1D_CFG *fwd_txfm_col_cfg_ls[TX_TYPES_1D][TX_SIZES] = {
// DCT
{ &fwd_txfm_1d_col_cfg_dct_4, &fwd_txfm_1d_col_cfg_dct_8,
&fwd_txfm_1d_col_cfg_dct_16, &fwd_txfm_1d_col_cfg_dct_32 },
&fwd_txfm_1d_col_cfg_dct_16, &fwd_txfm_1d_col_cfg_dct_32,
#if CONFIG_TX64X64
&fwd_txfm_1d_col_cfg_dct_64
#endif // CONFIG_TX64X64
},
// ADST
{ &fwd_txfm_1d_col_cfg_adst_4, &fwd_txfm_1d_col_cfg_adst_8,
&fwd_txfm_1d_col_cfg_adst_16, &fwd_txfm_1d_col_cfg_adst_32 },
&fwd_txfm_1d_col_cfg_adst_16, &fwd_txfm_1d_col_cfg_adst_32,
#if CONFIG_TX64X64
NULL
#endif // CONFIG_TX64X64
},
// FLIPADST
{ &fwd_txfm_1d_col_cfg_adst_4, &fwd_txfm_1d_col_cfg_adst_8,
&fwd_txfm_1d_col_cfg_adst_16, &fwd_txfm_1d_col_cfg_adst_32 },
&fwd_txfm_1d_col_cfg_adst_16, &fwd_txfm_1d_col_cfg_adst_32,
#if CONFIG_TX64X64
NULL
#endif // CONFIG_TX64X64
},
// IDENTITY
{ &fwd_txfm_1d_cfg_identity_4, &fwd_txfm_1d_cfg_identity_8,
&fwd_txfm_1d_cfg_identity_16, &fwd_txfm_1d_cfg_identity_32 },
&fwd_txfm_1d_cfg_identity_16, &fwd_txfm_1d_cfg_identity_32,
#if CONFIG_TX64X64
&fwd_txfm_1d_cfg_identity_64
#endif // CONFIG_TX64X64
},
};
static const TXFM_1D_CFG *fwd_txfm_row_cfg_ls[TX_TYPES_1D][TX_SIZES] = {
// DCT
{ &fwd_txfm_1d_row_cfg_dct_4, &fwd_txfm_1d_row_cfg_dct_8,
&fwd_txfm_1d_row_cfg_dct_16, &fwd_txfm_1d_row_cfg_dct_32 },
&fwd_txfm_1d_row_cfg_dct_16, &fwd_txfm_1d_row_cfg_dct_32,
#if CONFIG_TX64X64
&fwd_txfm_1d_row_cfg_dct_64
#endif // CONFIG_TX64X64
},
// ADST
{ &fwd_txfm_1d_row_cfg_adst_4, &fwd_txfm_1d_row_cfg_adst_8,
&fwd_txfm_1d_row_cfg_adst_16, &fwd_txfm_1d_row_cfg_adst_32 },
&fwd_txfm_1d_row_cfg_adst_16, &fwd_txfm_1d_row_cfg_adst_32,
#if CONFIG_TX64X64
NULL
#endif // CONFIG_TX64X64
},
// FLIPADST
{ &fwd_txfm_1d_row_cfg_adst_4, &fwd_txfm_1d_row_cfg_adst_8,
&fwd_txfm_1d_row_cfg_adst_16, &fwd_txfm_1d_row_cfg_adst_32 },
&fwd_txfm_1d_row_cfg_adst_16, &fwd_txfm_1d_row_cfg_adst_32,
#if CONFIG_TX64X64
NULL
#endif // CONFIG_TX64X64
},
// IDENTITY
{ &fwd_txfm_1d_cfg_identity_4, &fwd_txfm_1d_cfg_identity_8,
&fwd_txfm_1d_cfg_identity_16, &fwd_txfm_1d_cfg_identity_32 },
&fwd_txfm_1d_cfg_identity_16, &fwd_txfm_1d_cfg_identity_32,
#if CONFIG_TX64X64
&fwd_txfm_1d_cfg_identity_64
#endif // CONFIG_TX64X64
},
};
TXFM_2D_FLIP_CFG av1_get_fwd_txfm_cfg(TX_TYPE tx_type, TX_SIZE tx_size) {
......@@ -426,54 +458,3 @@ TXFM_2D_FLIP_CFG av1_get_fwd_txfm_cfg(TX_TYPE tx_type, TX_SIZE tx_size) {
cfg.row_cfg = fwd_txfm_row_cfg_ls[tx_type_row][tx_size_row];
return cfg;
}
#if CONFIG_TX64X64
TXFM_2D_FLIP_CFG av1_get_fwd_txfm_32x64_cfg(TX_TYPE tx_type) {
TXFM_2D_FLIP_CFG cfg;
const TX_TYPE_1D tx_type_row = htx_tab[tx_type];
const TX_SIZE tx_size_row = txsize_horz_map[TX_32X64];
switch (tx_type) {
case DCT_DCT:
cfg.col_cfg = &fwd_txfm_1d_col_cfg_dct_64;
cfg.row_cfg = fwd_txfm_row_cfg_ls[tx_type_row][tx_size_row];
cfg.ud_flip = 0;
cfg.lr_flip = 0;
break;
default: assert(0);
}
return cfg;
}
TXFM_2D_FLIP_CFG av1_get_fwd_txfm_64x32_cfg(TX_TYPE tx_type) {
TXFM_2D_FLIP_CFG cfg;
const TX_TYPE_1D tx_type_col = vtx_tab[tx_type];
const TX_SIZE tx_size_col = txsize_vert_map[TX_64X32];
switch (tx_type) {
case DCT_DCT:
cfg.col_cfg = fwd_txfm_col_cfg_ls[tx_type_col][tx_size_col];
cfg.row_cfg = &fwd_txfm_1d_row_cfg_dct_64;
cfg.ud_flip = 0;
cfg.lr_flip = 0;
break;
default: assert(0);
}
return cfg;
}
TXFM_2D_FLIP_CFG av1_get_fwd_txfm_64x64_cfg(TX_TYPE tx_type) {
TXFM_2D_FLIP_CFG cfg;
switch (tx_type) {
case DCT_DCT:
cfg.col_cfg = &fwd_txfm_1d_col_cfg_dct_64;
cfg.row_cfg = &fwd_txfm_1d_row_cfg_dct_64;
cfg.ud_flip = 0;
cfg.lr_flip = 0;
break;
default:
cfg.ud_flip = 0;
cfg.lr_flip = 0;
assert(0);
}
return cfg;
}
#endif // CONFIG_TX64X64
......@@ -348,7 +348,7 @@ static const TXFM_1D_CFG inv_txfm_1d_cfg_identity_32 = {
};
#if CONFIG_TX64X64
// ---------------- row/col config inv_identity_32 ----------------
// ---------------- row/col config inv_identity_64 ----------------
static const TXFM_1D_CFG inv_txfm_1d_cfg_identity_64 = {
64, // .txfm_size
1, // .stage_num
......
......@@ -115,47 +115,6 @@ TXFM_2D_FLIP_CFG av1_get_inv_txfm_cfg(TX_TYPE tx_type, TX_SIZE tx_size) {
return cfg;
}
#if CONFIG_TX64X64
TXFM_2D_FLIP_CFG av1_get_inv_txfm_64x64_cfg(TX_TYPE tx_type) {
TXFM_2D_FLIP_CFG cfg = { 0, 0, NULL, NULL };
switch (tx_type) {
case DCT_DCT:
cfg.col_cfg = &inv_txfm_1d_col_cfg_dct_64;
cfg.row_cfg = &inv_txfm_1d_row_cfg_dct_64;
set_flip_cfg(tx_type, &cfg);
break;
default: assert(0);
}
return cfg;
}
TXFM_2D_FLIP_CFG av1_get_inv_txfm_32x64_cfg(TX_TYPE tx_type) {
TXFM_2D_FLIP_CFG cfg = { 0, 0, NULL, NULL };
switch (tx_type) {
case DCT_DCT:
cfg.col_cfg = &inv_txfm_1d_col_cfg_dct_64;
cfg.row_cfg = &inv_txfm_1d_row_cfg_dct_32;
set_flip_cfg(tx_type, &cfg);
break;
default: assert(0);
}
return cfg;
}
TXFM_2D_FLIP_CFG av1_get_inv_txfm_64x32_cfg(TX_TYPE tx_type) {
TXFM_2D_FLIP_CFG cfg = { 0, 0, NULL, NULL };
switch (tx_type) {
case DCT_DCT:
cfg.col_cfg = &inv_txfm_1d_col_cfg_dct_32;
cfg.row_cfg = &inv_txfm_1d_row_cfg_dct_64;
set_flip_cfg(tx_type, &cfg);
break;
default: assert(0);
}
return cfg;
}
#endif // CONFIG_TX64X64
void av1_gen_inv_stage_range(int8_t *stage_range_col, int8_t *stage_range_row,
const TXFM_2D_FLIP_CFG *cfg, int8_t fwd_shift,
int bd) {
......
......@@ -385,14 +385,6 @@ void av1_gen_inv_stage_range(int8_t *stage_range_col, int8_t *stage_range_row,
TXFM_2D_FLIP_CFG av1_get_fwd_txfm_cfg(TX_TYPE tx_type, TX_SIZE tx_size);
TXFM_2D_FLIP_CFG av1_get_inv_txfm_cfg(TX_TYPE tx_type, TX_SIZE tx_size);
#if CONFIG_TX64X64
TXFM_2D_FLIP_CFG av1_get_fwd_txfm_64x64_cfg(TX_TYPE tx_type);
TXFM_2D_FLIP_CFG av1_get_fwd_txfm_64x32_cfg(TX_TYPE tx_type);
TXFM_2D_FLIP_CFG av1_get_fwd_txfm_32x64_cfg(TX_TYPE tx_type);
TXFM_2D_FLIP_CFG av1_get_inv_txfm_64x64_cfg(TX_TYPE tx_type);
TXFM_2D_FLIP_CFG av1_get_inv_txfm_64x32_cfg(TX_TYPE tx_type);
TXFM_2D_FLIP_CFG av1_get_inv_txfm_32x64_cfg(TX_TYPE tx_type);
#endif // CONFIG_TX64X64
#ifdef __cplusplus
}
#endif // __cplusplus
......
......@@ -186,14 +186,8 @@ TEST(AV1FwdTxfm2d, CfgTest) {
#if CONFIG_TX64X64
if (tx_size == TX_64X64 && tx_type != DCT_DCT) continue;
#endif // CONFIG_TX64X64
const TXFM_2D_FLIP_CFG cfg =
#if CONFIG_TX64X64
(tx_size == TX_64X64)
? av1_get_fwd_txfm_64x64_cfg(static_cast<TX_TYPE>(tx_type))
:
#endif // CONFIG_TX64X64
av1_get_fwd_txfm_cfg(static_cast<TX_TYPE>(tx_type),
static_cast<TX_SIZE>(tx_size));
const TXFM_2D_FLIP_CFG cfg = av1_get_fwd_txfm_cfg(
static_cast<TX_TYPE>(tx_type), static_cast<TX_SIZE>(tx_size));
int8_t stage_range_col[MAX_TXFM_STAGE_NUM];
int8_t stage_range_row[MAX_TXFM_STAGE_NUM];
av1_gen_fwd_stage_range(stage_range_col, stage_range_row, &cfg, bd);
......
......@@ -193,14 +193,8 @@ TEST(AV1InvTxfm2d, CfgTest) {
#if CONFIG_TX64X64
if (tx_size == TX_64X64 && tx_type != DCT_DCT) continue;
#endif // CONFIG_TX64X64
const TXFM_2D_FLIP_CFG cfg =
#if CONFIG_TX64X64
(tx_size == TX_64X64)
? av1_get_inv_txfm_64x64_cfg(static_cast<TX_TYPE>(tx_type))
:
#endif // CONFIG_TX64X64
av1_get_inv_txfm_cfg(static_cast<TX_TYPE>(tx_type),
static_cast<TX_SIZE>(tx_size));
const TXFM_2D_FLIP_CFG cfg = av1_get_inv_txfm_cfg(
static_cast<TX_TYPE>(tx_type), static_cast<TX_SIZE>(tx_size));
int8_t stage_range_col[MAX_TXFM_STAGE_NUM];
int8_t stage_range_row[MAX_TXFM_STAGE_NUM];
av1_gen_inv_stage_range(stage_range_col, stage_range_row, &cfg,
......
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