From 78a7bd7d8d957c36d482101c1498a6c48472bfb3 Mon Sep 17 00:00:00 2001 From: Sebastien Alaiwan Date: Thu, 19 Oct 2017 17:14:13 +0200 Subject: [PATCH] Use rtcd script to choose between implementations Change-Id: I752ad96a8b4349d4a437a97e30edc8e4c22f81b5 --- av1/common/av1_rtcd_defs.pl | 25 +++++++++++++------------ av1/common/idct.c | 37 ++----------------------------------- test/av1_fht16x16_test.cc | 4 ++-- test/av1_fht4x4_test.cc | 2 +- test/av1_fht8x8_test.cc | 2 +- 5 files changed, 19 insertions(+), 51 deletions(-) diff --git a/av1/common/av1_rtcd_defs.pl b/av1/common/av1_rtcd_defs.pl index e34b40523..b408db34a 100755 --- a/av1/common/av1_rtcd_defs.pl +++ b/av1/common/av1_rtcd_defs.pl @@ -70,10 +70,10 @@ if (aom_config("CONFIG_HIGHBITDEPTH") eq "yes") { # Inverse dct # add_proto qw/void av1_iht4x4_16_add/, "const tran_low_t *input, uint8_t *dest, int dest_stride, const struct txfm_param *param"; -if (aom_config("CONFIG_HIGHBITDEPTH") eq "yes") { - specialize qw/av1_iht4x4_16_add sse2/; -} else { - if (aom_config("CONFIG_DAALA_TX4") ne "yes") { +if (aom_config("CONFIG_DAALA_TX4") ne "yes" && aom_config("CONFIG_LGT") ne "yes") { + if (aom_config("CONFIG_HIGHBITDEPTH") eq "yes") { + specialize qw/av1_iht4x4_16_add sse2/; + } else { specialize qw/av1_iht4x4_16_add sse2 neon/; } } @@ -105,19 +105,20 @@ add_proto qw/void av1_iht8x32_256_add/, "const tran_low_t *input, uint8_t *dest, add_proto qw/void av1_iht32x8_256_add/, "const tran_low_t *input, uint8_t *dest, int dest_stride, const struct txfm_param *param"; add_proto qw/void av1_iht8x8_64_add/, "const tran_low_t *input, uint8_t *dest, int dest_stride, const struct txfm_param *param"; -if (aom_config("CONFIG_HIGHBITDEPTH") eq "yes") { - specialize qw/av1_iht8x8_64_add sse2/; -} else { - if (aom_config("CONFIG_DAALA_TX8") ne "yes") { +if (aom_config("CONFIG_DAALA_TX8") ne "yes" && aom_config("CONFIG_LGT") ne "yes") { + if (aom_config("CONFIG_HIGHBITDEPTH") eq "yes") { + specialize qw/av1_iht8x8_64_add sse2/; + } else { specialize qw/av1_iht8x8_64_add sse2 neon/; } } add_proto qw/void av1_iht16x16_256_add/, "const tran_low_t *input, uint8_t *output, int pitch, const struct txfm_param *param"; -if (aom_config("CONFIG_HIGHBITDEPTH") eq "yes") { - specialize qw/av1_iht16x16_256_add sse2 avx2/; -} else { - if (aom_config("CONFIG_DAALA_TX16") ne "yes") { + +if (aom_config("CONFIG_DAALA_TX16") ne "yes" && aom_config("CONFIG_LGT") ne "yes") { + if (aom_config("CONFIG_HIGHBITDEPTH") eq "yes") { + specialize qw/av1_iht16x16_256_add sse2 avx2/; + } else { specialize qw/av1_iht16x16_256_add sse2 avx2/; } } diff --git a/av1/common/idct.c b/av1/common/idct.c index 38cdd22ff..2ca17854f 100644 --- a/av1/common/idct.c +++ b/av1/common/idct.c @@ -2484,27 +2484,14 @@ static void inv_txfm_add_4x4(const tran_low_t *input, uint8_t *dest, int stride, #endif case ADST_DCT: case DCT_ADST: - case ADST_ADST: -#if CONFIG_LGT || CONFIG_DAALA_TX4 - // LGT only exists in C verson - av1_iht4x4_16_add_c(input, dest, stride, txfm_param); - break; -#else - av1_iht4x4_16_add(input, dest, stride, txfm_param); - break; -#endif + case ADST_ADST: av1_iht4x4_16_add(input, dest, stride, txfm_param); break; case FLIPADST_DCT: case DCT_FLIPADST: case FLIPADST_FLIPADST: case ADST_FLIPADST: case FLIPADST_ADST: -#if CONFIG_LGT || CONFIG_DAALA_TX4 - av1_iht4x4_16_add_c(input, dest, stride, txfm_param); - break; -#else av1_iht4x4_16_add(input, dest, stride, txfm_param); break; -#endif case V_DCT: case H_DCT: case V_ADST: @@ -2635,26 +2622,14 @@ static void inv_txfm_add_8x8(const tran_low_t *input, uint8_t *dest, int stride, #endif case ADST_DCT: case DCT_ADST: - case ADST_ADST: -#if CONFIG_LGT || CONFIG_DAALA_TX8 - av1_iht8x8_64_add_c(input, dest, stride, txfm_param); - break; -#else - av1_iht8x8_64_add(input, dest, stride, txfm_param); - break; -#endif + case ADST_ADST: av1_iht8x8_64_add(input, dest, stride, txfm_param); break; case FLIPADST_DCT: case DCT_FLIPADST: case FLIPADST_FLIPADST: case ADST_FLIPADST: case FLIPADST_ADST: -#if CONFIG_LGT || CONFIG_DAALA_TX8 - av1_iht8x8_64_add_c(input, dest, stride, txfm_param); - break; -#else av1_iht8x8_64_add(input, dest, stride, txfm_param); break; -#endif case V_DCT: case H_DCT: case V_ADST: @@ -2681,11 +2656,7 @@ static void inv_txfm_add_16x16(const tran_low_t *input, uint8_t *dest, case ADST_DCT: case DCT_ADST: case ADST_ADST: -#if CONFIG_DAALA_TX16 - av1_iht16x16_256_add_c(input, dest, stride, txfm_param); -#else av1_iht16x16_256_add(input, dest, stride, txfm_param); -#endif // CONFIG_DAALA_TX16 break; case FLIPADST_DCT: case DCT_FLIPADST: @@ -2698,11 +2669,7 @@ static void inv_txfm_add_16x16(const tran_low_t *input, uint8_t *dest, case H_ADST: case V_FLIPADST: case H_FLIPADST: -#if CONFIG_DAALA_TX16 - av1_iht16x16_256_add_c(input, dest, stride, txfm_param); -#else av1_iht16x16_256_add(input, dest, stride, txfm_param); -#endif // CONFIG_DAALA_TX16 break; case IDTX: inv_idtx_add_c(input, dest, stride, 16, 16, tx_type); break; #if CONFIG_MRC_TX diff --git a/test/av1_fht16x16_test.cc b/test/av1_fht16x16_test.cc index fefdab9a3..60d32de2f 100644 --- a/test/av1_fht16x16_test.cc +++ b/test/av1_fht16x16_test.cc @@ -164,7 +164,7 @@ TEST_P(AV1HighbdTrans16x16HT, HighbdCoeffCheck) { RunBitexactCheck(); } using std::tr1::make_tuple; -#if HAVE_SSE2 && !CONFIG_DAALA_TX16 +#if HAVE_SSE2 && !CONFIG_DAALA_TX16 && !CONFIG_LGT const Ht16x16Param kArrayHt16x16Param_sse2[] = { make_tuple(&av1_fht16x16_sse2, &av1_iht16x16_256_add_sse2, DCT_DCT, AOM_BITS_8, 256), @@ -203,7 +203,7 @@ INSTANTIATE_TEST_CASE_P(SSE2, AV1Trans16x16HT, ::testing::ValuesIn(kArrayHt16x16Param_sse2)); #endif // HAVE_SSE2 -#if HAVE_AVX2 && !CONFIG_DAALA_TX16 +#if HAVE_AVX2 && !CONFIG_DAALA_TX16 && !CONFIG_LGT const Ht16x16Param kArrayHt16x16Param_avx2[] = { make_tuple(&av1_fht16x16_avx2, &av1_iht16x16_256_add_avx2, DCT_DCT, AOM_BITS_8, 256), diff --git a/test/av1_fht4x4_test.cc b/test/av1_fht4x4_test.cc index df7b03cbf..3e6847d29 100644 --- a/test/av1_fht4x4_test.cc +++ b/test/av1_fht4x4_test.cc @@ -167,7 +167,7 @@ TEST_P(AV1HighbdTrans4x4HT, HighbdCoeffCheck) { RunBitexactCheck(); } using std::tr1::make_tuple; -#if HAVE_SSE2 && !CONFIG_DAALA_TX4 +#if HAVE_SSE2 && !CONFIG_DAALA_TX4 && !CONFIG_LGT const Ht4x4Param kArrayHt4x4Param_sse2[] = { make_tuple(&av1_fht4x4_sse2, &av1_iht4x4_16_add_sse2, DCT_DCT, AOM_BITS_8, 16), diff --git a/test/av1_fht8x8_test.cc b/test/av1_fht8x8_test.cc index 1bffe4ee8..325b1bb6f 100644 --- a/test/av1_fht8x8_test.cc +++ b/test/av1_fht8x8_test.cc @@ -167,7 +167,7 @@ TEST_P(AV1HighbdTrans8x8HT, HighbdCoeffCheck) { RunBitexactCheck(); } using std::tr1::make_tuple; -#if HAVE_SSE2 && !CONFIG_DAALA_TX8 +#if HAVE_SSE2 && !CONFIG_DAALA_TX8 && !CONFIG_LGT const Ht8x8Param kArrayHt8x8Param_sse2[] = { make_tuple(&av1_fht8x8_sse2, &av1_iht8x8_64_add_sse2, DCT_DCT, AOM_BITS_8, 64), -- GitLab