Unify FWD_TXFM_PARAM and INV_TXFM_PARAM

Change two similar structs, FWD_TXFM_PARAM and INV_TXFM_PARAM,
into a common struct: TxfmParam. Its definition is moved to
aom_dsp/txfm_common.h to simplify dependency.

This change is made so that, in later changes of the LGT
experiment, functions requiring FWD_TXFM_PARAM and
INV_TXFM_PARAM, such as get_fwd_lgt4 and get_inv_lgt4, can
also be unified.

Change-Id: I756b0176a02314005060adbf8e62386f10eeb344
diff --git a/aom_dsp/txfm_common.h b/aom_dsp/txfm_common.h
index e157d4c..945c963 100644
--- a/aom_dsp/txfm_common.h
+++ b/aom_dsp/txfm_common.h
@@ -21,6 +21,25 @@
 #define UNIT_QUANT_SHIFT 2
 #define UNIT_QUANT_FACTOR (1 << UNIT_QUANT_SHIFT)
 
+typedef struct txfm_param {
+  // for both forward and inverse transforms
+  int tx_type;
+  int tx_size;
+  int lossless;
+  int bd;
+#if CONFIG_LGT
+  int is_inter;
+  int stride;
+  int mode;
+  uint8_t *dst;
+#endif
+// for inverse transforms only
+#if CONFIG_ADAPT_SCAN
+  const int16_t *eob_threshold;
+#endif
+  int eob;
+} TxfmParam;
+
 // Constants:
 //  for (int i = 1; i< 32; ++i)
 //    printf("static const int cospi_%d_64 = %.0f;\n", i,
diff --git a/av1/common/arm/neon/iht4x4_add_neon.c b/av1/common/arm/neon/iht4x4_add_neon.c
index 867dbb2b..68184c5 100644
--- a/av1/common/arm/neon/iht4x4_add_neon.c
+++ b/av1/common/arm/neon/iht4x4_add_neon.c
@@ -16,7 +16,6 @@
 #include "./av1_rtcd.h"
 #include "aom_dsp/txfm_common.h"
 #include "av1/common/common.h"
