From d8b1ddcec30532413184d7659392213ff875b027 Mon Sep 17 00:00:00 2001 From: Lester Lu Date: Thu, 6 Jul 2017 16:13:29 -0700 Subject: [PATCH] Signature changes for the LGT experiment The input arguments of av1_fht* and av1_iht* functions (and their HBD versions) are slightly changed. Input arguments tx_type and bd are carried by a struct fwd_txfm_param/inv_txfm_param. This struct is meant to later on carry other prediction information, such as intra top/left boundaries to the transform level, so that the choice of transforms can be more adaptive to the prediction mode and local video content. Change-Id: Ia42544248a51845be64b72855b642ef1fe5910a9 --- av1/common/arm/neon/iht4x4_add_neon.c | 6 +- av1/common/arm/neon/iht8x8_add_neon.c | 6 +- av1/common/av1_rtcd_defs.pl | 131 ++++---- av1/common/idct.c | 331 ++++++++++----------- av1/common/idct.h | 18 +- av1/common/mips/dspr2/av1_itrans16_dspr2.c | 3 +- av1/common/mips/dspr2/av1_itrans4_dspr2.c | 3 +- av1/common/mips/dspr2/av1_itrans8_dspr2.c | 4 +- av1/common/mips/msa/av1_idct16x16_msa.c | 4 +- av1/common/mips/msa/av1_idct4x4_msa.c | 4 +- av1/common/mips/msa/av1_idct8x8_msa.c | 4 +- av1/common/x86/hybrid_inv_txfm_avx2.c | 5 +- av1/common/x86/idct_intrin_sse2.c | 33 +- av1/encoder/dct.c | 45 ++- av1/encoder/encodemb.c | 10 +- av1/encoder/hybrid_fwd_txfm.c | 291 ++++++++---------- av1/encoder/hybrid_fwd_txfm.h | 9 - av1/encoder/x86/dct_intrin_sse2.c | 31 +- av1/encoder/x86/hybrid_fwd_txfm_avx2.c | 7 +- test/av1_fht16x16_test.cc | 18 +- test/av1_fht16x32_test.cc | 19 +- test/av1_fht16x8_test.cc | 19 +- test/av1_fht32x16_test.cc | 19 +- test/av1_fht32x32_test.cc | 18 +- test/av1_fht4x4_test.cc | 19 +- test/av1_fht4x8_test.cc | 19 +- test/av1_fht64x64_test.cc | 18 +- test/av1_fht8x16_test.cc | 19 +- test/av1_fht8x4_test.cc | 19 +- test/av1_fht8x8_test.cc | 19 +- test/dct16x16_test.cc | 64 ++-- test/fdct4x4_test.cc | 44 +-- test/fdct8x8_test.cc | 52 ++-- test/transform_test_base.h | 19 +- 34 files changed, 694 insertions(+), 636 deletions(-) diff --git a/av1/common/arm/neon/iht4x4_add_neon.c b/av1/common/arm/neon/iht4x4_add_neon.c index 02572d405..867dbb2b2 100644 --- a/av1/common/arm/neon/iht4x4_add_neon.c +++ b/av1/common/arm/neon/iht4x4_add_neon.c @@ -16,6 +16,7 @@ #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; @@ -134,7 +135,7 @@ static INLINE void IADST4x4_1D(int16x4_t *d3s16, int16x4_t *d4s16, } void av1_iht4x4_16_add_neon(const tran_low_t *input, uint8_t *dest, - int dest_stride, int tx_type) { + int dest_stride, const INV_TXFM_PARAM *param) { uint8x8_t d26u8, d27u8; int16x4_t d0s16, d1s16, d2s16, d3s16, d4s16, d5s16; uint32x2_t d26u32, d27u32; @@ -148,9 +149,10 @@ void av1_iht4x4_16_add_neon(const tran_low_t *input, uint8_t *dest, TRANSPOSE4X4(&q8s16, &q9s16); + int tx_type = 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, tx_type); + av1_iht4x4_16_add_c(input, dest, dest_stride, 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 86798ccf1..b3af99837 100644 --- a/av1/common/arm/neon/iht8x8_add_neon.c +++ b/av1/common/arm/neon/iht8x8_add_neon.c @@ -16,6 +16,7 @@ #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, @@ -458,7 +459,7 @@ static INLINE void IADST8X8_1D(int16x8_t *q8s16, int16x8_t *q9s16, } void av1_iht8x8_64_add_neon(const tran_low_t *input, uint8_t *dest, - int dest_stride, int tx_type) { + int dest_stride, const INV_TXFM_PARAM *param) { int i; uint8_t *d1, *d2; uint8x8_t d0u8, d1u8, d2u8, d3u8; @@ -478,9 +479,10 @@ void av1_iht8x8_64_add_neon(const tran_low_t *input, uint8_t *dest, TRANSPOSE8X8(&q8s16, &q9s16, &q10s16, &q11s16, &q12s16, &q13s16, &q14s16, &q15s16); + int tx_type = 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, tx_type); + av1_iht8x8_64_add_c(input, dest, dest_stride, param); return; break; case 1: // iadst_idct diff --git a/av1/common/av1_rtcd_defs.pl b/av1/common/av1_rtcd_defs.pl index 1248cd31b..a7083ccb7 100755 --- a/av1/common/av1_rtcd_defs.pl +++ b/av1/common/av1_rtcd_defs.pl @@ -11,12 +11,15 @@ print <tx_type; static const transform_2d IHT_4[] = { { aom_idct4_c, aom_idct4_c }, // DCT_DCT = 0 { aom_iadst4_c, aom_idct4_c }, // ADST_DCT = 1 @@ -216,7 +217,7 @@ void av1_iht4x4_16_add_c(const tran_low_t *input, uint8_t *dest, int stride, { iidtx4_c, aom_iadst4_c }, // H_ADST { aom_iadst4_c, iidtx4_c }, // V_FLIPADST { iidtx4_c, aom_iadst4_c }, // H_FLIPADST -#endif // CONFIG_EXT_TX +#endif }; int i, j; @@ -258,7 +259,8 @@ void av1_iht4x4_16_add_c(const tran_low_t *input, uint8_t *dest, int stride, } void av1_iht4x8_32_add_c(const tran_low_t *input, uint8_t *dest, int stride, - int tx_type) { + const INV_TXFM_PARAM *param) { + int tx_type = param->tx_type; static const transform_2d IHT_4x8[] = { { aom_idct8_c, aom_idct4_c }, // DCT_DCT { aom_iadst8_c, aom_idct4_c }, // ADST_DCT @@ -315,7 +317,8 @@ void av1_iht4x8_32_add_c(const tran_low_t *input, uint8_t *dest, int stride, } void av1_iht8x4_32_add_c(const tran_low_t *input, uint8_t *dest, int stride, - int tx_type) { + const INV_TXFM_PARAM *param) { + int tx_type = param->tx_type; static const transform_2d IHT_8x4[] = { { aom_idct4_c, aom_idct8_c }, // DCT_DCT { aom_iadst4_c, aom_idct8_c }, // ADST_DCT @@ -336,6 +339,7 @@ void av1_iht8x4_32_add_c(const tran_low_t *input, uint8_t *dest, int stride, { iidtx4_c, aom_iadst8_c }, // H_FLIPADST #endif }; + const int n = 4; const int n2 = 8; @@ -372,7 +376,8 @@ void av1_iht8x4_32_add_c(const tran_low_t *input, uint8_t *dest, int stride, } void av1_iht4x16_64_add_c(const tran_low_t *input, uint8_t *dest, int stride, - int tx_type) { + const INV_TXFM_PARAM *param) { + int tx_type = param->tx_type; static const transform_2d IHT_4x16[] = { { aom_idct16_c, aom_idct4_c }, // DCT_DCT { aom_iadst16_c, aom_idct4_c }, // ADST_DCT @@ -426,7 +431,8 @@ void av1_iht4x16_64_add_c(const tran_low_t *input, uint8_t *dest, int stride, } void av1_iht16x4_64_add_c(const tran_low_t *input, uint8_t *dest, int stride, - int tx_type) { + const INV_TXFM_PARAM *param) { + int tx_type = param->tx_type; static const transform_2d IHT_16x4[] = { { aom_idct4_c, aom_idct16_c }, // DCT_DCT { aom_iadst4_c, aom_idct16_c }, // ADST_DCT @@ -447,6 +453,7 @@ void av1_iht16x4_64_add_c(const tran_low_t *input, uint8_t *dest, int stride, { iidtx4_c, aom_iadst16_c }, // H_FLIPADST #endif }; + const int n = 4; const int n4 = 16; @@ -480,7 +487,8 @@ void av1_iht16x4_64_add_c(const tran_low_t *input, uint8_t *dest, int stride, } void av1_iht8x16_128_add_c(const tran_low_t *input, uint8_t *dest, int stride, - int tx_type) { + const INV_TXFM_PARAM *param) { + int tx_type = param->tx_type; static const transform_2d IHT_8x16[] = { { aom_idct16_c, aom_idct8_c }, // DCT_DCT { aom_iadst16_c, aom_idct8_c }, // ADST_DCT @@ -537,7 +545,8 @@ void av1_iht8x16_128_add_c(const tran_low_t *input, uint8_t *dest, int stride, } void av1_iht16x8_128_add_c(const tran_low_t *input, uint8_t *dest, int stride, - int tx_type) { + const INV_TXFM_PARAM *param) { + int tx_type = param->tx_type; static const transform_2d IHT_16x8[] = { { aom_idct8_c, aom_idct16_c }, // DCT_DCT { aom_iadst8_c, aom_idct16_c }, // ADST_DCT @@ -558,6 +567,7 @@ void av1_iht16x8_128_add_c(const tran_low_t *input, uint8_t *dest, int stride, { iidtx8_c, aom_iadst16_c }, // H_FLIPADST #endif }; + const int n = 8; const int n2 = 16; @@ -594,7 +604,8 @@ void av1_iht16x8_128_add_c(const tran_low_t *input, uint8_t *dest, int stride, } void av1_iht8x32_256_add_c(const tran_low_t *input, uint8_t *dest, int stride, - int tx_type) { + const INV_TXFM_PARAM *param) { + int tx_type = param->tx_type; static const transform_2d IHT_8x32[] = { { aom_idct32_c, aom_idct8_c }, // DCT_DCT { ihalfright32_c, aom_idct8_c }, // ADST_DCT @@ -648,7 +659,8 @@ void av1_iht8x32_256_add_c(const tran_low_t *input, uint8_t *dest, int stride, } void av1_iht32x8_256_add_c(const tran_low_t *input, uint8_t *dest, int stride, - int tx_type) { + const INV_TXFM_PARAM *param) { + int tx_type = param->tx_type; static const transform_2d IHT_32x8[] = { { aom_idct8_c, aom_idct32_c }, // DCT_DCT { aom_iadst8_c, aom_idct32_c }, // ADST_DCT @@ -669,6 +681,7 @@ void av1_iht32x8_256_add_c(const tran_low_t *input, uint8_t *dest, int stride, { iidtx8_c, ihalfright32_c }, // H_FLIPADST #endif }; + const int n = 8; const int n4 = 32; @@ -702,7 +715,8 @@ void av1_iht32x8_256_add_c(const tran_low_t *input, uint8_t *dest, int stride, } void av1_iht16x32_512_add_c(const tran_low_t *input, uint8_t *dest, int stride, - int tx_type) { + const INV_TXFM_PARAM *param) { + int tx_type = param->tx_type; static const transform_2d IHT_16x32[] = { { aom_idct32_c, aom_idct16_c }, // DCT_DCT { ihalfright32_c, aom_idct16_c }, // ADST_DCT @@ -759,7 +773,8 @@ void av1_iht16x32_512_add_c(const tran_low_t *input, uint8_t *dest, int stride, } void av1_iht32x16_512_add_c(const tran_low_t *input, uint8_t *dest, int stride, - int tx_type) { + const INV_TXFM_PARAM *param) { + int tx_type = param->tx_type; static const transform_2d IHT_32x16[] = { { aom_idct16_c, aom_idct32_c }, // DCT_DCT { aom_iadst16_c, aom_idct32_c }, // ADST_DCT @@ -816,7 +831,8 @@ void av1_iht32x16_512_add_c(const tran_low_t *input, uint8_t *dest, int stride, } void av1_iht8x8_64_add_c(const tran_low_t *input, uint8_t *dest, int stride, - int tx_type) { + const INV_TXFM_PARAM *param) { + int tx_type = param->tx_type; static const transform_2d IHT_8[] = { { aom_idct8_c, aom_idct8_c }, // DCT_DCT = 0 { aom_iadst8_c, aom_idct8_c }, // ADST_DCT = 1 @@ -877,7 +893,8 @@ void av1_iht8x8_64_add_c(const tran_low_t *input, uint8_t *dest, int stride, } void av1_iht16x16_256_add_c(const tran_low_t *input, uint8_t *dest, int stride, - int tx_type) { + const INV_TXFM_PARAM *param) { + int tx_type = param->tx_type; static const transform_2d IHT_16[] = { { aom_idct16_c, aom_idct16_c }, // DCT_DCT = 0 { aom_iadst16_c, aom_idct16_c }, // ADST_DCT = 1 @@ -939,7 +956,8 @@ void av1_iht16x16_256_add_c(const tran_low_t *input, uint8_t *dest, int stride, #if CONFIG_EXT_TX void av1_iht32x32_1024_add_c(const tran_low_t *input, uint8_t *dest, int stride, - int tx_type) { + const INV_TXFM_PARAM *param) { + int tx_type = param->tx_type; static const transform_2d IHT_32[] = { { aom_idct32_c, aom_idct32_c }, // DCT_DCT { ihalfright32_c, aom_idct32_c }, // ADST_DCT @@ -998,7 +1016,8 @@ void av1_iht32x32_1024_add_c(const tran_low_t *input, uint8_t *dest, int stride, #if CONFIG_TX64X64 void av1_iht64x64_4096_add_c(const tran_low_t *input, uint8_t *dest, int stride, - int tx_type) { + const INV_TXFM_PARAM *param) { + int tx_type = param->tx_type; static const transform_2d IHT_64[] = { { idct64_col_c, idct64_row_c }, // DCT_DCT { ihalfright64_c, idct64_row_c }, // ADST_DCT @@ -1158,7 +1177,7 @@ static void idct64x64_add(const tran_low_t *input, uint8_t *dest, int stride, #if CONFIG_CHROMA_2X2 static void inv_txfm_add_2x2(const tran_low_t *input, uint8_t *dest, int stride, - int eob, TX_TYPE tx_type, int lossless) { + const INV_TXFM_PARAM *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; @@ -1169,9 +1188,7 @@ static void inv_txfm_add_2x2(const tran_low_t *input, uint8_t *dest, int stride, tran_high_t c2 = a1 - c1; tran_high_t d2 = b1 - d1; - (void)tx_type; - (void)lossless; - (void)eob; + (void)param; a1 = (a2 + b2) >> 2; b1 = (a2 - b2) >> 2; @@ -1186,8 +1203,10 @@ static void inv_txfm_add_2x2(const tran_low_t *input, uint8_t *dest, int stride, #endif static void inv_txfm_add_4x4(const tran_low_t *input, uint8_t *dest, int stride, - int eob, TX_TYPE tx_type, int lossless) { - if (lossless) { + const INV_TXFM_PARAM *param) { + const TX_TYPE tx_type = param->tx_type; + const int eob = param->eob; + if (param->lossless) { assert(tx_type == DCT_DCT); av1_iwht4x4_add(input, dest, stride, eob); return; @@ -1200,10 +1219,10 @@ static void inv_txfm_add_4x4(const tran_low_t *input, uint8_t *dest, int stride, case ADST_ADST: #if CONFIG_LGT // LGT only exists in C verson - av1_iht4x4_16_add_c(input, dest, stride, tx_type); + av1_iht4x4_16_add_c(input, dest, stride, param); break; #else - av1_iht4x4_16_add(input, dest, stride, tx_type); + av1_iht4x4_16_add(input, dest, stride, param); break; #endif #if CONFIG_EXT_TX @@ -1213,10 +1232,10 @@ static void inv_txfm_add_4x4(const tran_low_t *input, uint8_t *dest, int stride, case ADST_FLIPADST: case FLIPADST_ADST: #if CONFIG_LGT - av1_iht4x4_16_add_c(input, dest, stride, tx_type); + av1_iht4x4_16_add_c(input, dest, stride, param); break; #else - av1_iht4x4_16_add(input, dest, stride, tx_type); + av1_iht4x4_16_add(input, dest, stride, param); break; #endif case V_DCT: @@ -1226,7 +1245,7 @@ static void inv_txfm_add_4x4(const tran_low_t *input, uint8_t *dest, int stride, case V_FLIPADST: case H_FLIPADST: // Use C version since DST only exists in C code - av1_iht4x4_16_add_c(input, dest, stride, tx_type); + av1_iht4x4_16_add_c(input, dest, stride, param); break; case IDTX: inv_idtx_add_c(input, dest, stride, 4, tx_type); break; #endif // CONFIG_EXT_TX @@ -1235,98 +1254,88 @@ static void inv_txfm_add_4x4(const tran_low_t *input, uint8_t *dest, int stride, } static void inv_txfm_add_4x8(const tran_low_t *input, uint8_t *dest, int stride, - int eob, TX_TYPE tx_type) { - (void)eob; + const INV_TXFM_PARAM *param) { #if CONFIG_LGT - av1_iht4x8_32_add_c(input, dest, stride, tx_type); + av1_iht4x8_32_add_c(input, dest, stride, param); #else - av1_iht4x8_32_add(input, dest, stride, tx_type); + av1_iht4x8_32_add(input, dest, stride, param); #endif } static void inv_txfm_add_8x4(const tran_low_t *input, uint8_t *dest, int stride, - int eob, TX_TYPE tx_type) { - (void)eob; + const INV_TXFM_PARAM *param) { #if CONFIG_LGT - av1_iht8x4_32_add_c(input, dest, stride, tx_type); + av1_iht8x4_32_add_c(input, dest, stride, param); #else - av1_iht8x4_32_add(input, dest, stride, tx_type); + av1_iht8x4_32_add(input, dest, stride, 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, int eob, TX_TYPE tx_type) { - (void)eob; + int stride, const INV_TXFM_PARAM *param) { #if CONFIG_LGT - av1_iht4x16_64_add_c(input, dest, stride, tx_type); + av1_iht4x16_64_add_c(input, dest, stride, param); #else - av1_iht4x16_64_add(input, dest, stride, tx_type); + av1_iht4x16_64_add(input, dest, stride, param); #endif } static void inv_txfm_add_16x4(const tran_low_t *input, uint8_t *dest, - int stride, int eob, TX_TYPE tx_type) { - (void)eob; + int stride, const INV_TXFM_PARAM *param) { #if CONFIG_LGT - av1_iht16x4_64_add_c(input, dest, stride, tx_type); + av1_iht16x4_64_add_c(input, dest, stride, param); #else - av1_iht16x4_64_add(input, dest, stride, tx_type); + av1_iht16x4_64_add(input, dest, stride, param); #endif } static void inv_txfm_add_8x32(const tran_low_t *input, uint8_t *dest, - int stride, int eob, TX_TYPE tx_type) { - (void)eob; + int stride, const INV_TXFM_PARAM *param) { #if CONFIG_LGT - av1_iht8x32_256_add_c(input, dest, stride, tx_type); + av1_iht8x32_256_add_c(input, dest, stride, param); #else - av1_iht8x32_256_add(input, dest, stride, tx_type); + av1_iht8x32_256_add(input, dest, stride, param); #endif } static void inv_txfm_add_32x8(const tran_low_t *input, uint8_t *dest, - int stride, int eob, TX_TYPE tx_type) { - (void)eob; + int stride, const INV_TXFM_PARAM *param) { #if CONFIG_LGT - av1_iht32x8_256_add_c(input, dest, stride, tx_type); + av1_iht32x8_256_add_c(input, dest, stride, param); #else - av1_iht32x8_256_add(input, dest, stride, tx_type); + av1_iht32x8_256_add(input, dest, stride, param); #endif } -#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, int eob, TX_TYPE tx_type) { - (void)eob; + int stride, const INV_TXFM_PARAM *param) { #if CONFIG_LGT - av1_iht8x16_128_add_c(input, dest, stride, tx_type); + av1_iht8x16_128_add_c(input, dest, stride, param); #else - av1_iht8x16_128_add(input, dest, stride, tx_type); + av1_iht8x16_128_add(input, dest, stride, param); #endif } static void inv_txfm_add_16x8(const tran_low_t *input, uint8_t *dest, - int stride, int eob, TX_TYPE tx_type) { - (void)eob; + int stride, const INV_TXFM_PARAM *param) { #if CONFIG_LGT - av1_iht16x8_128_add_c(input, dest, stride, tx_type); + av1_iht16x8_128_add_c(input, dest, stride, param); #else - av1_iht16x8_128_add(input, dest, stride, tx_type); + av1_iht16x8_128_add(input, dest, stride, param); #endif } static void inv_txfm_add_16x32(const tran_low_t *input, uint8_t *dest, - int stride, int eob, TX_TYPE tx_type) { - (void)eob; - av1_iht16x32_512_add(input, dest, stride, tx_type); + int stride, const INV_TXFM_PARAM *param) { + av1_iht16x32_512_add(input, dest, stride, param); } static void inv_txfm_add_32x16(const tran_low_t *input, uint8_t *dest, - int stride, int eob, TX_TYPE tx_type) { - (void)eob; - av1_iht32x16_512_add(input, dest, stride, tx_type); + int stride, const INV_TXFM_PARAM *param) { + av1_iht32x16_512_add(input, dest, stride, param); } static void inv_txfm_add_8x8(const tran_low_t *input, uint8_t *dest, int stride, @@ -1338,10 +1347,10 @@ static void inv_txfm_add_8x8(const tran_low_t *input, uint8_t *dest, int stride, case DCT_ADST: case ADST_ADST: #if CONFIG_LGT - av1_iht8x8_64_add_c(input, dest, stride, tx_type); + av1_iht8x8_64_add_c(input, dest, stride, param); break; #else - av1_iht8x8_64_add(input, dest, stride, tx_type); + av1_iht8x8_64_add(input, dest, stride, param); break; #endif #if CONFIG_EXT_TX @@ -1351,10 +1360,10 @@ static void inv_txfm_add_8x8(const tran_low_t *input, uint8_t *dest, int stride, case ADST_FLIPADST: case FLIPADST_ADST: #if CONFIG_LGT - av1_iht8x8_64_add_c(input, dest, stride, tx_type); + av1_iht8x8_64_add_c(input, dest, stride, param); break; #else - av1_iht8x8_64_add(input, dest, stride, tx_type); + av1_iht8x8_64_add(input, dest, stride, param); break; #endif case V_DCT: @@ -1364,7 +1373,7 @@ static void inv_txfm_add_8x8(const tran_low_t *input, uint8_t *dest, int stride, case V_FLIPADST: case H_FLIPADST: // Use C version since DST only exists in C code - av1_iht8x8_64_add_c(input, dest, stride, tx_type); + av1_iht8x8_64_add_c(input, dest, stride, param); break; case IDTX: inv_idtx_add_c(input, dest, stride, 8, tx_type); break; #endif // CONFIG_EXT_TX @@ -1379,7 +1388,7 @@ static void inv_txfm_add_16x16(const tran_low_t *input, uint8_t *dest, case DCT_DCT: idct16x16_add(input, dest, stride, param); break; case ADST_DCT: case DCT_ADST: - case ADST_ADST: av1_iht16x16_256_add(input, dest, stride, tx_type); break; + case ADST_ADST: av1_iht16x16_256_add(input, dest, stride, param); break; #if CONFIG_EXT_TX case FLIPADST_DCT: case DCT_FLIPADST: @@ -1391,7 +1400,7 @@ static void inv_txfm_add_16x16(const tran_low_t *input, uint8_t *dest, case V_ADST: case H_ADST: case V_FLIPADST: - case H_FLIPADST: av1_iht16x16_256_add(input, dest, stride, tx_type); break; + case H_FLIPADST: av1_iht16x16_256_add(input, dest, stride, param); break; case IDTX: inv_idtx_add_c(input, dest, stride, 16, tx_type); break; #endif // CONFIG_EXT_TX default: assert(0); break; @@ -1417,9 +1426,7 @@ static void inv_txfm_add_32x32(const tran_low_t *input, uint8_t *dest, case V_ADST: case H_ADST: case V_FLIPADST: - case H_FLIPADST: - av1_iht32x32_1024_add_c(input, dest, stride, tx_type); - break; + case H_FLIPADST: av1_iht32x32_1024_add_c(input, dest, stride, param); break; case IDTX: inv_idtx_add_c(input, dest, stride, 32, tx_type); break; #endif // CONFIG_EXT_TX default: assert(0); break; @@ -1446,9 +1453,7 @@ static void inv_txfm_add_64x64(const tran_low_t *input, uint8_t *dest, case V_ADST: case H_ADST: case V_FLIPADST: - case H_FLIPADST: - av1_iht64x64_4096_add_c(input, dest, stride, tx_type); - break; + case H_FLIPADST: av1_iht64x64_4096_add_c(input, dest, stride, param); break; case IDTX: inv_idtx_add_c(input, dest, stride, 64, tx_type); break; #endif // CONFIG_EXT_TX default: assert(0); break; @@ -1466,8 +1471,11 @@ void av1_highbd_iwht4x4_add(const tran_low_t *input, uint8_t *dest, int stride, #if CONFIG_CHROMA_2X2 static void highbd_inv_txfm_add_2x2(const tran_low_t *input, uint8_t *dest, - int stride, int eob, int bd, - TX_TYPE tx_type, int lossless) { + 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; 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; @@ -1497,9 +1505,12 @@ static void highbd_inv_txfm_add_2x2(const tran_low_t *input, uint8_t *dest, #endif void av1_highbd_inv_txfm_add_4x4(const tran_low_t *input, uint8_t *dest, - int stride, int eob, int bd, TX_TYPE tx_type, - int lossless) { + int stride, const INV_TXFM_PARAM *param) { + int eob = param->eob; + int bd = param->bd; + int lossless = param->lossless; const int32_t *src = (const int32_t *)input; + TX_TYPE tx_type = param->tx_type; if (lossless) { assert(tx_type == DCT_DCT); av1_highbd_iwht4x4_add(input, dest, stride, eob, bd); @@ -1539,59 +1550,51 @@ void av1_highbd_inv_txfm_add_4x4(const tran_low_t *input, uint8_t *dest, } void av1_highbd_inv_txfm_add_4x8(const tran_low_t *input, uint8_t *dest, - int stride, int eob, int bd, TX_TYPE tx_type) { - (void)eob; + int stride, const INV_TXFM_PARAM *param) { const int32_t *src = (const int32_t *)input; - av1_inv_txfm2d_add_4x8_c(src, CONVERT_TO_SHORTPTR(dest), stride, tx_type, bd); + av1_inv_txfm2d_add_4x8_c(src, CONVERT_TO_SHORTPTR(dest), stride, + param->tx_type, param->bd); } void av1_highbd_inv_txfm_add_8x4(const tran_low_t *input, uint8_t *dest, - int stride, int eob, int bd, TX_TYPE tx_type) { - (void)eob; + int stride, const INV_TXFM_PARAM *param) { const int32_t *src = (const int32_t *)input; - av1_inv_txfm2d_add_8x4_c(src, CONVERT_TO_SHORTPTR(dest), stride, tx_type, bd); + av1_inv_txfm2d_add_8x4_c(src, CONVERT_TO_SHORTPTR(dest), stride, + param->tx_type, param->bd); } static void highbd_inv_txfm_add_8x16(const tran_low_t *input, uint8_t *dest, - int stride, int eob, int bd, - TX_TYPE tx_type) { - (void)eob; + int stride, const INV_TXFM_PARAM *param) { const int32_t *src = (const int32_t *)input; - av1_inv_txfm2d_add_8x16_c(src, CONVERT_TO_SHORTPTR(dest), stride, tx_type, - bd); + av1_inv_txfm2d_add_8x16_c(src, CONVERT_TO_SHORTPTR(dest), stride, + param->tx_type, param->bd); } static void highbd_inv_txfm_add_16x8(const tran_low_t *input, uint8_t *dest, - int stride, int eob, int bd, - TX_TYPE tx_type) { - (void)eob; + int stride, const INV_TXFM_PARAM *param) { const int32_t *src = (const int32_t *)input; - av1_inv_txfm2d_add_16x8_c(src, CONVERT_TO_SHORTPTR(dest), stride, tx_type, - bd); + av1_inv_txfm2d_add_16x8_c(src, CONVERT_TO_SHORTPTR(dest), stride, + param->tx_type, param->bd); } static void highbd_inv_txfm_add_16x32(const tran_low_t *input, uint8_t *dest, - int stride, int eob, int bd, - TX_TYPE tx_type) { - (void)eob; + int stride, const INV_TXFM_PARAM *param) { const int32_t *src = (const int32_t *)input; - av1_inv_txfm2d_add_16x32_c(src, CONVERT_TO_SHORTPTR(dest), stride, tx_type, - bd); + av1_inv_txfm2d_add_16x32_c(src, CONVERT_TO_SHORTPTR(dest), stride, + param->tx_type, param->bd); } static void highbd_inv_txfm_add_32x16(const tran_low_t *input, uint8_t *dest, - int stride, int eob, int bd, - TX_TYPE tx_type) { - (void)eob; + int stride, const INV_TXFM_PARAM *param) { const int32_t *src = (const int32_t *)input; - av1_inv_txfm2d_add_32x16_c(src, CONVERT_TO_SHORTPTR(dest), stride, tx_type, - bd); + av1_inv_txfm2d_add_32x16_c(src, CONVERT_TO_SHORTPTR(dest), stride, + param->tx_type, param->bd); } static void highbd_inv_txfm_add_8x8(const tran_low_t *input, uint8_t *dest, - int stride, int eob, int bd, - TX_TYPE tx_type) { - (void)eob; + int stride, const INV_TXFM_PARAM *param) { + int bd = param->bd; + TX_TYPE tx_type = param->tx_type; const int32_t *src = (const int32_t *)input; switch (tx_type) { case DCT_DCT: @@ -1627,9 +1630,9 @@ static void highbd_inv_txfm_add_8x8(const tran_low_t *input, uint8_t *dest, } static void highbd_inv_txfm_add_16x16(const tran_low_t *input, uint8_t *dest, - int stride, int eob, int bd, - TX_TYPE tx_type) { - (void)eob; + int stride, const INV_TXFM_PARAM *param) { + int bd = param->bd; + TX_TYPE tx_type = param->tx_type; const int32_t *src = (const int32_t *)input; switch (tx_type) { case DCT_DCT: @@ -1665,9 +1668,9 @@ static void highbd_inv_txfm_add_16x16(const tran_low_t *input, uint8_t *dest, } static void highbd_inv_txfm_add_32x32(const tran_low_t *input, uint8_t *dest, - int stride, int eob, int bd, - TX_TYPE tx_type) { - (void)eob; + int stride, const INV_TXFM_PARAM *param) { + int bd = param->bd; + TX_TYPE tx_type = param->tx_type; const int32_t *src = (const int32_t *)input; switch (tx_type) { case DCT_DCT: @@ -1704,9 +1707,9 @@ static void highbd_inv_txfm_add_32x32(const tran_low_t *input, uint8_t *dest, #if CONFIG_TX64X64 static void highbd_inv_txfm_add_64x64(const tran_low_t *input, uint8_t *dest, - int stride, int eob, int bd, - TX_TYPE tx_type) { - (void)eob; + int stride, const INV_TXFM_PARAM *param) { + int bd = param->bd; + TX_TYPE tx_type = param->tx_type; const int32_t *src = (const int32_t *)input; switch (tx_type) { case DCT_DCT: @@ -1748,11 +1751,7 @@ static void highbd_inv_txfm_add_64x64(const tran_low_t *input, uint8_t *dest, void av1_inv_txfm_add(const tran_low_t *input, uint8_t *dest, int stride, INV_TXFM_PARAM *param) { - const TX_TYPE tx_type = param->tx_type; const TX_SIZE tx_size = param->tx_size; - const int eob = param->eob; - const int lossless = param->lossless; - switch (tx_size) { #if CONFIG_TX64X64 case TX_64X64: inv_txfm_add_64x64(input, dest, stride, param); break; @@ -1760,28 +1759,26 @@ void av1_inv_txfm_add(const tran_low_t *input, uint8_t *dest, int stride, 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, eob, tx_type); break; - case TX_8X4: inv_txfm_add_8x4(input, dest, stride, eob, tx_type); break; - case TX_8X16: inv_txfm_add_8x16(input, dest, stride, eob, tx_type); break; - case TX_16X8: inv_txfm_add_16x8(input, dest, stride, eob, tx_type); break; - case TX_16X32: inv_txfm_add_16x32(input, dest, stride, eob, tx_type); break; - case TX_32X16: inv_txfm_add_32x16(input, dest, stride, eob, tx_type); 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_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, eob, tx_type, lossless); + inv_txfm_add_4x4(input, dest, stride, param); break; #if CONFIG_CHROMA_2X2 - case TX_2X2: - inv_txfm_add_2x2(input, dest, stride, eob, tx_type, lossless); - break; + case TX_2X2: inv_txfm_add_2x2(input, dest, stride, param); break; #endif #if CONFIG_EXT_TX && CONFIG_RECT_TX && CONFIG_RECT_TX_EXT - case TX_32X8: inv_txfm_add_32x8(input, dest, stride, eob, tx_type); break; - case TX_8X32: inv_txfm_add_8x32(input, dest, stride, eob, tx_type); break; - case TX_16X4: inv_txfm_add_16x4(input, dest, stride, eob, tx_type); break; - case TX_4X16: inv_txfm_add_4x16(input, dest, stride, eob, tx_type); break; + 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; #endif default: assert(0 && "Invalid transform size"); break; } @@ -1853,57 +1850,29 @@ void av1_inverse_transform_block_facade(MACROBLOCKD *xd, int plane, int block, } void av1_highbd_inv_txfm_add(const tran_low_t *input, uint8_t *dest, int stride, - INV_TXFM_PARAM *inv_txfm_param) { - const TX_TYPE tx_type = inv_txfm_param->tx_type; - const TX_SIZE tx_size = inv_txfm_param->tx_size; - const int eob = inv_txfm_param->eob; - const int bd = inv_txfm_param->bd; - const int lossless = inv_txfm_param->lossless; - + INV_TXFM_PARAM *param) { + const TX_SIZE tx_size = param->tx_size; switch (tx_size) { #if CONFIG_TX64X64 - case TX_64X64: - highbd_inv_txfm_add_64x64(input, dest, stride, eob, bd, tx_type); - break; + case TX_64X64: highbd_inv_txfm_add_64x64(input, dest, stride, param); break; #endif // CONFIG_TX64X64 - case TX_32X32: - highbd_inv_txfm_add_32x32(input, dest, stride, eob, bd, tx_type); - break; - case TX_16X16: - highbd_inv_txfm_add_16x16(input, dest, stride, eob, bd, tx_type); - break; - case TX_8X8: - highbd_inv_txfm_add_8x8(input, dest, stride, eob, bd, tx_type); - break; - case TX_4X8: - av1_highbd_inv_txfm_add_4x8(input, dest, stride, eob, bd, tx_type); - break; - case TX_8X4: - av1_highbd_inv_txfm_add_8x4(input, dest, stride, eob, bd, tx_type); - break; - case TX_8X16: - highbd_inv_txfm_add_8x16(input, dest, stride, eob, bd, tx_type); - break; - case TX_16X8: - highbd_inv_txfm_add_16x8(input, dest, stride, eob, bd, tx_type); - break; - case TX_16X32: - highbd_inv_txfm_add_16x32(input, dest, stride, eob, bd, tx_type); - break; - case TX_32X16: - highbd_inv_txfm_add_32x16(input, dest, stride, eob, bd, tx_type); - break; + 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_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, eob, bd, tx_type, - lossless); + av1_highbd_inv_txfm_add_4x4(input, dest, stride, param); break; #if CONFIG_CHROMA_2X2 - case TX_2X2: - highbd_inv_txfm_add_2x2(input, dest, stride, eob, bd, tx_type, lossless); - break; + case TX_2X2: highbd_inv_txfm_add_2x2(input, dest, stride, param); break; #endif default: assert(0 && "Invalid transform size"); break; } diff --git a/av1/common/idct.h b/av1/common/idct.h index c3b3876b5..3506916b6 100644 --- a/av1/common/idct.h +++ b/av1/common/idct.h @@ -26,7 +26,16 @@ extern "C" { #endif -typedef struct INV_TXFM_PARAM { +// 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; +} FWD_TXFM_PARAM; + +typedef struct inv_txfm_param { #if CONFIG_ADAPT_SCAN const int16_t *eob_threshold; #endif @@ -71,12 +80,11 @@ void av1_inverse_transform_block_facade(MACROBLOCKD *xd, int plane, int block, 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, int eob, int bd, TX_TYPE tx_type, - int lossless); + int stride, const INV_TXFM_PARAM *param); void av1_highbd_inv_txfm_add_4x8(const tran_low_t *input, uint8_t *dest, - int stride, int eob, int bd, TX_TYPE tx_type); + int stride, const INV_TXFM_PARAM *param); void av1_highbd_inv_txfm_add_8x4(const tran_low_t *input, uint8_t *dest, - int stride, int eob, int bd, TX_TYPE tx_type); + int stride, const INV_TXFM_PARAM *param); void av1_highbd_inv_txfm_add(const tran_low_t *input, uint8_t *dest, int stride, INV_TXFM_PARAM *inv_txfm_param); diff --git a/av1/common/mips/dspr2/av1_itrans16_dspr2.c b/av1/common/mips/dspr2/av1_itrans16_dspr2.c index 79f9338bd..3bbe1aa73 100644 --- a/av1/common/mips/dspr2/av1_itrans16_dspr2.c +++ b/av1/common/mips/dspr2/av1_itrans16_dspr2.c @@ -23,12 +23,13 @@ #if HAVE_DSPR2 void av1_iht16x16_256_add_dspr2(const int16_t *input, uint8_t *dest, int pitch, - int tx_type) { + FWD_TXFM_PARAM *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; /* 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 0a9552376..99eab2b36 100644 --- a/av1/common/mips/dspr2/av1_itrans4_dspr2.c +++ b/av1/common/mips/dspr2/av1_itrans4_dspr2.c @@ -23,12 +23,13 @@ #if HAVE_DSPR2 void av1_iht4x4_16_add_dspr2(const int16_t *input, uint8_t *dest, - int dest_stride, int tx_type) { + int dest_stride, FWD_TXFM_PARAM *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; /* 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 8bf5b4f0e..551c8fca5 100644 --- a/av1/common/mips/dspr2/av1_itrans8_dspr2.c +++ b/av1/common/mips/dspr2/av1_itrans8_dspr2.c @@ -16,18 +16,20 @@ #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, int tx_type) { + int dest_stride, FWD_TXFM_PARAM *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; /* 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 4bd0a1635..eb7d8c889 100644 --- a/av1/common/mips/msa/av1_idct16x16_msa.c +++ b/av1/common/mips/msa/av1_idct16x16_msa.c @@ -12,13 +12,15 @@ #include #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, int32_t tx_type) { + int32_t dst_stride, FWD_TXFM_PARAM *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; 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 8364f8dc4..b5d1196a2 100644 --- a/av1/common/mips/msa/av1_idct4x4_msa.c +++ b/av1/common/mips/msa/av1_idct4x4_msa.c @@ -12,11 +12,13 @@ #include #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, int32_t tx_type) { + int32_t dst_stride, FWD_TXFM_PARAM *param) { v8i16 in0, in1, in2, in3; + int32_t tx_type = 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 71117051b..6b1d48957 100644 --- a/av1/common/mips/msa/av1_idct8x8_msa.c +++ b/av1/common/mips/msa/av1_idct8x8_msa.c @@ -12,11 +12,13 @@ #include #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, int32_t tx_type) { + int32_t dst_stride, FWD_TXFM_PARAM *param) { v8i16 in0, in1, in2, in3, in4, in5, in6, in7; + int32_t tx_type = 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 c69614e42..617c99569 100644 --- a/av1/common/x86/hybrid_inv_txfm_avx2.c +++ b/av1/common/x86/hybrid_inv_txfm_avx2.c @@ -14,6 +14,7 @@ #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) { @@ -364,8 +365,10 @@ static void iidtx16(__m256i *in) { #endif void av1_iht16x16_256_add_avx2(const tran_low_t *input, uint8_t *dest, - int stride, int tx_type) { + int stride, + const INV_TXFM_PARAM *inv_txfm_param) { __m256i in[16]; + int tx_type = inv_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 d6a598746..6bc114177 100644 --- a/av1/common/x86/idct_intrin_sse2.c +++ b/av1/common/x86/idct_intrin_sse2.c @@ -15,6 +15,7 @@ #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]*/) { @@ -59,10 +60,11 @@ static INLINE void fliplr_16x8(__m128i *in /*in[16]*/) { #endif void av1_iht4x4_16_add_sse2(const tran_low_t *input, uint8_t *dest, int stride, - int tx_type) { + const INV_TXFM_PARAM *inv_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; in[0] = load_input_data(input); in[1] = load_input_data(input + 8); @@ -150,10 +152,11 @@ void av1_iht4x4_16_add_sse2(const tran_low_t *input, uint8_t *dest, int stride, } void av1_iht8x8_64_add_sse2(const tran_low_t *input, uint8_t *dest, int stride, - int tx_type) { + const INV_TXFM_PARAM *inv_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; // load input data in[0] = load_input_data(input); @@ -251,10 +254,12 @@ static void iidtx16_sse2(__m128i *in0, __m128i *in1) { #endif // CONFIG_EXT_TX void av1_iht16x16_256_add_sse2(const tran_low_t *input, uint8_t *dest, - int stride, int tx_type) { + int stride, + const INV_TXFM_PARAM *inv_txfm_param) { __m128i in[32]; __m128i *in0 = &in[0]; __m128i *in1 = &in[16]; + int tx_type = inv_txfm_param->tx_type; load_buffer_8x16(input, in0); input += 8; @@ -388,8 +393,10 @@ static INLINE void flip_buffer_lr_8x8(__m128i *in) { #endif // CONFIG_EXT_TX void av1_iht8x16_128_add_sse2(const tran_low_t *input, uint8_t *dest, - int stride, int tx_type) { + int stride, + const INV_TXFM_PARAM *inv_txfm_param) { __m128i in[16]; + int tx_type = inv_txfm_param->tx_type; in[0] = load_input_data(input + 0 * 8); in[1] = load_input_data(input + 1 * 8); @@ -553,8 +560,10 @@ static INLINE void write_buffer_8x8_round6(uint8_t *dest, __m128i *in, } void av1_iht16x8_128_add_sse2(const tran_low_t *input, uint8_t *dest, - int stride, int tx_type) { + int stride, + const INV_TXFM_PARAM *inv_txfm_param) { __m128i in[16]; + int tx_type = inv_txfm_param->tx_type; // Transpose 16x8 input into in[] in[0] = load_input_data(input + 0 * 16); @@ -713,8 +722,9 @@ static INLINE void write_buffer_8x4_round5(uint8_t *dest, __m128i *in, } void av1_iht8x4_32_add_sse2(const tran_low_t *input, uint8_t *dest, int stride, - int tx_type) { + const INV_TXFM_PARAM *inv_txfm_param) { __m128i in[8]; + int tx_type = inv_txfm_param->tx_type; in[0] = load_input_data(input + 0 * 8); in[1] = load_input_data(input + 1 * 8); @@ -897,8 +907,9 @@ static INLINE void write_buffer_4x8_round5(uint8_t *dest, __m128i *in, } void av1_iht4x8_32_add_sse2(const tran_low_t *input, uint8_t *dest, int stride, - int tx_type) { + const INV_TXFM_PARAM *inv_txfm_param) { __m128i in[8]; + int tx_type = inv_txfm_param->tx_type; // Load rows, packed two per element of 'in'. // We pack into the bottom half of 'in' so that the @@ -1119,8 +1130,10 @@ static INLINE void write_buffer_16x32_round6(uint8_t *dest, __m128i *intl, } void av1_iht16x32_512_add_sse2(const tran_low_t *input, uint8_t *dest, - int stride, int tx_type) { + int stride, + const INV_TXFM_PARAM *inv_txfm_param) { __m128i intl[16], intr[16], inbl[16], inbr[16]; + int tx_type = inv_txfm_param->tx_type; int i; for (i = 0; i < 16; ++i) { @@ -1272,8 +1285,10 @@ static INLINE void write_buffer_32x16_round6(uint8_t *dest, __m128i *in0, } void av1_iht32x16_512_add_sse2(const tran_low_t *input, uint8_t *dest, - int stride, int tx_type) { + int stride, + const INV_TXFM_PARAM *inv_txfm_param) { __m128i in0[16], in1[16], in2[16], in3[16]; + int tx_type = inv_txfm_param->tx_type; int i; for (i = 0; i < 16; ++i) { diff --git a/av1/encoder/dct.c b/av1/encoder/dct.c index 60c641f6d..b96cae108 100644 --- a/av1/encoder/dct.c +++ b/av1/encoder/dct.c @@ -1175,7 +1175,8 @@ static void maybe_flip_input(const int16_t **src, int *src_stride, int l, int w, #endif // CONFIG_EXT_TX void av1_fht4x4_c(const int16_t *input, tran_low_t *output, int stride, - int tx_type) { + FWD_TXFM_PARAM *fwd_txfm_param) { + int tx_type = fwd_txfm_param->tx_type; if (tx_type == DCT_DCT) { aom_fdct4x4_c(input, output, stride); } else { @@ -1227,7 +1228,8 @@ void av1_fht4x4_c(const int16_t *input, tran_low_t *output, int stride, } void av1_fht4x8_c(const int16_t *input, tran_low_t *output, int stride, - int tx_type) { + FWD_TXFM_PARAM *fwd_txfm_param) { + int tx_type = fwd_txfm_param->tx_type; static const transform_2d FHT[] = { { fdct8, fdct4 }, // DCT_DCT { fadst8, fdct4 }, // ADST_DCT @@ -1279,7 +1281,8 @@ void av1_fht4x8_c(const int16_t *input, tran_low_t *output, int stride, } void av1_fht8x4_c(const int16_t *input, tran_low_t *output, int stride, - int tx_type) { + FWD_TXFM_PARAM *fwd_txfm_param) { + int tx_type = fwd_txfm_param->tx_type; static const transform_2d FHT[] = { { fdct4, fdct8 }, // DCT_DCT { fadst4, fdct8 }, // ADST_DCT @@ -1331,7 +1334,8 @@ void av1_fht8x4_c(const int16_t *input, tran_low_t *output, int stride, } void av1_fht4x16_c(const int16_t *input, tran_low_t *output, int stride, - int tx_type) { + FWD_TXFM_PARAM *fwd_txfm_param) { + int tx_type = fwd_txfm_param->tx_type; static const transform_2d FHT[] = { { fdct16, fdct4 }, // DCT_DCT { fadst16, fdct4 }, // ADST_DCT @@ -1381,7 +1385,8 @@ void av1_fht4x16_c(const int16_t *input, tran_low_t *output, int stride, } void av1_fht16x4_c(const int16_t *input, tran_low_t *output, int stride, - int tx_type) { + FWD_TXFM_PARAM *fwd_txfm_param) { + int tx_type = fwd_txfm_param->tx_type; static const transform_2d FHT[] = { { fdct4, fdct16 }, // DCT_DCT { fadst4, fdct16 }, // ADST_DCT @@ -1431,7 +1436,8 @@ void av1_fht16x4_c(const int16_t *input, tran_low_t *output, int stride, } void av1_fht8x16_c(const int16_t *input, tran_low_t *output, int stride, - int tx_type) { + FWD_TXFM_PARAM *fwd_txfm_param) { + int tx_type = fwd_txfm_param->tx_type; static const transform_2d FHT[] = { { fdct16, fdct8 }, // DCT_DCT { fadst16, fdct8 }, // ADST_DCT @@ -1483,7 +1489,8 @@ void av1_fht8x16_c(const int16_t *input, tran_low_t *output, int stride, } void av1_fht16x8_c(const int16_t *input, tran_low_t *output, int stride, - int tx_type) { + FWD_TXFM_PARAM *fwd_txfm_param) { + int tx_type = fwd_txfm_param->tx_type; static const transform_2d FHT[] = { { fdct8, fdct16 }, // DCT_DCT { fadst8, fdct16 }, // ADST_DCT @@ -1535,7 +1542,8 @@ void av1_fht16x8_c(const int16_t *input, tran_low_t *output, int stride, } void av1_fht8x32_c(const int16_t *input, tran_low_t *output, int stride, - int tx_type) { + FWD_TXFM_PARAM *fwd_txfm_param) { + int tx_type = fwd_txfm_param->tx_type; static const transform_2d FHT[] = { { fdct32, fdct8 }, // DCT_DCT { fhalfright32, fdct8 }, // ADST_DCT @@ -1585,7 +1593,8 @@ void av1_fht8x32_c(const int16_t *input, tran_low_t *output, int stride, } void av1_fht32x8_c(const int16_t *input, tran_low_t *output, int stride, - int tx_type) { + FWD_TXFM_PARAM *fwd_txfm_param) { + int tx_type = fwd_txfm_param->tx_type; static const transform_2d FHT[] = { { fdct8, fdct32 }, // DCT_DCT { fadst8, fdct32 }, // ADST_DCT @@ -1635,7 +1644,8 @@ void av1_fht32x8_c(const int16_t *input, tran_low_t *output, int stride, } void av1_fht16x32_c(const int16_t *input, tran_low_t *output, int stride, - int tx_type) { + FWD_TXFM_PARAM *fwd_txfm_param) { + int tx_type = fwd_txfm_param->tx_type; static const transform_2d FHT[] = { { fdct32, fdct16 }, // DCT_DCT { fhalfright32, fdct16 }, // ADST_DCT @@ -1687,7 +1697,8 @@ void av1_fht16x32_c(const int16_t *input, tran_low_t *output, int stride, } void av1_fht32x16_c(const int16_t *input, tran_low_t *output, int stride, - int tx_type) { + FWD_TXFM_PARAM *fwd_txfm_param) { + int tx_type = fwd_txfm_param->tx_type; static const transform_2d FHT[] = { { fdct16, fdct32 }, // DCT_DCT { fadst16, fdct32 }, // ADST_DCT @@ -1864,7 +1875,8 @@ void av1_fdct8x8_quant_c(const int16_t *input, int stride, } void av1_fht8x8_c(const int16_t *input, tran_low_t *output, int stride, - int tx_type) { + FWD_TXFM_PARAM *fwd_txfm_param) { + int tx_type = fwd_txfm_param->tx_type; if (tx_type == DCT_DCT) { aom_fdct8x8_c(input, output, stride); } else { @@ -1972,7 +1984,8 @@ void av1_fwht4x4_c(const int16_t *input, tran_low_t *output, int stride) { } void av1_fht16x16_c(const int16_t *input, tran_low_t *output, int stride, - int tx_type) { + FWD_TXFM_PARAM *fwd_txfm_param) { + int tx_type = fwd_txfm_param->tx_type; static const transform_2d FHT[] = { { fdct16, fdct16 }, // DCT_DCT { fadst16, fdct16 }, // ADST_DCT @@ -2026,7 +2039,8 @@ void av1_highbd_fwht4x4_c(const int16_t *input, tran_low_t *output, } void av1_fht32x32_c(const int16_t *input, tran_low_t *output, int stride, - int tx_type) { + FWD_TXFM_PARAM *fwd_txfm_param) { + int tx_type = fwd_txfm_param->tx_type; static const transform_2d FHT[] = { { fdct32, fdct32 }, // DCT_DCT #if CONFIG_EXT_TX @@ -2114,7 +2128,8 @@ static void fdct64_row(const tran_low_t *input, tran_low_t *output) { } void av1_fht64x64_c(const int16_t *input, tran_low_t *output, int stride, - int tx_type) { + FWD_TXFM_PARAM *fwd_txfm_param) { + int tx_type = fwd_txfm_param->tx_type; static const transform_2d FHT[] = { { fdct64_col, fdct64_row }, // DCT_DCT #if CONFIG_EXT_TX diff --git a/av1/encoder/encodemb.c b/av1/encoder/encodemb.c index 5f8abd929..9d32276f3 100644 --- a/av1/encoder/encodemb.c +++ b/av1/encoder/encodemb.c @@ -846,10 +846,14 @@ static void encode_block_pass1(int plane, int block, int blk_row, int blk_col, } #endif // !CONFIG_PVQ #if CONFIG_HIGHBITDEPTH + INV_TXFM_PARAM inv_txfm_param; + 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]; if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) { - av1_highbd_inv_txfm_add_4x4(dqcoeff, dst, pd->dst.stride, p->eobs[block], - xd->bd, DCT_DCT, - xd->lossless[xd->mi[0]->mbmi.segment_id]); + av1_highbd_inv_txfm_add_4x4(dqcoeff, dst, pd->dst.stride, + &inv_txfm_param); return; } #endif // CONFIG_HIGHBITDEPTH diff --git a/av1/encoder/hybrid_fwd_txfm.c b/av1/encoder/hybrid_fwd_txfm.c index 0ff7524d6..bc5b976c1 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, TX_TYPE tx_type, int lossless) { + int diff_stride, FWD_TXFM_PARAM *fwd_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,174 +39,145 @@ static void fwd_txfm_2x2(const int16_t *src_diff, tran_low_t *coeff, coeff[2] = (tran_low_t)(4 * c1); coeff[3] = (tran_low_t)(4 * d1); - (void)tx_type; - (void)lossless; + (void)fwd_txfm_param; } #endif static void fwd_txfm_4x4(const int16_t *src_diff, tran_low_t *coeff, - int diff_stride, TX_TYPE tx_type, int lossless) { - if (lossless) { - assert(tx_type == DCT_DCT); + int diff_stride, FWD_TXFM_PARAM *fwd_txfm_param) { + if (fwd_txfm_param->lossless) { + assert(fwd_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, tx_type); + av1_fht4x4_c(src_diff, coeff, diff_stride, fwd_txfm_param); #else - av1_fht4x4(src_diff, coeff, diff_stride, tx_type); + av1_fht4x4(src_diff, coeff, diff_stride, fwd_txfm_param); #endif } static void fwd_txfm_4x8(const int16_t *src_diff, tran_low_t *coeff, - int diff_stride, TX_TYPE tx_type, - FWD_TXFM_OPT fwd_txfm_opt) { - (void)fwd_txfm_opt; + int diff_stride, FWD_TXFM_PARAM *fwd_txfm_param) { #if CONFIG_LGT - av1_fht4x8_c(src_diff, coeff, diff_stride, tx_type); + av1_fht4x8_c(src_diff, coeff, diff_stride, fwd_txfm_param); #else - av1_fht4x8(src_diff, coeff, diff_stride, tx_type); + av1_fht4x8(src_diff, coeff, diff_stride, fwd_txfm_param); #endif } static void fwd_txfm_8x4(const int16_t *src_diff, tran_low_t *coeff, - int diff_stride, TX_TYPE tx_type, - FWD_TXFM_OPT fwd_txfm_opt) { - (void)fwd_txfm_opt; + int diff_stride, FWD_TXFM_PARAM *fwd_txfm_param) { #if CONFIG_LGT - av1_fht8x4_c(src_diff, coeff, diff_stride, tx_type); + av1_fht8x4_c(src_diff, coeff, diff_stride, fwd_txfm_param); #else - av1_fht8x4(src_diff, coeff, diff_stride, tx_type); + av1_fht8x4(src_diff, coeff, diff_stride, fwd_txfm_param); #endif } static void fwd_txfm_8x16(const int16_t *src_diff, tran_low_t *coeff, - int diff_stride, TX_TYPE tx_type, - FWD_TXFM_OPT fwd_txfm_opt) { - (void)fwd_txfm_opt; + int diff_stride, FWD_TXFM_PARAM *fwd_txfm_param) { #if CONFIG_LGT - av1_fht8x16_c(src_diff, coeff, diff_stride, tx_type); + av1_fht8x16_c(src_diff, coeff, diff_stride, fwd_txfm_param); #else - av1_fht8x16(src_diff, coeff, diff_stride, tx_type); + av1_fht8x16(src_diff, coeff, diff_stride, fwd_txfm_param); #endif } static void fwd_txfm_16x8(const int16_t *src_diff, tran_low_t *coeff, - int diff_stride, TX_TYPE tx_type, - FWD_TXFM_OPT fwd_txfm_opt) { - (void)fwd_txfm_opt; + int diff_stride, FWD_TXFM_PARAM *fwd_txfm_param) { #if CONFIG_LGT - av1_fht16x8_c(src_diff, coeff, diff_stride, tx_type); + av1_fht16x8_c(src_diff, coeff, diff_stride, fwd_txfm_param); #else - av1_fht16x8(src_diff, coeff, diff_stride, tx_type); + av1_fht16x8(src_diff, coeff, diff_stride, fwd_txfm_param); #endif } static void fwd_txfm_16x32(const int16_t *src_diff, tran_low_t *coeff, - int diff_stride, TX_TYPE tx_type, - FWD_TXFM_OPT fwd_txfm_opt) { - (void)fwd_txfm_opt; - av1_fht16x32(src_diff, coeff, diff_stride, tx_type); + int diff_stride, FWD_TXFM_PARAM *fwd_txfm_param) { + av1_fht16x32(src_diff, coeff, diff_stride, fwd_txfm_param); } static void fwd_txfm_32x16(const int16_t *src_diff, tran_low_t *coeff, - int diff_stride, TX_TYPE tx_type, - FWD_TXFM_OPT fwd_txfm_opt) { - (void)fwd_txfm_opt; - av1_fht32x16(src_diff, coeff, diff_stride, tx_type); + int diff_stride, FWD_TXFM_PARAM *fwd_txfm_param) { + av1_fht32x16(src_diff, coeff, diff_stride, fwd_txfm_param); } static void fwd_txfm_8x8(const int16_t *src_diff, tran_low_t *coeff, - int diff_stride, TX_TYPE tx_type, - FWD_TXFM_OPT fwd_txfm_opt) { - (void)fwd_txfm_opt; + int diff_stride, FWD_TXFM_PARAM *fwd_txfm_param) { #if CONFIG_LGT - av1_fht8x8_c(src_diff, coeff, diff_stride, tx_type); + av1_fht8x8_c(src_diff, coeff, diff_stride, fwd_txfm_param); #else - av1_fht8x8(src_diff, coeff, diff_stride, tx_type); + av1_fht8x8(src_diff, coeff, diff_stride, fwd_txfm_param); #endif } static void fwd_txfm_16x16(const int16_t *src_diff, tran_low_t *coeff, - int diff_stride, TX_TYPE tx_type, - FWD_TXFM_OPT fwd_txfm_opt) { - (void)fwd_txfm_opt; - av1_fht16x16(src_diff, coeff, diff_stride, tx_type); + int diff_stride, FWD_TXFM_PARAM *fwd_txfm_param) { + av1_fht16x16(src_diff, coeff, diff_stride, fwd_txfm_param); } static void fwd_txfm_32x32(const int16_t *src_diff, tran_low_t *coeff, - int diff_stride, TX_TYPE tx_type, - FWD_TXFM_OPT fwd_txfm_opt) { - (void)fwd_txfm_opt; - av1_fht32x32(src_diff, coeff, diff_stride, tx_type); + int diff_stride, FWD_TXFM_PARAM *fwd_txfm_param) { + av1_fht32x32(src_diff, coeff, diff_stride, fwd_txfm_param); } #if CONFIG_TX64X64 static void fwd_txfm_64x64(const int16_t *src_diff, tran_low_t *coeff, - int diff_stride, TX_TYPE tx_type, - FWD_TXFM_OPT fwd_txfm_opt) { - (void)fwd_txfm_opt; + int diff_stride, FWD_TXFM_PARAM *fwd_txfm_param) { #if CONFIG_EXT_TX - if (tx_type == IDTX) - av1_fwd_idtx_c(src_diff, coeff, diff_stride, 64, tx_type); + if (fwd_txfm_param->tx_type == IDTX) + av1_fwd_idtx_c(src_diff, coeff, diff_stride, 64, fwd_txfm_param->tx_type); else #endif - av1_fht64x64(src_diff, coeff, diff_stride, tx_type); + av1_fht64x64(src_diff, coeff, diff_stride, fwd_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, TX_TYPE tx_type, - FWD_TXFM_OPT fwd_txfm_opt) { - (void)fwd_txfm_opt; + int diff_stride, FWD_TXFM_PARAM *fwd_txfm_param) { #if CONFIG_LGT - av1_fht16x4_c(src_diff, coeff, diff_stride, tx_type); + av1_fht16x4_c(src_diff, coeff, diff_stride, fwd_txfm_param); #else - av1_fht16x4(src_diff, coeff, diff_stride, tx_type); + av1_fht16x4(src_diff, coeff, diff_stride, fwd_txfm_param); #endif } static void fwd_txfm_4x16(const int16_t *src_diff, tran_low_t *coeff, - int diff_stride, TX_TYPE tx_type, - FWD_TXFM_OPT fwd_txfm_opt) { - (void)fwd_txfm_opt; + int diff_stride, FWD_TXFM_PARAM *fwd_txfm_param) { #if CONFIG_LGT - av1_fht4x16_c(src_diff, coeff, diff_stride, tx_type); + av1_fht4x16_c(src_diff, coeff, diff_stride, fwd_txfm_param); #else - av1_fht4x16(src_diff, coeff, diff_stride, tx_type); + av1_fht4x16(src_diff, coeff, diff_stride, fwd_txfm_param); #endif } static void fwd_txfm_32x8(const int16_t *src_diff, tran_low_t *coeff, - int diff_stride, TX_TYPE tx_type, - FWD_TXFM_OPT fwd_txfm_opt) { - (void)fwd_txfm_opt; + int diff_stride, FWD_TXFM_PARAM *fwd_txfm_param) { #if CONFIG_LGT - av1_fht32x8_c(src_diff, coeff, diff_stride, tx_type); + av1_fht32x8_c(src_diff, coeff, diff_stride, fwd_txfm_param); #else - av1_fht32x8(src_diff, coeff, diff_stride, tx_type); + av1_fht32x8(src_diff, coeff, diff_stride, fwd_txfm_param); #endif } static void fwd_txfm_8x32(const int16_t *src_diff, tran_low_t *coeff, - int diff_stride, TX_TYPE tx_type, - FWD_TXFM_OPT fwd_txfm_opt) { - (void)fwd_txfm_opt; + int diff_stride, FWD_TXFM_PARAM *fwd_txfm_param) { #if CONFIG_LGT - av1_fht8x32_c(src_diff, coeff, diff_stride, tx_type); + av1_fht8x32_c(src_diff, coeff, diff_stride, fwd_txfm_param); #else - av1_fht8x32(src_diff, coeff, diff_stride, tx_type); + av1_fht8x32(src_diff, coeff, diff_stride, fwd_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, TX_TYPE tx_type, int lossless, - const int bd) { + int diff_stride, + FWD_TXFM_PARAM *fwd_txfm_param) { tran_high_t a1 = src_diff[0]; tran_high_t b1 = src_diff[1]; tran_high_t c1 = src_diff[diff_stride]; @@ -227,17 +198,17 @@ static void highbd_fwd_txfm_2x2(const int16_t *src_diff, tran_low_t *coeff, coeff[2] = (tran_low_t)(4 * c1); coeff[3] = (tran_low_t)(4 * d1); - (void)tx_type; - (void)lossless; - (void)bd; + (void)fwd_txfm_param; } #endif static void highbd_fwd_txfm_4x4(const int16_t *src_diff, tran_low_t *coeff, - int diff_stride, TX_TYPE tx_type, int lossless, - const int bd) { + int diff_stride, + FWD_TXFM_PARAM *fwd_txfm_param) { int32_t *dst_coeff = (int32_t *)coeff; - if (lossless) { + const int tx_type = fwd_txfm_param->tx_type; + const int bd = fwd_txfm_param->bd; + if (fwd_txfm_param->lossless) { assert(tx_type == DCT_DCT); av1_highbd_fwht4x4(src_diff, coeff, diff_stride); return; @@ -276,58 +247,59 @@ static void highbd_fwd_txfm_4x4(const int16_t *src_diff, tran_low_t *coeff, } static void highbd_fwd_txfm_4x8(const int16_t *src_diff, tran_low_t *coeff, - int diff_stride, TX_TYPE tx_type, - FWD_TXFM_OPT fwd_txfm_opt, const int bd) { - (void)fwd_txfm_opt; + int diff_stride, + FWD_TXFM_PARAM *fwd_txfm_param) { int32_t *dst_coeff = (int32_t *)coeff; - av1_fwd_txfm2d_4x8_c(src_diff, dst_coeff, diff_stride, tx_type, bd); + av1_fwd_txfm2d_4x8_c(src_diff, dst_coeff, diff_stride, + fwd_txfm_param->tx_type, fwd_txfm_param->bd); } static void highbd_fwd_txfm_8x4(const int16_t *src_diff, tran_low_t *coeff, - int diff_stride, TX_TYPE tx_type, - FWD_TXFM_OPT fwd_txfm_opt, const int bd) { - (void)fwd_txfm_opt; + int diff_stride, + FWD_TXFM_PARAM *fwd_txfm_param) { int32_t *dst_coeff = (int32_t *)coeff; - av1_fwd_txfm2d_8x4_c(src_diff, dst_coeff, diff_stride, tx_type, bd); + av1_fwd_txfm2d_8x4_c(src_diff, dst_coeff, diff_stride, + fwd_txfm_param->tx_type, fwd_txfm_param->bd); } static void highbd_fwd_txfm_8x16(const int16_t *src_diff, tran_low_t *coeff, - int diff_stride, TX_TYPE tx_type, - FWD_TXFM_OPT fwd_txfm_opt, const int bd) { - (void)fwd_txfm_opt; + int diff_stride, + FWD_TXFM_PARAM *fwd_txfm_param) { int32_t *dst_coeff = (int32_t *)coeff; - av1_fwd_txfm2d_8x16_c(src_diff, dst_coeff, diff_stride, tx_type, bd); + av1_fwd_txfm2d_8x16_c(src_diff, dst_coeff, diff_stride, + fwd_txfm_param->tx_type, fwd_txfm_param->bd); } static void highbd_fwd_txfm_16x8(const int16_t *src_diff, tran_low_t *coeff, - int diff_stride, TX_TYPE tx_type, - FWD_TXFM_OPT fwd_txfm_opt, const int bd) { - (void)fwd_txfm_opt; + int diff_stride, + FWD_TXFM_PARAM *fwd_txfm_param) { int32_t *dst_coeff = (int32_t *)coeff; - av1_fwd_txfm2d_16x8_c(src_diff, dst_coeff, diff_stride, tx_type, bd); + av1_fwd_txfm2d_16x8_c(src_diff, dst_coeff, diff_stride, + fwd_txfm_param->tx_type, fwd_txfm_param->bd); } static void highbd_fwd_txfm_16x32(const int16_t *src_diff, tran_low_t *coeff, - int diff_stride, TX_TYPE tx_type, - FWD_TXFM_OPT fwd_txfm_opt, const int bd) { - (void)fwd_txfm_opt; + int diff_stride, + FWD_TXFM_PARAM *fwd_txfm_param) { int32_t *dst_coeff = (int32_t *)coeff; - av1_fwd_txfm2d_16x32_c(src_diff, dst_coeff, diff_stride, tx_type, bd); + av1_fwd_txfm2d_16x32_c(src_diff, dst_coeff, diff_stride, + fwd_txfm_param->tx_type, fwd_txfm_param->bd); } static void highbd_fwd_txfm_32x16(const int16_t *src_diff, tran_low_t *coeff, - int diff_stride, TX_TYPE tx_type, - FWD_TXFM_OPT fwd_txfm_opt, const int bd) { - (void)fwd_txfm_opt; + int diff_stride, + FWD_TXFM_PARAM *fwd_txfm_param) { int32_t *dst_coeff = (int32_t *)coeff; - av1_fwd_txfm2d_32x16_c(src_diff, dst_coeff, diff_stride, tx_type, bd); + av1_fwd_txfm2d_32x16_c(src_diff, dst_coeff, diff_stride, + fwd_txfm_param->tx_type, fwd_txfm_param->bd); } static void highbd_fwd_txfm_8x8(const int16_t *src_diff, tran_low_t *coeff, - int diff_stride, TX_TYPE tx_type, - FWD_TXFM_OPT fwd_txfm_opt, const int bd) { + int diff_stride, + FWD_TXFM_PARAM *fwd_txfm_param) { int32_t *dst_coeff = (int32_t *)coeff; - (void)fwd_txfm_opt; + const int tx_type = fwd_txfm_param->tx_type; + const int bd = fwd_txfm_param->bd; switch (tx_type) { case DCT_DCT: case ADST_DCT: @@ -362,10 +334,11 @@ static void highbd_fwd_txfm_8x8(const int16_t *src_diff, tran_low_t *coeff, } static void highbd_fwd_txfm_16x16(const int16_t *src_diff, tran_low_t *coeff, - int diff_stride, TX_TYPE tx_type, - FWD_TXFM_OPT fwd_txfm_opt, const int bd) { + int diff_stride, + FWD_TXFM_PARAM *fwd_txfm_param) { int32_t *dst_coeff = (int32_t *)coeff; - (void)fwd_txfm_opt; + const int tx_type = fwd_txfm_param->tx_type; + const int bd = fwd_txfm_param->bd; switch (tx_type) { case DCT_DCT: case ADST_DCT: @@ -400,10 +373,11 @@ static void highbd_fwd_txfm_16x16(const int16_t *src_diff, tran_low_t *coeff, } static void highbd_fwd_txfm_32x32(const int16_t *src_diff, tran_low_t *coeff, - int diff_stride, TX_TYPE tx_type, - FWD_TXFM_OPT fwd_txfm_opt, const int bd) { + int diff_stride, + FWD_TXFM_PARAM *fwd_txfm_param) { int32_t *dst_coeff = (int32_t *)coeff; - (void)fwd_txfm_opt; + const int tx_type = fwd_txfm_param->tx_type; + const int bd = fwd_txfm_param->bd; switch (tx_type) { case DCT_DCT: case ADST_DCT: @@ -439,11 +413,11 @@ static void highbd_fwd_txfm_32x32(const int16_t *src_diff, tran_low_t *coeff, #if CONFIG_TX64X64 static void highbd_fwd_txfm_64x64(const int16_t *src_diff, tran_low_t *coeff, - int diff_stride, TX_TYPE tx_type, - FWD_TXFM_OPT fwd_txfm_opt, const int bd) { + int diff_stride, + FWD_TXFM_PARAM *fwd_txfm_param) { int32_t *dst_coeff = (int32_t *)coeff; - (void)fwd_txfm_opt; - (void)bd; + const int tx_type = fwd_txfm_param->tx_type; + const int bd = fwd_txfm_param->bd; switch (tx_type) { case DCT_DCT: av1_fwd_txfm2d_64x64(src_diff, dst_coeff, diff_stride, tx_type, bd); @@ -471,7 +445,9 @@ static void highbd_fwd_txfm_64x64(const int16_t *src_diff, tran_low_t *coeff, // as dictated by get_ext_tx_set_type in blockd.h. av1_fwd_txfm2d_64x64_c(src_diff, dst_coeff, diff_stride, DCT_DCT, bd); break; - case IDTX: av1_fwd_idtx_c(src_diff, coeff, diff_stride, 64, tx_type); break; + case IDTX: + av1_fwd_idtx_c(src_diff, dst_coeff, diff_stride, 64, tx_type); + break; #endif // CONFIG_EXT_TX default: assert(0); break; } @@ -480,63 +456,60 @@ static void highbd_fwd_txfm_64x64(const int16_t *src_diff, tran_low_t *coeff, void av1_fwd_txfm(const int16_t *src_diff, tran_low_t *coeff, int diff_stride, FWD_TXFM_PARAM *fwd_txfm_param) { - const int fwd_txfm_opt = FWD_TXFM_OPT_NORMAL; - const TX_TYPE tx_type = fwd_txfm_param->tx_type; const TX_SIZE tx_size = fwd_txfm_param->tx_size; - const int lossless = fwd_txfm_param->lossless; switch (tx_size) { #if CONFIG_TX64X64 case TX_64X64: - fwd_txfm_64x64(src_diff, coeff, diff_stride, tx_type, fwd_txfm_opt); + fwd_txfm_64x64(src_diff, coeff, diff_stride, fwd_txfm_param); break; #endif // CONFIG_TX64X64 case TX_32X32: - fwd_txfm_32x32(src_diff, coeff, diff_stride, tx_type, fwd_txfm_opt); + fwd_txfm_32x32(src_diff, coeff, diff_stride, fwd_txfm_param); break; case TX_16X16: - fwd_txfm_16x16(src_diff, coeff, diff_stride, tx_type, fwd_txfm_opt); + fwd_txfm_16x16(src_diff, coeff, diff_stride, fwd_txfm_param); break; case TX_8X8: - fwd_txfm_8x8(src_diff, coeff, diff_stride, tx_type, fwd_txfm_opt); + fwd_txfm_8x8(src_diff, coeff, diff_stride, fwd_txfm_param); break; case TX_4X8: - fwd_txfm_4x8(src_diff, coeff, diff_stride, tx_type, fwd_txfm_opt); + fwd_txfm_4x8(src_diff, coeff, diff_stride, fwd_txfm_param); break; case TX_8X4: - fwd_txfm_8x4(src_diff, coeff, diff_stride, tx_type, fwd_txfm_opt); + fwd_txfm_8x4(src_diff, coeff, diff_stride, fwd_txfm_param); break; case TX_8X16: - fwd_txfm_8x16(src_diff, coeff, diff_stride, tx_type, fwd_txfm_opt); + fwd_txfm_8x16(src_diff, coeff, diff_stride, fwd_txfm_param); break; case TX_16X8: - fwd_txfm_16x8(src_diff, coeff, diff_stride, tx_type, fwd_txfm_opt); + fwd_txfm_16x8(src_diff, coeff, diff_stride, fwd_txfm_param); break; case TX_16X32: - fwd_txfm_16x32(src_diff, coeff, diff_stride, tx_type, fwd_txfm_opt); + fwd_txfm_16x32(src_diff, coeff, diff_stride, fwd_txfm_param); break; case TX_32X16: - fwd_txfm_32x16(src_diff, coeff, diff_stride, tx_type, fwd_txfm_opt); + fwd_txfm_32x16(src_diff, coeff, diff_stride, fwd_txfm_param); break; case TX_4X4: - fwd_txfm_4x4(src_diff, coeff, diff_stride, tx_type, lossless); + fwd_txfm_4x4(src_diff, coeff, diff_stride, fwd_txfm_param); break; #if CONFIG_CHROMA_2X2 case TX_2X2: - fwd_txfm_2x2(src_diff, coeff, diff_stride, tx_type, lossless); + fwd_txfm_2x2(src_diff, coeff, diff_stride, fwd_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, tx_type, fwd_txfm_opt); + fwd_txfm_4x16(src_diff, coeff, diff_stride, fwd_txfm_param); break; case TX_16X4: - fwd_txfm_16x4(src_diff, coeff, diff_stride, tx_type, fwd_txfm_opt); + fwd_txfm_16x4(src_diff, coeff, diff_stride, fwd_txfm_param); break; case TX_8X32: - fwd_txfm_8x32(src_diff, coeff, diff_stride, tx_type, fwd_txfm_opt); + fwd_txfm_8x32(src_diff, coeff, diff_stride, fwd_txfm_param); break; case TX_32X8: - fwd_txfm_32x8(src_diff, coeff, diff_stride, tx_type, fwd_txfm_opt); + fwd_txfm_32x8(src_diff, coeff, diff_stride, fwd_txfm_param); break; #endif // CONFIG_EXT_TX && CONFIG_RECT_TX && CONFIG_RECT_TX_EXT default: assert(0); break; @@ -545,60 +518,46 @@ void av1_fwd_txfm(const int16_t *src_diff, tran_low_t *coeff, int diff_stride, void av1_highbd_fwd_txfm(const int16_t *src_diff, tran_low_t *coeff, int diff_stride, FWD_TXFM_PARAM *fwd_txfm_param) { - const int fwd_txfm_opt = FWD_TXFM_OPT_NORMAL; - const TX_TYPE tx_type = fwd_txfm_param->tx_type; const TX_SIZE tx_size = fwd_txfm_param->tx_size; - const int lossless = fwd_txfm_param->lossless; - const int bd = fwd_txfm_param->bd; switch (tx_size) { #if CONFIG_TX64X64 case TX_64X64: - highbd_fwd_txfm_64x64(src_diff, coeff, diff_stride, tx_type, fwd_txfm_opt, - bd); + highbd_fwd_txfm_64x64(src_diff, coeff, diff_stride, fwd_txfm_param); break; #endif // CONFIG_TX64X64 case TX_32X32: - highbd_fwd_txfm_32x32(src_diff, coeff, diff_stride, tx_type, fwd_txfm_opt, - bd); + highbd_fwd_txfm_32x32(src_diff, coeff, diff_stride, fwd_txfm_param); break; case TX_16X16: - highbd_fwd_txfm_16x16(src_diff, coeff, diff_stride, tx_type, fwd_txfm_opt, - bd); + highbd_fwd_txfm_16x16(src_diff, coeff, diff_stride, fwd_txfm_param); break; case TX_8X8: - highbd_fwd_txfm_8x8(src_diff, coeff, diff_stride, tx_type, fwd_txfm_opt, - bd); + highbd_fwd_txfm_8x8(src_diff, coeff, diff_stride, fwd_txfm_param); break; case TX_4X8: - highbd_fwd_txfm_4x8(src_diff, coeff, diff_stride, tx_type, fwd_txfm_opt, - bd); + highbd_fwd_txfm_4x8(src_diff, coeff, diff_stride, fwd_txfm_param); break; case TX_8X4: - highbd_fwd_txfm_8x4(src_diff, coeff, diff_stride, tx_type, fwd_txfm_opt, - bd); + highbd_fwd_txfm_8x4(src_diff, coeff, diff_stride, fwd_txfm_param); break; case TX_8X16: - highbd_fwd_txfm_8x16(src_diff, coeff, diff_stride, tx_type, fwd_txfm_opt, - bd); + highbd_fwd_txfm_8x16(src_diff, coeff, diff_stride, fwd_txfm_param); break; case TX_16X8: - highbd_fwd_txfm_16x8(src_diff, coeff, diff_stride, tx_type, fwd_txfm_opt, - bd); + highbd_fwd_txfm_16x8(src_diff, coeff, diff_stride, fwd_txfm_param); break; case TX_16X32: - highbd_fwd_txfm_16x32(src_diff, coeff, diff_stride, tx_type, fwd_txfm_opt, - bd); + highbd_fwd_txfm_16x32(src_diff, coeff, diff_stride, fwd_txfm_param); break; case TX_32X16: - highbd_fwd_txfm_32x16(src_diff, coeff, diff_stride, tx_type, fwd_txfm_opt, - bd); + highbd_fwd_txfm_32x16(src_diff, coeff, diff_stride, fwd_txfm_param); break; case TX_4X4: - highbd_fwd_txfm_4x4(src_diff, coeff, diff_stride, tx_type, lossless, bd); + highbd_fwd_txfm_4x4(src_diff, coeff, diff_stride, fwd_txfm_param); break; #if CONFIG_CHROMA_2X2 case TX_2X2: - highbd_fwd_txfm_2x2(src_diff, coeff, diff_stride, tx_type, lossless, bd); + highbd_fwd_txfm_2x2(src_diff, coeff, diff_stride, fwd_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 88a72b542..36e7ee2c0 100644 --- a/av1/encoder/hybrid_fwd_txfm.h +++ b/av1/encoder/hybrid_fwd_txfm.h @@ -14,15 +14,6 @@ #include "./aom_config.h" -typedef enum FWD_TXFM_OPT { FWD_TXFM_OPT_NORMAL } FWD_TXFM_OPT; - -typedef struct FWD_TXFM_PARAM { - TX_TYPE tx_type; - TX_SIZE tx_size; - int lossless; - int bd; -} FWD_TXFM_PARAM; - #ifdef __cplusplus extern "C" { #endif diff --git a/av1/encoder/x86/dct_intrin_sse2.c b/av1/encoder/x86/dct_intrin_sse2.c index 37c4b0d88..656305d59 100644 --- a/av1/encoder/x86/dct_intrin_sse2.c +++ b/av1/encoder/x86/dct_intrin_sse2.c @@ -14,6 +14,7 @@ #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" @@ -203,8 +204,9 @@ static void fidtx4_sse2(__m128i *in) { #endif // CONFIG_EXT_TX void av1_fht4x4_sse2(const int16_t *input, tran_low_t *output, int stride, - int tx_type) { + FWD_TXFM_PARAM *fwd_txfm_param) { __m128i in[4]; + int tx_type = fwd_txfm_param->tx_type; switch (tx_type) { case DCT_DCT: aom_fdct4x4_sse2(input, output, stride); break; @@ -1301,8 +1303,9 @@ static void fidtx8_sse2(__m128i *in) { #endif // CONFIG_EXT_TX void av1_fht8x8_sse2(const int16_t *input, tran_low_t *output, int stride, - int tx_type) { + FWD_TXFM_PARAM *fwd_txfm_param) { __m128i in[8]; + int tx_type = fwd_txfm_param->tx_type; switch (tx_type) { case DCT_DCT: aom_fdct8x8_sse2(input, output, stride); break; @@ -2334,8 +2337,9 @@ static void fidtx16_sse2(__m128i *in0, __m128i *in1) { #endif // CONFIG_EXT_TX void av1_fht16x16_sse2(const int16_t *input, tran_low_t *output, int stride, - int tx_type) { + FWD_TXFM_PARAM *fwd_txfm_param) { __m128i in0[16], in1[16]; + int tx_type = fwd_txfm_param->tx_type; switch (tx_type) { case DCT_DCT: @@ -2550,8 +2554,9 @@ static INLINE void write_buffer_4x8(tran_low_t *output, __m128i *res) { } void av1_fht4x8_sse2(const int16_t *input, tran_low_t *output, int stride, - int tx_type) { + FWD_TXFM_PARAM *fwd_txfm_param) { __m128i in[8]; + int tx_type = fwd_txfm_param->tx_type; switch (tx_type) { case DCT_DCT: @@ -2724,8 +2729,9 @@ static INLINE void write_buffer_8x4(tran_low_t *output, __m128i *res) { } void av1_fht8x4_sse2(const int16_t *input, tran_low_t *output, int stride, - int tx_type) { + FWD_TXFM_PARAM *fwd_txfm_param) { __m128i in[8]; + int tx_type = fwd_txfm_param->tx_type; switch (tx_type) { case DCT_DCT: @@ -2864,8 +2870,9 @@ static void row_8x16_rounding(__m128i *in, int bits) { } void av1_fht8x16_sse2(const int16_t *input, tran_low_t *output, int stride, - int tx_type) { + FWD_TXFM_PARAM *fwd_txfm_param) { __m128i in[16]; + int tx_type = fwd_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 @@ -3045,8 +3052,9 @@ static INLINE void load_buffer_16x8(const int16_t *input, __m128i *in, #define col_16x8_rounding row_8x16_rounding void av1_fht16x8_sse2(const int16_t *input, tran_low_t *output, int stride, - int tx_type) { + FWD_TXFM_PARAM *fwd_txfm_param) { __m128i in[16]; + int tx_type = fwd_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 @@ -3355,8 +3363,9 @@ static INLINE void fhalfright32_16col(__m128i *tl, __m128i *tr, __m128i *bl, // 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, - int tx_type) { + FWD_TXFM_PARAM *fwd_txfm_param) { __m128i intl[16], intr[16], inbl[16], inbr[16]; + int tx_type = fwd_txfm_param->tx_type; switch (tx_type) { case DCT_DCT: @@ -3544,8 +3553,9 @@ static INLINE void write_buffer_32x16(tran_low_t *output, __m128i *res0, } void av1_fht32x16_sse2(const int16_t *input, tran_low_t *output, int stride, - int tx_type) { + FWD_TXFM_PARAM *fwd_txfm_param) { __m128i in0[16], in1[16], in2[16], in3[16]; + int tx_type = fwd_txfm_param->tx_type; load_buffer_32x16(input, in0, in1, in2, in3, stride, 0, 0); switch (tx_type) { @@ -3784,8 +3794,9 @@ static INLINE void write_buffer_32x32(__m128i *in0, __m128i *in1, __m128i *in2, } void av1_fht32x32_sse2(const int16_t *input, tran_low_t *output, int stride, - int tx_type) { + FWD_TXFM_PARAM *fwd_txfm_param) { __m128i in0[32], in1[32], in2[32], in3[32]; + int tx_type = fwd_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 713b0e9f8..10a16cf90 100644 --- a/av1/encoder/x86/hybrid_fwd_txfm_avx2.c +++ b/av1/encoder/x86/hybrid_fwd_txfm_avx2.c @@ -14,6 +14,7 @@ #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" @@ -914,8 +915,9 @@ static void fidtx16_avx2(__m256i *in) { #endif void av1_fht16x16_avx2(const int16_t *input, tran_low_t *output, int stride, - int tx_type) { + FWD_TXFM_PARAM *fwd_txfm_param) { __m256i in[16]; + int tx_type = fwd_txfm_param->tx_type; switch (tx_type) { case DCT_DCT: @@ -1509,9 +1511,10 @@ static void fidtx32_avx2(__m256i *in0, __m256i *in1) { #endif void av1_fht32x32_avx2(const int16_t *input, tran_low_t *output, int stride, - int tx_type) { + FWD_TXFM_PARAM *fwd_txfm_param) { __m256i in0[32]; // left 32 columns __m256i in1[32]; // right 32 columns + int tx_type = fwd_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 e1032ef24..7b19b7cbd 100644 --- a/test/av1_fht16x16_test.cc +++ b/test/av1_fht16x16_test.cc @@ -25,18 +25,19 @@ using libaom_test::ACMRandom; namespace { typedef void (*IhtFunc)(const tran_low_t *in, uint8_t *out, int stride, - int tx_type); + const INV_TXFM_PARAM *inv_txfm_param); using std::tr1::tuple; using libaom_test::FhtFunc; typedef tuple Ht16x16Param; -void fht16x16_ref(const int16_t *in, tran_low_t *out, int stride, int tx_type) { - av1_fht16x16_c(in, out, stride, tx_type); +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); } void iht16x16_ref(const tran_low_t *in, uint8_t *dest, int stride, - int tx_type) { - av1_iht16x16_256_add_c(in, dest, stride, tx_type); + const INV_TXFM_PARAM *inv_txfm_param) { + av1_iht16x16_256_add_c(in, dest, stride, inv_txfm_param); } #if CONFIG_HIGHBITDEPTH @@ -62,7 +63,6 @@ class AV1Trans16x16HT : public libaom_test::TransformTestBase, virtual void SetUp() { fwd_txfm_ = GET_PARAM(0); inv_txfm_ = GET_PARAM(1); - tx_type_ = GET_PARAM(2); pitch_ = 16; height_ = 16; fwd_txfm_ref = fht16x16_ref; @@ -70,16 +70,18 @@ class AV1Trans16x16HT : public libaom_test::TransformTestBase, 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); } virtual void TearDown() { libaom_test::ClearSystemState(); } protected: void RunFwdTxfm(const int16_t *in, tran_low_t *out, int stride) { - fwd_txfm_(in, out, stride, tx_type_); + fwd_txfm_(in, out, stride, &fwd_txfm_param_); } void RunInvTxfm(const tran_low_t *out, uint8_t *dst, int stride) { - inv_txfm_(out, dst, stride, tx_type_); + inv_txfm_(out, dst, stride, &inv_txfm_param_); } FhtFunc fwd_txfm_; diff --git a/test/av1_fht16x32_test.cc b/test/av1_fht16x32_test.cc index 43d025327..6bc0cad68 100644 --- a/test/av1_fht16x32_test.cc +++ b/test/av1_fht16x32_test.cc @@ -25,17 +25,19 @@ using libaom_test::ACMRandom; namespace { typedef void (*IhtFunc)(const tran_low_t *in, uint8_t *out, int stride, - int tx_type); + const INV_TXFM_PARAM *inv_txfm_param); using std::tr1::tuple; using libaom_test::FhtFunc; typedef tuple Ht16x32Param; -void fht16x32_ref(const int16_t *in, tran_low_t *out, int stride, int tx_type) { - av1_fht16x32_c(in, out, stride, tx_type); +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); } -void iht16x32_ref(const tran_low_t *in, uint8_t *out, int stride, int tx_type) { - av1_iht16x32_512_add_c(in, out, stride, tx_type); +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); } class AV1Trans16x32HT : public libaom_test::TransformTestBase, @@ -46,7 +48,6 @@ class AV1Trans16x32HT : public libaom_test::TransformTestBase, virtual void SetUp() { fwd_txfm_ = GET_PARAM(0); inv_txfm_ = GET_PARAM(1); - tx_type_ = GET_PARAM(2); pitch_ = 16; height_ = 32; fwd_txfm_ref = fht16x32_ref; @@ -54,16 +55,18 @@ class AV1Trans16x32HT : public libaom_test::TransformTestBase, 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); } virtual void TearDown() { libaom_test::ClearSystemState(); } protected: void RunFwdTxfm(const int16_t *in, tran_low_t *out, int stride) { - fwd_txfm_(in, out, stride, tx_type_); + fwd_txfm_(in, out, stride, &fwd_txfm_param_); } void RunInvTxfm(const tran_low_t *out, uint8_t *dst, int stride) { - inv_txfm_(out, dst, stride, tx_type_); + inv_txfm_(out, dst, stride, &inv_txfm_param_); } FhtFunc fwd_txfm_; diff --git a/test/av1_fht16x8_test.cc b/test/av1_fht16x8_test.cc index d99bec5eb..e12c12161 100644 --- a/test/av1_fht16x8_test.cc +++ b/test/av1_fht16x8_test.cc @@ -25,17 +25,19 @@ using libaom_test::ACMRandom; namespace { typedef void (*IhtFunc)(const tran_low_t *in, uint8_t *out, int stride, - int tx_type); + const INV_TXFM_PARAM *inv_txfm_param); using std::tr1::tuple; using libaom_test::FhtFunc; typedef tuple Ht16x8Param; -void fht16x8_ref(const int16_t *in, tran_low_t *out, int stride, int tx_type) { - av1_fht16x8_c(in, out, stride, tx_type); +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); } -void iht16x8_ref(const tran_low_t *in, uint8_t *out, int stride, int tx_type) { - av1_iht16x8_128_add_c(in, out, stride, tx_type); +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); } class AV1Trans16x8HT : public libaom_test::TransformTestBase, @@ -46,7 +48,6 @@ class AV1Trans16x8HT : public libaom_test::TransformTestBase, virtual void SetUp() { fwd_txfm_ = GET_PARAM(0); inv_txfm_ = GET_PARAM(1); - tx_type_ = GET_PARAM(2); pitch_ = 16; height_ = 8; inv_txfm_ref = iht16x8_ref; @@ -54,16 +55,18 @@ class AV1Trans16x8HT : public libaom_test::TransformTestBase, 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); } virtual void TearDown() { libaom_test::ClearSystemState(); } protected: void RunFwdTxfm(const int16_t *in, tran_low_t *out, int stride) { - fwd_txfm_(in, out, stride, tx_type_); + fwd_txfm_(in, out, stride, &fwd_txfm_param_); } void RunInvTxfm(const tran_low_t *out, uint8_t *dst, int stride) { - inv_txfm_(out, dst, stride, tx_type_); + inv_txfm_(out, dst, stride, &inv_txfm_param_); } FhtFunc fwd_txfm_; diff --git a/test/av1_fht32x16_test.cc b/test/av1_fht32x16_test.cc index e38283f86..6f285b745 100644 --- a/test/av1_fht32x16_test.cc +++ b/test/av1_fht32x16_test.cc @@ -25,17 +25,19 @@ using libaom_test::ACMRandom; namespace { typedef void (*IhtFunc)(const tran_low_t *in, uint8_t *out, int stride, - int tx_type); + const INV_TXFM_PARAM *inv_txfm_param); using std::tr1::tuple; using libaom_test::FhtFunc; typedef tuple Ht32x16Param; -void fht32x16_ref(const int16_t *in, tran_low_t *out, int stride, int tx_type) { - av1_fht32x16_c(in, out, stride, tx_type); +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); } -void iht32x16_ref(const tran_low_t *in, uint8_t *out, int stride, int tx_type) { - av1_iht32x16_512_add_c(in, out, stride, tx_type); +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); } class AV1Trans32x16HT : public libaom_test::TransformTestBase, @@ -46,7 +48,6 @@ class AV1Trans32x16HT : public libaom_test::TransformTestBase, virtual void SetUp() { fwd_txfm_ = GET_PARAM(0); inv_txfm_ = GET_PARAM(1); - tx_type_ = GET_PARAM(2); pitch_ = 32; height_ = 16; fwd_txfm_ref = fht32x16_ref; @@ -54,16 +55,18 @@ class AV1Trans32x16HT : public libaom_test::TransformTestBase, 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); } virtual void TearDown() { libaom_test::ClearSystemState(); } protected: void RunFwdTxfm(const int16_t *in, tran_low_t *out, int stride) { - fwd_txfm_(in, out, stride, tx_type_); + fwd_txfm_(in, out, stride, &fwd_txfm_param_); } void RunInvTxfm(const tran_low_t *out, uint8_t *dst, int stride) { - inv_txfm_(out, dst, stride, tx_type_); + inv_txfm_(out, dst, stride, &inv_txfm_param_); } FhtFunc fwd_txfm_; diff --git a/test/av1_fht32x32_test.cc b/test/av1_fht32x32_test.cc index cdd915337..1bd5d84ba 100644 --- a/test/av1_fht32x32_test.cc +++ b/test/av1_fht32x32_test.cc @@ -25,13 +25,14 @@ using libaom_test::ACMRandom; namespace { typedef void (*IhtFunc)(const tran_low_t *in, uint8_t *out, int stride, - int tx_type); + const INV_TXFM_PARAM *inv_txfm_param); using std::tr1::tuple; using libaom_test::FhtFunc; typedef tuple Ht32x32Param; -void fht32x32_ref(const int16_t *in, tran_low_t *out, int stride, int tx_type) { - av1_fht32x32_c(in, out, stride, tx_type); +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); } #if CONFIG_HIGHBITDEPTH @@ -51,11 +52,11 @@ void highbd_fht32x32_ref(const int16_t *in, int32_t *out, int stride, #if HAVE_SSE2 || HAVE_AVX2 void dummy_inv_txfm(const tran_low_t *in, uint8_t *out, int stride, - int tx_type) { + const INV_TXFM_PARAM *inv_txfm_param) { (void)in; (void)out; (void)stride; - (void)tx_type; + (void)inv_txfm_param; } #endif @@ -67,23 +68,24 @@ class AV1Trans32x32HT : public libaom_test::TransformTestBase, virtual void SetUp() { fwd_txfm_ = GET_PARAM(0); inv_txfm_ = GET_PARAM(1); - tx_type_ = GET_PARAM(2); pitch_ = 32; height_ = 32; fwd_txfm_ref = fht32x32_ref; 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); } virtual void TearDown() { libaom_test::ClearSystemState(); } protected: void RunFwdTxfm(const int16_t *in, tran_low_t *out, int stride) { - fwd_txfm_(in, out, stride, tx_type_); + fwd_txfm_(in, out, stride, &fwd_txfm_param_); } void RunInvTxfm(const tran_low_t *out, uint8_t *dst, int stride) { - inv_txfm_(out, dst, stride, tx_type_); + inv_txfm_(out, dst, stride, &inv_txfm_param_); } FhtFunc fwd_txfm_; diff --git a/test/av1_fht4x4_test.cc b/test/av1_fht4x4_test.cc index 42837d3a4..6506ab7f4 100644 --- a/test/av1_fht4x4_test.cc +++ b/test/av1_fht4x4_test.cc @@ -25,17 +25,19 @@ using libaom_test::ACMRandom; namespace { typedef void (*IhtFunc)(const tran_low_t *in, uint8_t *out, int stride, - int tx_type); + const INV_TXFM_PARAM *inv_txfm_param); using std::tr1::tuple; using libaom_test::FhtFunc; typedef tuple Ht4x4Param; -void fht4x4_ref(const int16_t *in, tran_low_t *out, int stride, int tx_type) { - av1_fht4x4_c(in, out, stride, tx_type); +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); } -void iht4x4_ref(const tran_low_t *in, uint8_t *out, int stride, int tx_type) { - av1_iht4x4_16_add_c(in, out, stride, tx_type); +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); } #if CONFIG_HIGHBITDEPTH @@ -62,7 +64,6 @@ class AV1Trans4x4HT : public libaom_test::TransformTestBase, virtual void SetUp() { fwd_txfm_ = GET_PARAM(0); inv_txfm_ = GET_PARAM(1); - tx_type_ = GET_PARAM(2); pitch_ = 4; height_ = 4; fwd_txfm_ref = fht4x4_ref; @@ -70,16 +71,18 @@ class AV1Trans4x4HT : public libaom_test::TransformTestBase, 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); } virtual void TearDown() { libaom_test::ClearSystemState(); } protected: void RunFwdTxfm(const int16_t *in, tran_low_t *out, int stride) { - fwd_txfm_(in, out, stride, tx_type_); + fwd_txfm_(in, out, stride, &fwd_txfm_param_); } void RunInvTxfm(const tran_low_t *out, uint8_t *dst, int stride) { - inv_txfm_(out, dst, stride, tx_type_); + inv_txfm_(out, dst, stride, &inv_txfm_param_); } FhtFunc fwd_txfm_; diff --git a/test/av1_fht4x8_test.cc b/test/av1_fht4x8_test.cc index a899c8739..08535394f 100644 --- a/test/av1_fht4x8_test.cc +++ b/test/av1_fht4x8_test.cc @@ -25,17 +25,19 @@ using libaom_test::ACMRandom; namespace { typedef void (*IhtFunc)(const tran_low_t *in, uint8_t *out, int stride, - int tx_type); + const INV_TXFM_PARAM *inv_txfm_param); using std::tr1::tuple; using libaom_test::FhtFunc; typedef tuple Ht4x8Param; -void fht4x8_ref(const int16_t *in, tran_low_t *out, int stride, int tx_type) { - av1_fht4x8_c(in, out, stride, tx_type); +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); } -void iht4x8_ref(const tran_low_t *in, uint8_t *out, int stride, int tx_type) { - av1_iht4x8_32_add_c(in, out, stride, tx_type); +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); } class AV1Trans4x8HT : public libaom_test::TransformTestBase, @@ -46,7 +48,6 @@ class AV1Trans4x8HT : public libaom_test::TransformTestBase, virtual void SetUp() { fwd_txfm_ = GET_PARAM(0); inv_txfm_ = GET_PARAM(1); - tx_type_ = GET_PARAM(2); pitch_ = 4; height_ = 8; fwd_txfm_ref = fht4x8_ref; @@ -54,16 +55,18 @@ class AV1Trans4x8HT : public libaom_test::TransformTestBase, 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); } virtual void TearDown() { libaom_test::ClearSystemState(); } protected: void RunFwdTxfm(const int16_t *in, tran_low_t *out, int stride) { - fwd_txfm_(in, out, stride, tx_type_); + fwd_txfm_(in, out, stride, &fwd_txfm_param_); } void RunInvTxfm(const tran_low_t *out, uint8_t *dst, int stride) { - inv_txfm_(out, dst, stride, tx_type_); + inv_txfm_(out, dst, stride, &inv_txfm_param_); } FhtFunc fwd_txfm_; diff --git a/test/av1_fht64x64_test.cc b/test/av1_fht64x64_test.cc index cde1d0ca3..ce8e9183c 100644 --- a/test/av1_fht64x64_test.cc +++ b/test/av1_fht64x64_test.cc @@ -26,18 +26,19 @@ using libaom_test::ACMRandom; namespace { typedef void (*IhtFunc)(const tran_low_t *in, uint8_t *out, int stride, - int tx_type); + const INV_TXFM_PARAM *inv_txfm_param); using std::tr1::tuple; using libaom_test::FhtFunc; typedef tuple Ht64x64Param; -void fht64x64_ref(const int16_t *in, tran_low_t *out, int stride, int tx_type) { - av1_fht64x64_c(in, out, stride, tx_type); +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); } void iht64x64_ref(const tran_low_t *in, uint8_t *dest, int stride, - int tx_type) { - av1_iht64x64_4096_add_c(in, dest, stride, tx_type); + const INV_TXFM_PARAM *inv_txfm_param) { + av1_iht64x64_4096_add_c(in, dest, stride, inv_txfm_param); } class AV1Trans64x64HT : public libaom_test::TransformTestBase, @@ -48,7 +49,6 @@ class AV1Trans64x64HT : public libaom_test::TransformTestBase, virtual void SetUp() { fwd_txfm_ = GET_PARAM(0); inv_txfm_ = GET_PARAM(1); - tx_type_ = GET_PARAM(2); pitch_ = 64; height_ = 64; fwd_txfm_ref = fht64x64_ref; @@ -56,16 +56,18 @@ class AV1Trans64x64HT : public libaom_test::TransformTestBase, 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); } virtual void TearDown() { libaom_test::ClearSystemState(); } protected: void RunFwdTxfm(const int16_t *in, tran_low_t *out, int stride) { - fwd_txfm_(in, out, stride, tx_type_); + fwd_txfm_(in, out, stride, &fwd_txfm_param_); } void RunInvTxfm(const tran_low_t *out, uint8_t *dst, int stride) { - inv_txfm_(out, dst, stride, tx_type_); + inv_txfm_(out, dst, stride, &inv_txfm_param_); } FhtFunc fwd_txfm_; diff --git a/test/av1_fht8x16_test.cc b/test/av1_fht8x16_test.cc index ace9a8f47..53e6bcec4 100644 --- a/test/av1_fht8x16_test.cc +++ b/test/av1_fht8x16_test.cc @@ -24,17 +24,19 @@ using libaom_test::ACMRandom; namespace { typedef void (*IhtFunc)(const tran_low_t *in, uint8_t *out, int stride, - int tx_type); + const INV_TXFM_PARAM *inv_txfm_param); using std::tr1::tuple; using libaom_test::FhtFunc; typedef tuple Ht8x16Param; -void fht8x16_ref(const int16_t *in, tran_low_t *out, int stride, int tx_type) { - av1_fht8x16_c(in, out, stride, tx_type); +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); } -void iht8x16_ref(const tran_low_t *in, uint8_t *out, int stride, int tx_type) { - av1_iht8x16_128_add_c(in, out, stride, tx_type); +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); } class AV1Trans8x16HT : public libaom_test::TransformTestBase, @@ -45,7 +47,6 @@ class AV1Trans8x16HT : public libaom_test::TransformTestBase, virtual void SetUp() { fwd_txfm_ = GET_PARAM(0); inv_txfm_ = GET_PARAM(1); - tx_type_ = GET_PARAM(2); pitch_ = 8; height_ = 16; inv_txfm_ref = iht8x16_ref; @@ -53,16 +54,18 @@ class AV1Trans8x16HT : public libaom_test::TransformTestBase, 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); } virtual void TearDown() { libaom_test::ClearSystemState(); } protected: void RunFwdTxfm(const int16_t *in, tran_low_t *out, int stride) { - fwd_txfm_(in, out, stride, tx_type_); + fwd_txfm_(in, out, stride, &fwd_txfm_param_); } void RunInvTxfm(const tran_low_t *out, uint8_t *dst, int stride) { - inv_txfm_(out, dst, stride, tx_type_); + inv_txfm_(out, dst, stride, &inv_txfm_param_); } FhtFunc fwd_txfm_; diff --git a/test/av1_fht8x4_test.cc b/test/av1_fht8x4_test.cc index 9bf4ff647..600474593 100644 --- a/test/av1_fht8x4_test.cc +++ b/test/av1_fht8x4_test.cc @@ -24,17 +24,19 @@ using libaom_test::ACMRandom; namespace { typedef void (*IhtFunc)(const tran_low_t *in, uint8_t *out, int stride, - int tx_type); + const INV_TXFM_PARAM *inv_txfm_param); using std::tr1::tuple; using libaom_test::FhtFunc; typedef tuple Ht8x4Param; -void fht8x4_ref(const int16_t *in, tran_low_t *out, int stride, int tx_type) { - av1_fht8x4_c(in, out, stride, tx_type); +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); } -void iht8x4_ref(const tran_low_t *in, uint8_t *out, int stride, int tx_type) { - av1_iht8x4_32_add_c(in, out, stride, tx_type); +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); } class AV1Trans8x4HT : public libaom_test::TransformTestBase, @@ -45,7 +47,6 @@ class AV1Trans8x4HT : public libaom_test::TransformTestBase, virtual void SetUp() { fwd_txfm_ = GET_PARAM(0); inv_txfm_ = GET_PARAM(1); - tx_type_ = GET_PARAM(2); pitch_ = 8; height_ = 4; fwd_txfm_ref = fht8x4_ref; @@ -53,16 +54,18 @@ class AV1Trans8x4HT : public libaom_test::TransformTestBase, 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); } virtual void TearDown() { libaom_test::ClearSystemState(); } protected: void RunFwdTxfm(const int16_t *in, tran_low_t *out, int stride) { - fwd_txfm_(in, out, stride, tx_type_); + fwd_txfm_(in, out, stride, &fwd_txfm_param_); } void RunInvTxfm(const tran_low_t *out, uint8_t *dst, int stride) { - inv_txfm_(out, dst, stride, tx_type_); + inv_txfm_(out, dst, stride, &inv_txfm_param_); } FhtFunc fwd_txfm_; diff --git a/test/av1_fht8x8_test.cc b/test/av1_fht8x8_test.cc index 99cff1014..5deaeac3e 100644 --- a/test/av1_fht8x8_test.cc +++ b/test/av1_fht8x8_test.cc @@ -25,18 +25,20 @@ using libaom_test::ACMRandom; namespace { typedef void (*IhtFunc)(const tran_low_t *in, uint8_t *out, int stride, - int tx_type); + const INV_TXFM_PARAM *inv_txfm_param); using libaom_test::FhtFunc; using std::tr1::tuple; typedef tuple Ht8x8Param; -void fht8x8_ref(const int16_t *in, tran_low_t *out, int stride, int tx_type) { - av1_fht8x8_c(in, out, stride, tx_type); +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); } -void iht8x8_ref(const tran_low_t *in, uint8_t *out, int stride, int tx_type) { - av1_iht8x8_64_add_c(in, out, stride, tx_type); +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); } #if CONFIG_HIGHBITDEPTH @@ -61,7 +63,6 @@ class AV1Trans8x8HT : public libaom_test::TransformTestBase, virtual void SetUp() { fwd_txfm_ = GET_PARAM(0); inv_txfm_ = GET_PARAM(1); - tx_type_ = GET_PARAM(2); pitch_ = 8; height_ = 8; fwd_txfm_ref = fht8x8_ref; @@ -69,16 +70,18 @@ class AV1Trans8x8HT : public libaom_test::TransformTestBase, 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); } virtual void TearDown() { libaom_test::ClearSystemState(); } protected: void RunFwdTxfm(const int16_t *in, tran_low_t *out, int stride) { - fwd_txfm_(in, out, stride, tx_type_); + fwd_txfm_(in, out, stride, &fwd_txfm_param_); } void RunInvTxfm(const tran_low_t *out, uint8_t *dst, int stride) { - inv_txfm_(out, dst, stride, tx_type_); + inv_txfm_(out, dst, stride, &inv_txfm_param_); } FhtFunc fwd_txfm_; diff --git a/test/dct16x16_test.cc b/test/dct16x16_test.cc index af01d0234..25972ef66 100644 --- a/test/dct16x16_test.cc +++ b/test/dct16x16_test.cc @@ -226,9 +226,9 @@ void reference_16x16_dct_2d(int16_t input[256], double output[256]) { 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, - int tx_type); + FWD_TXFM_PARAM *fwd_txfm_param); typedef void (*IhtFunc)(const tran_low_t *in, uint8_t *out, int stride, - int tx_type); + const INV_TXFM_PARAM *inv_txfm_param); typedef std::tr1::tuple Dct16x16Param; typedef std::tr1::tuple Ht16x16Param; @@ -236,39 +236,46 @@ typedef std::tr1::tuple Idct16x16Param; void fdct16x16_ref(const int16_t *in, tran_low_t *out, int stride, - int /*tx_type*/) { + FWD_TXFM_PARAM *fwd_txfm_param) { aom_fdct16x16_c(in, out, stride); } void idct16x16_ref(const tran_low_t *in, uint8_t *dest, int stride, - int /*tx_type*/) { + const INV_TXFM_PARAM *inv_txfm_param) { aom_idct16x16_256_add_c(in, dest, stride); } -void fht16x16_ref(const int16_t *in, tran_low_t *out, int stride, int tx_type) { - av1_fht16x16_c(in, out, stride, tx_type); +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); } void iht16x16_ref(const tran_low_t *in, uint8_t *dest, int stride, - int tx_type) { - av1_iht16x16_256_add_c(in, dest, stride, tx_type); + const INV_TXFM_PARAM *inv_txfm_param) { + av1_iht16x16_256_add_c(in, dest, stride, inv_txfm_param); } #if CONFIG_HIGHBITDEPTH -void fht16x16_10(const int16_t *in, tran_low_t *out, int stride, int tx_type) { - av1_fwd_txfm2d_16x16_c(in, out, stride, tx_type, 10); +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); } -void fht16x16_12(const int16_t *in, tran_low_t *out, int stride, int tx_type) { - av1_fwd_txfm2d_16x16_c(in, out, stride, tx_type, 12); +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); } -void iht16x16_10(const tran_low_t *in, uint8_t *out, int stride, int tx_type) { - av1_inv_txfm2d_add_16x16_c(in, CONVERT_TO_SHORTPTR(out), stride, tx_type, 10); +void iht16x16_10(const tran_low_t *in, uint8_t *out, int stride, + const INV_TXFM_PARAM *inv_txfm_param) { + av1_inv_txfm2d_add_16x16_c(in, CONVERT_TO_SHORTPTR(out), stride, + inv_txfm_param->tx_type, 10); } -void iht16x16_12(const tran_low_t *in, uint8_t *out, int stride, int tx_type) { - av1_inv_txfm2d_add_16x16_c(in, CONVERT_TO_SHORTPTR(out), stride, tx_type, 12); +void iht16x16_12(const tran_low_t *in, uint8_t *out, int stride, + const INV_TXFM_PARAM *inv_txfm_param) { + av1_inv_txfm2d_add_16x16_c(in, CONVERT_TO_SHORTPTR(out), stride, + inv_txfm_param->tx_type, 12); } #endif // CONFIG_HIGHBITDEPTH @@ -354,7 +361,7 @@ class Trans16x16TestBase { 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_, tx_type_); + fwd_txfm_ref(input_block, output_ref_block, pitch_, &fwd_txfm_param_); ASM_REGISTER_STATE_CHECK(RunFwdTxfm(input_block, output_block, pitch_)); // The minimum quant value is 4. @@ -381,7 +388,8 @@ class Trans16x16TestBase { for (int j = 0; j < kNumCoeffs; ++j) input_extreme_block[j] = -mask_; } - fwd_txfm_ref(input_extreme_block, output_ref_block, pitch_, tx_type_); + fwd_txfm_ref(input_extreme_block, output_ref_block, pitch_, + &fwd_txfm_param_); ASM_REGISTER_STATE_CHECK( RunFwdTxfm(input_extreme_block, output_block, pitch_)); @@ -417,7 +425,8 @@ class Trans16x16TestBase { 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_, tx_type_); + fwd_txfm_ref(input_extreme_block, output_ref_block, pitch_, + &fwd_txfm_param_); // clear reconstructed pixel buffers memset(dst, 0, kNumCoeffs * sizeof(uint8_t)); @@ -432,12 +441,12 @@ class Trans16x16TestBase { 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_, tx_type_); + inv_txfm_ref(output_ref_block, ref, pitch_, &inv_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_, - tx_type_); + &inv_txfm_param_); ASM_REGISTER_STATE_CHECK( RunInvTxfm(output_ref_block, CONVERT_TO_BYTEPTR(dst16), pitch_)); #endif @@ -566,11 +575,12 @@ class Trans16x16TestBase { } int pitch_; - int tx_type_; aom_bit_depth_t bit_depth_; int mask_; FhtFunc fwd_txfm_ref; IhtFunc inv_txfm_ref; + FWD_TXFM_PARAM fwd_txfm_param_; + INV_TXFM_PARAM inv_txfm_param_; }; class Trans16x16DCT : public Trans16x16TestBase, @@ -581,13 +591,14 @@ class Trans16x16DCT : public Trans16x16TestBase, virtual void SetUp() { fwd_txfm_ = GET_PARAM(0); inv_txfm_ = GET_PARAM(1); - tx_type_ = GET_PARAM(2); bit_depth_ = GET_PARAM(3); pitch_ = 16; fwd_txfm_ref = fdct16x16_ref; 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); } virtual void TearDown() { libaom_test::ClearSystemState(); } @@ -625,10 +636,11 @@ class Trans16x16HT : public Trans16x16TestBase, virtual void SetUp() { fwd_txfm_ = GET_PARAM(0); inv_txfm_ = GET_PARAM(1); - tx_type_ = GET_PARAM(2); 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); #if CONFIG_HIGHBITDEPTH switch (bit_depth_) { case AOM_BITS_10: @@ -653,10 +665,10 @@ class Trans16x16HT : public Trans16x16TestBase, protected: void RunFwdTxfm(int16_t *in, tran_low_t *out, int stride) { - fwd_txfm_(in, out, stride, tx_type_); + fwd_txfm_(in, out, stride, &fwd_txfm_param_); } void RunInvTxfm(tran_low_t *out, uint8_t *dst, int stride) { - inv_txfm_(out, dst, stride, tx_type_); + inv_txfm_(out, dst, stride, &inv_txfm_param_); } FhtFunc fwd_txfm_; diff --git a/test/fdct4x4_test.cc b/test/fdct4x4_test.cc index c6e8dbcc1..30043d6fc 100644 --- a/test/fdct4x4_test.cc +++ b/test/fdct4x4_test.cc @@ -33,7 +33,7 @@ namespace { 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, - int tx_type); + const INV_TXFM_PARAM *inv_txfm_param); using libaom_test::FhtFunc; typedef std::tr1::tuple @@ -41,34 +41,41 @@ typedef std::tr1::tuple typedef std::tr1::tuple Ht4x4Param; void fdct4x4_ref(const int16_t *in, tran_low_t *out, int stride, - int /*tx_type*/) { + FWD_TXFM_PARAM *fwd_txfm_param) { aom_fdct4x4_c(in, out, stride); } -void fht4x4_ref(const int16_t *in, tran_low_t *out, int stride, int tx_type) { - av1_fht4x4_c(in, out, stride, tx_type); +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); } void fwht4x4_ref(const int16_t *in, tran_low_t *out, int stride, - int /*tx_type*/) { + FWD_TXFM_PARAM *fwd_txfm_param) { av1_fwht4x4_c(in, out, stride); } #if CONFIG_HIGHBITDEPTH -void fht4x4_10(const int16_t *in, tran_low_t *out, int stride, int tx_type) { - av1_fwd_txfm2d_4x4_c(in, out, stride, tx_type, 10); +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); } -void fht4x4_12(const int16_t *in, tran_low_t *out, int stride, int tx_type) { - av1_fwd_txfm2d_4x4_c(in, out, stride, tx_type, 12); +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); } -void iht4x4_10(const tran_low_t *in, uint8_t *out, int stride, int tx_type) { - av1_inv_txfm2d_add_4x4_c(in, CONVERT_TO_SHORTPTR(out), stride, tx_type, 10); +void iht4x4_10(const tran_low_t *in, uint8_t *out, int stride, + const INV_TXFM_PARAM *inv_txfm_param) { + av1_inv_txfm2d_add_4x4_c(in, CONVERT_TO_SHORTPTR(out), stride, + inv_txfm_param->tx_type, 10); } -void iht4x4_12(const tran_low_t *in, uint8_t *out, int stride, int tx_type) { - av1_inv_txfm2d_add_4x4_c(in, CONVERT_TO_SHORTPTR(out), stride, tx_type, 12); +void iht4x4_12(const tran_low_t *in, uint8_t *out, int stride, + const INV_TXFM_PARAM *inv_txfm_param) { + av1_inv_txfm2d_add_4x4_c(in, CONVERT_TO_SHORTPTR(out), stride, + inv_txfm_param->tx_type, 12); } void iwht4x4_10(const tran_low_t *in, uint8_t *out, int stride) { @@ -88,13 +95,14 @@ class Trans4x4DCT : public libaom_test::TransformTestBase, virtual void SetUp() { fwd_txfm_ = GET_PARAM(0); inv_txfm_ = GET_PARAM(1); - tx_type_ = GET_PARAM(2); pitch_ = 4; height_ = 4; fwd_txfm_ref = fdct4x4_ref; 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); } virtual void TearDown() { libaom_test::ClearSystemState(); } @@ -126,13 +134,14 @@ class Trans4x4HT : public libaom_test::TransformTestBase, virtual void SetUp() { fwd_txfm_ = GET_PARAM(0); inv_txfm_ = GET_PARAM(1); - tx_type_ = GET_PARAM(2); pitch_ = 4; height_ = 4; fwd_txfm_ref = fht4x4_ref; 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); #if CONFIG_HIGHBITDEPTH switch (bit_depth_) { case AOM_BITS_10: fwd_txfm_ref = fht4x4_10; break; @@ -145,11 +154,11 @@ class Trans4x4HT : public libaom_test::TransformTestBase, protected: void RunFwdTxfm(const int16_t *in, tran_low_t *out, int stride) { - fwd_txfm_(in, out, stride, tx_type_); + fwd_txfm_(in, out, stride, &fwd_txfm_param_); } void RunInvTxfm(const tran_low_t *out, uint8_t *dst, int stride) { - inv_txfm_(out, dst, stride, tx_type_); + inv_txfm_(out, dst, stride, &inv_txfm_param_); } FhtFunc fwd_txfm_; @@ -172,7 +181,6 @@ class Trans4x4WHT : public libaom_test::TransformTestBase, virtual void SetUp() { fwd_txfm_ = GET_PARAM(0); inv_txfm_ = GET_PARAM(1); - tx_type_ = GET_PARAM(2); pitch_ = 4; height_ = 4; fwd_txfm_ref = fwht4x4_ref; diff --git a/test/fdct8x8_test.cc b/test/fdct8x8_test.cc index ff3ce4bdb..0bb3c6022 100644 --- a/test/fdct8x8_test.cc +++ b/test/fdct8x8_test.cc @@ -7,7 +7,7 @@ * obtain it at www.aomedia.org/license/software. If the Alliance for Open * Media Patent License 1.0 was not distributed with this source code in the * PATENTS file, you can obtain it at www.aomedia.org/license/patent. -*/ + */ #include #include @@ -40,9 +40,9 @@ const int kSignBiasMaxDiff15 = 10000; 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, - int tx_type); + FWD_TXFM_PARAM *fwd_txfm_param); typedef void (*IhtFunc)(const tran_low_t *in, uint8_t *out, int stride, - int tx_type); + const INV_TXFM_PARAM *inv_txfm_param); typedef std::tr1::tuple Dct8x8Param; typedef std::tr1::tuple Ht8x8Param; @@ -78,29 +78,36 @@ void reference_8x8_dct_2d(const int16_t input[kNumCoeffs], } void fdct8x8_ref(const int16_t *in, tran_low_t *out, int stride, - int /*tx_type*/) { + FWD_TXFM_PARAM *fwd_txfm_param) { aom_fdct8x8_c(in, out, stride); } -void fht8x8_ref(const int16_t *in, tran_low_t *out, int stride, int tx_type) { - av1_fht8x8_c(in, out, stride, tx_type); +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); } #if CONFIG_HIGHBITDEPTH -void fht8x8_10(const int16_t *in, tran_low_t *out, int stride, int tx_type) { - av1_fwd_txfm2d_8x8_c(in, out, stride, tx_type, 10); +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); } -void fht8x8_12(const int16_t *in, tran_low_t *out, int stride, int tx_type) { - av1_fwd_txfm2d_8x8_c(in, out, stride, tx_type, 12); +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); } -void iht8x8_10(const tran_low_t *in, uint8_t *out, int stride, int tx_type) { - av1_inv_txfm2d_add_8x8_c(in, CONVERT_TO_SHORTPTR(out), stride, tx_type, 10); +void iht8x8_10(const tran_low_t *in, uint8_t *out, int stride, + const INV_TXFM_PARAM *inv_txfm_param) { + av1_inv_txfm2d_add_8x8_c(in, CONVERT_TO_SHORTPTR(out), stride, + inv_txfm_param->tx_type, 10); } -void iht8x8_12(const tran_low_t *in, uint8_t *out, int stride, int tx_type) { - av1_inv_txfm2d_add_8x8_c(in, CONVERT_TO_SHORTPTR(out), stride, tx_type, 12); +void iht8x8_12(const tran_low_t *in, uint8_t *out, int stride, + const INV_TXFM_PARAM *inv_txfm_param) { + av1_inv_txfm2d_add_8x8_c(in, CONVERT_TO_SHORTPTR(out), stride, + inv_txfm_param->tx_type, 12); } #endif // CONFIG_HIGHBITDEPTH @@ -303,8 +310,8 @@ class FwdTrans8x8TestBase { 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_, tx_type_)); + ASM_REGISTER_STATE_CHECK(fwd_txfm_ref(test_input_block, ref_temp_block, + pitch_, &fwd_txfm_param_)); if (bit_depth_ == AOM_BITS_8) { ASM_REGISTER_STATE_CHECK(RunInvTxfm(test_temp_block, dst, pitch_)); #if CONFIG_HIGHBITDEPTH @@ -484,10 +491,11 @@ class FwdTrans8x8TestBase { } } int pitch_; - int tx_type_; FhtFunc fwd_txfm_ref; aom_bit_depth_t bit_depth_; int mask_; + FWD_TXFM_PARAM fwd_txfm_param_; + INV_TXFM_PARAM inv_txfm_param_; }; class FwdTrans8x8DCT : public FwdTrans8x8TestBase, @@ -498,11 +506,12 @@ class FwdTrans8x8DCT : public FwdTrans8x8TestBase, virtual void SetUp() { fwd_txfm_ = GET_PARAM(0); inv_txfm_ = GET_PARAM(1); - tx_type_ = GET_PARAM(2); pitch_ = 8; 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); } virtual void TearDown() { libaom_test::ClearSystemState(); } @@ -537,11 +546,12 @@ class FwdTrans8x8HT : public FwdTrans8x8TestBase, virtual void SetUp() { fwd_txfm_ = GET_PARAM(0); inv_txfm_ = GET_PARAM(1); - tx_type_ = GET_PARAM(2); pitch_ = 8; 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); #if CONFIG_HIGHBITDEPTH switch (bit_depth_) { case AOM_BITS_10: fwd_txfm_ref = fht8x8_10; break; @@ -555,10 +565,10 @@ class FwdTrans8x8HT : public FwdTrans8x8TestBase, protected: void RunFwdTxfm(int16_t *in, tran_low_t *out, int stride) { - fwd_txfm_(in, out, stride, tx_type_); + fwd_txfm_(in, out, stride, &fwd_txfm_param_); } void RunInvTxfm(tran_low_t *out, uint8_t *dst, int stride) { - inv_txfm_(out, dst, stride, tx_type_); + inv_txfm_(out, dst, stride, &inv_txfm_param_); } FhtFunc fwd_txfm_; diff --git a/test/transform_test_base.h b/test/transform_test_base.h index 4c1a55496..7be5c3d73 100644 --- a/test/transform_test_base.h +++ b/test/transform_test_base.h @@ -15,6 +15,7 @@ #include "./aom_config.h" #include "aom_mem/aom_mem.h" #include "aom/aom_codec.h" +#include "av1/common/idct.h" namespace libaom_test { @@ -28,10 +29,10 @@ namespace libaom_test { const int kDctMaxValue = 16384; typedef void (*FhtFunc)(const int16_t *in, tran_low_t *out, int stride, - int tx_type); + FWD_TXFM_PARAM *fwd_txfm_param); typedef void (*IhtFunc)(const tran_low_t *in, uint8_t *out, int stride, - int tx_type); + const INV_TXFM_PARAM *inv_txfm_param); class TransformTestBase { public: @@ -157,7 +158,7 @@ class TransformTestBase { } } - fwd_txfm_ref(input_block, output_ref_block, stride, tx_type_); + fwd_txfm_ref(input_block, output_ref_block, stride, &fwd_txfm_param_); ASM_REGISTER_STATE_CHECK(RunFwdTxfm(input_block, output_block, stride)); // The minimum quant value is 4. @@ -205,9 +206,9 @@ class TransformTestBase { } } - fwd_txfm_ref(input_block, trans_block, pitch_, tx_type_); + fwd_txfm_ref(input_block, trans_block, pitch_, &fwd_txfm_param_); - inv_txfm_ref(trans_block, output_ref_block, stride, tx_type_); + inv_txfm_ref(trans_block, output_ref_block, stride, &inv_txfm_param_); ASM_REGISTER_STATE_CHECK(RunInvTxfm(trans_block, output_block, stride)); for (j = 0; j < height_; ++j) { @@ -247,7 +248,8 @@ class TransformTestBase { for (int j = 0; j < num_coeffs_; ++j) input_extreme_block[j] = -mask_; } - fwd_txfm_ref(input_extreme_block, output_ref_block, pitch_, tx_type_); + fwd_txfm_ref(input_extreme_block, output_ref_block, pitch_, + &fwd_txfm_param_); ASM_REGISTER_STATE_CHECK( RunFwdTxfm(input_extreme_block, output_block, pitch_)); @@ -303,7 +305,7 @@ class TransformTestBase { } } - fwd_txfm_ref(in, coeff, pitch_, tx_type_); + fwd_txfm_ref(in, coeff, pitch_, &fwd_txfm_param_); if (bit_depth_ == AOM_BITS_8) { ASM_REGISTER_STATE_CHECK(RunInvTxfm(coeff, dst, pitch_)); @@ -338,12 +340,13 @@ class TransformTestBase { int pitch_; int height_; - int tx_type_; FhtFunc fwd_txfm_ref; IhtFunc inv_txfm_ref; aom_bit_depth_t bit_depth_; int mask_; int num_coeffs_; + FWD_TXFM_PARAM fwd_txfm_param_; + INV_TXFM_PARAM inv_txfm_param_; private: // Assume transform size is 4x4, 8x8, 16x16,... -- GitLab