Clean up hbd transform code
Responding to some left over cosmetic comments from
2b5cdb1cf87c933331a16cc0221455d0a8c255e1
Change-Id: I42e126593526cedd6675adf35b9c1df78e1ddf54
diff --git a/av1/common/av1_fwd_txfm2d.c b/av1/common/av1_fwd_txfm2d.c
index 5d20e54..c124f3a 100644
--- a/av1/common/av1_fwd_txfm2d.c
+++ b/av1/common/av1_fwd_txfm2d.c
@@ -51,8 +51,8 @@
const int txfm_size_col = cfg->row_cfg->txfm_size;
const int txfm_size_row = cfg->col_cfg->txfm_size;
// Take the shift from the larger dimension in the rectangular case.
- const int8_t *shift =
- txfm_size_col > txfm_size_row ? cfg->row_cfg->shift : cfg->col_cfg->shift;
+ const int8_t *shift = (txfm_size_col > txfm_size_row) ? cfg->row_cfg->shift
+ : cfg->col_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;
@@ -264,10 +264,10 @@
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);
- int tx_type_col = vtx_tab[tx_type];
- int tx_type_row = htx_tab[tx_type];
- int tx_size_col = txsize_vert_map[tx_size];
- int tx_size_row = txsize_horz_map[tx_size];
+ const int tx_type_col = vtx_tab[tx_type];
+ const int tx_type_row = htx_tab[tx_type];
+ const int tx_size_col = txsize_vert_map[tx_size];
+ const int tx_size_row = txsize_horz_map[tx_size];
cfg.col_cfg = fwd_txfm_col_cfg_ls[tx_type_col][tx_size_col];
cfg.row_cfg = fwd_txfm_row_cfg_ls[tx_type_row][tx_size_row];
return cfg;
diff --git a/av1/common/av1_inv_txfm2d.c b/av1/common/av1_inv_txfm2d.c
index 14c35fc..58845f1 100644
--- a/av1/common/av1_inv_txfm2d.c
+++ b/av1/common/av1_inv_txfm2d.c
@@ -105,10 +105,10 @@
TXFM_2D_FLIP_CFG av1_get_inv_txfm_cfg(int tx_type, int tx_size) {
TXFM_2D_FLIP_CFG cfg;
set_flip_cfg(tx_type, &cfg);
- int tx_type_col = vtx_tab[tx_type];
- int tx_type_row = htx_tab[tx_type];
- int tx_size_col = txsize_vert_map[tx_size];
- int tx_size_row = txsize_horz_map[tx_size];
+ const int tx_type_col = vtx_tab[tx_type];
+ const int tx_type_row = htx_tab[tx_type];
+ const int tx_size_col = txsize_vert_map[tx_size];
+ const int tx_size_row = txsize_horz_map[tx_size];
cfg.col_cfg = inv_txfm_col_cfg_ls[tx_type_col][tx_size_col];
cfg.row_cfg = inv_txfm_row_cfg_ls[tx_type_row][tx_size_row];
return cfg;
@@ -139,8 +139,8 @@
const int txfm_size_col = cfg->row_cfg->txfm_size;
const int txfm_size_row = cfg->col_cfg->txfm_size;
// Take the shift from the larger dimension in the rectangular case.
- const int8_t *shift =
- txfm_size_col > txfm_size_row ? cfg->row_cfg->shift : cfg->col_cfg->shift;
+ const int8_t *shift = (txfm_size_col > txfm_size_row) ? cfg->row_cfg->shift
+ : cfg->col_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;
diff --git a/av1/common/idct.c b/av1/common/idct.c
index 4e15969..460e9b5 100644
--- a/av1/common/idct.c
+++ b/av1/common/idct.c
@@ -1458,7 +1458,6 @@
case ADST_DCT:
case DCT_ADST:
case ADST_ADST:
- // fallthrough intended
av1_inv_txfm2d_add_4x4(input, CONVERT_TO_SHORTPTR(dest), stride, tx_type,
bd);
break;
@@ -1468,7 +1467,6 @@
case FLIPADST_FLIPADST:
case ADST_FLIPADST:
case FLIPADST_ADST:
- // fallthrough intended
av1_inv_txfm2d_add_4x4(input, CONVERT_TO_SHORTPTR(dest), stride, tx_type,
bd);
break;
@@ -1480,7 +1478,6 @@
case V_FLIPADST:
case H_FLIPADST:
case IDTX:
- // fallthrough intended
av1_inv_txfm2d_add_4x4_c(input, CONVERT_TO_SHORTPTR(dest), stride,
tx_type, bd);
break;
@@ -1544,7 +1541,6 @@
case ADST_DCT:
case DCT_ADST:
case ADST_ADST:
- // fallthrough intended
av1_inv_txfm2d_add_8x8(input, CONVERT_TO_SHORTPTR(dest), stride, tx_type,
bd);
break;
@@ -1554,7 +1550,6 @@
case FLIPADST_FLIPADST:
case ADST_FLIPADST:
case FLIPADST_ADST:
- // fallthrough intended
av1_inv_txfm2d_add_8x8(input, CONVERT_TO_SHORTPTR(dest), stride, tx_type,
bd);
break;
@@ -1566,7 +1561,6 @@
case V_FLIPADST:
case H_FLIPADST:
case IDTX:
- // fallthrough intended
av1_inv_txfm2d_add_8x8_c(input, CONVERT_TO_SHORTPTR(dest), stride,
tx_type, bd);
break;
@@ -1584,7 +1578,6 @@
case ADST_DCT:
case DCT_ADST:
case ADST_ADST:
- // fallthrough intended
av1_inv_txfm2d_add_16x16(input, CONVERT_TO_SHORTPTR(dest), stride,
tx_type, bd);
break;
@@ -1594,7 +1587,6 @@
case FLIPADST_FLIPADST:
case ADST_FLIPADST:
case FLIPADST_ADST:
- // fallthrough intended
av1_inv_txfm2d_add_16x16(input, CONVERT_TO_SHORTPTR(dest), stride,
tx_type, bd);
break;
@@ -1606,7 +1598,6 @@
case V_FLIPADST:
case H_FLIPADST:
case IDTX:
- // fallthrough intended
av1_inv_txfm2d_add_16x16_c(input, CONVERT_TO_SHORTPTR(dest), stride,
tx_type, bd);
break;
@@ -1624,7 +1615,6 @@
case ADST_DCT:
case DCT_ADST:
case ADST_ADST:
- // fallthrough intended
av1_inv_txfm2d_add_32x32(input, CONVERT_TO_SHORTPTR(dest), stride,
tx_type, bd);
break;
@@ -1634,7 +1624,6 @@
case FLIPADST_FLIPADST:
case ADST_FLIPADST:
case FLIPADST_ADST:
- // fallthrough intended
av1_inv_txfm2d_add_32x32(input, CONVERT_TO_SHORTPTR(dest), stride,
tx_type, bd);
break;
@@ -1646,7 +1635,6 @@
case V_FLIPADST:
case H_FLIPADST:
case IDTX:
- // fallthrough intended
av1_inv_txfm2d_add_32x32_c(input, CONVERT_TO_SHORTPTR(dest), stride,
tx_type, bd);
break;
diff --git a/av1/common/x86/av1_fwd_txfm2d_sse4.c b/av1/common/x86/av1_fwd_txfm2d_sse4.c
index 1785509..f7824b6 100644
--- a/av1/common/x86/av1_fwd_txfm2d_sse4.c
+++ b/av1/common/x86/av1_fwd_txfm2d_sse4.c
@@ -45,6 +45,7 @@
// Rectangular transforms use c code only, so it should be ok for now.
// It will be corrected when there are sse implementations for rectangular
// transforms.
+ assert(cfg->row_cfg->txfm_size == cfg->col_cfg->txfm_size);
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;
diff --git a/av1/encoder/dct.c b/av1/encoder/dct.c
index fcaea59..cf00cd0 100644
--- a/av1/encoder/dct.c
+++ b/av1/encoder/dct.c
@@ -2149,20 +2149,6 @@
}
#endif // CONFIG_EXT_TX
-#if CONFIG_HIGHBITDEPTH
-void av1_highbd_fht32x32_c(const int16_t *input, tran_low_t *output, int stride,
- int tx_type) {
- av1_fht32x32_c(input, output, stride, tx_type);
-}
-
-#if CONFIG_TX64X64
-void av1_highbd_fht64x64_c(const int16_t *input, tran_low_t *output, int stride,
- int tx_type) {
- av1_fht64x64_c(input, output, stride, tx_type);
-}
-#endif // CONFIG_TX64X64
-#endif // CONFIG_HIGHBITDEPTH
-
#if CONFIG_DPCM_INTRA
void av1_dpcm_ft4_c(const int16_t *input, int stride, TX_TYPE_1D tx_type,
tran_low_t *output) {
diff --git a/test/dct16x16_test.cc b/test/dct16x16_test.cc
index 6c69f65..af01d02 100644
--- a/test/dct16x16_test.cc
+++ b/test/dct16x16_test.cc
@@ -628,8 +628,6 @@
tx_type_ = GET_PARAM(2);
bit_depth_ = GET_PARAM(3);
pitch_ = 16;
- fwd_txfm_ref = fht16x16_ref;
- inv_txfm_ref = iht16x16_ref;
mask_ = (1 << bit_depth_) - 1;
#if CONFIG_HIGHBITDEPTH
switch (bit_depth_) {
@@ -647,6 +645,7 @@
break;
}
#else
+ fwd_txfm_ref = fht16x16_ref;
inv_txfm_ref = iht16x16_ref;
#endif
}