-#include "av1/common/idct.h"
 
 static INLINE void TRANSPOSE4X4(int16x8_t *q8s16, int16x8_t *q9s16) {
   int32x4_t q8s32, q9s32;
@@ -135,7 +134,7 @@
 }
 
 void av1_iht4x4_16_add_neon(const tran_low_t *input, uint8_t *dest,
-                            int dest_stride, const INV_TXFM_PARAM *param) {
+                            int dest_stride, const TxfmParam *txfm_param) {
   uint8x8_t d26u8, d27u8;
   int16x4_t d0s16, d1s16, d2s16, d3s16, d4s16, d5s16;
   uint32x2_t d26u32, d27u32;
@@ -149,10 +148,10 @@
 
   TRANSPOSE4X4(&q8s16, &q9s16);
 
-  int tx_type = param->tx_type;
+  int tx_type = txfm_param->tx_type;
   switch (tx_type) {
     case 0:  // idct_idct is not supported. Fall back to C
-      av1_iht4x4_16_add_c(input, dest, dest_stride, param);
+      av1_iht4x4_16_add_c(input, dest, dest_stride, txfm_param);
       return;
       break;
     case 1:  // iadst_idct
diff --git a/av1/common/arm/neon/iht8x8_add_neon.c b/av1/common/arm/neon/iht8x8_add_neon.c
index b3af998..a984495 100644
--- a/av1/common/arm/neon/iht8x8_add_neon.c
+++ b/av1/common/arm/neon/iht8x8_add_neon.c
@@ -16,7 +16,6 @@
 #include "./av1_rtcd.h"
 #include "aom_dsp/txfm_common.h"
 #include "av1/common/common.h"
-#include "av1/common/idct.h"
 
 static INLINE void TRANSPOSE8X8(int16x8_t *q8s16, int16x8_t *q9s16,
                                 int16x8_t *q10s16, int16x8_t *q11s16,
@@ -459,7 +458,7 @@
 }
 
 void av1_iht8x8_64_add_neon(const tran_low_t *input, uint8_t *dest,
-                            int dest_stride, const INV_TXFM_PARAM *param) {
+                            int dest_stride, const TxfmParam *txfm_param) {
   int i;
   uint8_t *d1, *d2;
   uint8x8_t d0u8, d1u8, d2u8, d3u8;
@@ -479,10 +478,10 @@
   TRANSPOSE8X8(&q8s16, &q9s16, &q10s16, &q11s16, &q12s16, &q13s16, &q14s16,
                &q15s16);
 
-  int tx_type = param->tx_type;
+  int tx_type = txfm_param->tx_type;
   switch (tx_type) {
     case 0:  // idct_idct is not supported. Fall back to C
-      av1_iht8x8_64_add_c(input, dest, dest_stride, param);
+      av1_iht8x8_64_add_c(input, dest, dest_stride, txfm_param);
       return;
       break;
     case 1:  // iadst_idct
diff --git a/av1/common/av1_rtcd_defs.pl b/av1/common/av1_rtcd_defs.pl
index 00ab3ec..4020e10 100755
--- a/av1/common/av1_rtcd_defs.pl
+++ b/av1/common/av1_rtcd_defs.pl
@@ -5,21 +5,20 @@
  */
 
 #include "aom/aom_integer.h"
+#include "aom_dsp/txfm_common.h"
 #include "av1/common/common.h"
 #include "av1/common/enums.h"
 #include "av1/common/quant_common.h"
 #include "av1/common/filter.h"
 #include "av1/common/convolve.h"
 #include "av1/common/av1_txfm.h"
-#include "av1/common/idct.h"
 #include "av1/common/odintrin.h"
 
 struct macroblockd;
 
 /* Encoder forward decls */
 struct macroblock;
-struct fwd_txfm_param;
-struct inv_txfm_param;
+struct txfm_param;
 struct aom_variance_vtable;
 struct search_site_config;
 struct mv;
@@ -66,81 +65,81 @@
 #
 if (aom_config("CONFIG_HIGHBITDEPTH") eq "yes") {
   {
-    add_proto qw/void av1_iht4x4_16_add/, "const tran_low_t *input, uint8_t *dest, int dest_stride, const struct inv_txfm_param *param";
+    add_proto qw/void av1_iht4x4_16_add/, "const tran_low_t *input, uint8_t *dest, int dest_stride, const struct txfm_param *param";
       specialize qw/av1_iht4x4_16_add sse2/;
 
-    add_proto qw/void av1_iht4x8_32_add/, "const tran_low_t *input, uint8_t *dest, int dest_stride, const struct inv_txfm_param *param";
+    add_proto qw/void av1_iht4x8_32_add/, "const tran_low_t *input, uint8_t *dest, int dest_stride, const struct txfm_param *param";
       specialize qw/av1_iht4x8_32_add sse2/;
 
-    add_proto qw/void av1_iht8x4_32_add/, "const tran_low_t *input, uint8_t *dest, int dest_stride, const struct inv_txfm_param *param";
+    add_proto qw/void av1_iht8x4_32_add/, "const tran_low_t *input, uint8_t *dest, int dest_stride, const struct txfm_param *param";
       specialize qw/av1_iht8x4_32_add sse2/;
 
-    add_proto qw/void av1_iht8x16_128_add/, "const tran_low_t *input, uint8_t *dest, int dest_stride, const struct inv_txfm_param *param";
+    add_proto qw/void av1_iht8x16_128_add/, "const tran_low_t *input, uint8_t *dest, int dest_stride, const struct txfm_param *param";
       specialize qw/av1_iht8x16_128_add sse2/;
 
-    add_proto qw/void av1_iht16x8_128_add/, "const tran_low_t *input, uint8_t *dest, int dest_stride, const struct inv_txfm_param *param";
+    add_proto qw/void av1_iht16x8_128_add/, "const tran_low_t *input, uint8_t *dest, int dest_stride, const struct txfm_param *param";
       specialize qw/av1_iht16x8_128_add sse2/;
 
-    add_proto qw/void av1_iht16x32_512_add/, "const tran_low_t *input, uint8_t *dest, int dest_stride, const struct inv_txfm_param *param";
+    add_proto qw/void av1_iht16x32_512_add/, "const tran_low_t *input, uint8_t *dest, int dest_stride, const struct txfm_param *param";
       specialize qw/av1_iht16x32_512_add sse2/;
 
-    add_proto qw/void av1_iht32x16_512_add/, "const tran_low_t *input, uint8_t *dest, int dest_stride, const struct inv_txfm_param *param";
+    add_proto qw/void av1_iht32x16_512_add/, "const tran_low_t *input, uint8_t *dest, int dest_stride, const struct txfm_param *param";
       specialize qw/av1_iht32x16_512_add sse2/;
 
-    add_proto qw/void av1_iht4x16_64_add/, "const tran_low_t *input, uint8_t *dest, int dest_stride, const struct inv_txfm_param *param";
+    add_proto qw/void av1_iht4x16_64_add/, "const tran_low_t *input, uint8_t *dest, int dest_stride, const struct txfm_param *param";
 
-    add_proto qw/void av1_iht16x4_64_add/, "const tran_low_t *input, uint8_t *dest, int dest_stride, const struct inv_txfm_param *param";
+    add_proto qw/void av1_iht16x4_64_add/, "const tran_low_t *input, uint8_t *dest, int dest_stride, const struct txfm_param *param";
 
-    add_proto qw/void av1_iht8x32_256_add/, "const tran_low_t *input, uint8_t *dest, int dest_stride, const struct inv_txfm_param *param";
+    add_proto qw/void av1_iht8x32_256_add/, "const tran_low_t *input, uint8_t *dest, int dest_stride, const struct txfm_param *param";
 
-    add_proto qw/void av1_iht32x8_256_add/, "const tran_low_t *input, uint8_t *dest, int dest_stride, const struct inv_txfm_param *param";
+    add_proto qw/void av1_iht32x8_256_add/, "const tran_low_t *input, uint8_t *dest, int dest_stride, const struct txfm_param *param";
 
-    add_proto qw/void av1_iht8x8_64_add/, "const tran_low_t *input, uint8_t *dest, int dest_stride, const struct inv_txfm_param *param";
+    add_proto qw/void av1_iht8x8_64_add/, "const tran_low_t *input, uint8_t *dest, int dest_stride, const struct txfm_param *param";
       specialize qw/av1_iht8x8_64_add sse2/;
 
-    add_proto qw/void av1_iht16x16_256_add/, "const tran_low_t *input, uint8_t *output, int pitch, const struct inv_txfm_param *param";
+    add_proto qw/void av1_iht16x16_256_add/, "const tran_low_t *input, uint8_t *output, int pitch, const struct txfm_param *param";
       specialize qw/av1_iht16x16_256_add sse2 avx2/;
 
-    add_proto qw/void av1_iht32x32_1024_add/, "const tran_low_t *input, uint8_t *output, int pitch, const struct inv_txfm_param *param";
+    add_proto qw/void av1_iht32x32_1024_add/, "const tran_low_t *input, uint8_t *output, int pitch, const struct txfm_param *param";
   }
 } else {
   {
-    add_proto qw/void av1_iht4x4_16_add/, "const tran_low_t *input, uint8_t *dest, int dest_stride, const struct inv_txfm_param *param";
+    add_proto qw/void av1_iht4x4_16_add/, "const tran_low_t *input, uint8_t *dest, int dest_stride, const struct txfm_param *param";
     specialize qw/av1_iht4x4_16_add sse2 neon dspr2/;
 
-    add_proto qw/void av1_iht4x8_32_add/, "const tran_low_t *input, uint8_t *dest, int dest_stride, const struct inv_txfm_param *param";
+    add_proto qw/void av1_iht4x8_32_add/, "const tran_low_t *input, uint8_t *dest, int dest_stride, const struct txfm_param *param";
       specialize qw/av1_iht4x8_32_add sse2/;
 
-    add_proto qw/void av1_iht8x4_32_add/, "const tran_low_t *input, uint8_t *dest, int dest_stride, const struct inv_txfm_param *param";
+    add_proto qw/void av1_iht8x4_32_add/, "const tran_low_t *input, uint8_t *dest, int dest_stride, const struct txfm_param *param";
       specialize qw/av1_iht8x4_32_add sse2/;
 
-    add_proto qw/void av1_iht8x16_128_add/, "const tran_low_t *input, uint8_t *dest, int dest_stride, const struct inv_txfm_param *param";
+    add_proto qw/void av1_iht8x16_128_add/, "const tran_low_t *input, uint8_t *dest, int dest_stride, const struct txfm_param *param";
       specialize qw/av1_iht8x16_128_add sse2/;
 
-    add_proto qw/void av1_iht16x8_128_add/, "const tran_low_t *input, uint8_t *dest, int dest_stride, const struct inv_txfm_param *param";
+    add_proto qw/void av1_iht16x8_128_add/, "const tran_low_t *input, uint8_t *dest, int dest_stride, const struct txfm_param *param";
       specialize qw/av1_iht16x8_128_add sse2/;
 
-    add_proto qw/void av1_iht16x32_512_add/, "const tran_low_t *input, uint8_t *dest, int dest_stride, const struct inv_txfm_param *param";
+    add_proto qw/void av1_iht16x32_512_add/, "const tran_low_t *input, uint8_t *dest, int dest_stride, const struct txfm_param *param";
       specialize qw/av1_iht16x32_512_add sse2/;
 
-    add_proto qw/void av1_iht32x16_512_add/, "const tran_low_t *input, uint8_t *dest, int dest_stride, const struct inv_txfm_param *param";
+    add_proto qw/void av1_iht32x16_512_add/, "const tran_low_t *input, uint8_t *dest, int dest_stride, const struct txfm_param *param";
       specialize qw/av1_iht32x16_512_add sse2/;
 
-    add_proto qw/void av1_iht4x16_64_add/, "const tran_low_t *input, uint8_t *dest, int dest_stride, const struct inv_txfm_param *param";
+    add_proto qw/void av1_iht4x16_64_add/, "const tran_low_t *input, uint8_t *dest, int dest_stride, const struct txfm_param *param";
 
-    add_proto qw/void av1_iht16x4_64_add/, "const tran_low_t *input, uint8_t *dest, int dest_stride, const struct inv_txfm_param *param";
+    add_proto qw/void av1_iht16x4_64_add/, "const tran_low_t *input, uint8_t *dest, int dest_stride, const struct txfm_param *param";
 
-    add_proto qw/void av1_iht8x32_256_add/, "const tran_low_t *input, uint8_t *dest, int dest_stride, const struct inv_txfm_param *param";
+    add_proto qw/void av1_iht8x32_256_add/, "const tran_low_t *input, uint8_t *dest, int dest_stride, const struct txfm_param *param";
 
-    add_proto qw/void av1_iht32x8_256_add/, "const tran_low_t *input, uint8_t *dest, int dest_stride, const struct inv_txfm_param *param";
+    add_proto qw/void av1_iht32x8_256_add/, "const tran_low_t *input, uint8_t *dest, int dest_stride, const struct txfm_param *param";
 
-    add_proto qw/void av1_iht8x8_64_add/, "const tran_low_t *input, uint8_t *dest, int dest_stride, const struct inv_txfm_param *param";
+    add_proto qw/void av1_iht8x8_64_add/, "const tran_low_t *input, uint8_t *dest, int dest_stride, const struct txfm_param *param";
       specialize qw/av1_iht8x8_64_add sse2 neon dspr2/;
 
-    add_proto qw/void av1_iht16x16_256_add/, "const tran_low_t *input, uint8_t *output, int pitch, const struct inv_txfm_param *param";
+    add_proto qw/void av1_iht16x16_256_add/, "const tran_low_t *input, uint8_t *output, int pitch, const struct txfm_param *param";
       specialize qw/av1_iht16x16_256_add sse2 avx2 dspr2/;
 
-    add_proto qw/void av1_iht32x32_1024_add/, "const tran_low_t *input, uint8_t *output, int pitch, const struct inv_txfm_param *param";
+    add_proto qw/void av1_iht32x32_1024_add/, "const tran_low_t *input, uint8_t *output, int pitch, const struct txfm_param *param";
 
     if (aom_config("CONFIG_EXT_TX") ne "yes") {
       specialize qw/av1_iht4x4_16_add msa/;
@@ -150,10 +149,10 @@
   }
 }
 
-add_proto qw/void av1_iht32x32_1024_add/, "const tran_low_t *input, uint8_t *output, int pitch, const struct inv_txfm_param *param";
+add_proto qw/void av1_iht32x32_1024_add/, "const tran_low_t *input, uint8_t *output, int pitch, const struct txfm_param *param";
 
 if (aom_config("CONFIG_TX64X64") eq "yes") {
-  add_proto qw/void av1_iht64x64_4096_add/, "const tran_low_t *input, uint8_t *output, int pitch, const struct inv_txfm_param *param";
+  add_proto qw/void av1_iht64x64_4096_add/, "const tran_low_t *input, uint8_t *output, int pitch, const struct txfm_param *param";
 }
 
 if (aom_config("CONFIG_NEW_QUANT") eq "yes") {
@@ -229,31 +228,31 @@
   #
   # dct
   #
-  add_proto qw/void av1_highbd_iht4x4_16_add/, "const tran_low_t *input, uint8_t *dest, int dest_stride, const struct inv_txfm_param *param";
+  add_proto qw/void av1_highbd_iht4x4_16_add/, "const tran_low_t *input, uint8_t *dest, int dest_stride, const struct txfm_param *param";
 
-  add_proto qw/void av1_highbd_iht4x8_32_add/, "const tran_low_t *input, uint8_t *dest, int dest_stride, const struct inv_txfm_param *param";
+  add_proto qw/void av1_highbd_iht4x8_32_add/, "const tran_low_t *input, uint8_t *dest, int dest_stride, const struct txfm_param *param";
 
-  add_proto qw/void av1_highbd_iht8x4_32_add/, "const tran_low_t *input, uint8_t *dest, int dest_stride, const struct inv_txfm_param *param";
+  add_proto qw/void av1_highbd_iht8x4_32_add/, "const tran_low_t *input, uint8_t *dest, int dest_stride, const struct txfm_param *param";
 
-  add_proto qw/void av1_highbd_iht8x16_128_add/, "const tran_low_t *input, uint8_t *dest, int dest_stride, const struct inv_txfm_param *param";
+  add_proto qw/void av1_highbd_iht8x16_128_add/, "const tran_low_t *input, uint8_t *dest, int dest_stride, const struct txfm_param *param";
 
-  add_proto qw/void av1_highbd_iht16x8_128_add/, "const tran_low_t *input, uint8_t *dest, int dest_stride, const struct inv_txfm_param *param";
+  add_proto qw/void av1_highbd_iht16x8_128_add/, "const tran_low_t *input, uint8_t *dest, int dest_stride, const struct txfm_param *param";
 
-  add_proto qw/void av1_highbd_iht16x32_512_add/, "const tran_low_t *input, uint8_t *dest, int dest_stride, const struct inv_txfm_param *param";
+  add_proto qw/void av1_highbd_iht16x32_512_add/, "const tran_low_t *input, uint8_t *dest, int dest_stride, const struct txfm_param *param";
 
-  add_proto qw/void av1_highbd_iht32x16_512_add/, "const tran_low_t *input, uint8_t *dest, int dest_stride, const struct inv_txfm_param *param";
+  add_proto qw/void av1_highbd_iht32x16_512_add/, "const tran_low_t *input, uint8_t *dest, int dest_stride, const struct txfm_param *param";
 
-  add_proto qw/void av1_highbd_iht4x16_64_add/, "const tran_low_t *input, uint8_t *dest, int dest_stride, const struct inv_txfm_param *param";
+  add_proto qw/void av1_highbd_iht4x16_64_add/, "const tran_low_t *input, uint8_t *dest, int dest_stride, const struct txfm_param *param";
 
-  add_proto qw/void av1_highbd_iht16x4_64_add/, "const tran_low_t *input, uint8_t *dest, int dest_stride, const struct inv_txfm_param *param";
+  add_proto qw/void av1_highbd_iht16x4_64_add/, "const tran_low_t *input, uint8_t *dest, int dest_stride, const struct txfm_param *param";
 
-  add_proto qw/void av1_highbd_iht8x32_256_add/, "const tran_low_t *input, uint8_t *dest, int dest_stride, const struct inv_txfm_param *param";
+  add_proto qw/void av1_highbd_iht8x32_256_add/, "const tran_low_t *input, uint8_t *dest, int dest_stride, const struct txfm_param *param";
 
-  add_proto qw/void av1_highbd_iht32x8_256_add/, "const tran_low_t *input, uint8_t *dest, int dest_stride, const struct inv_txfm_param *param";
+  add_proto qw/void av1_highbd_iht32x8_256_add/, "const tran_low_t *input, uint8_t *dest, int dest_stride, const struct txfm_param *param";
 
-  add_proto qw/void av1_highbd_iht8x8_64_add/, "const tran_low_t *input, uint8_t *dest, int dest_stride, const struct inv_txfm_param *param";
+  add_proto qw/void av1_highbd_iht8x8_64_add/, "const tran_low_t *input, uint8_t *dest, int dest_stride, const struct txfm_param *param";
 
-  add_proto qw/void av1_highbd_iht16x16_256_add/, "const tran_low_t *input, uint8_t *output, int pitch, const struct inv_txfm_param *param";
+  add_proto qw/void av1_highbd_iht16x16_256_add/, "const tran_low_t *input, uint8_t *output, int pitch, const struct txfm_param *param";
 }
 
 #inv txfm
@@ -356,49 +355,49 @@
 
 # fdct functions
 
-add_proto qw/void av1_fht4x4/, "const int16_t *input, tran_low_t *output, int stride, struct fwd_txfm_param *param";
+add_proto qw/void av1_fht4x4/, "const int16_t *input, tran_low_t *output, int stride, struct txfm_param *param";
 specialize qw/av1_fht4x4 sse2/;
 
 add_proto qw/void av1_fwht4x4/, "const int16_t *input, tran_low_t *output, int stride";
 
-add_proto qw/void av1_fht8x8/, "const int16_t *input, tran_low_t *output, int stride, struct fwd_txfm_param *param";
+add_proto qw/void av1_fht8x8/, "const int16_t *input, tran_low_t *output, int stride, struct txfm_param *param";
 specialize qw/av1_fht8x8 sse2/;
 
-add_proto qw/void av1_fht16x16/, "const int16_t *input, tran_low_t *output, int stride, struct fwd_txfm_param *param";
+add_proto qw/void av1_fht16x16/, "const int16_t *input, tran_low_t *output, int stride, struct txfm_param *param";
 specialize qw/av1_fht16x16 sse2 avx2/;
 
-add_proto qw/void av1_fht32x32/, "const int16_t *input, tran_low_t *output, int stride, struct fwd_txfm_param *param";
+add_proto qw/void av1_fht32x32/, "const int16_t *input, tran_low_t *output, int stride, struct txfm_param *param";
 specialize qw/av1_fht32x32 sse2 avx2/;
 
 if (aom_config("CONFIG_TX64X64") eq "yes") {
-  add_proto qw/void av1_fht64x64/, "const int16_t *input, tran_low_t *output, int stride, struct fwd_txfm_param *param";
+  add_proto qw/void av1_fht64x64/, "const int16_t *input, tran_low_t *output, int stride, struct txfm_param *param";
 }
 
-add_proto qw/void av1_fht4x8/, "const int16_t *input, tran_low_t *output, int stride, struct fwd_txfm_param *param";
+add_proto qw/void av1_fht4x8/, "const int16_t *input, tran_low_t *output, int stride, struct txfm_param *param";
 specialize qw/av1_fht4x8 sse2/;
 
-add_proto qw/void av1_fht8x4/, "const int16_t *input, tran_low_t *output, int stride, struct fwd_txfm_param *param";
+add_proto qw/void av1_fht8x4/, "const int16_t *input, tran_low_t *output, int stride, struct txfm_param *param";
 specialize qw/av1_fht8x4 sse2/;
 
-add_proto qw/void av1_fht8x16/, "const int16_t *input, tran_low_t *output, int stride, struct fwd_txfm_param *param";
+add_proto qw/void av1_fht8x16/, "const int16_t *input, tran_low_t *output, int stride, struct txfm_param *param";
 specialize qw/av1_fht8x16 sse2/;
 
-add_proto qw/void av1_fht16x8/, "const int16_t *input, tran_low_t *output, int stride, struct fwd_txfm_param *param";
+add_proto qw/void av1_fht16x8/, "const int16_t *input, tran_low_t *output, int stride, struct txfm_param *param";
 specialize qw/av1_fht16x8 sse2/;
 
-add_proto qw/void av1_fht16x32/, "const int16_t *input, tran_low_t *output, int stride, struct fwd_txfm_param *param";
+add_proto qw/void av1_fht16x32/, "const int16_t *input, tran_low_t *output, int stride, struct txfm_param *param";
 specialize qw/av1_fht16x32 sse2/;
 
-add_proto qw/void av1_fht32x16/, "const int16_t *input, tran_low_t *output, int stride, struct fwd_txfm_param *param";
+add_proto qw/void av1_fht32x16/, "const int16_t *input, tran_low_t *output, int stride, struct txfm_param *param";
 specialize qw/av1_fht32x16 sse2/;
 
-add_proto qw/void av1_fht4x16/, "const int16_t *input, tran_low_t *output, int stride, struct fwd_txfm_param *param";
+add_proto qw/void av1_fht4x16/, "const int16_t *input, tran_low_t *output, int stride, struct txfm_param *param";
 
-add_proto qw/void av1_fht16x4/, "const int16_t *input, tran_low_t *output, int stride, struct fwd_txfm_param *param";
+add_proto qw/void av1_fht16x4/, "const int16_t *input, tran_low_t *output, int stride, struct txfm_param *param";
 
-add_proto qw/void av1_fht8x32/, "const int16_t *input, tran_low_t *output, int stride, struct fwd_txfm_param *param";
+add_proto qw/void av1_fht8x32/, "const int16_t *input, tran_low_t *output, int stride, struct txfm_param *param";
 
-add_proto qw/void av1_fht32x8/, "const int16_t *input, tran_low_t *output, int stride, struct fwd_txfm_param *param";
+add_proto qw/void av1_fht32x8/, "const int16_t *input, tran_low_t *output, int stride, struct txfm_param *param";
 
 if (aom_config("CONFIG_HIGHBITDEPTH") ne "yes") {
   if (aom_config("CONFIG_EXT_TX") ne "yes") {
@@ -528,25 +527,25 @@
 # fdct functions
 
 if (aom_config("CONFIG_HIGHBITDEPTH") eq "yes") {
-  add_proto qw/void av1_fht4x4/, "const int16_t *input, tran_low_t *output, int stride, struct fwd_txfm_param *param";
+  add_proto qw/void av1_fht4x4/, "const int16_t *input, tran_low_t *output, int stride, struct txfm_param *param";
   specialize qw/av1_fht4x4 sse2/;
 
-  add_proto qw/void av1_fht8x8/, "const int16_t *input, tran_low_t *output, int stride, struct fwd_txfm_param *param";
+  add_proto qw/void av1_fht8x8/, "const int16_t *input, tran_low_t *output, int stride, struct txfm_param *param";
   specialize qw/av1_fht8x8 sse2/;
 
-  add_proto qw/void av1_fht16x16/, "const int16_t *input, tran_low_t *output, int stride, struct fwd_txfm_param *param";
+  add_proto qw/void av1_fht16x16/, "const int16_t *input, tran_low_t *output, int stride, struct txfm_param *param";
   specialize qw/av1_fht16x16 sse2/;
 
   add_proto qw/void av1_fwht4x4/, "const int16_t *input, tran_low_t *output, int stride";
   specialize qw/av1_fwht4x4 sse2/;
 } else {
-  add_proto qw/void av1_fht4x4/, "const int16_t *input, tran_low_t *output, int stride, struct fwd_txfm_param *param";
+  add_proto qw/void av1_fht4x4/, "const int16_t *input, tran_low_t *output, int stride, struct txfm_param *param";
   specialize qw/av1_fht4x4 sse2 msa/;
 
-  add_proto qw/void av1_fht8x8/, "const int16_t *input, tran_low_t *output, int stride, struct fwd_txfm_param *param";
+  add_proto qw/void av1_fht8x8/, "const int16_t *input, tran_low_t *output, int stride, struct txfm_param *param";
   specialize qw/av1_fht8x8 sse2 msa/;
 
-  add_proto qw/void av1_fht16x16/, "const int16_t *input, tran_low_t *output, int stride, struct fwd_txfm_param *param";
+  add_proto qw/void av1_fht16x16/, "const int16_t *input, tran_low_t *output, int stride, struct txfm_param *param";
   specialize qw/av1_fht16x16 sse2 msa/;
 
   add_proto qw/void av1_fwht4x4/, "const int16_t *input, tran_low_t *output, int stride";
diff --git a/av1/common/idct.c b/av1/common/idct.c
index 9099e48..38de47b 100644
--- a/av1/common/idct.c
+++ b/av1/common/idct.c
@@ -228,23 +228,23 @@
 }
 
 // The get_inv_lgt functions return 1 if LGT is chosen to apply, and 0 otherwise
-int get_inv_lgt4(transform_1d tx_orig, const INV_TXFM_PARAM *inv_txfm_param,
+int get_inv_lgt4(transform_1d tx_orig, const TxfmParam *txfm_param,
                  const tran_high_t *lgtmtx[], int ntx) {
   // inter/intra split
   if (tx_orig == &aom_iadst4_c) {
     for (int i = 0; i < ntx; ++i)
-      lgtmtx[i] = inv_txfm_param->is_inter ? &lgt4_170[0][0] : &lgt4_140[0][0];
+      lgtmtx[i] = txfm_param->is_inter ? &lgt4_170[0][0] : &lgt4_140[0][0];
     return 1;
   }
   return 0;
 }
 
-int get_inv_lgt8(transform_1d tx_orig, const INV_TXFM_PARAM *inv_txfm_param,
+int get_inv_lgt8(transform_1d tx_orig, const TxfmParam *txfm_param,
                  const tran_high_t *lgtmtx[], int ntx) {
   // inter/intra split
   if (tx_orig == &aom_iadst8_c) {
     for (int i = 0; i < ntx; ++i)
-      lgtmtx[i] = inv_txfm_param->is_inter ? &lgt8_170[0][0] : &lgt8_150[0][0];
+      lgtmtx[i] = txfm_param->is_inter ? &lgt8_170[0][0] : &lgt8_150[0][0];
     return 1;
   }
   return 0;
@@ -252,8 +252,8 @@
 #endif  // CONFIG_LGT
 
 void av1_iht4x4_16_add_c(const tran_low_t *input, uint8_t *dest, int stride,
-                         const INV_TXFM_PARAM *param) {
-  int tx_type = param->tx_type;
+                         const TxfmParam *txfm_param) {
+  int tx_type = txfm_param->tx_type;
 #if !CONFIG_DAALA_DCT4
   if (tx_type == DCT_DCT) {
     aom_idct4x4_16_add(input, dest, stride);
@@ -294,8 +294,10 @@
 #if CONFIG_LGT
   const tran_high_t *lgtmtx_col[4];
   const tran_high_t *lgtmtx_row[4];
-  int use_lgt_col = get_inv_lgt4(IHT_4[tx_type].cols, param, lgtmtx_col, 4);
-  int use_lgt_row = get_inv_lgt4(IHT_4[tx_type].rows, param, lgtmtx_row, 4);
+  int use_lgt_col =
+      get_inv_lgt4(IHT_4[tx_type].cols, txfm_param, lgtmtx_col, 4);
+  int use_lgt_row =
+      get_inv_lgt4(IHT_4[tx_type].rows, txfm_param, lgtmtx_row, 4);
 #endif
 
   // inverse transform row vectors
@@ -351,8 +353,8 @@
 }
 
 void av1_iht4x8_32_add_c(const tran_low_t *input, uint8_t *dest, int stride,
-                         const INV_TXFM_PARAM *param) {
-  int tx_type = param->tx_type;
+                         const TxfmParam *txfm_param) {
+  int tx_type = txfm_param->tx_type;
 #if CONFIG_DCT_ONLY
   assert(tx_type == DCT_DCT);
 #endif
@@ -387,8 +389,10 @@
 #if CONFIG_LGT
   const tran_high_t *lgtmtx_col[4];
   const tran_high_t *lgtmtx_row[8];
-  int use_lgt_col = get_inv_lgt8(IHT_4x8[tx_type].cols, param, lgtmtx_col, 4);
-  int use_lgt_row = get_inv_lgt4(IHT_4x8[tx_type].rows, param, lgtmtx_row, 8);
+  int use_lgt_col =
+      get_inv_lgt8(IHT_4x8[tx_type].cols, txfm_param, lgtmtx_col, 4);
+  int use_lgt_row =
+      get_inv_lgt4(IHT_4x8[tx_type].rows, txfm_param, lgtmtx_row, 8);
 #endif
 
   // inverse transform row vectors and transpose
@@ -429,8 +433,8 @@
 }
 
 void av1_iht8x4_32_add_c(const tran_low_t *input, uint8_t *dest, int stride,
-                         const INV_TXFM_PARAM *param) {
-  int tx_type = param->tx_type;
+                         const TxfmParam *txfm_param) {
+  int tx_type = txfm_param->tx_type;
 #if CONFIG_DCT_ONLY
   assert(tx_type == DCT_DCT);
 #endif
@@ -466,8 +470,10 @@
 #if CONFIG_LGT
   const tran_high_t *lgtmtx_col[8];
   const tran_high_t *lgtmtx_row[4];
-  int use_lgt_col = get_inv_lgt4(IHT_8x4[tx_type].cols, param, lgtmtx_col, 8);
-  int use_lgt_row = get_inv_lgt8(IHT_8x4[tx_type].rows, param, lgtmtx_row, 4);
+  int use_lgt_col =
+      get_inv_lgt4(IHT_8x4[tx_type].cols, txfm_param, lgtmtx_col, 8);
+  int use_lgt_row =
+      get_inv_lgt8(IHT_8x4[tx_type].rows, txfm_param, lgtmtx_row, 4);
 #endif
 
   // inverse transform row vectors and transpose
@@ -508,8 +514,8 @@
 }
 
 void av1_iht4x16_64_add_c(const tran_low_t *input, uint8_t *dest, int stride,
-                          const INV_TXFM_PARAM *param) {
-  int tx_type = param->tx_type;
+                          const TxfmParam *txfm_param) {
+  int tx_type = txfm_param->tx_type;
 #if CONFIG_DCT_ONLY
   assert(tx_type == DCT_DCT);
 #endif
@@ -543,7 +549,8 @@
 
 #if CONFIG_LGT
   const tran_high_t *lgtmtx_row[16];
-  int use_lgt_row = get_inv_lgt4(IHT_4x16[tx_type].rows, param, lgtmtx_row, 16);
+  int use_lgt_row =
+      get_inv_lgt4(IHT_4x16[tx_type].rows, txfm_param, lgtmtx_row, 16);
 #endif
 
   // inverse transform row vectors and transpose
@@ -578,8 +585,8 @@
 }
 
 void av1_iht16x4_64_add_c(const tran_low_t *input, uint8_t *dest, int stride,
-                          const INV_TXFM_PARAM *param) {
-  int tx_type = param->tx_type;
+                          const TxfmParam *txfm_param) {
+  int tx_type = txfm_param->tx_type;
 #if CONFIG_DCT_ONLY
   assert(tx_type == DCT_DCT);
 #endif
@@ -614,7 +621,8 @@
 
 #if CONFIG_LGT
   const tran_high_t *lgtmtx_col[16];
-  int use_lgt_col = get_inv_lgt4(IHT_16x4[tx_type].cols, param, lgtmtx_col, 16);
+  int use_lgt_col =
+      get_inv_lgt4(IHT_16x4[tx_type].cols, txfm_param, lgtmtx_col, 16);
 #endif
 
   // inverse transform row vectors and transpose
@@ -649,8 +657,8 @@
 }
 
 void av1_iht8x16_128_add_c(const tran_low_t *input, uint8_t *dest, int stride,
-                           const INV_TXFM_PARAM *param) {
-  int tx_type = param->tx_type;
+                           const TxfmParam *txfm_param) {
+  int tx_type = txfm_param->tx_type;
 #if CONFIG_DCT_ONLY
   assert(tx_type == DCT_DCT);
 #endif
@@ -684,7 +692,8 @@
 
 #if CONFIG_LGT
   const tran_high_t *lgtmtx_row[16];
-  int use_lgt_row = get_inv_lgt8(IHT_8x16[tx_type].rows, param, lgtmtx_row, 16);
+  int use_lgt_row =
+      get_inv_lgt8(IHT_8x16[tx_type].rows, txfm_param, lgtmtx_row, 16);
 #endif
 
   // inverse transform row vectors and transpose
@@ -720,8 +729,8 @@
 }
 
 void av1_iht16x8_128_add_c(const tran_low_t *input, uint8_t *dest, int stride,
-                           const INV_TXFM_PARAM *param) {
-  int tx_type = param->tx_type;
+                           const TxfmParam *txfm_param) {
+  int tx_type = txfm_param->tx_type;
 #if CONFIG_DCT_ONLY
   assert(tx_type == DCT_DCT);
 #endif
@@ -756,7 +765,8 @@
 
 #if CONFIG_LGT
   const tran_high_t *lgtmtx_col[16];
-  int use_lgt_col = get_inv_lgt8(IHT_16x8[tx_type].cols, param, lgtmtx_col, 16);
+  int use_lgt_col =
+      get_inv_lgt8(IHT_16x8[tx_type].cols, txfm_param, lgtmtx_col, 16);
 #endif
 
   // inverse transform row vectors and transpose
@@ -792,8 +802,8 @@
 }
 
 void av1_iht8x32_256_add_c(const tran_low_t *input, uint8_t *dest, int stride,
-                           const INV_TXFM_PARAM *param) {
-  int tx_type = param->tx_type;
+                           const TxfmParam *txfm_param) {
+  int tx_type = txfm_param->tx_type;
 #if CONFIG_DCT_ONLY
   assert(tx_type == DCT_DCT);
 #endif
@@ -827,7 +837,8 @@
 
 #if CONFIG_LGT
   const tran_high_t *lgtmtx_row[32];
-  int use_lgt_row = get_inv_lgt8(IHT_8x32[tx_type].rows, param, lgtmtx_row, 32);
+  int use_lgt_row =
+      get_inv_lgt8(IHT_8x32[tx_type].rows, txfm_param, lgtmtx_row, 32);
 #endif
 
   // inverse transform row vectors and transpose
@@ -862,8 +873,8 @@
 }
 
 void av1_iht32x8_256_add_c(const tran_low_t *input, uint8_t *dest, int stride,
-                           const INV_TXFM_PARAM *param) {
-  int tx_type = param->tx_type;
+                           const TxfmParam *txfm_param) {
+  int tx_type = txfm_param->tx_type;
 #if CONFIG_DCT_ONLY
   assert(tx_type == DCT_DCT);
 #endif
@@ -898,7 +909,8 @@
 
 #if CONFIG_LGT
   const tran_high_t *lgtmtx_col[32];
-  int use_lgt_col = get_inv_lgt4(IHT_32x8[tx_type].cols, param, lgtmtx_col, 32);
+  int use_lgt_col =
+      get_inv_lgt4(IHT_32x8[tx_type].cols, txfm_param, lgtmtx_col, 32);
 #endif
 
   // inverse transform row vectors and transpose
@@ -933,8 +945,8 @@
 }
 
 void av1_iht16x32_512_add_c(const tran_low_t *input, uint8_t *dest, int stride,
-                            const INV_TXFM_PARAM *param) {
-  int tx_type = param->tx_type;
+                            const TxfmParam *txfm_param) {
+  int tx_type = txfm_param->tx_type;
 #if CONFIG_DCT_ONLY
   assert(tx_type == DCT_DCT);
 #endif
@@ -992,8 +1004,8 @@
 }
 
 void av1_iht32x16_512_add_c(const tran_low_t *input, uint8_t *dest, int stride,
-                            const INV_TXFM_PARAM *param) {
-  int tx_type = param->tx_type;
+                            const TxfmParam *txfm_param) {
+  int tx_type = txfm_param->tx_type;
 #if CONFIG_DCT_ONLY
   assert(tx_type == DCT_DCT);
 #endif
@@ -1051,8 +1063,8 @@
 }
 
 void av1_iht8x8_64_add_c(const tran_low_t *input, uint8_t *dest, int stride,
-                         const INV_TXFM_PARAM *param) {
-  int tx_type = param->tx_type;
+                         const TxfmParam *txfm_param) {
+  int tx_type = txfm_param->tx_type;
 #if CONFIG_DCT_ONLY
   assert(tx_type == DCT_DCT);
 #endif
@@ -1086,8 +1098,10 @@
 #if CONFIG_LGT
   const tran_high_t *lgtmtx_col[8];
   const tran_high_t *lgtmtx_row[8];
-  int use_lgt_col = get_inv_lgt8(IHT_8[tx_type].cols, param, lgtmtx_col, 8);
-  int use_lgt_row = get_inv_lgt8(IHT_8[tx_type].rows, param, lgtmtx_row, 8);
+  int use_lgt_col =
+      get_inv_lgt8(IHT_8[tx_type].cols, txfm_param, lgtmtx_col, 8);
+  int use_lgt_row =
+      get_inv_lgt8(IHT_8[tx_type].rows, txfm_param, lgtmtx_row, 8);
 #endif
 
   // inverse transform row vectors
@@ -1133,8 +1147,8 @@
 }
 
 void av1_iht16x16_256_add_c(const tran_low_t *input, uint8_t *dest, int stride,
-                            const INV_TXFM_PARAM *param) {
-  int tx_type = param->tx_type;
+                            const TxfmParam *txfm_param) {
+  int tx_type = txfm_param->tx_type;
 #if CONFIG_DCT_ONLY
   assert(tx_type == DCT_DCT);
 #endif
@@ -1197,8 +1211,8 @@
 
 #if CONFIG_EXT_TX
 void av1_iht32x32_1024_add_c(const tran_low_t *input, uint8_t *dest, int stride,
-                             const INV_TXFM_PARAM *param) {
-  int tx_type = param->tx_type;
+                             const TxfmParam *txfm_param) {
+  int tx_type = txfm_param->tx_type;
 #if CONFIG_DCT_ONLY
   assert(tx_type == DCT_DCT);
 #endif
@@ -1258,8 +1272,8 @@
 
 #if CONFIG_TX64X64
 void av1_iht64x64_4096_add_c(const tran_low_t *input, uint8_t *dest, int stride,
-                             const INV_TXFM_PARAM *param) {
-  int tx_type = param->tx_type;
+                             const TxfmParam *txfm_param) {
+  int tx_type = txfm_param->tx_type;
 #if CONFIG_DCT_ONLY
   assert(tx_type == DCT_DCT);
 #endif
@@ -1324,17 +1338,17 @@
 
 // idct
 void av1_idct4x4_add(const tran_low_t *input, uint8_t *dest, int stride,
-                     const INV_TXFM_PARAM *param) {
-  const int eob = param->eob;
+                     const TxfmParam *txfm_param) {
+  const int eob = txfm_param->eob;
   if (eob > 1)
-    av1_iht4x4_16_add(input, dest, stride, param);
+    av1_iht4x4_16_add(input, dest, stride, txfm_param);
   else
     aom_idct4x4_1_add(input, dest, stride);
 }
 
 void av1_iwht4x4_add(const tran_low_t *input, uint8_t *dest, int stride,
-                     const INV_TXFM_PARAM *param) {
-  const int eob = param->eob;
+                     const TxfmParam *txfm_param) {
+  const int eob = txfm_param->eob;
   if (eob > 1)
     aom_iwht4x4_16_add(input, dest, stride);
   else
@@ -1342,7 +1356,7 @@
 }
 
 static void idct8x8_add(const tran_low_t *input, uint8_t *dest, int stride,
-                        const INV_TXFM_PARAM *param) {
+                        const TxfmParam *txfm_param) {
 // If dc is 1, then input[0] is the reconstructed value, do not need
 // dequantization. Also, when dc is 1, dc is counted in eobs, namely eobs >=1.
 
@@ -1351,12 +1365,12 @@
 // TODO(yunqingwang): "eobs = 1" case is also handled in av1_short_idct8x8_c.
 // Combine that with code here.
 #if CONFIG_ADAPT_SCAN
-  const int16_t half = param->eob_threshold[0];
+  const int16_t half = txfm_param->eob_threshold[0];
 #else
   const int16_t half = 12;
 #endif
 
-  const int eob = param->eob;
+  const int eob = txfm_param->eob;
   if (eob == 1)
     // DC only DCT coefficient
     aom_idct8x8_1_add(input, dest, stride);
@@ -1367,18 +1381,18 @@
 }
 
 static void idct16x16_add(const tran_low_t *input, uint8_t *dest, int stride,
-                          const INV_TXFM_PARAM *param) {
+                          const TxfmParam *txfm_param) {
 // The calculation can be simplified if there are not many non-zero dct
 // coefficients. Use eobs to separate different cases.
 #if CONFIG_ADAPT_SCAN
-  const int16_t half = param->eob_threshold[0];
-  const int16_t quarter = param->eob_threshold[1];
+  const int16_t half = txfm_param->eob_threshold[0];
+  const int16_t quarter = txfm_param->eob_threshold[1];
 #else
   const int16_t half = 38;
   const int16_t quarter = 10;
 #endif
 
-  const int eob = param->eob;
+  const int eob = txfm_param->eob;
   if (eob == 1) /* DC only DCT coefficient. */
     aom_idct16x16_1_add(input, dest, stride);
   else if (eob <= quarter)
@@ -1390,16 +1404,16 @@
 }
 
 static void idct32x32_add(const tran_low_t *input, uint8_t *dest, int stride,
-                          const INV_TXFM_PARAM *param) {
+                          const TxfmParam *txfm_param) {
 #if CONFIG_ADAPT_SCAN
-  const int16_t half = param->eob_threshold[0];
-  const int16_t quarter = param->eob_threshold[1];
+  const int16_t half = txfm_param->eob_threshold[0];
+  const int16_t quarter = txfm_param->eob_threshold[1];
 #else
   const int16_t half = 135;
   const int16_t quarter = 34;
 #endif
 
-  const int eob = param->eob;
+  const int eob = txfm_param->eob;
   if (eob == 1)
     aom_idct32x32_1_add(input, dest, stride);
   else if (eob <= quarter)
@@ -1414,15 +1428,15 @@
 
 #if CONFIG_TX64X64
 static void idct64x64_add(const tran_low_t *input, uint8_t *dest, int stride,
-                          const INV_TXFM_PARAM *param) {
-  (void)param;
+                          const TxfmParam *txfm_param) {
+  (void)txfm_param;
   av1_iht64x64_4096_add(input, dest, stride, DCT_DCT);
 }
 #endif  // CONFIG_TX64X64
 
 #if CONFIG_CHROMA_2X2
 static void inv_txfm_add_2x2(const tran_low_t *input, uint8_t *dest, int stride,
-                             const INV_TXFM_PARAM *param) {
+                             const TxfmParam *txfm_param) {
   tran_high_t a1 = input[0] >> UNIT_QUANT_SHIFT;
   tran_high_t b1 = input[1] >> UNIT_QUANT_SHIFT;
   tran_high_t c1 = input[2] >> UNIT_QUANT_SHIFT;
@@ -1433,7 +1447,7 @@
   tran_high_t c2 = a1 - c1;
   tran_high_t d2 = b1 - d1;
 
-  (void)param;
+  (void)txfm_param;
 
   a1 = (a2 + b2) >> 2;
   b1 = (a2 - b2) >> 2;
@@ -1448,17 +1462,17 @@
 #endif
 
 static void inv_txfm_add_4x4(const tran_low_t *input, uint8_t *dest, int stride,
-                             const INV_TXFM_PARAM *param) {
-  const TX_TYPE tx_type = param->tx_type;
-  if (param->lossless) {
+                             const TxfmParam *txfm_param) {
+  const TX_TYPE tx_type = txfm_param->tx_type;
+  if (txfm_param->lossless) {
     assert(tx_type == DCT_DCT);
-    av1_iwht4x4_add(input, dest, stride, param);
+    av1_iwht4x4_add(input, dest, stride, txfm_param);
     return;
   }
 
   switch (tx_type) {
 #if !CONFIG_DAALA_DCT4
-    case DCT_DCT: av1_idct4x4_add(input, dest, stride, param); break;
+    case DCT_DCT: av1_idct4x4_add(input, dest, stride, txfm_param); break;
 #else
     case DCT_DCT:
 #endif
@@ -1467,10 +1481,10 @@
     case ADST_ADST:
 #if CONFIG_LGT
       // LGT only exists in C verson
-      av1_iht4x4_16_add_c(input, dest, stride, param);
+      av1_iht4x4_16_add_c(input, dest, stride, txfm_param);
       break;
 #else
-      av1_iht4x4_16_add(input, dest, stride, param);
+      av1_iht4x4_16_add(input, dest, stride, txfm_param);
       break;
 #endif
 #if CONFIG_EXT_TX
@@ -1480,10 +1494,10 @@
     case ADST_FLIPADST:
     case FLIPADST_ADST:
 #if CONFIG_LGT
-      av1_iht4x4_16_add_c(input, dest, stride, param);
+      av1_iht4x4_16_add_c(input, dest, stride, txfm_param);
       break;
 #else
-      av1_iht4x4_16_add(input, dest, stride, param);
+      av1_iht4x4_16_add(input, dest, stride, txfm_param);
       break;
 #endif
     case V_DCT:
@@ -1493,7 +1507,7 @@
     case V_FLIPADST:
     case H_FLIPADST:
       // Use C version since DST only exists in C code
-      av1_iht4x4_16_add_c(input, dest, stride, param);
+      av1_iht4x4_16_add_c(input, dest, stride, txfm_param);
       break;
     case IDTX: inv_idtx_add_c(input, dest, stride, 4, tx_type); break;
 #endif  // CONFIG_EXT_TX
@@ -1502,103 +1516,103 @@
 }
 
 static void inv_txfm_add_4x8(const tran_low_t *input, uint8_t *dest, int stride,
-                             const INV_TXFM_PARAM *param) {
+                             const TxfmParam *txfm_param) {
 #if CONFIG_LGT
-  av1_iht4x8_32_add_c(input, dest, stride, param);
+  av1_iht4x8_32_add_c(input, dest, stride, txfm_param);
 #else
-  av1_iht4x8_32_add(input, dest, stride, param);
+  av1_iht4x8_32_add(input, dest, stride, txfm_param);
 #endif
 }
 
 static void inv_txfm_add_8x4(const tran_low_t *input, uint8_t *dest, int stride,
-                             const INV_TXFM_PARAM *param) {
+                             const TxfmParam *txfm_param) {
 #if CONFIG_LGT
-  av1_iht8x4_32_add_c(input, dest, stride, param);
+  av1_iht8x4_32_add_c(input, dest, stride, txfm_param);
 #else
-  av1_iht8x4_32_add(input, dest, stride, param);
+  av1_iht8x4_32_add(input, dest, stride, txfm_param);
 #endif
 }
 
 // These will be used by the masked-tx experiment in the future.
 #if CONFIG_RECT_TX && CONFIG_EXT_TX && CONFIG_RECT_TX_EXT
 static void inv_txfm_add_4x16(const tran_low_t *input, uint8_t *dest,
-                              int stride, const INV_TXFM_PARAM *param) {
+                              int stride, const TxfmParam *txfm_param) {
 #if CONFIG_LGT
-  av1_iht4x16_64_add_c(input, dest, stride, param);
+  av1_iht4x16_64_add_c(input, dest, stride, txfm_param);
 #else
-  av1_iht4x16_64_add(input, dest, stride, param);
+  av1_iht4x16_64_add(input, dest, stride, txfm_param);
 #endif
 }
 
 static void inv_txfm_add_16x4(const tran_low_t *input, uint8_t *dest,
-                              int stride, const INV_TXFM_PARAM *param) {
+                              int stride, const TxfmParam *txfm_param) {
 #if CONFIG_LGT
-  av1_iht16x4_64_add_c(input, dest, stride, param);
+  av1_iht16x4_64_add_c(input, dest, stride, txfm_param);
 #else
-  av1_iht16x4_64_add(input, dest, stride, param);
+  av1_iht16x4_64_add(input, dest, stride, txfm_param);
 #endif
 }
 
 static void inv_txfm_add_8x32(const tran_low_t *input, uint8_t *dest,
-                              int stride, const INV_TXFM_PARAM *param) {
+                              int stride, const TxfmParam *txfm_param) {
 #if CONFIG_LGT
-  av1_iht8x32_256_add_c(input, dest, stride, param);
+  av1_iht8x32_256_add_c(input, dest, stride, txfm_param);
 #else
-  av1_iht8x32_256_add(input, dest, stride, param);
+  av1_iht8x32_256_add(input, dest, stride, txfm_param);
 #endif
 }
 
 static void inv_txfm_add_32x8(const tran_low_t *input, uint8_t *dest,
-                              int stride, const INV_TXFM_PARAM *param) {
+                              int stride, const TxfmParam *txfm_param) {
 #if CONFIG_LGT
-  av1_iht32x8_256_add_c(input, dest, stride, param);
+  av1_iht32x8_256_add_c(input, dest, stride, txfm_param);
 #else
-  av1_iht32x8_256_add(input, dest, stride, param);
+  av1_iht32x8_256_add(input, dest, stride, txfm_param);
 #endif
 }
 #endif  // CONFIG_RECT_TX && CONFIG_EXT_TX && CONFIG_RECT_TX_EXT
 
 static void inv_txfm_add_8x16(const tran_low_t *input, uint8_t *dest,
-                              int stride, const INV_TXFM_PARAM *param) {
+                              int stride, const TxfmParam *txfm_param) {
 #if CONFIG_LGT
-  av1_iht8x16_128_add_c(input, dest, stride, param);
+  av1_iht8x16_128_add_c(input, dest, stride, txfm_param);
 #else
-  av1_iht8x16_128_add(input, dest, stride, param);
+  av1_iht8x16_128_add(input, dest, stride, txfm_param);
 #endif
 }
 
 static void inv_txfm_add_16x8(const tran_low_t *input, uint8_t *dest,
-                              int stride, const INV_TXFM_PARAM *param) {
+                              int stride, const TxfmParam *txfm_param) {
 #if CONFIG_LGT
-  av1_iht16x8_128_add_c(input, dest, stride, param);
+  av1_iht16x8_128_add_c(input, dest, stride, txfm_param);
 #else
-  av1_iht16x8_128_add(input, dest, stride, param);
+  av1_iht16x8_128_add(input, dest, stride, txfm_param);
 #endif
 }
 
 static void inv_txfm_add_16x32(const tran_low_t *input, uint8_t *dest,
-                               int stride, const INV_TXFM_PARAM *param) {
-  av1_iht16x32_512_add(input, dest, stride, param);
+                               int stride, const TxfmParam *txfm_param) {
+  av1_iht16x32_512_add(input, dest, stride, txfm_param);
 }
 
 static void inv_txfm_add_32x16(const tran_low_t *input, uint8_t *dest,
-                               int stride, const INV_TXFM_PARAM *param) {
-  av1_iht32x16_512_add(input, dest, stride, param);
+                               int stride, const TxfmParam *txfm_param) {
+  av1_iht32x16_512_add(input, dest, stride, txfm_param);
 }
 
 static void inv_txfm_add_8x8(const tran_low_t *input, uint8_t *dest, int stride,
-                             const INV_TXFM_PARAM *param) {
-  const TX_TYPE tx_type = param->tx_type;
+                             const TxfmParam *txfm_param) {
+  const TX_TYPE tx_type = txfm_param->tx_type;
   switch (tx_type) {
-    case DCT_DCT: idct8x8_add(input, dest, stride, param); break;
+    case DCT_DCT: idct8x8_add(input, dest, stride, txfm_param); break;
     case ADST_DCT:
     case DCT_ADST:
     case ADST_ADST:
 #if CONFIG_LGT
-      av1_iht8x8_64_add_c(input, dest, stride, param);
+      av1_iht8x8_64_add_c(input, dest, stride, txfm_param);
       break;
 #else
-      av1_iht8x8_64_add(input, dest, stride, param);
+      av1_iht8x8_64_add(input, dest, stride, txfm_param);
       break;
 #endif
 #if CONFIG_EXT_TX
@@ -1608,10 +1622,10 @@
     case ADST_FLIPADST:
     case FLIPADST_ADST:
 #if CONFIG_LGT
-      av1_iht8x8_64_add_c(input, dest, stride, param);
+      av1_iht8x8_64_add_c(input, dest, stride, txfm_param);
       break;
 #else
-      av1_iht8x8_64_add(input, dest, stride, param);
+      av1_iht8x8_64_add(input, dest, stride, txfm_param);
       break;
 #endif
     case V_DCT:
@@ -1621,7 +1635,7 @@
     case V_FLIPADST:
     case H_FLIPADST:
       // Use C version since DST only exists in C code
-      av1_iht8x8_64_add_c(input, dest, stride, param);
+      av1_iht8x8_64_add_c(input, dest, stride, txfm_param);
       break;
     case IDTX: inv_idtx_add_c(input, dest, stride, 8, tx_type); break;
 #endif  // CONFIG_EXT_TX
@@ -1630,13 +1644,15 @@
 }
 
 static void inv_txfm_add_16x16(const tran_low_t *input, uint8_t *dest,
-                               int stride, const INV_TXFM_PARAM *param) {
-  const TX_TYPE tx_type = param->tx_type;
+                               int stride, const TxfmParam *txfm_param) {
+  const TX_TYPE tx_type = txfm_param->tx_type;
   switch (tx_type) {
-    case DCT_DCT: idct16x16_add(input, dest, stride, param); break;
+    case DCT_DCT: idct16x16_add(input, dest, stride, txfm_param); break;
     case ADST_DCT:
     case DCT_ADST:
-    case ADST_ADST: av1_iht16x16_256_add(input, dest, stride, param); break;
+    case ADST_ADST:
+      av1_iht16x16_256_add(input, dest, stride, txfm_param);
+      break;
 #if CONFIG_EXT_TX
     case FLIPADST_DCT:
     case DCT_FLIPADST:
@@ -1648,7 +1664,9 @@
     case V_ADST:
     case H_ADST:
     case V_FLIPADST:
-    case H_FLIPADST: av1_iht16x16_256_add(input, dest, stride, param); break;
+    case H_FLIPADST:
+      av1_iht16x16_256_add(input, dest, stride, txfm_param);
+      break;
     case IDTX: inv_idtx_add_c(input, dest, stride, 16, tx_type); break;
 #endif  // CONFIG_EXT_TX
     default: assert(0); break;
@@ -1656,10 +1674,10 @@
 }
 
 static void inv_txfm_add_32x32(const tran_low_t *input, uint8_t *dest,
-                               int stride, const INV_TXFM_PARAM *param) {
-  const TX_TYPE tx_type = param->tx_type;
+                               int stride, const TxfmParam *txfm_param) {
+  const TX_TYPE tx_type = txfm_param->tx_type;
   switch (tx_type) {
-    case DCT_DCT: idct32x32_add(input, dest, stride, param); break;
+    case DCT_DCT: idct32x32_add(input, dest, stride, txfm_param); break;
 #if CONFIG_EXT_TX
     case ADST_DCT:
     case DCT_ADST:
@@ -1674,7 +1692,9 @@
     case V_ADST:
     case H_ADST:
     case V_FLIPADST:
-    case H_FLIPADST: av1_iht32x32_1024_add_c(input, dest, stride, param); break;
+    case H_FLIPADST:
+      av1_iht32x32_1024_add_c(input, dest, stride, txfm_param);
+      break;
     case IDTX: inv_idtx_add_c(input, dest, stride, 32, tx_type); break;
 #endif  // CONFIG_EXT_TX
     default: assert(0); break;
@@ -1683,10 +1703,10 @@
 
 #if CONFIG_TX64X64
 static void inv_txfm_add_64x64(const tran_low_t *input, uint8_t *dest,
-                               int stride, const INV_TXFM_PARAM *param) {
-  const TX_TYPE tx_type = param->tx_type;
+                               int stride, const TxfmParam *txfm_param) {
+  const TX_TYPE tx_type = txfm_param->tx_type;
   switch (tx_type) {
-    case DCT_DCT: idct64x64_add(input, dest, stride, param); break;
+    case DCT_DCT: idct64x64_add(input, dest, stride, txfm_param); break;
 #if CONFIG_EXT_TX
     case ADST_DCT:
     case DCT_ADST:
@@ -1701,7 +1721,9 @@
     case V_ADST:
     case H_ADST:
     case V_FLIPADST:
-    case H_FLIPADST: av1_iht64x64_4096_add_c(input, dest, stride, param); break;
+    case H_FLIPADST:
+      av1_iht64x64_4096_add_c(input, dest, stride, txfm_param);
+      break;
     case IDTX: inv_idtx_add_c(input, dest, stride, 64, tx_type); break;
 #endif  // CONFIG_EXT_TX
     default: assert(0); break;
@@ -1719,11 +1741,11 @@
 
 #if CONFIG_CHROMA_2X2
 static void highbd_inv_txfm_add_2x2(const tran_low_t *input, uint8_t *dest,
-                                    int stride, const INV_TXFM_PARAM *param) {
-  int eob = param->eob;
-  int bd = param->bd;
-  int lossless = param->lossless;
-  TX_TYPE tx_type = param->tx_type;
+                                    int stride, const TxfmParam *txfm_param) {
+  int eob = txfm_param->eob;
+  int bd = txfm_param->bd;
+  int lossless = txfm_param->lossless;
+  TX_TYPE tx_type = txfm_param->tx_type;
   tran_high_t a1 = input[0] >> UNIT_QUANT_SHIFT;
   tran_high_t b1 = input[1] >> UNIT_QUANT_SHIFT;
   tran_high_t c1 = input[2] >> UNIT_QUANT_SHIFT;
@@ -1753,12 +1775,12 @@
 #endif
 
 void av1_highbd_inv_txfm_add_4x4(const tran_low_t *input, uint8_t *dest,
-                                 int stride, const INV_TXFM_PARAM *param) {
-  int eob = param->eob;
-  int bd = param->bd;
-  int lossless = param->lossless;
+                                 int stride, const TxfmParam *txfm_param) {
+  int eob = txfm_param->eob;
+  int bd = txfm_param->bd;
+  int lossless = txfm_param->lossless;
   const int32_t *src = (const int32_t *)input;
-  TX_TYPE tx_type = param->tx_type;
+  TX_TYPE tx_type = txfm_param->tx_type;
   if (lossless) {
     assert(tx_type == DCT_DCT);
     av1_highbd_iwht4x4_add(input, dest, stride, eob, bd);
@@ -1798,51 +1820,51 @@
 }
 
 void av1_highbd_inv_txfm_add_4x8(const tran_low_t *input, uint8_t *dest,
-                                 int stride, const INV_TXFM_PARAM *param) {
+                                 int stride, const TxfmParam *txfm_param) {
   const int32_t *src = (const int32_t *)input;
   av1_inv_txfm2d_add_4x8_c(src, CONVERT_TO_SHORTPTR(dest), stride,
-                           param->tx_type, param->bd);
+                           txfm_param->tx_type, txfm_param->bd);
 }
 
 void av1_highbd_inv_txfm_add_8x4(const tran_low_t *input, uint8_t *dest,
-                                 int stride, const INV_TXFM_PARAM *param) {
+                                 int stride, const TxfmParam *txfm_param) {
   const int32_t *src = (const int32_t *)input;
   av1_inv_txfm2d_add_8x4_c(src, CONVERT_TO_SHORTPTR(dest), stride,
-                           param->tx_type, param->bd);
+                           txfm_param->tx_type, txfm_param->bd);
 }
 
 static void highbd_inv_txfm_add_8x16(const tran_low_t *input, uint8_t *dest,
-                                     int stride, const INV_TXFM_PARAM *param) {
+                                     int stride, const TxfmParam *txfm_param) {
   const int32_t *src = (const int32_t *)input;
   av1_inv_txfm2d_add_8x16_c(src, CONVERT_TO_SHORTPTR(dest), stride,
-                            param->tx_type, param->bd);
+                            txfm_param->tx_type, txfm_param->bd);
 }
 
 static void highbd_inv_txfm_add_16x8(const tran_low_t *input, uint8_t *dest,
-                                     int stride, const INV_TXFM_PARAM *param) {
+                                     int stride, const TxfmParam *txfm_param) {
   const int32_t *src = (const int32_t *)input;
   av1_inv_txfm2d_add_16x8_c(src, CONVERT_TO_SHORTPTR(dest), stride,
-                            param->tx_type, param->bd);
+                            txfm_param->tx_type, txfm_param->bd);
 }
 
 static void highbd_inv_txfm_add_16x32(const tran_low_t *input, uint8_t *dest,
-                                      int stride, const INV_TXFM_PARAM *param) {
+                                      int stride, const TxfmParam *txfm_param) {
   const int32_t *src = (const int32_t *)input;
   av1_inv_txfm2d_add_16x32_c(src, CONVERT_TO_SHORTPTR(dest), stride,
-                             param->tx_type, param->bd);
+                             txfm_param->tx_type, txfm_param->bd);
 }
 
 static void highbd_inv_txfm_add_32x16(const tran_low_t *input, uint8_t *dest,
-                                      int stride, const INV_TXFM_PARAM *param) {
+                                      int stride, const TxfmParam *txfm_param) {
   const int32_t *src = (const int32_t *)input;
   av1_inv_txfm2d_add_32x16_c(src, CONVERT_TO_SHORTPTR(dest), stride,
-                             param->tx_type, param->bd);
+                             txfm_param->tx_type, txfm_param->bd);
 }
 
 static void highbd_inv_txfm_add_8x8(const tran_low_t *input, uint8_t *dest,
-                                    int stride, const INV_TXFM_PARAM *param) {
-  int bd = param->bd;
-  TX_TYPE tx_type = param->tx_type;
+                                    int stride, const TxfmParam *txfm_param) {
+  int bd = txfm_param->bd;
+  TX_TYPE tx_type = txfm_param->tx_type;
   const int32_t *src = (const int32_t *)input;
   switch (tx_type) {
     case DCT_DCT:
@@ -1878,9 +1900,9 @@
 }
 
 static void highbd_inv_txfm_add_16x16(const tran_low_t *input, uint8_t *dest,
-                                      int stride, const INV_TXFM_PARAM *param) {
-  int bd = param->bd;
-  TX_TYPE tx_type = param->tx_type;
+                                      int stride, const TxfmParam *txfm_param) {
+  int bd = txfm_param->bd;
+  TX_TYPE tx_type = txfm_param->tx_type;
   const int32_t *src = (const int32_t *)input;
   switch (tx_type) {
     case DCT_DCT:
@@ -1916,9 +1938,9 @@
 }
 
 static void highbd_inv_txfm_add_32x32(const tran_low_t *input, uint8_t *dest,
-                                      int stride, const INV_TXFM_PARAM *param) {
-  int bd = param->bd;
-  TX_TYPE tx_type = param->tx_type;
+                                      int stride, const TxfmParam *txfm_param) {
+  int bd = txfm_param->bd;
+  TX_TYPE tx_type = txfm_param->tx_type;
   const int32_t *src = (const int32_t *)input;
   switch (tx_type) {
     case DCT_DCT:
@@ -1955,9 +1977,9 @@
 
 #if CONFIG_TX64X64
 static void highbd_inv_txfm_add_64x64(const tran_low_t *input, uint8_t *dest,
-                                      int stride, const INV_TXFM_PARAM *param) {
-  int bd = param->bd;
-  TX_TYPE tx_type = param->tx_type;
+                                      int stride, const TxfmParam *txfm_param) {
+  int bd = txfm_param->bd;
+  TX_TYPE tx_type = txfm_param->tx_type;
   const int32_t *src = (const int32_t *)input;
   switch (tx_type) {
     case DCT_DCT:
@@ -1998,65 +2020,65 @@
 #endif  // CONFIG_TX64X64
 
 void av1_inv_txfm_add(const tran_low_t *input, uint8_t *dest, int stride,
-                      INV_TXFM_PARAM *param) {
-  const TX_SIZE tx_size = param->tx_size;
+                      TxfmParam *txfm_param) {
+  const TX_SIZE tx_size = txfm_param->tx_size;
   switch (tx_size) {
 #if CONFIG_TX64X64
-    case TX_64X64: inv_txfm_add_64x64(input, dest, stride, param); break;
+    case TX_64X64: inv_txfm_add_64x64(input, dest, stride, txfm_param); break;
 #endif  // CONFIG_TX64X64
-    case TX_32X32: inv_txfm_add_32x32(input, dest, stride, param); break;
-    case TX_16X16: inv_txfm_add_16x16(input, dest, stride, param); break;
-    case TX_8X8: inv_txfm_add_8x8(input, dest, stride, param); break;
-    case TX_4X8: inv_txfm_add_4x8(input, dest, stride, param); break;
-    case TX_8X4: inv_txfm_add_8x4(input, dest, stride, param); break;
-    case TX_8X16: inv_txfm_add_8x16(input, dest, stride, param); break;
-    case TX_16X8: inv_txfm_add_16x8(input, dest, stride, param); break;
-    case TX_16X32: inv_txfm_add_16x32(input, dest, stride, param); break;
-    case TX_32X16: inv_txfm_add_32x16(input, dest, stride, param); break;
+    case TX_32X32: inv_txfm_add_32x32(input, dest, stride, txfm_param); break;
+    case TX_16X16: inv_txfm_add_16x16(input, dest, stride, txfm_param); break;
+    case TX_8X8: inv_txfm_add_8x8(input, dest, stride, txfm_param); break;
+    case TX_4X8: inv_txfm_add_4x8(input, dest, stride, txfm_param); break;
+    case TX_8X4: inv_txfm_add_8x4(input, dest, stride, txfm_param); break;
+    case TX_8X16: inv_txfm_add_8x16(input, dest, stride, txfm_param); break;
+    case TX_16X8: inv_txfm_add_16x8(input, dest, stride, txfm_param); break;
+    case TX_16X32: inv_txfm_add_16x32(input, dest, stride, txfm_param); break;
+    case TX_32X16: inv_txfm_add_32x16(input, dest, stride, txfm_param); break;
     case TX_4X4:
       // this is like av1_short_idct4x4 but has a special case around eob<=1
       // which is significant (not just an optimization) for the lossless
       // case.
-      inv_txfm_add_4x4(input, dest, stride, param);
+      inv_txfm_add_4x4(input, dest, stride, txfm_param);
       break;
 #if CONFIG_CHROMA_2X2
-    case TX_2X2: inv_txfm_add_2x2(input, dest, stride, param); break;
+    case TX_2X2: inv_txfm_add_2x2(input, dest, stride, txfm_param); break;
 #endif
 #if CONFIG_EXT_TX && CONFIG_RECT_TX && CONFIG_RECT_TX_EXT
-    case TX_32X8: inv_txfm_add_32x8(input, dest, stride, param); break;
-    case TX_8X32: inv_txfm_add_8x32(input, dest, stride, param); break;
-    case TX_16X4: inv_txfm_add_16x4(input, dest, stride, param); break;
-    case TX_4X16: inv_txfm_add_4x16(input, dest, stride, param); break;
+    case TX_32X8: inv_txfm_add_32x8(input, dest, stride, txfm_param); break;
+    case TX_8X32: inv_txfm_add_8x32(input, dest, stride, txfm_param); break;
+    case TX_16X4: inv_txfm_add_16x4(input, dest, stride, txfm_param); break;
+    case TX_4X16: inv_txfm_add_4x16(input, dest, stride, txfm_param); break;
 #endif
     default: assert(0 && "Invalid transform size"); break;
   }
 }
 
-static void init_inv_txfm_param(const MACROBLOCKD *xd, TX_SIZE tx_size,
-                                TX_TYPE tx_type, int eob, INV_TXFM_PARAM *inv) {
-  inv->tx_type = tx_type;
-  inv->tx_size = tx_size;
-  inv->eob = eob;
-  inv->lossless = xd->lossless[xd->mi[0]->mbmi.segment_id];
+static void init_txfm_param(const MACROBLOCKD *xd, TX_SIZE tx_size,
+                            TX_TYPE tx_type, int eob, TxfmParam *txfm_param) {
+  txfm_param->tx_type = tx_type;
+  txfm_param->tx_size = tx_size;
+  txfm_param->eob = eob;
+  txfm_param->lossless = xd->lossless[xd->mi[0]->mbmi.segment_id];
 #if CONFIG_HIGHBITDEPTH
-  inv->bd = xd->bd;
+  txfm_param->bd = xd->bd;
 #endif
 #if CONFIG_LGT
-  inv->is_inter = is_inter_block(&xd->mi[0]->mbmi);
+  txfm_param->is_inter = is_inter_block(&xd->mi[0]->mbmi);
 #endif
 #if CONFIG_ADAPT_SCAN
-  inv->eob_threshold =
+  txfm_param->eob_threshold =
       (const int16_t *)&xd->eob_threshold_md[tx_size][tx_type][0];
 #endif
 }
 
 typedef void (*InvTxfmFunc)(const tran_low_t *dqcoeff, uint8_t *dst, int stride,
-                            INV_TXFM_PARAM *param);
+                            TxfmParam *txfm_param);
 
 static InvTxfmFunc inv_txfm_func[2] = { av1_inv_txfm_add,
                                         av1_highbd_inv_txfm_add };
 
-// TODO(kslu) Change input arguments to INV_TXFM_PARAM, which contains mode,
+// TODO(kslu) Change input arguments to TxfmParam, which contains mode,
 // tx_type, tx_size, dst, stride, eob. Thus, the additional argument when LGT
 // is on will no longer be needed.
 void av1_inverse_transform_block(const MACROBLOCKD *xd,
@@ -2085,16 +2107,16 @@
   }
 #endif  // CONFIG_HIGHBITDEPTH
 #endif  // CONFIG_PVQ
-  INV_TXFM_PARAM inv_txfm_param;
-  init_inv_txfm_param(xd, tx_size, tx_type, eob, &inv_txfm_param);
+  TxfmParam txfm_param;
+  init_txfm_param(xd, tx_size, tx_type, eob, &txfm_param);
 #if CONFIG_LGT
-  inv_txfm_param.dst = dst;
-  inv_txfm_param.mode = mode;
-  inv_txfm_param.stride = stride;
+  txfm_param.dst = dst;
+  txfm_param.mode = mode;
+  txfm_param.stride = stride;
 #endif
 
   const int is_hbd = get_bitdepth_data_path_index(xd);
-  inv_txfm_func[is_hbd](dqcoeff, dst, stride, &inv_txfm_param);
+  inv_txfm_func[is_hbd](dqcoeff, dst, stride, &txfm_param);
 }
 
 void av1_inverse_transform_block_facade(MACROBLOCKD *xd, int plane, int block,
@@ -2118,29 +2140,51 @@
 }
 
 void av1_highbd_inv_txfm_add(const tran_low_t *input, uint8_t *dest, int stride,
-                             INV_TXFM_PARAM *param) {
-  const TX_SIZE tx_size = param->tx_size;
+                             TxfmParam *txfm_param) {
+  const TX_SIZE tx_size = txfm_param->tx_size;
   switch (tx_size) {
 #if CONFIG_TX64X64
-    case TX_64X64: highbd_inv_txfm_add_64x64(input, dest, stride, param); break;
+    case TX_64X64:
+      highbd_inv_txfm_add_64x64(input, dest, stride, txfm_param);
+      break;
 #endif  // CONFIG_TX64X64
-    case TX_32X32: highbd_inv_txfm_add_32x32(input, dest, stride, param); break;
-    case TX_16X16: highbd_inv_txfm_add_16x16(input, dest, stride, param); break;
-    case TX_8X8: highbd_inv_txfm_add_8x8(input, dest, stride, param); break;
-    case TX_4X8: av1_highbd_inv_txfm_add_4x8(input, dest, stride, param); break;
-    case TX_8X4: av1_highbd_inv_txfm_add_8x4(input, dest, stride, param); break;
-    case TX_8X16: highbd_inv_txfm_add_8x16(input, dest, stride, param); break;
-    case TX_16X8: highbd_inv_txfm_add_16x8(input, dest, stride, param); break;
-    case TX_16X32: highbd_inv_txfm_add_16x32(input, dest, stride, param); break;
-    case TX_32X16: highbd_inv_txfm_add_32x16(input, dest, stride, param); break;
+    case TX_32X32:
+      highbd_inv_txfm_add_32x32(input, dest, stride, txfm_param);
+      break;
+    case TX_16X16:
+      highbd_inv_txfm_add_16x16(input, dest, stride, txfm_param);
+      break;
+    case TX_8X8:
+      highbd_inv_txfm_add_8x8(input, dest, stride, txfm_param);
+      break;
+    case TX_4X8:
+      av1_highbd_inv_txfm_add_4x8(input, dest, stride, txfm_param);
+      break;
+    case TX_8X4:
+      av1_highbd_inv_txfm_add_8x4(input, dest, stride, txfm_param);
+      break;
+    case TX_8X16:
+      highbd_inv_txfm_add_8x16(input, dest, stride, txfm_param);
+      break;
+    case TX_16X8:
+      highbd_inv_txfm_add_16x8(input, dest, stride, txfm_param);
+      break;
+    case TX_16X32:
+      highbd_inv_txfm_add_16x32(input, dest, stride, txfm_param);
+      break;
+    case TX_32X16:
+      highbd_inv_txfm_add_32x16(input, dest, stride, txfm_param);
+      break;
     case TX_4X4:
       // this is like av1_short_idct4x4 but has a special case around eob<=1
       // which is significant (not just an optimization) for the lossless
       // case.
-      av1_highbd_inv_txfm_add_4x4(input, dest, stride, param);
+      av1_highbd_inv_txfm_add_4x4(input, dest, stride, txfm_param);
       break;
 #if CONFIG_CHROMA_2X2
-    case TX_2X2: highbd_inv_txfm_add_2x2(input, dest, stride, param); break;
+    case TX_2X2:
+      highbd_inv_txfm_add_2x2(input, dest, stride, txfm_param);
+      break;
 #endif
     default: assert(0 && "Invalid transform size"); break;
   }
diff --git a/av1/common/idct.h b/av1/common/idct.h
index 0591d4a..c2ca69b 100644
--- a/av1/common/idct.h
+++ b/av1/common/idct.h
@@ -26,38 +26,7 @@
 extern "C" {
 #endif
 
-// TODO(kslu) Combine FWD_TXFM_PARAM and INV_TXFM_PARAM into a common struct.
-// and move the common stuff in idct.h to av1_txfm.h or txfm_common.h
-typedef struct fwd_txfm_param {
-  TX_TYPE tx_type;
-  TX_SIZE tx_size;
-  int lossless;
-  int bd;
-#if CONFIG_LGT
-  int is_inter;
-  int stride;
-  PREDICTION_MODE mode;
-  uint8_t *dst;
-#endif
-} FWD_TXFM_PARAM;
-
-typedef struct inv_txfm_param {
-#if CONFIG_ADAPT_SCAN
-  const int16_t *eob_threshold;
-#endif
-  TX_TYPE tx_type;
-  TX_SIZE tx_size;
-  int eob;
-  int lossless;
-  int bd;
-#if CONFIG_LGT
-  int is_inter;
-  int stride;
-  PREDICTION_MODE mode;
-  uint8_t *dst;
-#endif
-} INV_TXFM_PARAM;
-
+// TODO(kslu) move the common stuff in idct.h to av1_txfm.h or txfm_common.h
 typedef void (*transform_1d)(const tran_low_t *, tran_low_t *);
 
 typedef struct {
@@ -76,12 +45,12 @@
 int av1_get_tx_scale(const TX_SIZE tx_size);
 
 void av1_iwht4x4_add(const tran_low_t *input, uint8_t *dest, int stride,
-                     const INV_TXFM_PARAM *inv_txfm_param);
+                     const TxfmParam *txfm_param);
 void av1_idct4x4_add(const tran_low_t *input, uint8_t *dest, int stride,
-                     const INV_TXFM_PARAM *inv_txfm_param);
+                     const TxfmParam *txfm_param);
 
 void av1_inv_txfm_add(const tran_low_t *input, uint8_t *dest, int stride,
-                      INV_TXFM_PARAM *inv_txfm_param);
+                      TxfmParam *txfm_param);
 void av1_inverse_transform_block(const MACROBLOCKD *xd,
                                  const tran_low_t *dqcoeff,
 #if CONFIG_LGT
@@ -95,13 +64,13 @@
 void av1_highbd_iwht4x4_add(const tran_low_t *input, uint8_t *dest, int stride,
                             int eob, int bd);
 void av1_highbd_inv_txfm_add_4x4(const tran_low_t *input, uint8_t *dest,
-                                 int stride, const INV_TXFM_PARAM *param);
+                                 int stride, const TxfmParam *param);
 void av1_highbd_inv_txfm_add_4x8(const tran_low_t *input, uint8_t *dest,
-                                 int stride, const INV_TXFM_PARAM *param);
+                                 int stride, const TxfmParam *param);
 void av1_highbd_inv_txfm_add_8x4(const tran_low_t *input, uint8_t *dest,
-                                 int stride, const INV_TXFM_PARAM *param);
+                                 int stride, const TxfmParam *param);
 void av1_highbd_inv_txfm_add(const tran_low_t *input, uint8_t *dest, int stride,
-                             INV_TXFM_PARAM *inv_txfm_param);
+                             TxfmParam *txfm_param);
 
 #if CONFIG_DPCM_INTRA
 void av1_dpcm_inv_txfm_add_4_c(const tran_low_t *input, int stride,
diff --git a/av1/common/mips/dspr2/av1_itrans16_dspr2.c b/av1/common/mips/dspr2/av1_itrans16_dspr2.c
index 3bbe1aa..1b33431 100644
--- a/av1/common/mips/dspr2/av1_itrans16_dspr2.c
+++ b/av1/common/mips/dspr2/av1_itrans16_dspr2.c
@@ -16,20 +16,19 @@
 #include "./av1_rtcd.h"
 #include "av1/common/common.h"
 #include "av1/common/blockd.h"
-#include "av1/common/idct.h"
 #include "aom_dsp/mips/inv_txfm_dspr2.h"
 #include "aom_dsp/txfm_common.h"
 #include "aom_ports/mem.h"
 
 #if HAVE_DSPR2
 void av1_iht16x16_256_add_dspr2(const int16_t *input, uint8_t *dest, int pitch,
-                                FWD_TXFM_PARAM *param) {
+                                TxfmParam *txfm_param) {
   int i, j;
   DECLARE_ALIGNED(32, int16_t, out[16 * 16]);
   int16_t *outptr = out;
   int16_t temp_out[16];
   uint32_t pos = 45;
-  int tx_type = param->tx_type;
+  int tx_type = txfm_param->tx_type;
 
   /* bit positon for extract from acc */
   __asm__ __volatile__("wrdsp    %[pos],    1    \n\t" : : [pos] "r"(pos));
diff --git a/av1/common/mips/dspr2/av1_itrans4_dspr2.c b/av1/common/mips/dspr2/av1_itrans4_dspr2.c
index 99eab2b..d9da3a1 100644
--- a/av1/common/mips/dspr2/av1_itrans4_dspr2.c
+++ b/av1/common/mips/dspr2/av1_itrans4_dspr2.c
@@ -16,20 +16,19 @@
 #include "./av1_rtcd.h"
 #include "av1/common/common.h"
 #include "av1/common/blockd.h"
-#include "av1/common/idct.h"
 #include "aom_dsp/mips/inv_txfm_dspr2.h"
 #include "aom_dsp/txfm_common.h"
 #include "aom_ports/mem.h"
 
 #if HAVE_DSPR2
 void av1_iht4x4_16_add_dspr2(const int16_t *input, uint8_t *dest,
-                             int dest_stride, FWD_TXFM_PARAM *param) {
+                             int dest_stride, TxfmParam *txfm_param) {
   int i, j;
   DECLARE_ALIGNED(32, int16_t, out[4 * 4]);
   int16_t *outptr = out;
   int16_t temp_in[4 * 4], temp_out[4];
   uint32_t pos = 45;
-  int tx_type = param->tx_type;
+  int tx_type = txfm_param->tx_type;
 
   /* bit positon for extract from acc */
   __asm__ __volatile__("wrdsp      %[pos],     1           \n\t"
diff --git a/av1/common/mips/dspr2/av1_itrans8_dspr2.c b/av1/common/mips/dspr2/av1_itrans8_dspr2.c
index 551c8fc..f62d5fa 100644
--- a/av1/common/mips/dspr2/av1_itrans8_dspr2.c
+++ b/av1/common/mips/dspr2/av1_itrans8_dspr2.c
@@ -16,20 +16,19 @@
 #include "./av1_rtcd.h"
 #include "av1/common/common.h"
 #include "av1/common/blockd.h"
-#include "av1/common/idct.h"
 #include "aom_dsp/mips/inv_txfm_dspr2.h"
 #include "aom_dsp/txfm_common.h"
 #include "aom_ports/mem.h"
 
 #if HAVE_DSPR2
 void av1_iht8x8_64_add_dspr2(const int16_t *input, uint8_t *dest,
-                             int dest_stride, FWD_TXFM_PARAM *param) {
+                             int dest_stride, TxfmParam *txfm_param) {
   int i, j;
   DECLARE_ALIGNED(32, int16_t, out[8 * 8]);
   int16_t *outptr = out;
   int16_t temp_in[8 * 8], temp_out[8];
   uint32_t pos = 45;
-  int tx_type = param->tx_type;
+  int tx_type = txfm_param->tx_type;
 
   /* bit positon for extract from acc */
   __asm__ __volatile__("wrdsp    %[pos],    1    \n\t" : : [pos] "r"(pos));
diff --git a/av1/common/mips/msa/av1_idct16x16_msa.c b/av1/common/mips/msa/av1_idct16x16_msa.c
index eb7d8c8..522cce0 100644
--- a/av1/common/mips/msa/av1_idct16x16_msa.c
+++ b/av1/common/mips/msa/av1_idct16x16_msa.c
@@ -12,15 +12,14 @@
 #include <assert.h>
 
 #include "av1/common/enums.h"
-#include "av1/common/idct.h"
 #include "aom_dsp/mips/inv_txfm_msa.h"
 
 void av1_iht16x16_256_add_msa(const int16_t *input, uint8_t *dst,
-                              int32_t dst_stride, FWD_TXFM_PARAM *param) {
+                              int32_t dst_stride, TxfmParam *txfm_param) {
   int32_t i;
   DECLARE_ALIGNED(32, int16_t, out[16 * 16]);
   int16_t *out_ptr = &out[0];
-  int32_t tx_type = param->tx_type;
+  int32_t tx_type = txfm_param->tx_type;
 
   switch (tx_type) {
     case DCT_DCT:
diff --git a/av1/common/mips/msa/av1_idct4x4_msa.c b/av1/common/mips/msa/av1_idct4x4_msa.c
index b5d1196..7a68dbb 100644
--- a/av1/common/mips/msa/av1_idct4x4_msa.c
+++ b/av1/common/mips/msa/av1_idct4x4_msa.c
@@ -12,13 +12,12 @@
 #include <assert.h>
 
 #include "av1/common/enums.h"
-#include "av1/common/idct.h"
 #include "aom_dsp/mips/inv_txfm_msa.h"
 
 void av1_iht4x4_16_add_msa(const int16_t *input, uint8_t *dst,
-                           int32_t dst_stride, FWD_TXFM_PARAM *param) {
+                           int32_t dst_stride, TxfmParam *txfm_param) {
   v8i16 in0, in1, in2, in3;
-  int32_t tx_type = param->tx_type;
+  int32_t tx_type = txfm_param->tx_type;
 
   /* load vector elements of 4x4 block */
   LD4x4_SH(input, in0, in1, in2, in3);
diff --git a/av1/common/mips/msa/av1_idct8x8_msa.c b/av1/common/mips/msa/av1_idct8x8_msa.c
index 6b1d489..c6ef61e 100644
--- a/av1/common/mips/msa/av1_idct8x8_msa.c
+++ b/av1/common/mips/msa/av1_idct8x8_msa.c
@@ -12,13 +12,12 @@
 #include <assert.h>
 
 #include "av1/common/enums.h"
-#include "av1/common/idct.h"
 #include "aom_dsp/mips/inv_txfm_msa.h"
 
 void av1_iht8x8_64_add_msa(const int16_t *input, uint8_t *dst,
-                           int32_t dst_stride, FWD_TXFM_PARAM *param) {
+                           int32_t dst_stride, TxfmParam *txfm_param) {
   v8i16 in0, in1, in2, in3, in4, in5, in6, in7;
-  int32_t tx_type = param->tx_type;
+  int32_t tx_type = txfm_param->tx_type;
 
   /* load vector elements of 8x8 block */
   LD_SH8(input, 8, in0, in1, in2, in3, in4, in5, in6, in7);
diff --git a/av1/common/x86/hybrid_inv_txfm_avx2.c b/av1/common/x86/hybrid_inv_txfm_avx2.c
index 617c995..0648b95 100644
--- a/av1/common/x86/hybrid_inv_txfm_avx2.c
+++ b/av1/common/x86/hybrid_inv_txfm_avx2.c
@@ -14,7 +14,6 @@
 #include "./aom_config.h"
 #include "./av1_rtcd.h"
 
-#include "av1/common/idct.h"
 #include "aom_dsp/x86/inv_txfm_common_avx2.h"
 
 void av1_idct16_avx2(__m256i *in) {
@@ -365,10 +364,9 @@
 #endif
 
 void av1_iht16x16_256_add_avx2(const tran_low_t *input, uint8_t *dest,
-                               int stride,
-                               const INV_TXFM_PARAM *inv_txfm_param) {
+                               int stride, const TxfmParam *txfm_param) {
   __m256i in[16];
-  int tx_type = inv_txfm_param->tx_type;
+  int tx_type = txfm_param->tx_type;
 
   load_buffer_16x16(input, in);
   switch (tx_type) {
diff --git a/av1/common/x86/idct_intrin_sse2.c b/av1/common/x86/idct_intrin_sse2.c
index 6bc1141..bf12a26 100644
--- a/av1/common/x86/idct_intrin_sse2.c
+++ b/av1/common/x86/idct_intrin_sse2.c
@@ -15,7 +15,6 @@
 #include "aom_dsp/x86/txfm_common_sse2.h"
 #include "aom_ports/mem.h"
 #include "av1/common/enums.h"
-#include "av1/common/idct.h"
 
 #if CONFIG_EXT_TX
 static INLINE void fliplr_4x4(__m128i *in /*in[2]*/) {
@@ -60,11 +59,11 @@
 #endif
 
 void av1_iht4x4_16_add_sse2(const tran_low_t *input, uint8_t *dest, int stride,
-                            const INV_TXFM_PARAM *inv_txfm_param) {
+                            const TxfmParam *txfm_param) {
   __m128i in[2];
   const __m128i zero = _mm_setzero_si128();
   const __m128i eight = _mm_set1_epi16(8);
-  int tx_type = inv_txfm_param->tx_type;
+  int tx_type = txfm_param->tx_type;
 
   in[0] = load_input_data(input);
   in[1] = load_input_data(input + 8);
@@ -152,11 +151,11 @@
 }
 
 void av1_iht8x8_64_add_sse2(const tran_low_t *input, uint8_t *dest, int stride,
-                            const INV_TXFM_PARAM *inv_txfm_param) {
+                            const TxfmParam *txfm_param) {
   __m128i in[8];
   const __m128i zero = _mm_setzero_si128();
   const __m128i final_rounding = _mm_set1_epi16(1 << 4);
-  int tx_type = inv_txfm_param->tx_type;
+  int tx_type = txfm_param->tx_type;
 
   // load input data
   in[0] = load_input_data(input);
@@ -254,12 +253,11 @@
 #endif  // CONFIG_EXT_TX
 
 void av1_iht16x16_256_add_sse2(const tran_low_t *input, uint8_t *dest,
-                               int stride,
-                               const INV_TXFM_PARAM *inv_txfm_param) {
+                               int stride, const TxfmParam *txfm_param) {
   __m128i in[32];
   __m128i *in0 = &in[0];
   __m128i *in1 = &in[16];
-  int tx_type = inv_txfm_param->tx_type;
+  int tx_type = txfm_param->tx_type;
 
   load_buffer_8x16(input, in0);
   input += 8;
@@ -393,10 +391,9 @@
 #endif  // CONFIG_EXT_TX
 
 void av1_iht8x16_128_add_sse2(const tran_low_t *input, uint8_t *dest,
-                              int stride,
-                              const INV_TXFM_PARAM *inv_txfm_param) {
+                              int stride, const TxfmParam *txfm_param) {
   __m128i in[16];
-  int tx_type = inv_txfm_param->tx_type;
+  int tx_type = txfm_param->tx_type;
 
   in[0] = load_input_data(input + 0 * 8);
   in[1] = load_input_data(input + 1 * 8);
@@ -560,10 +557,9 @@
 }
 
 void av1_iht16x8_128_add_sse2(const tran_low_t *input, uint8_t *dest,
-                              int stride,
-                              const INV_TXFM_PARAM *inv_txfm_param) {
+                              int stride, const TxfmParam *txfm_param) {
   __m128i in[16];
-  int tx_type = inv_txfm_param->tx_type;
+  int tx_type = txfm_param->tx_type;
 
   // Transpose 16x8 input into in[]
   in[0] = load_input_data(input + 0 * 16);
@@ -722,9 +718,9 @@
 }
 
 void av1_iht8x4_32_add_sse2(const tran_low_t *input, uint8_t *dest, int stride,
-                            const INV_TXFM_PARAM *inv_txfm_param) {
+                            const TxfmParam *txfm_param) {
   __m128i in[8];
-  int tx_type = inv_txfm_param->tx_type;
+  int tx_type = txfm_param->tx_type;
 
   in[0] = load_input_data(input + 0 * 8);
   in[1] = load_input_data(input + 1 * 8);
@@ -907,9 +903,9 @@
 }
 
 void av1_iht4x8_32_add_sse2(const tran_low_t *input, uint8_t *dest, int stride,
-                            const INV_TXFM_PARAM *inv_txfm_param) {
+                            const TxfmParam *txfm_param) {
   __m128i in[8];
-  int tx_type = inv_txfm_param->tx_type;
+  int tx_type = txfm_param->tx_type;
 
   // Load rows, packed two per element of 'in'.
   // We pack into the bottom half of 'in' so that the
@@ -1130,10 +1126,9 @@
 }
 
 void av1_iht16x32_512_add_sse2(const tran_low_t *input, uint8_t *dest,
-                               int stride,
-                               const INV_TXFM_PARAM *inv_txfm_param) {
+                               int stride, const TxfmParam *txfm_param) {
   __m128i intl[16], intr[16], inbl[16], inbr[16];
-  int tx_type = inv_txfm_param->tx_type;
+  int tx_type = txfm_param->tx_type;
 
   int i;
   for (i = 0; i < 16; ++i) {
@@ -1285,10 +1280,9 @@
 }
 
 void av1_iht32x16_512_add_sse2(const tran_low_t *input, uint8_t *dest,
-                               int stride,
-                               const INV_TXFM_PARAM *inv_txfm_param) {
+                               int stride, const TxfmParam *txfm_param) {
   __m128i in0[16], in1[16], in2[16], in3[16];
-  int tx_type = inv_txfm_param->tx_type;
+  int tx_type = txfm_param->tx_type;
   int i;
 
   for (i = 0; i < 16; ++i) {
diff --git a/av1/decoder/decodeframe.c b/av1/decoder/decodeframe.c
index 8b502d8..3e7a7c5 100644
--- a/av1/decoder/decodeframe.c
+++ b/av1/decoder/decodeframe.c
@@ -419,7 +419,7 @@
     int xdec = pd->subsampling_x;
     int seg_id = mbmi->segment_id;
     int16_t *quant;
-    FWD_TXFM_PARAM fwd_txfm_param;
+    TxfmParam txfm_param;
     // ToDo(yaowu): correct this with optimal number from decoding process.
     const int max_scan_line = tx_size_2d[tx_size];
 #if CONFIG_HIGHBITDEPTH
@@ -437,17 +437,17 @@
     }
 #endif
 
-    fwd_txfm_param.tx_type = tx_type;
-    fwd_txfm_param.tx_size = tx_size;
-    fwd_txfm_param.lossless = xd->lossless[seg_id];
+    txfm_param.tx_type = tx_type;
+    txfm_param.tx_size = tx_size;
+    txfm_param.lossless = xd->lossless[seg_id];
 
 #if CONFIG_HIGHBITDEPTH
     if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) {
-      fwd_txfm_param.bd = xd->bd;
-      av1_highbd_fwd_txfm(pred, pvq_ref_coeff, diff_stride, &fwd_txfm_param);
+      txfm_param.bd = xd->bd;
+      av1_highbd_fwd_txfm(pred, pvq_ref_coeff, diff_stride, &txfm_param);
     } else {
 #endif  // CONFIG_HIGHBITDEPTH
-      av1_fwd_txfm(pred, pvq_ref_coeff, diff_stride, &fwd_txfm_param);
+      av1_fwd_txfm(pred, pvq_ref_coeff, diff_stride, &txfm_param);
 #if CONFIG_HIGHBITDEPTH
     }
 #endif  // CONFIG_HIGHBITDEPTH
diff --git a/av1/encoder/dct.c b/av1/encoder/dct.c
index e9d166c..c989d49 100644
--- a/av1/encoder/dct.c
+++ b/av1/encoder/dct.c
@@ -1064,23 +1064,23 @@
 }
 
 // The get_fwd_lgt functions return 1 if LGT is chosen to apply, and 0 otherwise
-int get_fwd_lgt4(transform_1d tx_orig, FWD_TXFM_PARAM *fwd_txfm_param,
+int get_fwd_lgt4(transform_1d tx_orig, TxfmParam *txfm_param,
                  const tran_high_t *lgtmtx[], int ntx) {
   // inter/intra split
   if (tx_orig == &fadst4) {
     for (int i = 0; i < ntx; ++i)
-      lgtmtx[i] = fwd_txfm_param->is_inter ? &lgt4_170[0][0] : &lgt4_140[0][0];
+      lgtmtx[i] = txfm_param->is_inter ? &lgt4_170[0][0] : &lgt4_140[0][0];
     return 1;
   }
   return 0;
 }
 
-int get_fwd_lgt8(transform_1d tx_orig, FWD_TXFM_PARAM *fwd_txfm_param,
+int get_fwd_lgt8(transform_1d tx_orig, TxfmParam *txfm_param,
                  const tran_high_t *lgtmtx[], int ntx) {
   // inter/intra split
   if (tx_orig == &fadst8) {
     for (int i = 0; i < ntx; ++i)
-      lgtmtx[i] = fwd_txfm_param->is_inter ? &lgt8_170[0][0] : &lgt8_150[0][0];
+      lgtmtx[i] = txfm_param->is_inter ? &lgt8_170[0][0] : &lgt8_150[0][0];
     return 1;
   }
   return 0;
@@ -1215,8 +1215,8 @@
 #endif  // CONFIG_EXT_TX
 
 void av1_fht4x4_c(const int16_t *input, tran_low_t *output, int stride,
-                  FWD_TXFM_PARAM *fwd_txfm_param) {
-  int tx_type = fwd_txfm_param->tx_type;
+                  TxfmParam *txfm_param) {
+  int tx_type = txfm_param->tx_type;
 #if CONFIG_DCT_ONLY
   assert(tx_type == DCT_DCT);
 #endif
@@ -1262,8 +1262,8 @@
     // different rows/columns, indicated by the pointers to 2D arrays
     const tran_high_t *lgtmtx_col[4];
     const tran_high_t *lgtmtx_row[4];
-    int use_lgt_col = get_fwd_lgt4(ht.cols, fwd_txfm_param, lgtmtx_col, 4);
-    int use_lgt_row = get_fwd_lgt4(ht.rows, fwd_txfm_param, lgtmtx_row, 4);
+    int use_lgt_col = get_fwd_lgt4(ht.cols, txfm_param, lgtmtx_col, 4);
+    int use_lgt_row = get_fwd_lgt4(ht.rows, txfm_param, lgtmtx_row, 4);
 #endif
 
     // Columns
@@ -1303,8 +1303,8 @@
 }
 
 void av1_fht4x8_c(const int16_t *input, tran_low_t *output, int stride,
-                  FWD_TXFM_PARAM *fwd_txfm_param) {
-  int tx_type = fwd_txfm_param->tx_type;
+                  TxfmParam *txfm_param) {
+  int tx_type = txfm_param->tx_type;
 #if CONFIG_DCT_ONLY
   assert(tx_type == DCT_DCT);
 #endif
@@ -1342,8 +1342,8 @@
 #if CONFIG_LGT
   const tran_high_t *lgtmtx_col[4];
   const tran_high_t *lgtmtx_row[8];
-  int use_lgt_col = get_fwd_lgt8(ht.cols, fwd_txfm_param, lgtmtx_col, 4);
-  int use_lgt_row = get_fwd_lgt4(ht.rows, fwd_txfm_param, lgtmtx_row, 8);
+  int use_lgt_col = get_fwd_lgt8(ht.cols, txfm_param, lgtmtx_col, 4);
+  int use_lgt_row = get_fwd_lgt4(ht.rows, txfm_param, lgtmtx_row, 8);
 #endif
 
   // Rows
@@ -1376,8 +1376,8 @@
 }
 
 void av1_fht8x4_c(const int16_t *input, tran_low_t *output, int stride,
-                  FWD_TXFM_PARAM *fwd_txfm_param) {
-  int tx_type = fwd_txfm_param->tx_type;
+                  TxfmParam *txfm_param) {
+  int tx_type = txfm_param->tx_type;
 #if CONFIG_DCT_ONLY
   assert(tx_type == DCT_DCT);
 #endif
@@ -1415,8 +1415,8 @@
 #if CONFIG_LGT
   const tran_high_t *lgtmtx_col[8];
   const tran_high_t *lgtmtx_row[4];
-  int use_lgt_col = get_fwd_lgt4(ht.cols, fwd_txfm_param, lgtmtx_col, 8);
-  int use_lgt_row = get_fwd_lgt8(ht.rows, fwd_txfm_param, lgtmtx_row, 4);
+  int use_lgt_col = get_fwd_lgt4(ht.cols, txfm_param, lgtmtx_col, 8);
+  int use_lgt_row = get_fwd_lgt8(ht.rows, txfm_param, lgtmtx_row, 4);
 #endif
 
   // Columns
@@ -1449,8 +1449,8 @@
 }
 
 void av1_fht4x16_c(const int16_t *input, tran_low_t *output, int stride,
-                   FWD_TXFM_PARAM *fwd_txfm_param) {
-  int tx_type = fwd_txfm_param->tx_type;
+                   TxfmParam *txfm_param) {
+  int tx_type = txfm_param->tx_type;
 #if CONFIG_DCT_ONLY
   assert(tx_type == DCT_DCT);
 #endif
@@ -1487,7 +1487,7 @@
 
 #if CONFIG_LGT
   const tran_high_t *lgtmtx_row[16];
-  int use_lgt_row = get_fwd_lgt4(ht.rows, fwd_txfm_param, lgtmtx_row, 16);
+  int use_lgt_row = get_fwd_lgt4(ht.rows, txfm_param, lgtmtx_row, 16);
 #endif
 
   // Rows
@@ -1513,8 +1513,8 @@
 }
 
 void av1_fht16x4_c(const int16_t *input, tran_low_t *output, int stride,
-                   FWD_TXFM_PARAM *fwd_txfm_param) {
-  int tx_type = fwd_txfm_param->tx_type;
+                   TxfmParam *txfm_param) {
+  int tx_type = txfm_param->tx_type;
 #if CONFIG_DCT_ONLY
   assert(tx_type == DCT_DCT);
 #endif
@@ -1551,7 +1551,7 @@
 
 #if CONFIG_LGT
   const tran_high_t *lgtmtx_col[16];
-  int use_lgt_col = get_fwd_lgt4(ht.cols, fwd_txfm_param, lgtmtx_col, 16);
+  int use_lgt_col = get_fwd_lgt4(ht.cols, txfm_param, lgtmtx_col, 16);
 #endif
 
   // Columns
@@ -1577,8 +1577,8 @@
 }
 
 void av1_fht8x16_c(const int16_t *input, tran_low_t *output, int stride,
-                   FWD_TXFM_PARAM *fwd_txfm_param) {
-  int tx_type = fwd_txfm_param->tx_type;
+                   TxfmParam *txfm_param) {
+  int tx_type = txfm_param->tx_type;
 #if CONFIG_DCT_ONLY
   assert(tx_type == DCT_DCT);
 #endif
@@ -1615,7 +1615,7 @@
 
 #if CONFIG_LGT
   const tran_high_t *lgtmtx_row[16];
-  int use_lgt_row = get_fwd_lgt8(ht.rows, fwd_txfm_param, lgtmtx_row, 16);
+  int use_lgt_row = get_fwd_lgt8(ht.rows, txfm_param, lgtmtx_row, 16);
 #endif
 
   // Rows
@@ -1643,8 +1643,8 @@
 }
 
 void av1_fht16x8_c(const int16_t *input, tran_low_t *output, int stride,
-                   FWD_TXFM_PARAM *fwd_txfm_param) {
-  int tx_type = fwd_txfm_param->tx_type;
+                   TxfmParam *txfm_param) {
+  int tx_type = txfm_param->tx_type;
 #if CONFIG_DCT_ONLY
   assert(tx_type == DCT_DCT);
 #endif
@@ -1681,7 +1681,7 @@
 
 #if CONFIG_LGT
   const tran_high_t *lgtmtx_col[16];
-  int use_lgt_col = get_fwd_lgt8(ht.cols, fwd_txfm_param, lgtmtx_col, 16);
+  int use_lgt_col = get_fwd_lgt8(ht.cols, txfm_param, lgtmtx_col, 16);
 #endif
 
   // Columns
@@ -1709,8 +1709,8 @@
 }
 
 void av1_fht8x32_c(const int16_t *input, tran_low_t *output, int stride,
-                   FWD_TXFM_PARAM *fwd_txfm_param) {
-  int tx_type = fwd_txfm_param->tx_type;
+                   TxfmParam *txfm_param) {
+  int tx_type = txfm_param->tx_type;
 #if CONFIG_DCT_ONLY
   assert(tx_type == DCT_DCT);
 #endif
@@ -1747,7 +1747,7 @@
 
 #if CONFIG_LGT
   const tran_high_t *lgtmtx_row[32];
-  int use_lgt_row = get_fwd_lgt8(ht.rows, fwd_txfm_param, lgtmtx_row, 32);
+  int use_lgt_row = get_fwd_lgt8(ht.rows, txfm_param, lgtmtx_row, 32);
 #endif
 
   // Rows
@@ -1773,8 +1773,8 @@
 }
 
 void av1_fht32x8_c(const int16_t *input, tran_low_t *output, int stride,
-                   FWD_TXFM_PARAM *fwd_txfm_param) {
-  int tx_type = fwd_txfm_param->tx_type;
+                   TxfmParam *txfm_param) {
+  int tx_type = txfm_param->tx_type;
 #if CONFIG_DCT_ONLY
   assert(tx_type == DCT_DCT);
 #endif
@@ -1811,7 +1811,7 @@
 
 #if CONFIG_LGT
   const tran_high_t *lgtmtx_col[32];
-  int use_lgt_col = get_fwd_lgt8(ht.cols, fwd_txfm_param, lgtmtx_col, 32);
+  int use_lgt_col = get_fwd_lgt8(ht.cols, txfm_param, lgtmtx_col, 32);
 #endif
 
   // Columns
@@ -1837,8 +1837,8 @@
 }
 
 void av1_fht16x32_c(const int16_t *input, tran_low_t *output, int stride,
-                    FWD_TXFM_PARAM *fwd_txfm_param) {
-  int tx_type = fwd_txfm_param->tx_type;
+                    TxfmParam *txfm_param) {
+  int tx_type = txfm_param->tx_type;
 #if CONFIG_DCT_ONLY
   assert(tx_type == DCT_DCT);
 #endif
@@ -1893,8 +1893,8 @@
 }
 
 void av1_fht32x16_c(const int16_t *input, tran_low_t *output, int stride,
-                    FWD_TXFM_PARAM *fwd_txfm_param) {
-  int tx_type = fwd_txfm_param->tx_type;
+                    TxfmParam *txfm_param) {
+  int tx_type = txfm_param->tx_type;
 #if CONFIG_DCT_ONLY
   assert(tx_type == DCT_DCT);
 #endif
@@ -2074,8 +2074,8 @@
 }
 
 void av1_fht8x8_c(const int16_t *input, tran_low_t *output, int stride,
-                  FWD_TXFM_PARAM *fwd_txfm_param) {
-  int tx_type = fwd_txfm_param->tx_type;
+                  TxfmParam *txfm_param) {
+  int tx_type = txfm_param->tx_type;
 #if CONFIG_DCT_ONLY
   assert(tx_type == DCT_DCT);
 #endif
@@ -2115,8 +2115,8 @@
 #if CONFIG_LGT
     const tran_high_t *lgtmtx_col[8];
     const tran_high_t *lgtmtx_row[8];
-    int use_lgt_col = get_fwd_lgt8(ht.cols, fwd_txfm_param, lgtmtx_col, 8);
-    int use_lgt_row = get_fwd_lgt8(ht.rows, fwd_txfm_param, lgtmtx_row, 8);
+    int use_lgt_col = get_fwd_lgt8(ht.cols, txfm_param, lgtmtx_col, 8);
+    int use_lgt_row = get_fwd_lgt8(ht.rows, txfm_param, lgtmtx_row, 8);
 #endif
 
     // Columns
@@ -2203,8 +2203,8 @@
 }
 
 void av1_fht16x16_c(const int16_t *input, tran_low_t *output, int stride,
-                    FWD_TXFM_PARAM *fwd_txfm_param) {
-  int tx_type = fwd_txfm_param->tx_type;
+                    TxfmParam *txfm_param) {
+  int tx_type = txfm_param->tx_type;
 #if CONFIG_DCT_ONLY
   assert(tx_type == DCT_DCT);
 #endif
@@ -2260,8 +2260,8 @@
 }
 
 void av1_fht32x32_c(const int16_t *input, tran_low_t *output, int stride,
-                    FWD_TXFM_PARAM *fwd_txfm_param) {
-  int tx_type = fwd_txfm_param->tx_type;
+                    TxfmParam *txfm_param) {
+  int tx_type = txfm_param->tx_type;
 #if CONFIG_DCT_ONLY
   assert(tx_type == DCT_DCT);
 #endif
@@ -2352,8 +2352,8 @@
 }
 
 void av1_fht64x64_c(const int16_t *input, tran_low_t *output, int stride,
-                    FWD_TXFM_PARAM *fwd_txfm_param) {
-  int tx_type = fwd_txfm_param->tx_type;
+                    TxfmParam *txfm_param) {
+  int tx_type = txfm_param->tx_type;
 #if CONFIG_DCT_ONLY
   assert(tx_type == DCT_DCT);
 #endif
diff --git a/av1/encoder/encodemb.c b/av1/encoder/encodemb.c
index 6c167fe..b397f73 100644
--- a/av1/encoder/encodemb.c
+++ b/av1/encoder/encodemb.c
@@ -490,7 +490,7 @@
 #endif  // !CONFIG_PVQ
 
 typedef void (*fwdTxfmFunc)(const int16_t *diff, tran_low_t *coeff, int stride,
-                            FWD_TXFM_PARAM *param);
+                            TxfmParam *txfm_param);
 static const fwdTxfmFunc fwd_txfm_func[2] = { av1_fwd_txfm,
                                               av1_highbd_fwd_txfm };
 
@@ -532,7 +532,7 @@
           : cm->giqmatrix[NUM_QM_LEVELS - 1][0][0][tx_size];
 #endif
 
-  FWD_TXFM_PARAM fwd_txfm_param;
+  TxfmParam txfm_param;
 
 #if CONFIG_PVQ || CONFIG_DAALA_DIST || CONFIG_LGT
   uint8_t *dst;
@@ -623,20 +623,20 @@
 
   (void)ctx;
 
-  fwd_txfm_param.tx_type = tx_type;
-  fwd_txfm_param.tx_size = tx_size;
-  fwd_txfm_param.lossless = xd->lossless[mbmi->segment_id];
+  txfm_param.tx_type = tx_type;
+  txfm_param.tx_size = tx_size;
+  txfm_param.lossless = xd->lossless[mbmi->segment_id];
 #if CONFIG_LGT
-  fwd_txfm_param.is_inter = is_inter_block(mbmi);
-  fwd_txfm_param.dst = dst;
-  fwd_txfm_param.stride = dst_stride;
-  fwd_txfm_param.mode = get_prediction_mode(xd->mi[0], plane, tx_size, block);
+  txfm_param.is_inter = is_inter_block(mbmi);
+  txfm_param.dst = dst;
+  txfm_param.stride = dst_stride;
+  txfm_param.mode = get_prediction_mode(xd->mi[0], plane, tx_size, block);
 #endif
 
 #if !CONFIG_PVQ
-  fwd_txfm_param.bd = xd->bd;
+  txfm_param.bd = xd->bd;
   const int is_hbd = get_bitdepth_data_path_index(xd);
-  fwd_txfm_func[is_hbd](src_diff, coeff, diff_stride, &fwd_txfm_param);
+  fwd_txfm_func[is_hbd](src_diff, coeff, diff_stride, &txfm_param);
 
   if (xform_quant_idx != AV1_XFORM_QUANT_SKIP_QUANT) {
     if (LIKELY(!x->skip_block)) {
@@ -654,14 +654,14 @@
 #else  // CONFIG_PVQ
   (void)xform_quant_idx;
 #if CONFIG_HIGHBITDEPTH
-  fwd_txfm_param.bd = xd->bd;
+  txfm_param.bd = xd->bd;
   if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) {
-    av1_highbd_fwd_txfm(src_int16, coeff, diff_stride, &fwd_txfm_param);
-    av1_highbd_fwd_txfm(pred, ref_coeff, diff_stride, &fwd_txfm_param);
+    av1_highbd_fwd_txfm(src_int16, coeff, diff_stride, &txfm_param);
+    av1_highbd_fwd_txfm(pred, ref_coeff, diff_stride, &txfm_param);
   } else {
 #endif
-    av1_fwd_txfm(src_int16, coeff, diff_stride, &fwd_txfm_param);
-    av1_fwd_txfm(pred, ref_coeff, diff_stride, &fwd_txfm_param);
+    av1_fwd_txfm(src_int16, coeff, diff_stride, &txfm_param);
+    av1_fwd_txfm(pred, ref_coeff, diff_stride, &txfm_param);
 #if CONFIG_HIGHBITDEPTH
   }
 #endif
@@ -827,7 +827,7 @@
   struct macroblock_plane *const p = &x->plane[plane];
   struct macroblockd_plane *const pd = &xd->plane[plane];
   tran_low_t *const dqcoeff = BLOCK_OFFSET(pd->dqcoeff, block);
-  INV_TXFM_PARAM inv_txfm_param;
+  TxfmParam txfm_param;
   uint8_t *dst;
   int ctx = 0;
   dst = &pd->dst
@@ -863,21 +863,20 @@
 #endif  // CONFIG_HIGHBITDEPTH
     }
 #endif  // !CONFIG_PVQ
-    inv_txfm_param.bd = xd->bd;
-    inv_txfm_param.tx_type = DCT_DCT;
-    inv_txfm_param.eob = p->eobs[block];
-    inv_txfm_param.lossless = xd->lossless[xd->mi[0]->mbmi.segment_id];
+    txfm_param.bd = xd->bd;
+    txfm_param.tx_type = DCT_DCT;
+    txfm_param.eob = p->eobs[block];
+    txfm_param.lossless = xd->lossless[xd->mi[0]->mbmi.segment_id];
 #if CONFIG_HIGHBITDEPTH
     if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) {
-      av1_highbd_inv_txfm_add_4x4(dqcoeff, dst, pd->dst.stride,
-                                  &inv_txfm_param);
+      av1_highbd_inv_txfm_add_4x4(dqcoeff, dst, pd->dst.stride, &txfm_param);
       return;
     }
 #endif  //  CONFIG_HIGHBITDEPTH
     if (xd->lossless[xd->mi[0]->mbmi.segment_id]) {
-      av1_iwht4x4_add(dqcoeff, dst, pd->dst.stride, &inv_txfm_param);
+      av1_iwht4x4_add(dqcoeff, dst, pd->dst.stride, &txfm_param);
     } else {
-      av1_idct4x4_add(dqcoeff, dst, pd->dst.stride, &inv_txfm_param);
+      av1_idct4x4_add(dqcoeff, dst, pd->dst.stride, &txfm_param);
     }
   }
 }
diff --git a/av1/encoder/hybrid_fwd_txfm.c b/av1/encoder/hybrid_fwd_txfm.c
index bc5b976..1e53c63 100644
--- a/av1/encoder/hybrid_fwd_txfm.c
+++ b/av1/encoder/hybrid_fwd_txfm.c
@@ -18,7 +18,7 @@
 
 #if CONFIG_CHROMA_2X2
 static void fwd_txfm_2x2(const int16_t *src_diff, tran_low_t *coeff,
-                         int diff_stride, FWD_TXFM_PARAM *fwd_txfm_param) {
+                         int diff_stride, TxfmParam *txfm_param) {
   tran_high_t a1 = src_diff[0];
   tran_high_t b1 = src_diff[1];
   tran_high_t c1 = src_diff[diff_stride];
@@ -39,145 +39,144 @@
   coeff[2] = (tran_low_t)(4 * c1);
   coeff[3] = (tran_low_t)(4 * d1);
 
-  (void)fwd_txfm_param;
+  (void)txfm_param;
 }
 #endif
 
 static void fwd_txfm_4x4(const int16_t *src_diff, tran_low_t *coeff,
-                         int diff_stride, FWD_TXFM_PARAM *fwd_txfm_param) {
-  if (fwd_txfm_param->lossless) {
-    assert(fwd_txfm_param->tx_type == DCT_DCT);
+                         int diff_stride, TxfmParam *txfm_param) {
+  if (txfm_param->lossless) {
+    assert(txfm_param->tx_type == DCT_DCT);
     av1_fwht4x4(src_diff, coeff, diff_stride);
     return;
   }
 
 #if CONFIG_LGT
   // only C version has LGTs
-  av1_fht4x4_c(src_diff, coeff, diff_stride, fwd_txfm_param);
+  av1_fht4x4_c(src_diff, coeff, diff_stride, txfm_param);
 #else
-  av1_fht4x4(src_diff, coeff, diff_stride, fwd_txfm_param);
+  av1_fht4x4(src_diff, coeff, diff_stride, txfm_param);
 #endif
 }
 
 static void fwd_txfm_4x8(const int16_t *src_diff, tran_low_t *coeff,
-                         int diff_stride, FWD_TXFM_PARAM *fwd_txfm_param) {
+                         int diff_stride, TxfmParam *txfm_param) {
 #if CONFIG_LGT
-  av1_fht4x8_c(src_diff, coeff, diff_stride, fwd_txfm_param);
+  av1_fht4x8_c(src_diff, coeff, diff_stride, txfm_param);
 #else
-  av1_fht4x8(src_diff, coeff, diff_stride, fwd_txfm_param);
+  av1_fht4x8(src_diff, coeff, diff_stride, txfm_param);
 #endif
 }
 
 static void fwd_txfm_8x4(const int16_t *src_diff, tran_low_t *coeff,
-                         int diff_stride, FWD_TXFM_PARAM *fwd_txfm_param) {
+                         int diff_stride, TxfmParam *txfm_param) {
 #if CONFIG_LGT
-  av1_fht8x4_c(src_diff, coeff, diff_stride, fwd_txfm_param);
+  av1_fht8x4_c(src_diff, coeff, diff_stride, txfm_param);
 #else
-  av1_fht8x4(src_diff, coeff, diff_stride, fwd_txfm_param);
+  av1_fht8x4(src_diff, coeff, diff_stride, txfm_param);
 #endif
 }
 
 static void fwd_txfm_8x16(const int16_t *src_diff, tran_low_t *coeff,
-                          int diff_stride, FWD_TXFM_PARAM *fwd_txfm_param) {
+                          int diff_stride, TxfmParam *txfm_param) {
 #if CONFIG_LGT
-  av1_fht8x16_c(src_diff, coeff, diff_stride, fwd_txfm_param);
+  av1_fht8x16_c(src_diff, coeff, diff_stride, txfm_param);
 #else
-  av1_fht8x16(src_diff, coeff, diff_stride, fwd_txfm_param);
+  av1_fht8x16(src_diff, coeff, diff_stride, txfm_param);
 #endif
 }
 
 static void fwd_txfm_16x8(const int16_t *src_diff, tran_low_t *coeff,
-                          int diff_stride, FWD_TXFM_PARAM *fwd_txfm_param) {
+                          int diff_stride, TxfmParam *txfm_param) {
 #if CONFIG_LGT
-  av1_fht16x8_c(src_diff, coeff, diff_stride, fwd_txfm_param);
+  av1_fht16x8_c(src_diff, coeff, diff_stride, txfm_param);
 #else
-  av1_fht16x8(src_diff, coeff, diff_stride, fwd_txfm_param);
+  av1_fht16x8(src_diff, coeff, diff_stride, txfm_param);
 #endif
 }
 
 static void fwd_txfm_16x32(const int16_t *src_diff, tran_low_t *coeff,
-                           int diff_stride, FWD_TXFM_PARAM *fwd_txfm_param) {
-  av1_fht16x32(src_diff, coeff, diff_stride, fwd_txfm_param);
+                           int diff_stride, TxfmParam *txfm_param) {
+  av1_fht16x32(src_diff, coeff, diff_stride, txfm_param);
 }
 
 static void fwd_txfm_32x16(const int16_t *src_diff, tran_low_t *coeff,
-                           int diff_stride, FWD_TXFM_PARAM *fwd_txfm_param) {
-  av1_fht32x16(src_diff, coeff, diff_stride, fwd_txfm_param);
+                           int diff_stride, TxfmParam *txfm_param) {
+  av1_fht32x16(src_diff, coeff, diff_stride, txfm_param);
 }
 
 static void fwd_txfm_8x8(const int16_t *src_diff, tran_low_t *coeff,
-                         int diff_stride, FWD_TXFM_PARAM *fwd_txfm_param) {
+                         int diff_stride, TxfmParam *txfm_param) {
 #if CONFIG_LGT
-  av1_fht8x8_c(src_diff, coeff, diff_stride, fwd_txfm_param);
+  av1_fht8x8_c(src_diff, coeff, diff_stride, txfm_param);
 #else
-  av1_fht8x8(src_diff, coeff, diff_stride, fwd_txfm_param);
+  av1_fht8x8(src_diff, coeff, diff_stride, txfm_param);
 #endif
 }
 
 static void fwd_txfm_16x16(const int16_t *src_diff, tran_low_t *coeff,
-                           int diff_stride, FWD_TXFM_PARAM *fwd_txfm_param) {
-  av1_fht16x16(src_diff, coeff, diff_stride, fwd_txfm_param);
+                           int diff_stride, TxfmParam *txfm_param) {
+  av1_fht16x16(src_diff, coeff, diff_stride, txfm_param);
 }
 
 static void fwd_txfm_32x32(const int16_t *src_diff, tran_low_t *coeff,
-                           int diff_stride, FWD_TXFM_PARAM *fwd_txfm_param) {
-  av1_fht32x32(src_diff, coeff, diff_stride, fwd_txfm_param);
+                           int diff_stride, TxfmParam *txfm_param) {
+  av1_fht32x32(src_diff, coeff, diff_stride, txfm_param);
 }
 
 #if CONFIG_TX64X64
 static void fwd_txfm_64x64(const int16_t *src_diff, tran_low_t *coeff,
-                           int diff_stride, FWD_TXFM_PARAM *fwd_txfm_param) {
+                           int diff_stride, TxfmParam *txfm_param) {
 #if CONFIG_EXT_TX
-  if (fwd_txfm_param->tx_type == IDTX)
-    av1_fwd_idtx_c(src_diff, coeff, diff_stride, 64, fwd_txfm_param->tx_type);
+  if (txfm_param->tx_type == IDTX)
+    av1_fwd_idtx_c(src_diff, coeff, diff_stride, 64, txfm_param->tx_type);
   else
 #endif
-    av1_fht64x64(src_diff, coeff, diff_stride, fwd_txfm_param);
+    av1_fht64x64(src_diff, coeff, diff_stride, txfm_param);
 }
 #endif  // CONFIG_TX64X64
 
 #if CONFIG_EXT_TX && CONFIG_RECT_TX && CONFIG_RECT_TX_EXT
 static void fwd_txfm_16x4(const int16_t *src_diff, tran_low_t *coeff,
-                          int diff_stride, FWD_TXFM_PARAM *fwd_txfm_param) {
+                          int diff_stride, TxfmParam *txfm_param) {
 #if CONFIG_LGT
-  av1_fht16x4_c(src_diff, coeff, diff_stride, fwd_txfm_param);
+  av1_fht16x4_c(src_diff, coeff, diff_stride, txfm_param);
 #else
-  av1_fht16x4(src_diff, coeff, diff_stride, fwd_txfm_param);
+  av1_fht16x4(src_diff, coeff, diff_stride, txfm_param);
 #endif
 }
 
 static void fwd_txfm_4x16(const int16_t *src_diff, tran_low_t *coeff,
-                          int diff_stride, FWD_TXFM_PARAM *fwd_txfm_param) {
+                          int diff_stride, TxfmParam *txfm_param) {
 #if CONFIG_LGT
-  av1_fht4x16_c(src_diff, coeff, diff_stride, fwd_txfm_param);
+  av1_fht4x16_c(src_diff, coeff, diff_stride, txfm_param);
 #else
-  av1_fht4x16(src_diff, coeff, diff_stride, fwd_txfm_param);
+  av1_fht4x16(src_diff, coeff, diff_stride, txfm_param);
 #endif
 }
 
 static void fwd_txfm_32x8(const int16_t *src_diff, tran_low_t *coeff,
-                          int diff_stride, FWD_TXFM_PARAM *fwd_txfm_param) {
+                          int diff_stride, TxfmParam *txfm_param) {
 #if CONFIG_LGT
-  av1_fht32x8_c(src_diff, coeff, diff_stride, fwd_txfm_param);
+  av1_fht32x8_c(src_diff, coeff, diff_stride, txfm_param);
 #else
-  av1_fht32x8(src_diff, coeff, diff_stride, fwd_txfm_param);
+  av1_fht32x8(src_diff, coeff, diff_stride, txfm_param);
 #endif
 }
 
 static void fwd_txfm_8x32(const int16_t *src_diff, tran_low_t *coeff,
-                          int diff_stride, FWD_TXFM_PARAM *fwd_txfm_param) {
+                          int diff_stride, TxfmParam *txfm_param) {
 #if CONFIG_LGT
-  av1_fht8x32_c(src_diff, coeff, diff_stride, fwd_txfm_param);
+  av1_fht8x32_c(src_diff, coeff, diff_stride, txfm_param);
 #else
-  av1_fht8x32(src_diff, coeff, diff_stride, fwd_txfm_param);
+  av1_fht8x32(src_diff, coeff, diff_stride, txfm_param);
 #endif
 }
 #endif  // CONFIG_EXT_TX && CONFIG_RECT_TX && CONFIG_RECT_TX_EXT
 
 #if CONFIG_CHROMA_2X2
 static void highbd_fwd_txfm_2x2(const int16_t *src_diff, tran_low_t *coeff,
-                                int diff_stride,
-                                FWD_TXFM_PARAM *fwd_txfm_param) {
+                                int diff_stride, TxfmParam *txfm_param) {
   tran_high_t a1 = src_diff[0];
   tran_high_t b1 = src_diff[1];
   tran_high_t c1 = src_diff[diff_stride];
@@ -198,17 +197,16 @@
   coeff[2] = (tran_low_t)(4 * c1);
   coeff[3] = (tran_low_t)(4 * d1);
 
-  (void)fwd_txfm_param;
+  (void)txfm_param;
 }
 #endif
 
 static void highbd_fwd_txfm_4x4(const int16_t *src_diff, tran_low_t *coeff,
-                                int diff_stride,
-                                FWD_TXFM_PARAM *fwd_txfm_param) {
+                                int diff_stride, TxfmParam *txfm_param) {
   int32_t *dst_coeff = (int32_t *)coeff;
-  const int tx_type = fwd_txfm_param->tx_type;
-  const int bd = fwd_txfm_param->bd;
-  if (fwd_txfm_param->lossless) {
+  const int tx_type = txfm_param->tx_type;
+  const int bd = txfm_param->bd;
+  if (txfm_param->lossless) {
     assert(tx_type == DCT_DCT);
     av1_highbd_fwht4x4(src_diff, coeff, diff_stride);
     return;
@@ -247,59 +245,52 @@
 }
 
 static void highbd_fwd_txfm_4x8(const int16_t *src_diff, tran_low_t *coeff,
-                                int diff_stride,
-                                FWD_TXFM_PARAM *fwd_txfm_param) {
+                                int diff_stride, TxfmParam *txfm_param) {
   int32_t *dst_coeff = (int32_t *)coeff;
-  av1_fwd_txfm2d_4x8_c(src_diff, dst_coeff, diff_stride,
-                       fwd_txfm_param->tx_type, fwd_txfm_param->bd);
+  av1_fwd_txfm2d_4x8_c(src_diff, dst_coeff, diff_stride, txfm_param->tx_type,
+                       txfm_param->bd);
 }
 
 static void highbd_fwd_txfm_8x4(const int16_t *src_diff, tran_low_t *coeff,
-                                int diff_stride,
-                                FWD_TXFM_PARAM *fwd_txfm_param) {
+                                int diff_stride, TxfmParam *txfm_param) {
   int32_t *dst_coeff = (int32_t *)coeff;
-  av1_fwd_txfm2d_8x4_c(src_diff, dst_coeff, diff_stride,
-                       fwd_txfm_param->tx_type, fwd_txfm_param->bd);
+  av1_fwd_txfm2d_8x4_c(src_diff, dst_coeff, diff_stride, txfm_param->tx_type,
+                       txfm_param->bd);
 }
 
 static void highbd_fwd_txfm_8x16(const int16_t *src_diff, tran_low_t *coeff,
-                                 int diff_stride,
-                                 FWD_TXFM_PARAM *fwd_txfm_param) {
+                                 int diff_stride, TxfmParam *txfm_param) {
   int32_t *dst_coeff = (int32_t *)coeff;
-  av1_fwd_txfm2d_8x16_c(src_diff, dst_coeff, diff_stride,
-                        fwd_txfm_param->tx_type, fwd_txfm_param->bd);
+  av1_fwd_txfm2d_8x16_c(src_diff, dst_coeff, diff_stride, txfm_param->tx_type,
+                        txfm_param->bd);
 }
 
 static void highbd_fwd_txfm_16x8(const int16_t *src_diff, tran_low_t *coeff,
-                                 int diff_stride,
-                                 FWD_TXFM_PARAM *fwd_txfm_param) {
+                                 int diff_stride, TxfmParam *txfm_param) {
   int32_t *dst_coeff = (int32_t *)coeff;
-  av1_fwd_txfm2d_16x8_c(src_diff, dst_coeff, diff_stride,
-                        fwd_txfm_param->tx_type, fwd_txfm_param->bd);
+  av1_fwd_txfm2d_16x8_c(src_diff, dst_coeff, diff_stride, txfm_param->tx_type,
+                        txfm_param->bd);
 }
 
 static void highbd_fwd_txfm_16x32(const int16_t *src_diff, tran_low_t *coeff,
-                                  int diff_stride,
-                                  FWD_TXFM_PARAM *fwd_txfm_param) {
+                                  int diff_stride, TxfmParam *txfm_param) {
   int32_t *dst_coeff = (int32_t *)coeff;
-  av1_fwd_txfm2d_16x32_c(src_diff, dst_coeff, diff_stride,
-                         fwd_txfm_param->tx_type, fwd_txfm_param->bd);
+  av1_fwd_txfm2d_16x32_c(src_diff, dst_coeff, diff_stride, txfm_param->tx_type,
+                         txfm_param->bd);
 }
 
 static void highbd_fwd_txfm_32x16(const int16_t *src_diff, tran_low_t *coeff,
-                                  int diff_stride,
-                                  FWD_TXFM_PARAM *fwd_txfm_param) {
+                                  int diff_stride, TxfmParam *txfm_param) {
   int32_t *dst_coeff = (int32_t *)coeff;
-  av1_fwd_txfm2d_32x16_c(src_diff, dst_coeff, diff_stride,
-                         fwd_txfm_param->tx_type, fwd_txfm_param->bd);
+  av1_fwd_txfm2d_32x16_c(src_diff, dst_coeff, diff_stride, txfm_param->tx_type,
+                         txfm_param->bd);
 }
 
 static void highbd_fwd_txfm_8x8(const int16_t *src_diff, tran_low_t *coeff,
-                                int diff_stride,
-                                FWD_TXFM_PARAM *fwd_txfm_param) {
+                                int diff_stride, TxfmParam *txfm_param) {
   int32_t *dst_coeff = (int32_t *)coeff;
-  const int tx_type = fwd_txfm_param->tx_type;
-  const int bd = fwd_txfm_param->bd;
+  const int tx_type = txfm_param->tx_type;
+  const int bd = txfm_param->bd;
   switch (tx_type) {
     case DCT_DCT:
     case ADST_DCT:
@@ -334,11 +325,10 @@
 }
 
 static void highbd_fwd_txfm_16x16(const int16_t *src_diff, tran_low_t *coeff,
-                                  int diff_stride,
-                                  FWD_TXFM_PARAM *fwd_txfm_param) {
+                                  int diff_stride, TxfmParam *txfm_param) {
   int32_t *dst_coeff = (int32_t *)coeff;
-  const int tx_type = fwd_txfm_param->tx_type;
-  const int bd = fwd_txfm_param->bd;
+  const int tx_type = txfm_param->tx_type;
+  const int bd = txfm_param->bd;
   switch (tx_type) {
     case DCT_DCT:
     case ADST_DCT:
@@ -373,11 +363,10 @@
 }
 
 static void highbd_fwd_txfm_32x32(const int16_t *src_diff, tran_low_t *coeff,
-                                  int diff_stride,
-                                  FWD_TXFM_PARAM *fwd_txfm_param) {
+                                  int diff_stride, TxfmParam *txfm_param) {
   int32_t *dst_coeff = (int32_t *)coeff;
-  const int tx_type = fwd_txfm_param->tx_type;
-  const int bd = fwd_txfm_param->bd;
+  const int tx_type = txfm_param->tx_type;
+  const int bd = txfm_param->bd;
   switch (tx_type) {
     case DCT_DCT:
     case ADST_DCT:
@@ -413,11 +402,10 @@
 
 #if CONFIG_TX64X64
 static void highbd_fwd_txfm_64x64(const int16_t *src_diff, tran_low_t *coeff,
-                                  int diff_stride,
-                                  FWD_TXFM_PARAM *fwd_txfm_param) {
+                                  int diff_stride, TxfmParam *txfm_param) {
   int32_t *dst_coeff = (int32_t *)coeff;
-  const int tx_type = fwd_txfm_param->tx_type;
-  const int bd = fwd_txfm_param->bd;
+  const int tx_type = txfm_param->tx_type;
+  const int bd = txfm_param->bd;
   switch (tx_type) {
     case DCT_DCT:
       av1_fwd_txfm2d_64x64(src_diff, dst_coeff, diff_stride, tx_type, bd);
@@ -455,61 +443,51 @@
 #endif  // CONFIG_TX64X64
 
 void av1_fwd_txfm(const int16_t *src_diff, tran_low_t *coeff, int diff_stride,
-                  FWD_TXFM_PARAM *fwd_txfm_param) {
-  const TX_SIZE tx_size = fwd_txfm_param->tx_size;
+                  TxfmParam *txfm_param) {
+  const TX_SIZE tx_size = txfm_param->tx_size;
   switch (tx_size) {
 #if CONFIG_TX64X64
     case TX_64X64:
-      fwd_txfm_64x64(src_diff, coeff, diff_stride, fwd_txfm_param);
+      fwd_txfm_64x64(src_diff, coeff, diff_stride, txfm_param);
       break;
 #endif  // CONFIG_TX64X64
     case TX_32X32:
-      fwd_txfm_32x32(src_diff, coeff, diff_stride, fwd_txfm_param);
+      fwd_txfm_32x32(src_diff, coeff, diff_stride, txfm_param);
       break;
     case TX_16X16:
-      fwd_txfm_16x16(src_diff, coeff, diff_stride, fwd_txfm_param);
+      fwd_txfm_16x16(src_diff, coeff, diff_stride, txfm_param);
       break;
-    case TX_8X8:
-      fwd_txfm_8x8(src_diff, coeff, diff_stride, fwd_txfm_param);
-      break;
-    case TX_4X8:
-      fwd_txfm_4x8(src_diff, coeff, diff_stride, fwd_txfm_param);
-      break;
-    case TX_8X4:
-      fwd_txfm_8x4(src_diff, coeff, diff_stride, fwd_txfm_param);
-      break;
+    case TX_8X8: fwd_txfm_8x8(src_diff, coeff, diff_stride, txfm_param); break;
+    case TX_4X8: fwd_txfm_4x8(src_diff, coeff, diff_stride, txfm_param); break;
+    case TX_8X4: fwd_txfm_8x4(src_diff, coeff, diff_stride, txfm_param); break;
     case TX_8X16:
-      fwd_txfm_8x16(src_diff, coeff, diff_stride, fwd_txfm_param);
+      fwd_txfm_8x16(src_diff, coeff, diff_stride, txfm_param);
       break;
     case TX_16X8:
-      fwd_txfm_16x8(src_diff, coeff, diff_stride, fwd_txfm_param);
+      fwd_txfm_16x8(src_diff, coeff, diff_stride, txfm_param);
       break;
     case TX_16X32:
-      fwd_txfm_16x32(src_diff, coeff, diff_stride, fwd_txfm_param);
+      fwd_txfm_16x32(src_diff, coeff, diff_stride, txfm_param);
       break;
     case TX_32X16:
-      fwd_txfm_32x16(src_diff, coeff, diff_stride, fwd_txfm_param);
+      fwd_txfm_32x16(src_diff, coeff, diff_stride, txfm_param);
       break;
-    case TX_4X4:
-      fwd_txfm_4x4(src_diff, coeff, diff_stride, fwd_txfm_param);
-      break;
+    case TX_4X4: fwd_txfm_4x4(src_diff, coeff, diff_stride, txfm_param); break;
 #if CONFIG_CHROMA_2X2
-    case TX_2X2:
-      fwd_txfm_2x2(src_diff, coeff, diff_stride, fwd_txfm_param);
-      break;
+    case TX_2X2: fwd_txfm_2x2(src_diff, coeff, diff_stride, txfm_param); break;
 #endif
 #if CONFIG_EXT_TX && CONFIG_RECT_TX && CONFIG_RECT_TX_EXT
     case TX_4X16:
-      fwd_txfm_4x16(src_diff, coeff, diff_stride, fwd_txfm_param);
+      fwd_txfm_4x16(src_diff, coeff, diff_stride, txfm_param);
       break;
     case TX_16X4:
-      fwd_txfm_16x4(src_diff, coeff, diff_stride, fwd_txfm_param);
+      fwd_txfm_16x4(src_diff, coeff, diff_stride, txfm_param);
       break;
     case TX_8X32:
-      fwd_txfm_8x32(src_diff, coeff, diff_stride, fwd_txfm_param);
+      fwd_txfm_8x32(src_diff, coeff, diff_stride, txfm_param);
       break;
     case TX_32X8:
-      fwd_txfm_32x8(src_diff, coeff, diff_stride, fwd_txfm_param);
+      fwd_txfm_32x8(src_diff, coeff, diff_stride, txfm_param);
       break;
 #endif  // CONFIG_EXT_TX && CONFIG_RECT_TX && CONFIG_RECT_TX_EXT
     default: assert(0); break;
@@ -517,47 +495,47 @@
 }
 
 void av1_highbd_fwd_txfm(const int16_t *src_diff, tran_low_t *coeff,
-                         int diff_stride, FWD_TXFM_PARAM *fwd_txfm_param) {
-  const TX_SIZE tx_size = fwd_txfm_param->tx_size;
+                         int diff_stride, TxfmParam *txfm_param) {
+  const TX_SIZE tx_size = txfm_param->tx_size;
   switch (tx_size) {
 #if CONFIG_TX64X64
     case TX_64X64:
-      highbd_fwd_txfm_64x64(src_diff, coeff, diff_stride, fwd_txfm_param);
+      highbd_fwd_txfm_64x64(src_diff, coeff, diff_stride, txfm_param);
       break;
 #endif  // CONFIG_TX64X64
     case TX_32X32:
-      highbd_fwd_txfm_32x32(src_diff, coeff, diff_stride, fwd_txfm_param);
+      highbd_fwd_txfm_32x32(src_diff, coeff, diff_stride, txfm_param);
       break;
     case TX_16X16:
-      highbd_fwd_txfm_16x16(src_diff, coeff, diff_stride, fwd_txfm_param);
+      highbd_fwd_txfm_16x16(src_diff, coeff, diff_stride, txfm_param);
       break;
     case TX_8X8:
-      highbd_fwd_txfm_8x8(src_diff, coeff, diff_stride, fwd_txfm_param);
+      highbd_fwd_txfm_8x8(src_diff, coeff, diff_stride, txfm_param);
       break;
     case TX_4X8:
-      highbd_fwd_txfm_4x8(src_diff, coeff, diff_stride, fwd_txfm_param);
+      highbd_fwd_txfm_4x8(src_diff, coeff, diff_stride, txfm_param);
       break;
     case TX_8X4:
-      highbd_fwd_txfm_8x4(src_diff, coeff, diff_stride, fwd_txfm_param);
+      highbd_fwd_txfm_8x4(src_diff, coeff, diff_stride, txfm_param);
       break;
     case TX_8X16:
-      highbd_fwd_txfm_8x16(src_diff, coeff, diff_stride, fwd_txfm_param);
+      highbd_fwd_txfm_8x16(src_diff, coeff, diff_stride, txfm_param);
       break;
     case TX_16X8:
-      highbd_fwd_txfm_16x8(src_diff, coeff, diff_stride, fwd_txfm_param);
+      highbd_fwd_txfm_16x8(src_diff, coeff, diff_stride, txfm_param);
       break;
     case TX_16X32:
-      highbd_fwd_txfm_16x32(src_diff, coeff, diff_stride, fwd_txfm_param);
+      highbd_fwd_txfm_16x32(src_diff, coeff, diff_stride, txfm_param);
       break;
     case TX_32X16:
-      highbd_fwd_txfm_32x16(src_diff, coeff, diff_stride, fwd_txfm_param);
+      highbd_fwd_txfm_32x16(src_diff, coeff, diff_stride, txfm_param);
       break;
     case TX_4X4:
-      highbd_fwd_txfm_4x4(src_diff, coeff, diff_stride, fwd_txfm_param);
+      highbd_fwd_txfm_4x4(src_diff, coeff, diff_stride, txfm_param);
       break;
 #if CONFIG_CHROMA_2X2
     case TX_2X2:
-      highbd_fwd_txfm_2x2(src_diff, coeff, diff_stride, fwd_txfm_param);
+      highbd_fwd_txfm_2x2(src_diff, coeff, diff_stride, txfm_param);
       break;
 #endif
     default: assert(0); break;
diff --git a/av1/encoder/hybrid_fwd_txfm.h b/av1/encoder/hybrid_fwd_txfm.h
index 36e7ee2..b25ffb8 100644
--- a/av1/encoder/hybrid_fwd_txfm.h
+++ b/av1/encoder/hybrid_fwd_txfm.h
@@ -19,10 +19,10 @@
 #endif
 
 void av1_fwd_txfm(const int16_t *src_diff, tran_low_t *coeff, int diff_stride,
-                  FWD_TXFM_PARAM *fwd_txfm_param);
+                  TxfmParam *txfm_param);
 
 void av1_highbd_fwd_txfm(const int16_t *src_diff, tran_low_t *coeff,
-                         int diff_stride, FWD_TXFM_PARAM *fwd_txfm_param);
+                         int diff_stride, TxfmParam *txfm_param);
 
 #ifdef __cplusplus
 }  // extern "C"
diff --git a/av1/encoder/x86/dct_intrin_sse2.c b/av1/encoder/x86/dct_intrin_sse2.c
index 656305d..ba6345f 100644
--- a/av1/encoder/x86/dct_intrin_sse2.c
+++ b/av1/encoder/x86/dct_intrin_sse2.c
@@ -14,7 +14,6 @@
 
 #include "./aom_dsp_rtcd.h"
 #include "./av1_rtcd.h"
-#include "av1/common/idct.h"
 #include "aom_dsp/txfm_common.h"
 #include "aom_dsp/x86/fwd_txfm_sse2.h"
 #include "aom_dsp/x86/synonyms.h"
@@ -204,9 +203,9 @@
 #endif  // CONFIG_EXT_TX
 
 void av1_fht4x4_sse2(const int16_t *input, tran_low_t *output, int stride,
-                     FWD_TXFM_PARAM *fwd_txfm_param) {
+                     TxfmParam *txfm_param) {
   __m128i in[4];
-  int tx_type = fwd_txfm_param->tx_type;
+  int tx_type = txfm_param->tx_type;
 
   switch (tx_type) {
     case DCT_DCT: aom_fdct4x4_sse2(input, output, stride); break;
@@ -1303,9 +1302,9 @@
 #endif  // CONFIG_EXT_TX
 
 void av1_fht8x8_sse2(const int16_t *input, tran_low_t *output, int stride,
-                     FWD_TXFM_PARAM *fwd_txfm_param) {
+                     TxfmParam *txfm_param) {
   __m128i in[8];
-  int tx_type = fwd_txfm_param->tx_type;
+  int tx_type = txfm_param->tx_type;
 
   switch (tx_type) {
     case DCT_DCT: aom_fdct8x8_sse2(input, output, stride); break;
@@ -2337,9 +2336,9 @@
 #endif  // CONFIG_EXT_TX
 
 void av1_fht16x16_sse2(const int16_t *input, tran_low_t *output, int stride,
-                       FWD_TXFM_PARAM *fwd_txfm_param) {
+                       TxfmParam *txfm_param) {
   __m128i in0[16], in1[16];
-  int tx_type = fwd_txfm_param->tx_type;
+  int tx_type = txfm_param->tx_type;
 
   switch (tx_type) {
     case DCT_DCT:
@@ -2554,9 +2553,9 @@
 }
 
 void av1_fht4x8_sse2(const int16_t *input, tran_low_t *output, int stride,
-                     FWD_TXFM_PARAM *fwd_txfm_param) {
+                     TxfmParam *txfm_param) {
   __m128i in[8];
-  int tx_type = fwd_txfm_param->tx_type;
+  int tx_type = txfm_param->tx_type;
 
   switch (tx_type) {
     case DCT_DCT:
@@ -2729,9 +2728,9 @@
 }
 
 void av1_fht8x4_sse2(const int16_t *input, tran_low_t *output, int stride,
-                     FWD_TXFM_PARAM *fwd_txfm_param) {
+                     TxfmParam *txfm_param) {
   __m128i in[8];
-  int tx_type = fwd_txfm_param->tx_type;
+  int tx_type = txfm_param->tx_type;
 
   switch (tx_type) {
     case DCT_DCT:
@@ -2870,9 +2869,9 @@
 }
 
 void av1_fht8x16_sse2(const int16_t *input, tran_low_t *output, int stride,
-                      FWD_TXFM_PARAM *fwd_txfm_param) {
+                      TxfmParam *txfm_param) {
   __m128i in[16];
-  int tx_type = fwd_txfm_param->tx_type;
+  int tx_type = txfm_param->tx_type;
 
   __m128i *const t = in;      // Alias to top 8x8 sub block
   __m128i *const b = in + 8;  // Alias to bottom 8x8 sub block
@@ -3052,9 +3051,9 @@
 #define col_16x8_rounding row_8x16_rounding
 
 void av1_fht16x8_sse2(const int16_t *input, tran_low_t *output, int stride,
-                      FWD_TXFM_PARAM *fwd_txfm_param) {
+                      TxfmParam *txfm_param) {
   __m128i in[16];
-  int tx_type = fwd_txfm_param->tx_type;
+  int tx_type = txfm_param->tx_type;
 
   __m128i *const l = in;      // Alias to left 8x8 sub block
   __m128i *const r = in + 8;  // Alias to right 8x8 sub block, which we store
@@ -3363,9 +3362,9 @@
 // For 16x32, this means the input is a 2x2 grid of such blocks.
 // For 32x16, it means the input is a 4x1 grid.
 void av1_fht16x32_sse2(const int16_t *input, tran_low_t *output, int stride,
-                       FWD_TXFM_PARAM *fwd_txfm_param) {
+                       TxfmParam *txfm_param) {
   __m128i intl[16], intr[16], inbl[16], inbr[16];
-  int tx_type = fwd_txfm_param->tx_type;
+  int tx_type = txfm_param->tx_type;
 
   switch (tx_type) {
     case DCT_DCT:
@@ -3553,9 +3552,9 @@
 }
 
 void av1_fht32x16_sse2(const int16_t *input, tran_low_t *output, int stride,
-                       FWD_TXFM_PARAM *fwd_txfm_param) {
+                       TxfmParam *txfm_param) {
   __m128i in0[16], in1[16], in2[16], in3[16];
-  int tx_type = fwd_txfm_param->tx_type;
+  int tx_type = txfm_param->tx_type;
 
   load_buffer_32x16(input, in0, in1, in2, in3, stride, 0, 0);
   switch (tx_type) {
@@ -3794,9 +3793,9 @@
 }
 
 void av1_fht32x32_sse2(const int16_t *input, tran_low_t *output, int stride,
-                       FWD_TXFM_PARAM *fwd_txfm_param) {
+                       TxfmParam *txfm_param) {
   __m128i in0[32], in1[32], in2[32], in3[32];
-  int tx_type = fwd_txfm_param->tx_type;
+  int tx_type = txfm_param->tx_type;
 
   load_buffer_32x32(input, in0, in1, in2, in3, stride, 0, 0);
   switch (tx_type) {
diff --git a/av1/encoder/x86/hybrid_fwd_txfm_avx2.c b/av1/encoder/x86/hybrid_fwd_txfm_avx2.c
index 10a16cf..6e82679 100644
--- a/av1/encoder/x86/hybrid_fwd_txfm_avx2.c
+++ b/av1/encoder/x86/hybrid_fwd_txfm_avx2.c
@@ -14,7 +14,6 @@
 #include "./av1_rtcd.h"
 #include "./aom_dsp_rtcd.h"
 
-#include "av1/common/idct.h"
 #include "aom_dsp/x86/fwd_txfm_avx2.h"
 #include "aom_dsp/txfm_common.h"
 #include "aom_dsp/x86/txfm_common_avx2.h"
@@ -915,9 +914,9 @@
 #endif
 
 void av1_fht16x16_avx2(const int16_t *input, tran_low_t *output, int stride,
-                       FWD_TXFM_PARAM *fwd_txfm_param) {
+                       TxfmParam *txfm_param) {
   __m256i in[16];
-  int tx_type = fwd_txfm_param->tx_type;
+  int tx_type = txfm_param->tx_type;
 
   switch (tx_type) {
     case DCT_DCT:
@@ -1511,10 +1510,10 @@
 #endif
 
 void av1_fht32x32_avx2(const int16_t *input, tran_low_t *output, int stride,
-                       FWD_TXFM_PARAM *fwd_txfm_param) {
+                       TxfmParam *txfm_param) {
   __m256i in0[32];  // left 32 columns
   __m256i in1[32];  // right 32 columns
-  int tx_type = fwd_txfm_param->tx_type;
+  int tx_type = txfm_param->tx_type;
 
   switch (tx_type) {
     case DCT_DCT:
diff --git a/test/av1_fht16x16_test.cc b/test/av1_fht16x16_test.cc
index 7b19b7c..c0f6974 100644
--- a/test/av1_fht16x16_test.cc
+++ b/test/av1_fht16x16_test.cc
@@ -25,19 +25,19 @@
 
 namespace {
 typedef void (*IhtFunc)(const tran_low_t *in, uint8_t *out, int stride,
-                        const INV_TXFM_PARAM *inv_txfm_param);
+                        const TxfmParam *txfm_param);
 using std::tr1::tuple;
 using libaom_test::FhtFunc;
 typedef tuple<FhtFunc, IhtFunc, int, aom_bit_depth_t, int> Ht16x16Param;
 
 void fht16x16_ref(const int16_t *in, tran_low_t *out, int stride,
-                  FWD_TXFM_PARAM *fwd_txfm_param) {
-  av1_fht16x16_c(in, out, stride, fwd_txfm_param);
+                  TxfmParam *txfm_param) {
+  av1_fht16x16_c(in, out, stride, txfm_param);
 }
 
 void iht16x16_ref(const tran_low_t *in, uint8_t *dest, int stride,
-                  const INV_TXFM_PARAM *inv_txfm_param) {
-  av1_iht16x16_256_add_c(in, dest, stride, inv_txfm_param);
+                  const TxfmParam *txfm_param) {
+  av1_iht16x16_256_add_c(in, dest, stride, txfm_param);
 }
 
 #if CONFIG_HIGHBITDEPTH
@@ -70,18 +70,17 @@
     bit_depth_ = GET_PARAM(3);
     mask_ = (1 << bit_depth_) - 1;
     num_coeffs_ = GET_PARAM(4);
-    fwd_txfm_param_.tx_type = (TX_TYPE)GET_PARAM(2);
-    inv_txfm_param_.tx_type = (TX_TYPE)GET_PARAM(2);
+    txfm_param_.tx_type = GET_PARAM(2);
   }
   virtual void TearDown() { libaom_test::ClearSystemState(); }
 
  protected:
   void RunFwdTxfm(const int16_t *in, tran_low_t *out, int stride) {
-    fwd_txfm_(in, out, stride, &fwd_txfm_param_);
+    fwd_txfm_(in, out, stride, &txfm_param_);
   }
 
   void RunInvTxfm(const tran_low_t *out, uint8_t *dst, int stride) {
-    inv_txfm_(out, dst, stride, &inv_txfm_param_);
+    inv_txfm_(out, dst, stride, &txfm_param_);
   }
 
   FhtFunc fwd_txfm_;
diff --git a/test/av1_fht16x32_test.cc b/test/av1_fht16x32_test.cc
index 6bc0cad..099a312 100644
--- a/test/av1_fht16x32_test.cc
+++ b/test/av1_fht16x32_test.cc
@@ -25,19 +25,19 @@
 
 namespace {
 typedef void (*IhtFunc)(const tran_low_t *in, uint8_t *out, int stride,
-                        const INV_TXFM_PARAM *inv_txfm_param);
+                        const TxfmParam *txfm_param);
 using std::tr1::tuple;
 using libaom_test::FhtFunc;
 typedef tuple<FhtFunc, IhtFunc, int, aom_bit_depth_t, int> Ht16x32Param;
 
 void fht16x32_ref(const int16_t *in, tran_low_t *out, int stride,
-                  FWD_TXFM_PARAM *fwd_txfm_param) {
-  av1_fht16x32_c(in, out, stride, fwd_txfm_param);
+                  TxfmParam *txfm_param) {
+  av1_fht16x32_c(in, out, stride, txfm_param);
 }
 
 void iht16x32_ref(const tran_low_t *in, uint8_t *out, int stride,
-                  const INV_TXFM_PARAM *inv_txfm_param) {
-  av1_iht16x32_512_add_c(in, out, stride, inv_txfm_param);
+                  const TxfmParam *txfm_param) {
+  av1_iht16x32_512_add_c(in, out, stride, txfm_param);
 }
 
 class AV1Trans16x32HT : public libaom_test::TransformTestBase,
@@ -55,18 +55,17 @@
     bit_depth_ = GET_PARAM(3);
     mask_ = (1 << bit_depth_) - 1;
     num_coeffs_ = GET_PARAM(4);
-    fwd_txfm_param_.tx_type = (TX_TYPE)GET_PARAM(2);
-    inv_txfm_param_.tx_type = (TX_TYPE)GET_PARAM(2);
+    txfm_param_.tx_type = GET_PARAM(2);
   }
   virtual void TearDown() { libaom_test::ClearSystemState(); }
 
  protected:
   void RunFwdTxfm(const int16_t *in, tran_low_t *out, int stride) {
-    fwd_txfm_(in, out, stride, &fwd_txfm_param_);
+    fwd_txfm_(in, out, stride, &txfm_param_);
   }
 
   void RunInvTxfm(const tran_low_t *out, uint8_t *dst, int stride) {
-    inv_txfm_(out, dst, stride, &inv_txfm_param_);
+    inv_txfm_(out, dst, stride, &txfm_param_);
   }
 
   FhtFunc fwd_txfm_;
diff --git a/test/av1_fht16x8_test.cc b/test/av1_fht16x8_test.cc
index e12c121..8277e28 100644
--- a/test/av1_fht16x8_test.cc
+++ b/test/av1_fht16x8_test.cc
@@ -25,19 +25,19 @@
 
 namespace {
 typedef void (*IhtFunc)(const tran_low_t *in, uint8_t *out, int stride,
-                        const INV_TXFM_PARAM *inv_txfm_param);
+                        const TxfmParam *txfm_param);
 using std::tr1::tuple;
 using libaom_test::FhtFunc;
 typedef tuple<FhtFunc, IhtFunc, int, aom_bit_depth_t, int> Ht16x8Param;
 
 void fht16x8_ref(const int16_t *in, tran_low_t *out, int stride,
-                 FWD_TXFM_PARAM *fwd_txfm_param) {
-  av1_fht16x8_c(in, out, stride, fwd_txfm_param);
+                 TxfmParam *txfm_param) {
+  av1_fht16x8_c(in, out, stride, txfm_param);
 }
 
 void iht16x8_ref(const tran_low_t *in, uint8_t *out, int stride,
-                 const INV_TXFM_PARAM *inv_txfm_param) {
-  av1_iht16x8_128_add_c(in, out, stride, inv_txfm_param);
+                 const TxfmParam *txfm_param) {
+  av1_iht16x8_128_add_c(in, out, stride, txfm_param);
 }
 
 class AV1Trans16x8HT : public libaom_test::TransformTestBase,
@@ -55,18 +55,17 @@
     bit_depth_ = GET_PARAM(3);
     mask_ = (1 << bit_depth_) - 1;
     num_coeffs_ = GET_PARAM(4);
-    fwd_txfm_param_.tx_type = (TX_TYPE)GET_PARAM(2);
-    inv_txfm_param_.tx_type = (TX_TYPE)GET_PARAM(2);
+    txfm_param_.tx_type = GET_PARAM(2);
   }
   virtual void TearDown() { libaom_test::ClearSystemState(); }
 
  protected:
   void RunFwdTxfm(const int16_t *in, tran_low_t *out, int stride) {
-    fwd_txfm_(in, out, stride, &fwd_txfm_param_);
+    fwd_txfm_(in, out, stride, &txfm_param_);
   }
 
   void RunInvTxfm(const tran_low_t *out, uint8_t *dst, int stride) {
-    inv_txfm_(out, dst, stride, &inv_txfm_param_);
+    inv_txfm_(out, dst, stride, &txfm_param_);
   }
 
   FhtFunc fwd_txfm_;
diff --git a/test/av1_fht32x16_test.cc b/test/av1_fht32x16_test.cc
index 6f285b7..1c70fd4 100644
--- a/test/av1_fht32x16_test.cc
+++ b/test/av1_fht32x16_test.cc
@@ -25,19 +25,19 @@
 
 namespace {
 typedef void (*IhtFunc)(const tran_low_t *in, uint8_t *out, int stride,
-                        const INV_TXFM_PARAM *inv_txfm_param);
+                        const TxfmParam *txfm_param);
 using std::tr1::tuple;
 using libaom_test::FhtFunc;
 typedef tuple<FhtFunc, IhtFunc, int, aom_bit_depth_t, int> Ht32x16Param;
 
 void fht32x16_ref(const int16_t *in, tran_low_t *out, int stride,
-                  FWD_TXFM_PARAM *fwd_txfm_param) {
-  av1_fht32x16_c(in, out, stride, fwd_txfm_param);
+                  TxfmParam *txfm_param) {
+  av1_fht32x16_c(in, out, stride, txfm_param);
 }
 
 void iht32x16_ref(const tran_low_t *in, uint8_t *out, int stride,
-                  const INV_TXFM_PARAM *inv_txfm_param) {
-  av1_iht32x16_512_add_c(in, out, stride, inv_txfm_param);
+                  const TxfmParam *txfm_param) {
+  av1_iht32x16_512_add_c(in, out, stride, txfm_param);
 }
 
 class AV1Trans32x16HT : public libaom_test::TransformTestBase,
@@ -55,18 +55,17 @@
     bit_depth_ = GET_PARAM(3);
     mask_ = (1 << bit_depth_) - 1;
     num_coeffs_ = GET_PARAM(4);
-    fwd_txfm_param_.tx_type = (TX_TYPE)GET_PARAM(2);
-    inv_txfm_param_.tx_type = (TX_TYPE)GET_PARAM(2);
+    txfm_param_.tx_type = GET_PARAM(2);
   }
   virtual void TearDown() { libaom_test::ClearSystemState(); }
 
  protected:
   void RunFwdTxfm(const int16_t *in, tran_low_t *out, int stride) {
-    fwd_txfm_(in, out, stride, &fwd_txfm_param_);
+    fwd_txfm_(in, out, stride, &txfm_param_);
   }
 
   void RunInvTxfm(const tran_low_t *out, uint8_t *dst, int stride) {
-    inv_txfm_(out, dst, stride, &inv_txfm_param_);
+    inv_txfm_(out, dst, stride, &txfm_param_);
   }
 
   FhtFunc fwd_txfm_;
diff --git a/test/av1_fht32x32_test.cc b/test/av1_fht32x32_test.cc
index 1bd5d84..e96ffff 100644
--- a/test/av1_fht32x32_test.cc
+++ b/test/av1_fht32x32_test.cc
@@ -25,14 +25,14 @@
 
 namespace {
 typedef void (*IhtFunc)(const tran_low_t *in, uint8_t *out, int stride,
-                        const INV_TXFM_PARAM *inv_txfm_param);
+                        const TxfmParam *txfm_param);
 using std::tr1::tuple;
 using libaom_test::FhtFunc;
 typedef tuple<FhtFunc, IhtFunc, int, aom_bit_depth_t, int> Ht32x32Param;
 
 void fht32x32_ref(const int16_t *in, tran_low_t *out, int stride,
-                  FWD_TXFM_PARAM *fwd_txfm_param) {
-  av1_fht32x32_c(in, out, stride, fwd_txfm_param);
+                  TxfmParam *txfm_param) {
+  av1_fht32x32_c(in, out, stride, txfm_param);
 }
 
 #if CONFIG_HIGHBITDEPTH
@@ -52,11 +52,11 @@
 
 #if HAVE_SSE2 || HAVE_AVX2
 void dummy_inv_txfm(const tran_low_t *in, uint8_t *out, int stride,
-                    const INV_TXFM_PARAM *inv_txfm_param) {
+                    const TxfmParam *txfm_param) {
   (void)in;
   (void)out;
   (void)stride;
-  (void)inv_txfm_param;
+  (void)txfm_param;
 }
 #endif
 
@@ -74,18 +74,17 @@
     bit_depth_ = GET_PARAM(3);
     mask_ = (1 << bit_depth_) - 1;
     num_coeffs_ = GET_PARAM(4);
-    fwd_txfm_param_.tx_type = (TX_TYPE)GET_PARAM(2);
-    inv_txfm_param_.tx_type = (TX_TYPE)GET_PARAM(2);
+    txfm_param_.tx_type = GET_PARAM(2);
   }
   virtual void TearDown() { libaom_test::ClearSystemState(); }
 
  protected:
   void RunFwdTxfm(const int16_t *in, tran_low_t *out, int stride) {
-    fwd_txfm_(in, out, stride, &fwd_txfm_param_);
+    fwd_txfm_(in, out, stride, &txfm_param_);
   }
 
   void RunInvTxfm(const tran_low_t *out, uint8_t *dst, int stride) {
-    inv_txfm_(out, dst, stride, &inv_txfm_param_);
+    inv_txfm_(out, dst, stride, &txfm_param_);
   }
 
   FhtFunc fwd_txfm_;
diff --git a/test/av1_fht4x4_test.cc b/test/av1_fht4x4_test.cc
index 6506ab7..f49d736 100644
--- a/test/av1_fht4x4_test.cc
+++ b/test/av1_fht4x4_test.cc
@@ -25,19 +25,19 @@
 
 namespace {
 typedef void (*IhtFunc)(const tran_low_t *in, uint8_t *out, int stride,
-                        const INV_TXFM_PARAM *inv_txfm_param);
+                        const TxfmParam *txfm_param);
 using std::tr1::tuple;
 using libaom_test::FhtFunc;
 typedef tuple<FhtFunc, IhtFunc, int, aom_bit_depth_t, int> Ht4x4Param;
 
 void fht4x4_ref(const int16_t *in, tran_low_t *out, int stride,
-                FWD_TXFM_PARAM *fwd_txfm_param) {
-  av1_fht4x4_c(in, out, stride, fwd_txfm_param);
+                TxfmParam *txfm_param) {
+  av1_fht4x4_c(in, out, stride, txfm_param);
 }
 
 void iht4x4_ref(const tran_low_t *in, uint8_t *out, int stride,
-                const INV_TXFM_PARAM *inv_txfm_param) {
-  av1_iht4x4_16_add_c(in, out, stride, inv_txfm_param);
+                const TxfmParam *txfm_param) {
+  av1_iht4x4_16_add_c(in, out, stride, txfm_param);
 }
 
 #if CONFIG_HIGHBITDEPTH
@@ -71,18 +71,17 @@
     bit_depth_ = GET_PARAM(3);
     mask_ = (1 << bit_depth_) - 1;
     num_coeffs_ = GET_PARAM(4);
-    fwd_txfm_param_.tx_type = (TX_TYPE)GET_PARAM(2);
-    inv_txfm_param_.tx_type = (TX_TYPE)GET_PARAM(2);
+    txfm_param_.tx_type = GET_PARAM(2);
   }
   virtual void TearDown() { libaom_test::ClearSystemState(); }
 
  protected:
   void RunFwdTxfm(const int16_t *in, tran_low_t *out, int stride) {
-    fwd_txfm_(in, out, stride, &fwd_txfm_param_);
+    fwd_txfm_(in, out, stride, &txfm_param_);
   }
 
   void RunInvTxfm(const tran_low_t *out, uint8_t *dst, int stride) {
-    inv_txfm_(out, dst, stride, &inv_txfm_param_);
+    inv_txfm_(out, dst, stride, &txfm_param_);
   }
 
   FhtFunc fwd_txfm_;
diff --git a/test/av1_fht4x8_test.cc b/test/av1_fht4x8_test.cc
index 0853539..e447d8e 100644
--- a/test/av1_fht4x8_test.cc
+++ b/test/av1_fht4x8_test.cc
@@ -25,19 +25,19 @@
 
 namespace {
 typedef void (*IhtFunc)(const tran_low_t *in, uint8_t *out, int stride,
-                        const INV_TXFM_PARAM *inv_txfm_param);
+                        const TxfmParam *txfm_param);
 using std::tr1::tuple;
 using libaom_test::FhtFunc;
 typedef tuple<FhtFunc, IhtFunc, int, aom_bit_depth_t, int> Ht4x8Param;
 
 void fht4x8_ref(const int16_t *in, tran_low_t *out, int stride,
-                FWD_TXFM_PARAM *fwd_txfm_param) {
-  av1_fht4x8_c(in, out, stride, fwd_txfm_param);
+                TxfmParam *txfm_param) {
+  av1_fht4x8_c(in, out, stride, txfm_param);
 }
 
 void iht4x8_ref(const tran_low_t *in, uint8_t *out, int stride,
-                const INV_TXFM_PARAM *inv_txfm_param) {
-  av1_iht4x8_32_add_c(in, out, stride, inv_txfm_param);
+                const TxfmParam *txfm_param) {
+  av1_iht4x8_32_add_c(in, out, stride, txfm_param);
 }
 
 class AV1Trans4x8HT : public libaom_test::TransformTestBase,
@@ -55,18 +55,17 @@
     bit_depth_ = GET_PARAM(3);
     mask_ = (1 << bit_depth_) - 1;
     num_coeffs_ = GET_PARAM(4);
-    fwd_txfm_param_.tx_type = (TX_TYPE)GET_PARAM(2);
-    inv_txfm_param_.tx_type = (TX_TYPE)GET_PARAM(2);
+    txfm_param_.tx_type = GET_PARAM(2);
   }
   virtual void TearDown() { libaom_test::ClearSystemState(); }
 
  protected:
   void RunFwdTxfm(const int16_t *in, tran_low_t *out, int stride) {
-    fwd_txfm_(in, out, stride, &fwd_txfm_param_);
+    fwd_txfm_(in, out, stride, &txfm_param_);
   }
 
   void RunInvTxfm(const tran_low_t *out, uint8_t *dst, int stride) {
-    inv_txfm_(out, dst, stride, &inv_txfm_param_);
+    inv_txfm_(out, dst, stride, &txfm_param_);
   }
 
   FhtFunc fwd_txfm_;
diff --git a/test/av1_fht64x64_test.cc b/test/av1_fht64x64_test.cc
index ce8e918..61ea9f1 100644
--- a/test/av1_fht64x64_test.cc
+++ b/test/av1_fht64x64_test.cc
@@ -26,19 +26,19 @@
 
 namespace {
 typedef void (*IhtFunc)(const tran_low_t *in, uint8_t *out, int stride,
-                        const INV_TXFM_PARAM *inv_txfm_param);
+                        const TxfmParam *txfm_param);
 using std::tr1::tuple;
 using libaom_test::FhtFunc;
 typedef tuple<FhtFunc, IhtFunc, int, aom_bit_depth_t, int> Ht64x64Param;
 
 void fht64x64_ref(const int16_t *in, tran_low_t *out, int stride,
-                  FWD_TXFM_PARAM *fwd_txfm_param) {
-  av1_fht64x64_c(in, out, stride, fwd_txfm_param);
+                  TxfmParam *txfm_param) {
+  av1_fht64x64_c(in, out, stride, txfm_param);
 }
 
 void iht64x64_ref(const tran_low_t *in, uint8_t *dest, int stride,
-                  const INV_TXFM_PARAM *inv_txfm_param) {
-  av1_iht64x64_4096_add_c(in, dest, stride, inv_txfm_param);
+                  const TxfmParam *txfm_param) {
+  av1_iht64x64_4096_add_c(in, dest, stride, txfm_param);
 }
 
 class AV1Trans64x64HT : public libaom_test::TransformTestBase,
@@ -56,18 +56,17 @@
     bit_depth_ = GET_PARAM(3);
     mask_ = (1 << bit_depth_) - 1;
     num_coeffs_ = GET_PARAM(4);
-    fwd_txfm_param_.tx_type = (TX_TYPE)GET_PARAM(2);
-    inv_txfm_param_.tx_type = (TX_TYPE)GET_PARAM(2);
+    txfm_param_.tx_type = GET_PARAM(2);
   }
   virtual void TearDown() { libaom_test::ClearSystemState(); }
 
  protected:
   void RunFwdTxfm(const int16_t *in, tran_low_t *out, int stride) {
-    fwd_txfm_(in, out, stride, &fwd_txfm_param_);
+    fwd_txfm_(in, out, stride, &txfm_param_);
   }
 
   void RunInvTxfm(const tran_low_t *out, uint8_t *dst, int stride) {
-    inv_txfm_(out, dst, stride, &inv_txfm_param_);
+    inv_txfm_(out, dst, stride, &txfm_param_);
   }
 
   FhtFunc fwd_txfm_;
diff --git a/test/av1_fht8x16_test.cc b/test/av1_fht8x16_test.cc
index 53e6bce..11f0858 100644
--- a/test/av1_fht8x16_test.cc
+++ b/test/av1_fht8x16_test.cc
@@ -24,19 +24,19 @@
 
 namespace {
 typedef void (*IhtFunc)(const tran_low_t *in, uint8_t *out, int stride,
-                        const INV_TXFM_PARAM *inv_txfm_param);
+                        const TxfmParam *txfm_param);
 using std::tr1::tuple;
 using libaom_test::FhtFunc;
 typedef tuple<FhtFunc, IhtFunc, int, aom_bit_depth_t, int> Ht8x16Param;
 
 void fht8x16_ref(const int16_t *in, tran_low_t *out, int stride,
-                 FWD_TXFM_PARAM *fwd_txfm_param) {
-  av1_fht8x16_c(in, out, stride, fwd_txfm_param);
+                 TxfmParam *txfm_param) {
+  av1_fht8x16_c(in, out, stride, txfm_param);
 }
 
 void iht8x16_ref(const tran_low_t *in, uint8_t *out, int stride,
-                 const INV_TXFM_PARAM *inv_txfm_param) {
-  av1_iht8x16_128_add_c(in, out, stride, inv_txfm_param);
+                 const TxfmParam *txfm_param) {
+  av1_iht8x16_128_add_c(in, out, stride, txfm_param);
 }
 
 class AV1Trans8x16HT : public libaom_test::TransformTestBase,
@@ -54,18 +54,17 @@
     bit_depth_ = GET_PARAM(3);
     mask_ = (1 << bit_depth_) - 1;
     num_coeffs_ = GET_PARAM(4);
-    fwd_txfm_param_.tx_type = (TX_TYPE)GET_PARAM(2);
-    inv_txfm_param_.tx_type = (TX_TYPE)GET_PARAM(2);
+    txfm_param_.tx_type = GET_PARAM(2);
   }
   virtual void TearDown() { libaom_test::ClearSystemState(); }
 
  protected:
   void RunFwdTxfm(const int16_t *in, tran_low_t *out, int stride) {
-    fwd_txfm_(in, out, stride, &fwd_txfm_param_);
+    fwd_txfm_(in, out, stride, &txfm_param_);
   }
 
   void RunInvTxfm(const tran_low_t *out, uint8_t *dst, int stride) {
-    inv_txfm_(out, dst, stride, &inv_txfm_param_);
+    inv_txfm_(out, dst, stride, &txfm_param_);
   }
 
   FhtFunc fwd_txfm_;
diff --git a/test/av1_fht8x4_test.cc b/test/av1_fht8x4_test.cc
index 6004745..c797421 100644
--- a/test/av1_fht8x4_test.cc
+++ b/test/av1_fht8x4_test.cc
@@ -24,19 +24,19 @@
 
 namespace {
 typedef void (*IhtFunc)(const tran_low_t *in, uint8_t *out, int stride,
-                        const INV_TXFM_PARAM *inv_txfm_param);
+                        const TxfmParam *txfm_param);
 using std::tr1::tuple;
 using libaom_test::FhtFunc;
 typedef tuple<FhtFunc, IhtFunc, int, aom_bit_depth_t, int> Ht8x4Param;
 
 void fht8x4_ref(const int16_t *in, tran_low_t *out, int stride,
-                FWD_TXFM_PARAM *fwd_txfm_param) {
-  av1_fht8x4_c(in, out, stride, fwd_txfm_param);
+                TxfmParam *txfm_param) {
+  av1_fht8x4_c(in, out, stride, txfm_param);
 }
 
 void iht8x4_ref(const tran_low_t *in, uint8_t *out, int stride,
-                const INV_TXFM_PARAM *inv_txfm_param) {
-  av1_iht8x4_32_add_c(in, out, stride, inv_txfm_param);
+                const TxfmParam *txfm_param) {
+  av1_iht8x4_32_add_c(in, out, stride, txfm_param);
 }
 
 class AV1Trans8x4HT : public libaom_test::TransformTestBase,
@@ -54,18 +54,17 @@
     bit_depth_ = GET_PARAM(3);
     mask_ = (1 << bit_depth_) - 1;
     num_coeffs_ = GET_PARAM(4);
-    fwd_txfm_param_.tx_type = (TX_TYPE)GET_PARAM(2);
-    inv_txfm_param_.tx_type = (TX_TYPE)GET_PARAM(2);
+    txfm_param_.tx_type = GET_PARAM(2);
   }
   virtual void TearDown() { libaom_test::ClearSystemState(); }
 
  protected:
   void RunFwdTxfm(const int16_t *in, tran_low_t *out, int stride) {
-    fwd_txfm_(in, out, stride, &fwd_txfm_param_);
+    fwd_txfm_(in, out, stride, &txfm_param_);
   }
 
   void RunInvTxfm(const tran_low_t *out, uint8_t *dst, int stride) {
-    inv_txfm_(out, dst, stride, &inv_txfm_param_);
+    inv_txfm_(out, dst, stride, &txfm_param_);
   }
 
   FhtFunc fwd_txfm_;
diff --git a/test/av1_fht8x8_test.cc b/test/av1_fht8x8_test.cc
index 5deaeac..259557c 100644
--- a/test/av1_fht8x8_test.cc
+++ b/test/av1_fht8x8_test.cc
@@ -25,20 +25,20 @@
 
 namespace {
 typedef void (*IhtFunc)(const tran_low_t *in, uint8_t *out, int stride,
-                        const INV_TXFM_PARAM *inv_txfm_param);
+                        const TxfmParam *txfm_param);
 
 using libaom_test::FhtFunc;
 using std::tr1::tuple;
 typedef tuple<FhtFunc, IhtFunc, int, aom_bit_depth_t, int> Ht8x8Param;
 
 void fht8x8_ref(const int16_t *in, tran_low_t *out, int stride,
-                FWD_TXFM_PARAM *fwd_txfm_param) {
-  av1_fht8x8_c(in, out, stride, fwd_txfm_param);
+                TxfmParam *txfm_param) {
+  av1_fht8x8_c(in, out, stride, txfm_param);
 }
 
 void iht8x8_ref(const tran_low_t *in, uint8_t *out, int stride,
-                const INV_TXFM_PARAM *inv_txfm_param) {
-  av1_iht8x8_64_add_c(in, out, stride, inv_txfm_param);
+                const TxfmParam *txfm_param) {
+  av1_iht8x8_64_add_c(in, out, stride, txfm_param);
 }
 
 #if CONFIG_HIGHBITDEPTH
@@ -70,18 +70,17 @@
     bit_depth_ = GET_PARAM(3);
     mask_ = (1 << bit_depth_) - 1;
     num_coeffs_ = GET_PARAM(4);
-    fwd_txfm_param_.tx_type = (TX_TYPE)GET_PARAM(2);
-    inv_txfm_param_.tx_type = (TX_TYPE)GET_PARAM(2);
+    txfm_param_.tx_type = GET_PARAM(2);
   }
   virtual void TearDown() { libaom_test::ClearSystemState(); }
 
  protected:
   void RunFwdTxfm(const int16_t *in, tran_low_t *out, int stride) {
-    fwd_txfm_(in, out, stride, &fwd_txfm_param_);
+    fwd_txfm_(in, out, stride, &txfm_param_);
   }
 
   void RunInvTxfm(const tran_low_t *out, uint8_t *dst, int stride) {
-    inv_txfm_(out, dst, stride, &inv_txfm_param_);
+    inv_txfm_(out, dst, stride, &txfm_param_);
   }
 
   FhtFunc fwd_txfm_;
diff --git a/test/dct16x16_test.cc b/test/dct16x16_test.cc
index 7cd0ba3..c2c0724 100644
--- a/test/dct16x16_test.cc
+++ b/test/dct16x16_test.cc
@@ -226,9 +226,9 @@
 typedef void (*FdctFunc)(const int16_t *in, tran_low_t *out, int stride);
 typedef void (*IdctFunc)(const tran_low_t *in, uint8_t *out, int stride);
 typedef void (*FhtFunc)(const int16_t *in, tran_low_t *out, int stride,
-                        FWD_TXFM_PARAM *fwd_txfm_param);
+                        TxfmParam *txfm_param);
 typedef void (*IhtFunc)(const tran_low_t *in, uint8_t *out, int stride,
-                        const INV_TXFM_PARAM *inv_txfm_param);
+                        const TxfmParam *txfm_param);
 
 typedef std::tr1::tuple<FdctFunc, IdctFunc, int, aom_bit_depth_t> Dct16x16Param;
 typedef std::tr1::tuple<FhtFunc, IhtFunc, int, aom_bit_depth_t> Ht16x16Param;
@@ -236,46 +236,46 @@
     Idct16x16Param;
 
 void fdct16x16_ref(const int16_t *in, tran_low_t *out, int stride,
-                   FWD_TXFM_PARAM * /*fwd_txfm_param*/) {
+                   TxfmParam * /*txfm_param*/) {
   aom_fdct16x16_c(in, out, stride);
 }
 
 void idct16x16_ref(const tran_low_t *in, uint8_t *dest, int stride,
-                   const INV_TXFM_PARAM * /*inv_txfm_param*/) {
+                   const TxfmParam * /*txfm_param*/) {
   aom_idct16x16_256_add_c(in, dest, stride);
 }
 
 void fht16x16_ref(const int16_t *in, tran_low_t *out, int stride,
-                  FWD_TXFM_PARAM *fwd_txfm_param) {
-  av1_fht16x16_c(in, out, stride, fwd_txfm_param);
+                  TxfmParam *txfm_param) {
+  av1_fht16x16_c(in, out, stride, txfm_param);
 }
 
 void iht16x16_ref(const tran_low_t *in, uint8_t *dest, int stride,
-                  const INV_TXFM_PARAM *inv_txfm_param) {
-  av1_iht16x16_256_add_c(in, dest, stride, inv_txfm_param);
+                  const TxfmParam *txfm_param) {
+  av1_iht16x16_256_add_c(in, dest, stride, txfm_param);
 }
 
 #if CONFIG_HIGHBITDEPTH
 void fht16x16_10(const int16_t *in, tran_low_t *out, int stride,
-                 FWD_TXFM_PARAM *fwd_txfm_param) {
-  av1_fwd_txfm2d_16x16_c(in, out, stride, fwd_txfm_param->tx_type, 10);
+                 TxfmParam *txfm_param) {
+  av1_fwd_txfm2d_16x16_c(in, out, stride, txfm_param->tx_type, 10);
 }
 
 void fht16x16_12(const int16_t *in, tran_low_t *out, int stride,
-                 FWD_TXFM_PARAM *fwd_txfm_param) {
-  av1_fwd_txfm2d_16x16_c(in, out, stride, fwd_txfm_param->tx_type, 12);
+                 TxfmParam *txfm_param) {
+  av1_fwd_txfm2d_16x16_c(in, out, stride, txfm_param->tx_type, 12);
 }
 
 void iht16x16_10(const tran_low_t *in, uint8_t *out, int stride,
-                 const INV_TXFM_PARAM *inv_txfm_param) {
+                 const TxfmParam *txfm_param) {
   av1_inv_txfm2d_add_16x16_c(in, CONVERT_TO_SHORTPTR(out), stride,
-                             inv_txfm_param->tx_type, 10);
+                             txfm_param->tx_type, 10);
 }
 
 void iht16x16_12(const tran_low_t *in, uint8_t *out, int stride,
-                 const INV_TXFM_PARAM *inv_txfm_param) {
+                 const TxfmParam *txfm_param) {
   av1_inv_txfm2d_add_16x16_c(in, CONVERT_TO_SHORTPTR(out), stride,
-                             inv_txfm_param->tx_type, 12);
+                             txfm_param->tx_type, 12);
 }
 #endif  // CONFIG_HIGHBITDEPTH
 
@@ -361,7 +361,7 @@
       for (int j = 0; j < kNumCoeffs; ++j)
         input_block[j] = (rnd.Rand16() & mask_) - (rnd.Rand16() & mask_);
 
-      fwd_txfm_ref(input_block, output_ref_block, pitch_, &fwd_txfm_param_);
+      fwd_txfm_ref(input_block, output_ref_block, pitch_, &txfm_param_);
       ASM_REGISTER_STATE_CHECK(RunFwdTxfm(input_block, output_block, pitch_));
 
       // The minimum quant value is 4.
@@ -388,8 +388,7 @@
         for (int j = 0; j < kNumCoeffs; ++j) input_extreme_block[j] = -mask_;
       }
 
-      fwd_txfm_ref(input_extreme_block, output_ref_block, pitch_,
-                   &fwd_txfm_param_);
+      fwd_txfm_ref(input_extreme_block, output_ref_block, pitch_, &txfm_param_);
       ASM_REGISTER_STATE_CHECK(
           RunFwdTxfm(input_extreme_block, output_block, pitch_));
 
@@ -425,8 +424,7 @@
       if (i == 1)
         for (int j = 0; j < kNumCoeffs; ++j) input_extreme_block[j] = -mask_;
 
-      fwd_txfm_ref(input_extreme_block, output_ref_block, pitch_,
-                   &fwd_txfm_param_);
+      fwd_txfm_ref(input_extreme_block, output_ref_block, pitch_, &txfm_param_);
 
       // clear reconstructed pixel buffers
       memset(dst, 0, kNumCoeffs * sizeof(uint8_t));
@@ -441,12 +439,12 @@
       for (int j = 1; j < kNumCoeffs; ++j)
         output_ref_block[j] = (output_ref_block[j] / ac_thred) * ac_thred;
       if (bit_depth_ == AOM_BITS_8) {
-        inv_txfm_ref(output_ref_block, ref, pitch_, &inv_txfm_param_);
+        inv_txfm_ref(output_ref_block, ref, pitch_, &txfm_param_);
         ASM_REGISTER_STATE_CHECK(RunInvTxfm(output_ref_block, dst, pitch_));
 #if CONFIG_HIGHBITDEPTH
       } else {
         inv_txfm_ref(output_ref_block, CONVERT_TO_BYTEPTR(ref16), pitch_,
-                     &inv_txfm_param_);
+                     &txfm_param_);
         ASM_REGISTER_STATE_CHECK(
             RunInvTxfm(output_ref_block, CONVERT_TO_BYTEPTR(dst16), pitch_));
 #endif
@@ -579,8 +577,7 @@
   int mask_;
   FhtFunc fwd_txfm_ref;
   IhtFunc inv_txfm_ref;
-  FWD_TXFM_PARAM fwd_txfm_param_;
-  INV_TXFM_PARAM inv_txfm_param_;
+  TxfmParam txfm_param_;
 };
 
 class Trans16x16DCT : public Trans16x16TestBase,
@@ -597,8 +594,7 @@
     inv_txfm_ref = idct16x16_ref;
     mask_ = (1 << bit_depth_) - 1;
     inv_txfm_ref = idct16x16_ref;
-    fwd_txfm_param_.tx_type = (TX_TYPE)GET_PARAM(2);
-    inv_txfm_param_.tx_type = (TX_TYPE)GET_PARAM(2);
+    txfm_param_.tx_type = GET_PARAM(2);
   }
   virtual void TearDown() { libaom_test::ClearSystemState(); }
 
@@ -639,8 +635,7 @@
     bit_depth_ = GET_PARAM(3);
     pitch_ = 16;
     mask_ = (1 << bit_depth_) - 1;
-    fwd_txfm_param_.tx_type = (TX_TYPE)GET_PARAM(2);
-    inv_txfm_param_.tx_type = (TX_TYPE)GET_PARAM(2);
+    txfm_param_.tx_type = GET_PARAM(2);
 #if CONFIG_HIGHBITDEPTH
     switch (bit_depth_) {
       case AOM_BITS_10:
@@ -665,10 +660,10 @@
 
  protected:
   void RunFwdTxfm(int16_t *in, tran_low_t *out, int stride) {
-    fwd_txfm_(in, out, stride, &fwd_txfm_param_);
+    fwd_txfm_(in, out, stride, &txfm_param_);
   }
   void RunInvTxfm(tran_low_t *out, uint8_t *dst, int stride) {
-    inv_txfm_(out, dst, stride, &inv_txfm_param_);
+    inv_txfm_(out, dst, stride, &txfm_param_);
   }
 
   FhtFunc fwd_txfm_;
diff --git a/test/fdct4x4_test.cc b/test/fdct4x4_test.cc
index 68b35fa..e1bd612 100644
--- a/test/fdct4x4_test.cc
+++ b/test/fdct4x4_test.cc
@@ -33,7 +33,7 @@
 typedef void (*FdctFunc)(const int16_t *in, tran_low_t *out, int stride);
 typedef void (*IdctFunc)(const tran_low_t *in, uint8_t *out, int stride);
 typedef void (*IhtFunc)(const tran_low_t *in, uint8_t *out, int stride,
-                        const INV_TXFM_PARAM *inv_txfm_param);
+                        const TxfmParam *txfm_param);
 using libaom_test::FhtFunc;
 
 typedef std::tr1::tuple<FdctFunc, IdctFunc, int, aom_bit_depth_t, int>
@@ -41,41 +41,41 @@
 typedef std::tr1::tuple<FhtFunc, IhtFunc, int, aom_bit_depth_t, int> Ht4x4Param;
 
 void fdct4x4_ref(const int16_t *in, tran_low_t *out, int stride,
-                 FWD_TXFM_PARAM * /*fwd_txfm_param*/) {
+                 TxfmParam * /*txfm_param*/) {
   aom_fdct4x4_c(in, out, stride);
 }
 
 void fht4x4_ref(const int16_t *in, tran_low_t *out, int stride,
-                FWD_TXFM_PARAM *fwd_txfm_param) {
-  av1_fht4x4_c(in, out, stride, fwd_txfm_param);
+                TxfmParam *txfm_param) {
+  av1_fht4x4_c(in, out, stride, txfm_param);
 }
 
 void fwht4x4_ref(const int16_t *in, tran_low_t *out, int stride,
-                 FWD_TXFM_PARAM * /*fwd_txfm_param*/) {
+                 TxfmParam * /*txfm_param*/) {
   av1_fwht4x4_c(in, out, stride);
 }
 
 #if CONFIG_HIGHBITDEPTH
 void fht4x4_10(const int16_t *in, tran_low_t *out, int stride,
-               FWD_TXFM_PARAM *fwd_txfm_param) {
-  av1_fwd_txfm2d_4x4_c(in, out, stride, fwd_txfm_param->tx_type, 10);
+               TxfmParam *txfm_param) {
+  av1_fwd_txfm2d_4x4_c(in, out, stride, txfm_param->tx_type, 10);
 }
 
 void fht4x4_12(const int16_t *in, tran_low_t *out, int stride,
-               FWD_TXFM_PARAM *fwd_txfm_param) {
-  av1_fwd_txfm2d_4x4_c(in, out, stride, fwd_txfm_param->tx_type, 12);
+               TxfmParam *txfm_param) {
+  av1_fwd_txfm2d_4x4_c(in, out, stride, txfm_param->tx_type, 12);
 }
 
 void iht4x4_10(const tran_low_t *in, uint8_t *out, int stride,
-               const INV_TXFM_PARAM *inv_txfm_param) {
+               const TxfmParam *txfm_param) {
   av1_inv_txfm2d_add_4x4_c(in, CONVERT_TO_SHORTPTR(out), stride,
-                           inv_txfm_param->tx_type, 10);
+                           txfm_param->tx_type, 10);
 }
 
 void iht4x4_12(const tran_low_t *in, uint8_t *out, int stride,
-               const INV_TXFM_PARAM *inv_txfm_param) {
+               const TxfmParam *txfm_param) {
   av1_inv_txfm2d_add_4x4_c(in, CONVERT_TO_SHORTPTR(out), stride,
-                           inv_txfm_param->tx_type, 12);
+                           txfm_param->tx_type, 12);
 }
 
 void iwht4x4_10(const tran_low_t *in, uint8_t *out, int stride) {
@@ -101,8 +101,7 @@
     bit_depth_ = GET_PARAM(3);
     mask_ = (1 << bit_depth_) - 1;
     num_coeffs_ = GET_PARAM(4);
-    fwd_txfm_param_.tx_type = (TX_TYPE)GET_PARAM(2);
-    inv_txfm_param_.tx_type = (TX_TYPE)GET_PARAM(2);
+    txfm_param_.tx_type = GET_PARAM(2);
   }
   virtual void TearDown() { libaom_test::ClearSystemState(); }
 
@@ -140,8 +139,7 @@
     bit_depth_ = GET_PARAM(3);
     mask_ = (1 << bit_depth_) - 1;
     num_coeffs_ = GET_PARAM(4);
-    fwd_txfm_param_.tx_type = (TX_TYPE)GET_PARAM(2);
-    inv_txfm_param_.tx_type = (TX_TYPE)GET_PARAM(2);
+    txfm_param_.tx_type = GET_PARAM(2);
 #if CONFIG_HIGHBITDEPTH
     switch (bit_depth_) {
       case AOM_BITS_10: fwd_txfm_ref = fht4x4_10; break;
@@ -154,11 +152,11 @@
 
  protected:
   void RunFwdTxfm(const int16_t *in, tran_low_t *out, int stride) {
-    fwd_txfm_(in, out, stride, &fwd_txfm_param_);
+    fwd_txfm_(in, out, stride, &txfm_param_);
   }
 
   void RunInvTxfm(const tran_low_t *out, uint8_t *dst, int stride) {
-    inv_txfm_(out, dst, stride, &inv_txfm_param_);
+    inv_txfm_(out, dst, stride, &txfm_param_);
   }
 
   FhtFunc fwd_txfm_;
diff --git a/test/fdct8x8_test.cc b/test/fdct8x8_test.cc
index 059ce7f..62cdf62 100644
--- a/test/fdct8x8_test.cc
+++ b/test/fdct8x8_test.cc
@@ -40,9 +40,9 @@
 typedef void (*FdctFunc)(const int16_t *in, tran_low_t *out, int stride);
 typedef void (*IdctFunc)(const tran_low_t *in, uint8_t *out, int stride);
 typedef void (*FhtFunc)(const int16_t *in, tran_low_t *out, int stride,
-                        FWD_TXFM_PARAM *fwd_txfm_param);
+                        TxfmParam *txfm_param);
 typedef void (*IhtFunc)(const tran_low_t *in, uint8_t *out, int stride,
-                        const INV_TXFM_PARAM *inv_txfm_param);
+                        const TxfmParam *txfm_param);
 
 typedef std::tr1::tuple<FdctFunc, IdctFunc, int, aom_bit_depth_t> Dct8x8Param;
 typedef std::tr1::tuple<FhtFunc, IhtFunc, int, aom_bit_depth_t> Ht8x8Param;
@@ -78,36 +78,36 @@
 }
 
 void fdct8x8_ref(const int16_t *in, tran_low_t *out, int stride,
-                 FWD_TXFM_PARAM * /*fwd_txfm_param*/) {
+                 TxfmParam * /*txfm_param*/) {
   aom_fdct8x8_c(in, out, stride);
 }
 
 void fht8x8_ref(const int16_t *in, tran_low_t *out, int stride,
-                FWD_TXFM_PARAM *fwd_txfm_param) {
-  av1_fht8x8_c(in, out, stride, fwd_txfm_param);
+                TxfmParam *txfm_param) {
+  av1_fht8x8_c(in, out, stride, txfm_param);
 }
 
 #if CONFIG_HIGHBITDEPTH
 void fht8x8_10(const int16_t *in, tran_low_t *out, int stride,
-               FWD_TXFM_PARAM *fwd_txfm_param) {
-  av1_fwd_txfm2d_8x8_c(in, out, stride, fwd_txfm_param->tx_type, 10);
+               TxfmParam *txfm_param) {
+  av1_fwd_txfm2d_8x8_c(in, out, stride, txfm_param->tx_type, 10);
 }
 
 void fht8x8_12(const int16_t *in, tran_low_t *out, int stride,
-               FWD_TXFM_PARAM *fwd_txfm_param) {
-  av1_fwd_txfm2d_8x8_c(in, out, stride, fwd_txfm_param->tx_type, 12);
+               TxfmParam *txfm_param) {
+  av1_fwd_txfm2d_8x8_c(in, out, stride, txfm_param->tx_type, 12);
 }
 
 void iht8x8_10(const tran_low_t *in, uint8_t *out, int stride,
-               const INV_TXFM_PARAM *inv_txfm_param) {
+               const TxfmParam *txfm_param) {
   av1_inv_txfm2d_add_8x8_c(in, CONVERT_TO_SHORTPTR(out), stride,
-                           inv_txfm_param->tx_type, 10);
+                           txfm_param->tx_type, 10);
 }
 
 void iht8x8_12(const tran_low_t *in, uint8_t *out, int stride,
-               const INV_TXFM_PARAM *inv_txfm_param) {
+               const TxfmParam *txfm_param) {
   av1_inv_txfm2d_add_8x8_c(in, CONVERT_TO_SHORTPTR(out), stride,
-                           inv_txfm_param->tx_type, 12);
+                           txfm_param->tx_type, 12);
 }
 
 #endif  // CONFIG_HIGHBITDEPTH
@@ -310,8 +310,8 @@
 
       ASM_REGISTER_STATE_CHECK(
           RunFwdTxfm(test_input_block, test_temp_block, pitch_));
-      ASM_REGISTER_STATE_CHECK(fwd_txfm_ref(test_input_block, ref_temp_block,
-                                            pitch_, &fwd_txfm_param_));
+      ASM_REGISTER_STATE_CHECK(
+          fwd_txfm_ref(test_input_block, ref_temp_block, pitch_, &txfm_param_));
       if (bit_depth_ == AOM_BITS_8) {
         ASM_REGISTER_STATE_CHECK(RunInvTxfm(test_temp_block, dst, pitch_));
 #if CONFIG_HIGHBITDEPTH
@@ -494,8 +494,7 @@
   FhtFunc fwd_txfm_ref;
   aom_bit_depth_t bit_depth_;
   int mask_;
-  FWD_TXFM_PARAM fwd_txfm_param_;
-  INV_TXFM_PARAM inv_txfm_param_;
+  TxfmParam txfm_param_;
 };
 
 class FwdTrans8x8DCT : public FwdTrans8x8TestBase,
@@ -510,8 +509,7 @@
     fwd_txfm_ref = fdct8x8_ref;
     bit_depth_ = GET_PARAM(3);
     mask_ = (1 << bit_depth_) - 1;
-    fwd_txfm_param_.tx_type = (TX_TYPE)GET_PARAM(2);
-    inv_txfm_param_.tx_type = (TX_TYPE)GET_PARAM(2);
+    txfm_param_.tx_type = GET_PARAM(2);
   }
 
   virtual void TearDown() { libaom_test::ClearSystemState(); }
@@ -550,8 +548,7 @@
     fwd_txfm_ref = fht8x8_ref;
     bit_depth_ = GET_PARAM(3);
     mask_ = (1 << bit_depth_) - 1;
-    fwd_txfm_param_.tx_type = (TX_TYPE)GET_PARAM(2);
-    inv_txfm_param_.tx_type = (TX_TYPE)GET_PARAM(2);
+    txfm_param_.tx_type = GET_PARAM(2);
 #if CONFIG_HIGHBITDEPTH
     switch (bit_depth_) {
       case AOM_BITS_10: fwd_txfm_ref = fht8x8_10; break;
@@ -565,10 +562,10 @@
 
  protected:
   void RunFwdTxfm(int16_t *in, tran_low_t *out, int stride) {
-    fwd_txfm_(in, out, stride, &fwd_txfm_param_);
+    fwd_txfm_(in, out, stride, &txfm_param_);
   }
   void RunInvTxfm(tran_low_t *out, uint8_t *dst, int stride) {
-    inv_txfm_(out, dst, stride, &inv_txfm_param_);
+    inv_txfm_(out, dst, stride, &txfm_param_);
   }
 
   FhtFunc fwd_txfm_;
diff --git a/test/transform_test_base.h b/test/transform_test_base.h
index 7be5c3d..21441be 100644
--- a/test/transform_test_base.h
+++ b/test/transform_test_base.h
@@ -15,7 +15,7 @@
 #include "./aom_config.h"
 #include "aom_mem/aom_mem.h"
 #include "aom/aom_codec.h"
-#include "av1/common/idct.h"
+#include "aom_dsp/txfm_common.h"
 
 namespace libaom_test {
 
@@ -29,10 +29,10 @@
 const int kDctMaxValue = 16384;
 
 typedef void (*FhtFunc)(const int16_t *in, tran_low_t *out, int stride,
-                        FWD_TXFM_PARAM *fwd_txfm_param);
+                        TxfmParam *txfm_param);
 
 typedef void (*IhtFunc)(const tran_low_t *in, uint8_t *out, int stride,
-                        const INV_TXFM_PARAM *inv_txfm_param);
+                        const TxfmParam *txfm_param);
 
 class TransformTestBase {
  public:
@@ -158,7 +158,7 @@
         }
       }
 
-      fwd_txfm_ref(input_block, output_ref_block, stride, &fwd_txfm_param_);
+      fwd_txfm_ref(input_block, output_ref_block, stride, &txfm_param_);
       ASM_REGISTER_STATE_CHECK(RunFwdTxfm(input_block, output_block, stride));
 
       // The minimum quant value is 4.
@@ -206,9 +206,9 @@
         }
       }
 
-      fwd_txfm_ref(input_block, trans_block, pitch_, &fwd_txfm_param_);
+      fwd_txfm_ref(input_block, trans_block, pitch_, &txfm_param_);
 
-      inv_txfm_ref(trans_block, output_ref_block, stride, &inv_txfm_param_);
+      inv_txfm_ref(trans_block, output_ref_block, stride, &txfm_param_);
       ASM_REGISTER_STATE_CHECK(RunInvTxfm(trans_block, output_block, stride));
 
       for (j = 0; j < height_; ++j) {
@@ -248,8 +248,7 @@
         for (int j = 0; j < num_coeffs_; ++j) input_extreme_block[j] = -mask_;
       }
 
-      fwd_txfm_ref(input_extreme_block, output_ref_block, pitch_,
-                   &fwd_txfm_param_);
+      fwd_txfm_ref(input_extreme_block, output_ref_block, pitch_, &txfm_param_);
       ASM_REGISTER_STATE_CHECK(
           RunFwdTxfm(input_extreme_block, output_block, pitch_));
 
@@ -305,7 +304,7 @@
         }
       }
 
-      fwd_txfm_ref(in, coeff, pitch_, &fwd_txfm_param_);
+      fwd_txfm_ref(in, coeff, pitch_, &txfm_param_);
 
       if (bit_depth_ == AOM_BITS_8) {
         ASM_REGISTER_STATE_CHECK(RunInvTxfm(coeff, dst, pitch_));
@@ -345,8 +344,7 @@
   aom_bit_depth_t bit_depth_;
   int mask_;
   int num_coeffs_;
-  FWD_TXFM_PARAM fwd_txfm_param_;
-  INV_TXFM_PARAM inv_txfm_param_;
+  TxfmParam txfm_param_;
 
  private:
   //  Assume transform size is 4x4, 8x8, 16x16,...