summaryrefslogtreecommitdiffstats
path: root/third_party/aom/av1/common/av1_fwd_txfm2d.c
diff options
context:
space:
mode:
Diffstat (limited to 'third_party/aom/av1/common/av1_fwd_txfm2d.c')
-rw-r--r--third_party/aom/av1/common/av1_fwd_txfm2d.c134
1 files changed, 61 insertions, 73 deletions
diff --git a/third_party/aom/av1/common/av1_fwd_txfm2d.c b/third_party/aom/av1/common/av1_fwd_txfm2d.c
index d1dba82ca..f8d7b2333 100644
--- a/third_party/aom/av1/common/av1_fwd_txfm2d.c
+++ b/third_party/aom/av1/common/av1_fwd_txfm2d.c
@@ -14,7 +14,7 @@
#include "./av1_rtcd.h"
#include "av1/common/enums.h"
#include "av1/common/av1_fwd_txfm1d.h"
-#include "av1/common/av1_fwd_txfm2d_cfg.h"
+#include "av1/common/av1_fwd_txfm1d_cfg.h"
#include "av1/common/av1_txfm.h"
static INLINE TxfmFunc fwd_txfm_type_to_func(TXFM_TYPE txfm_type) {
@@ -27,6 +27,12 @@ static INLINE TxfmFunc fwd_txfm_type_to_func(TXFM_TYPE txfm_type) {
case TXFM_TYPE_ADST8: return av1_fadst8_new;
case TXFM_TYPE_ADST16: return av1_fadst16_new;
case TXFM_TYPE_ADST32: return av1_fadst32_new;
+#if CONFIG_EXT_TX
+ case TXFM_TYPE_IDENTITY4: return av1_fidentity4_c;
+ case TXFM_TYPE_IDENTITY8: return av1_fidentity8_c;
+ case TXFM_TYPE_IDENTITY16: return av1_fidentity16_c;
+ case TXFM_TYPE_IDENTITY32: return av1_fidentity32_c;
+#endif // CONFIG_EXT_TX
default: assert(0); return NULL;
}
}
@@ -35,14 +41,15 @@ static INLINE void fwd_txfm2d_c(const int16_t *input, int32_t *output,
const int stride, const TXFM_2D_FLIP_CFG *cfg,
int32_t *buf) {
int c, r;
- const int txfm_size = cfg->cfg->txfm_size;
- const int8_t *shift = cfg->cfg->shift;
- const int8_t *stage_range_col = cfg->cfg->stage_range_col;
- const int8_t *stage_range_row = cfg->cfg->stage_range_row;
- const int8_t *cos_bit_col = cfg->cfg->cos_bit_col;
- const int8_t *cos_bit_row = cfg->cfg->cos_bit_row;
- const TxfmFunc txfm_func_col = fwd_txfm_type_to_func(cfg->cfg->txfm_type_col);
- const TxfmFunc txfm_func_row = fwd_txfm_type_to_func(cfg->cfg->txfm_type_row);
+ // TODO(sarahparker) must correct for rectangular transforms in follow up
+ const int txfm_size = cfg->row_cfg->txfm_size;
+ const int8_t *shift = cfg->row_cfg->shift;
+ const int8_t *stage_range_col = cfg->col_cfg->stage_range;
+ const int8_t *stage_range_row = cfg->row_cfg->stage_range;
+ const int8_t *cos_bit_col = cfg->col_cfg->cos_bit;
+ const int8_t *cos_bit_row = cfg->row_cfg->cos_bit;
+ const TxfmFunc txfm_func_col = fwd_txfm_type_to_func(cfg->col_cfg->txfm_type);
+ const TxfmFunc txfm_func_row = fwd_txfm_type_to_func(cfg->row_cfg->txfm_type);
// use output buffer as temp buffer
int32_t *temp_in = output;
@@ -117,96 +124,79 @@ void av1_fwd_txfm2d_64x64_c(const int16_t *input, int32_t *output, int stride,
fwd_txfm2d_c(input, output, stride, &cfg, txfm_buf);
}
-#if CONFIG_EXT_TX
-static const TXFM_2D_CFG *fwd_txfm_cfg_ls[FLIPADST_ADST + 1][TX_SIZES] = {
- {
-#if CONFIG_CB4X4
- NULL,
-#endif
- &fwd_txfm_2d_cfg_dct_dct_4, &fwd_txfm_2d_cfg_dct_dct_8,
- &fwd_txfm_2d_cfg_dct_dct_16, &fwd_txfm_2d_cfg_dct_dct_32 },
- {
-#if CONFIG_CB4X4
- NULL,
-#endif
- &fwd_txfm_2d_cfg_adst_dct_4, &fwd_txfm_2d_cfg_adst_dct_8,
- &fwd_txfm_2d_cfg_adst_dct_16, &fwd_txfm_2d_cfg_adst_dct_32 },
- {
-#if CONFIG_CB4X4
- NULL,
-#endif
- &fwd_txfm_2d_cfg_dct_adst_4, &fwd_txfm_2d_cfg_dct_adst_8,
- &fwd_txfm_2d_cfg_dct_adst_16, &fwd_txfm_2d_cfg_dct_adst_32 },
+static const TXFM_1D_CFG *fwd_txfm_col_cfg_ls[TX_TYPES_1D][TX_SIZES] = {
+ // DCT
{
-#if CONFIG_CB4X4
+#if CONFIG_CHROMA_2X2
NULL,
#endif
- &fwd_txfm_2d_cfg_adst_adst_4, &fwd_txfm_2d_cfg_adst_adst_8,
- &fwd_txfm_2d_cfg_adst_adst_16, &fwd_txfm_2d_cfg_adst_adst_32 },
+ &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 },
+ // ADST
{
-#if CONFIG_CB4X4
+#if CONFIG_CHROMA_2X2
NULL,
#endif
- &fwd_txfm_2d_cfg_adst_dct_4, &fwd_txfm_2d_cfg_adst_dct_8,
- &fwd_txfm_2d_cfg_adst_dct_16, &fwd_txfm_2d_cfg_adst_dct_32 },
- {
-#if CONFIG_CB4X4
- NULL,
-#endif
- &fwd_txfm_2d_cfg_dct_adst_4, &fwd_txfm_2d_cfg_dct_adst_8,
- &fwd_txfm_2d_cfg_dct_adst_16, &fwd_txfm_2d_cfg_dct_adst_32 },
- {
-#if CONFIG_CB4X4
- NULL,
-#endif
- &fwd_txfm_2d_cfg_adst_adst_4, &fwd_txfm_2d_cfg_adst_adst_8,
- &fwd_txfm_2d_cfg_adst_adst_16, &fwd_txfm_2d_cfg_adst_adst_32 },
+ &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 },
+#if CONFIG_EXT_TX
+ // FLIPADST
{
-#if CONFIG_CB4X4
+#if CONFIG_CHROMA_2X2
NULL,
#endif
- &fwd_txfm_2d_cfg_adst_adst_4, &fwd_txfm_2d_cfg_adst_adst_8,
- &fwd_txfm_2d_cfg_adst_adst_16, &fwd_txfm_2d_cfg_adst_adst_32 },
+ &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 },
+ // IDENTITY
{
-#if CONFIG_CB4X4
+#if CONFIG_CHROMA_2X2
NULL,
#endif
- &fwd_txfm_2d_cfg_adst_adst_4, &fwd_txfm_2d_cfg_adst_adst_8,
- &fwd_txfm_2d_cfg_adst_adst_16, &fwd_txfm_2d_cfg_adst_adst_32 },
+ &fwd_txfm_1d_cfg_identity_4, &fwd_txfm_1d_cfg_identity_8,
+ &fwd_txfm_1d_cfg_identity_16, &fwd_txfm_1d_cfg_identity_32 },
+#endif // CONFIG_EXT_TX
};
-#else // CONFIG_EXT_TX
-static const TXFM_2D_CFG *fwd_txfm_cfg_ls[TX_TYPES][TX_SIZES] = {
+
+static const TXFM_1D_CFG *fwd_txfm_row_cfg_ls[TX_TYPES_1D][TX_SIZES] = {
+ // DCT
{
-#if CONFIG_CB4X4
+#if CONFIG_CHROMA_2X2
NULL,
#endif
- &fwd_txfm_2d_cfg_dct_dct_4, &fwd_txfm_2d_cfg_dct_dct_8,
- &fwd_txfm_2d_cfg_dct_dct_16, &fwd_txfm_2d_cfg_dct_dct_32 },
+ &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 },
+ // ADST
{
-#if CONFIG_CB4X4
+#if CONFIG_CHROMA_2X2
NULL,
#endif
- &fwd_txfm_2d_cfg_adst_dct_4, &fwd_txfm_2d_cfg_adst_dct_8,
- &fwd_txfm_2d_cfg_adst_dct_16, &fwd_txfm_2d_cfg_adst_dct_32 },
+ &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 },
+#if CONFIG_EXT_TX
+ // FLIPADST
{
-#if CONFIG_CB4X4
+#if CONFIG_CHROMA_2X2
NULL,
#endif
- &fwd_txfm_2d_cfg_dct_adst_4, &fwd_txfm_2d_cfg_dct_adst_8,
- &fwd_txfm_2d_cfg_dct_adst_16, &fwd_txfm_2d_cfg_dct_adst_32 },
+ &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 },
+ // IDENTITY
{
-#if CONFIG_CB4X4
+#if CONFIG_CHROMA_2X2
NULL,
#endif
- &fwd_txfm_2d_cfg_adst_adst_4, &fwd_txfm_2d_cfg_adst_adst_8,
- &fwd_txfm_2d_cfg_adst_adst_16, &fwd_txfm_2d_cfg_adst_adst_32 },
-};
+ &fwd_txfm_1d_cfg_identity_4, &fwd_txfm_1d_cfg_identity_8,
+ &fwd_txfm_1d_cfg_identity_16, &fwd_txfm_1d_cfg_identity_32 },
#endif // CONFIG_EXT_TX
+};
TXFM_2D_FLIP_CFG av1_get_fwd_txfm_cfg(int tx_type, int tx_size) {
TXFM_2D_FLIP_CFG cfg;
set_flip_cfg(tx_type, &cfg);
- cfg.cfg = fwd_txfm_cfg_ls[tx_type][tx_size];
+ int tx_type_col = vtx_tab[tx_type];
+ int tx_type_row = htx_tab[tx_type];
+ cfg.col_cfg = fwd_txfm_col_cfg_ls[tx_type_col][tx_size];
+ cfg.row_cfg = fwd_txfm_row_cfg_ls[tx_type_row][tx_size];
return cfg;
}
@@ -214,13 +204,11 @@ TXFM_2D_FLIP_CFG av1_get_fwd_txfm_64x64_cfg(int tx_type) {
TXFM_2D_FLIP_CFG cfg;
switch (tx_type) {
case DCT_DCT:
- cfg.cfg = &fwd_txfm_2d_cfg_dct_dct_64;
+ 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;
- case ADST_DCT:
- case DCT_ADST:
- case ADST_ADST:
default:
cfg.ud_flip = 0;
cfg.lr_flip = 0;