Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 1 | /* |
Yaowu Xu | 2ab7ff0 | 2016-09-02 12:04:54 -0700 | [diff] [blame] | 2 | * Copyright (c) 2016, Alliance for Open Media. All rights reserved |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 3 | * |
Yaowu Xu | 2ab7ff0 | 2016-09-02 12:04:54 -0700 | [diff] [blame] | 4 | * This source code is subject to the terms of the BSD 2 Clause License and |
| 5 | * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License |
| 6 | * was not distributed with this source code in the LICENSE file, you can |
| 7 | * obtain it at www.aomedia.org/license/software. If the Alliance for Open |
| 8 | * Media Patent License 1.0 was not distributed with this source code in the |
| 9 | * PATENTS file, you can obtain it at www.aomedia.org/license/patent. |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 10 | */ |
| 11 | |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 12 | #include "./av1_rtcd.h" |
| 13 | #include "./aom_config.h" |
| 14 | #include "./aom_dsp_rtcd.h" |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 15 | |
| 16 | #include "av1/common/idct.h" |
| 17 | #include "av1/encoder/hybrid_fwd_txfm.h" |
Monty Montgomery | a2d40a3 | 2017-10-30 23:32:03 -0400 | [diff] [blame] | 18 | #if CONFIG_DAALA_TX |
| 19 | #include "av1/encoder/daala_fwd_txfm.h" |
| 20 | #else |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 21 | |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 22 | static void fwd_txfm_4x4(const int16_t *src_diff, tran_low_t *coeff, |
Lester Lu | 27319b6 | 2017-07-10 16:57:15 -0700 | [diff] [blame] | 23 | int diff_stride, TxfmParam *txfm_param) { |
| 24 | if (txfm_param->lossless) { |
| 25 | assert(txfm_param->tx_type == DCT_DCT); |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 26 | av1_fwht4x4(src_diff, coeff, diff_stride); |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 27 | return; |
| 28 | } |
| 29 | |
Sebastien Alaiwan | 2fa189e | 2017-11-08 12:37:42 +0100 | [diff] [blame] | 30 | #if CONFIG_DAALA_TX4 |
Lester Lu | ad8290b | 2017-06-12 18:26:18 -0700 | [diff] [blame] | 31 | // only C version has LGTs |
Lester Lu | 27319b6 | 2017-07-10 16:57:15 -0700 | [diff] [blame] | 32 | av1_fht4x4_c(src_diff, coeff, diff_stride, txfm_param); |
Lester Lu | ad8290b | 2017-06-12 18:26:18 -0700 | [diff] [blame] | 33 | #else |
Lester Lu | 27319b6 | 2017-07-10 16:57:15 -0700 | [diff] [blame] | 34 | av1_fht4x4(src_diff, coeff, diff_stride, txfm_param); |
Lester Lu | ad8290b | 2017-06-12 18:26:18 -0700 | [diff] [blame] | 35 | #endif |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 36 | } |
| 37 | |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 38 | static void fwd_txfm_4x8(const int16_t *src_diff, tran_low_t *coeff, |
Lester Lu | 27319b6 | 2017-07-10 16:57:15 -0700 | [diff] [blame] | 39 | int diff_stride, TxfmParam *txfm_param) { |
Sebastien Alaiwan | 2fa189e | 2017-11-08 12:37:42 +0100 | [diff] [blame] | 40 | #if (CONFIG_DAALA_TX4 && CONFIG_DAALA_TX8) |
Lester Lu | 27319b6 | 2017-07-10 16:57:15 -0700 | [diff] [blame] | 41 | av1_fht4x8_c(src_diff, coeff, diff_stride, txfm_param); |
Lester Lu | ad8290b | 2017-06-12 18:26:18 -0700 | [diff] [blame] | 42 | #else |
Lester Lu | 27319b6 | 2017-07-10 16:57:15 -0700 | [diff] [blame] | 43 | av1_fht4x8(src_diff, coeff, diff_stride, txfm_param); |
Lester Lu | ad8290b | 2017-06-12 18:26:18 -0700 | [diff] [blame] | 44 | #endif |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 45 | } |
| 46 | |
| 47 | static void fwd_txfm_8x4(const int16_t *src_diff, tran_low_t *coeff, |
Lester Lu | 27319b6 | 2017-07-10 16:57:15 -0700 | [diff] [blame] | 48 | int diff_stride, TxfmParam *txfm_param) { |
Sebastien Alaiwan | 2fa189e | 2017-11-08 12:37:42 +0100 | [diff] [blame] | 49 | #if (CONFIG_DAALA_TX4 && CONFIG_DAALA_TX8) |
Lester Lu | 27319b6 | 2017-07-10 16:57:15 -0700 | [diff] [blame] | 50 | av1_fht8x4_c(src_diff, coeff, diff_stride, txfm_param); |
Lester Lu | ad8290b | 2017-06-12 18:26:18 -0700 | [diff] [blame] | 51 | #else |
Lester Lu | 27319b6 | 2017-07-10 16:57:15 -0700 | [diff] [blame] | 52 | av1_fht8x4(src_diff, coeff, diff_stride, txfm_param); |
Lester Lu | ad8290b | 2017-06-12 18:26:18 -0700 | [diff] [blame] | 53 | #endif |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 54 | } |
| 55 | |
| 56 | static void fwd_txfm_8x16(const int16_t *src_diff, tran_low_t *coeff, |
Lester Lu | 27319b6 | 2017-07-10 16:57:15 -0700 | [diff] [blame] | 57 | int diff_stride, TxfmParam *txfm_param) { |
Sebastien Alaiwan | 2fa189e | 2017-11-08 12:37:42 +0100 | [diff] [blame] | 58 | #if (CONFIG_DAALA_TX8 && CONFIG_DAALA_TX16) |
Lester Lu | 27319b6 | 2017-07-10 16:57:15 -0700 | [diff] [blame] | 59 | av1_fht8x16_c(src_diff, coeff, diff_stride, txfm_param); |
Lester Lu | ad8290b | 2017-06-12 18:26:18 -0700 | [diff] [blame] | 60 | #else |
Lester Lu | 27319b6 | 2017-07-10 16:57:15 -0700 | [diff] [blame] | 61 | av1_fht8x16(src_diff, coeff, diff_stride, txfm_param); |
Lester Lu | ad8290b | 2017-06-12 18:26:18 -0700 | [diff] [blame] | 62 | #endif |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 63 | } |
| 64 | |
| 65 | static void fwd_txfm_16x8(const int16_t *src_diff, tran_low_t *coeff, |
Lester Lu | 27319b6 | 2017-07-10 16:57:15 -0700 | [diff] [blame] | 66 | int diff_stride, TxfmParam *txfm_param) { |
Sebastien Alaiwan | 2fa189e | 2017-11-08 12:37:42 +0100 | [diff] [blame] | 67 | #if (CONFIG_DAALA_TX8 && CONFIG_DAALA_TX16) |
Lester Lu | 27319b6 | 2017-07-10 16:57:15 -0700 | [diff] [blame] | 68 | av1_fht16x8_c(src_diff, coeff, diff_stride, txfm_param); |
Lester Lu | ad8290b | 2017-06-12 18:26:18 -0700 | [diff] [blame] | 69 | #else |
Lester Lu | 27319b6 | 2017-07-10 16:57:15 -0700 | [diff] [blame] | 70 | av1_fht16x8(src_diff, coeff, diff_stride, txfm_param); |
Lester Lu | ad8290b | 2017-06-12 18:26:18 -0700 | [diff] [blame] | 71 | #endif |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 72 | } |
| 73 | |
| 74 | static void fwd_txfm_16x32(const int16_t *src_diff, tran_low_t *coeff, |
Lester Lu | 27319b6 | 2017-07-10 16:57:15 -0700 | [diff] [blame] | 75 | int diff_stride, TxfmParam *txfm_param) { |
Monty Montgomery | ad39685 | 2017-10-20 03:35:26 -0400 | [diff] [blame] | 76 | #if CONFIG_DAALA_TX16 && CONFIG_DAALA_TX32 |
| 77 | av1_fht16x32_c(src_diff, coeff, diff_stride, txfm_param); |
| 78 | #else |
Lester Lu | 27319b6 | 2017-07-10 16:57:15 -0700 | [diff] [blame] | 79 | av1_fht16x32(src_diff, coeff, diff_stride, txfm_param); |
Monty Montgomery | ad39685 | 2017-10-20 03:35:26 -0400 | [diff] [blame] | 80 | #endif |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 81 | } |
| 82 | |
| 83 | static void fwd_txfm_32x16(const int16_t *src_diff, tran_low_t *coeff, |
Lester Lu | 27319b6 | 2017-07-10 16:57:15 -0700 | [diff] [blame] | 84 | int diff_stride, TxfmParam *txfm_param) { |
Monty Montgomery | ad39685 | 2017-10-20 03:35:26 -0400 | [diff] [blame] | 85 | #if CONFIG_DAALA_TX16 && CONFIG_DAALA_TX32 |
| 86 | av1_fht32x16_c(src_diff, coeff, diff_stride, txfm_param); |
| 87 | #else |
Lester Lu | 27319b6 | 2017-07-10 16:57:15 -0700 | [diff] [blame] | 88 | av1_fht32x16(src_diff, coeff, diff_stride, txfm_param); |
Monty Montgomery | ad39685 | 2017-10-20 03:35:26 -0400 | [diff] [blame] | 89 | #endif |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 90 | } |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 91 | |
| 92 | static void fwd_txfm_8x8(const int16_t *src_diff, tran_low_t *coeff, |
Lester Lu | 27319b6 | 2017-07-10 16:57:15 -0700 | [diff] [blame] | 93 | int diff_stride, TxfmParam *txfm_param) { |
Sebastien Alaiwan | 2fa189e | 2017-11-08 12:37:42 +0100 | [diff] [blame] | 94 | #if CONFIG_DAALA_TX8 |
Lester Lu | 27319b6 | 2017-07-10 16:57:15 -0700 | [diff] [blame] | 95 | av1_fht8x8_c(src_diff, coeff, diff_stride, txfm_param); |
Lester Lu | ad8290b | 2017-06-12 18:26:18 -0700 | [diff] [blame] | 96 | #else |
Lester Lu | 27319b6 | 2017-07-10 16:57:15 -0700 | [diff] [blame] | 97 | av1_fht8x8(src_diff, coeff, diff_stride, txfm_param); |
Lester Lu | ad8290b | 2017-06-12 18:26:18 -0700 | [diff] [blame] | 98 | #endif |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 99 | } |
| 100 | |
| 101 | static void fwd_txfm_16x16(const int16_t *src_diff, tran_low_t *coeff, |
Lester Lu | 27319b6 | 2017-07-10 16:57:15 -0700 | [diff] [blame] | 102 | int diff_stride, TxfmParam *txfm_param) { |
Nathan E. Egge | e554f36 | 2017-10-04 14:44:38 -0400 | [diff] [blame] | 103 | #if CONFIG_DAALA_TX16 |
Nathan E. Egge | 34e1201 | 2017-09-13 09:02:32 -0400 | [diff] [blame] | 104 | av1_fht16x16_c(src_diff, coeff, diff_stride, txfm_param); |
| 105 | #else |
Lester Lu | 27319b6 | 2017-07-10 16:57:15 -0700 | [diff] [blame] | 106 | av1_fht16x16(src_diff, coeff, diff_stride, txfm_param); |
Nathan E. Egge | e554f36 | 2017-10-04 14:44:38 -0400 | [diff] [blame] | 107 | #endif // CONFIG_DAALA_TX16 |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 108 | } |
| 109 | |
Angie Chiang | 8fd2d7a | 2017-01-03 15:50:15 -0800 | [diff] [blame] | 110 | static void fwd_txfm_32x32(const int16_t *src_diff, tran_low_t *coeff, |
Lester Lu | 27319b6 | 2017-07-10 16:57:15 -0700 | [diff] [blame] | 111 | int diff_stride, TxfmParam *txfm_param) { |
Sarah Parker | 53f93db | 2017-07-11 17:20:04 -0700 | [diff] [blame] | 112 | #if CONFIG_MRC_TX |
| 113 | // MRC_DCT currently only has a C implementation |
| 114 | if (txfm_param->tx_type == MRC_DCT) { |
| 115 | av1_fht32x32_c(src_diff, coeff, diff_stride, txfm_param); |
| 116 | return; |
| 117 | } |
| 118 | #endif // CONFIG_MRC_TX |
Lester Lu | 27319b6 | 2017-07-10 16:57:15 -0700 | [diff] [blame] | 119 | av1_fht32x32(src_diff, coeff, diff_stride, txfm_param); |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 120 | } |
| 121 | |
Debargha Mukherjee | 6a47cff | 2016-11-02 14:57:42 -0700 | [diff] [blame] | 122 | #if CONFIG_TX64X64 |
| 123 | static void fwd_txfm_64x64(const int16_t *src_diff, tran_low_t *coeff, |
Lester Lu | 27319b6 | 2017-07-10 16:57:15 -0700 | [diff] [blame] | 124 | int diff_stride, TxfmParam *txfm_param) { |
Lester Lu | 27319b6 | 2017-07-10 16:57:15 -0700 | [diff] [blame] | 125 | if (txfm_param->tx_type == IDTX) |
Debargha Mukherjee | 2b43501 | 2017-09-28 08:30:35 -0700 | [diff] [blame] | 126 | av1_fwd_idtx_c(src_diff, coeff, diff_stride, 64, 64, txfm_param->tx_type); |
Angie Chiang | 2cc057c | 2017-01-03 18:31:47 -0800 | [diff] [blame] | 127 | else |
Lester Lu | 27319b6 | 2017-07-10 16:57:15 -0700 | [diff] [blame] | 128 | av1_fht64x64(src_diff, coeff, diff_stride, txfm_param); |
Debargha Mukherjee | 6a47cff | 2016-11-02 14:57:42 -0700 | [diff] [blame] | 129 | } |
Debargha Mukherjee | 2b43501 | 2017-09-28 08:30:35 -0700 | [diff] [blame] | 130 | |
| 131 | static void fwd_txfm_32x64(const int16_t *src_diff, tran_low_t *coeff, |
| 132 | int diff_stride, TxfmParam *txfm_param) { |
Debargha Mukherjee | 2b43501 | 2017-09-28 08:30:35 -0700 | [diff] [blame] | 133 | if (txfm_param->tx_type == IDTX) |
| 134 | av1_fwd_idtx_c(src_diff, coeff, diff_stride, 32, 64, txfm_param->tx_type); |
| 135 | else |
Debargha Mukherjee | 2b43501 | 2017-09-28 08:30:35 -0700 | [diff] [blame] | 136 | av1_fht32x64(src_diff, coeff, diff_stride, txfm_param); |
| 137 | } |
| 138 | |
| 139 | static void fwd_txfm_64x32(const int16_t *src_diff, tran_low_t *coeff, |
| 140 | int diff_stride, TxfmParam *txfm_param) { |
Debargha Mukherjee | 2b43501 | 2017-09-28 08:30:35 -0700 | [diff] [blame] | 141 | if (txfm_param->tx_type == IDTX) |
| 142 | av1_fwd_idtx_c(src_diff, coeff, diff_stride, 64, 32, txfm_param->tx_type); |
| 143 | else |
Debargha Mukherjee | 2b43501 | 2017-09-28 08:30:35 -0700 | [diff] [blame] | 144 | av1_fht64x32(src_diff, coeff, diff_stride, txfm_param); |
| 145 | } |
Debargha Mukherjee | 6a47cff | 2016-11-02 14:57:42 -0700 | [diff] [blame] | 146 | #endif // CONFIG_TX64X64 |
| 147 | |
Sebastien Alaiwan | fb83877 | 2017-10-24 12:02:54 +0200 | [diff] [blame] | 148 | #if CONFIG_RECT_TX_EXT |
Yue Chen | 56e226e | 2017-05-02 16:21:40 -0700 | [diff] [blame] | 149 | static void fwd_txfm_16x4(const int16_t *src_diff, tran_low_t *coeff, |
Lester Lu | 27319b6 | 2017-07-10 16:57:15 -0700 | [diff] [blame] | 150 | int diff_stride, TxfmParam *txfm_param) { |
Lester Lu | 27319b6 | 2017-07-10 16:57:15 -0700 | [diff] [blame] | 151 | av1_fht16x4(src_diff, coeff, diff_stride, txfm_param); |
Yue Chen | 56e226e | 2017-05-02 16:21:40 -0700 | [diff] [blame] | 152 | } |
| 153 | |
| 154 | static void fwd_txfm_4x16(const int16_t *src_diff, tran_low_t *coeff, |
Lester Lu | 27319b6 | 2017-07-10 16:57:15 -0700 | [diff] [blame] | 155 | int diff_stride, TxfmParam *txfm_param) { |
Lester Lu | 27319b6 | 2017-07-10 16:57:15 -0700 | [diff] [blame] | 156 | av1_fht4x16(src_diff, coeff, diff_stride, txfm_param); |
Yue Chen | 56e226e | 2017-05-02 16:21:40 -0700 | [diff] [blame] | 157 | } |
| 158 | |
| 159 | static void fwd_txfm_32x8(const int16_t *src_diff, tran_low_t *coeff, |
Lester Lu | 27319b6 | 2017-07-10 16:57:15 -0700 | [diff] [blame] | 160 | int diff_stride, TxfmParam *txfm_param) { |
Lester Lu | 27319b6 | 2017-07-10 16:57:15 -0700 | [diff] [blame] | 161 | av1_fht32x8(src_diff, coeff, diff_stride, txfm_param); |
Yue Chen | 56e226e | 2017-05-02 16:21:40 -0700 | [diff] [blame] | 162 | } |
| 163 | |
| 164 | static void fwd_txfm_8x32(const int16_t *src_diff, tran_low_t *coeff, |
Lester Lu | 27319b6 | 2017-07-10 16:57:15 -0700 | [diff] [blame] | 165 | int diff_stride, TxfmParam *txfm_param) { |
Lester Lu | 27319b6 | 2017-07-10 16:57:15 -0700 | [diff] [blame] | 166 | av1_fht8x32(src_diff, coeff, diff_stride, txfm_param); |
Yue Chen | 56e226e | 2017-05-02 16:21:40 -0700 | [diff] [blame] | 167 | } |
Yue Chen | d6bdd46 | 2017-07-19 16:05:43 -0700 | [diff] [blame] | 168 | #endif |
Yue Chen | 56e226e | 2017-05-02 16:21:40 -0700 | [diff] [blame] | 169 | |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 170 | static void highbd_fwd_txfm_4x4(const int16_t *src_diff, tran_low_t *coeff, |
Lester Lu | 27319b6 | 2017-07-10 16:57:15 -0700 | [diff] [blame] | 171 | int diff_stride, TxfmParam *txfm_param) { |
Yi Luo | 0f4195c | 2017-06-27 16:07:28 -0700 | [diff] [blame] | 172 | int32_t *dst_coeff = (int32_t *)coeff; |
Urvang Joshi | 2283d37 | 2017-10-02 17:16:45 -0700 | [diff] [blame] | 173 | const TX_TYPE tx_type = txfm_param->tx_type; |
Lester Lu | 27319b6 | 2017-07-10 16:57:15 -0700 | [diff] [blame] | 174 | const int bd = txfm_param->bd; |
| 175 | if (txfm_param->lossless) { |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 176 | assert(tx_type == DCT_DCT); |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 177 | av1_highbd_fwht4x4(src_diff, coeff, diff_stride); |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 178 | return; |
| 179 | } |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 180 | switch (tx_type) { |
| 181 | case DCT_DCT: |
| 182 | case ADST_DCT: |
| 183 | case DCT_ADST: |
| 184 | case ADST_ADST: |
Yi Luo | 0f4195c | 2017-06-27 16:07:28 -0700 | [diff] [blame] | 185 | av1_fwd_txfm2d_4x4(src_diff, dst_coeff, diff_stride, tx_type, bd); |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 186 | break; |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 187 | case FLIPADST_DCT: |
| 188 | case DCT_FLIPADST: |
| 189 | case FLIPADST_FLIPADST: |
| 190 | case ADST_FLIPADST: |
| 191 | case FLIPADST_ADST: |
Yi Luo | 0f4195c | 2017-06-27 16:07:28 -0700 | [diff] [blame] | 192 | av1_fwd_txfm2d_4x4(src_diff, dst_coeff, diff_stride, tx_type, bd); |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 193 | break; |
Sarah Parker | 31c6650 | 2017-05-19 16:51:07 -0700 | [diff] [blame] | 194 | // use the c version for anything including identity for now |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 195 | case V_DCT: |
| 196 | case H_DCT: |
| 197 | case V_ADST: |
| 198 | case H_ADST: |
| 199 | case V_FLIPADST: |
| 200 | case H_FLIPADST: |
Sarah Parker | 31c6650 | 2017-05-19 16:51:07 -0700 | [diff] [blame] | 201 | case IDTX: |
Yi Luo | 0f4195c | 2017-06-27 16:07:28 -0700 | [diff] [blame] | 202 | av1_fwd_txfm2d_4x4_c(src_diff, dst_coeff, diff_stride, tx_type, bd); |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 203 | break; |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 204 | default: assert(0); |
| 205 | } |
| 206 | } |
| 207 | |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 208 | static void highbd_fwd_txfm_4x8(const int16_t *src_diff, tran_low_t *coeff, |
Lester Lu | 27319b6 | 2017-07-10 16:57:15 -0700 | [diff] [blame] | 209 | int diff_stride, TxfmParam *txfm_param) { |
Yi Luo | 0f4195c | 2017-06-27 16:07:28 -0700 | [diff] [blame] | 210 | int32_t *dst_coeff = (int32_t *)coeff; |
Lester Lu | 27319b6 | 2017-07-10 16:57:15 -0700 | [diff] [blame] | 211 | av1_fwd_txfm2d_4x8_c(src_diff, dst_coeff, diff_stride, txfm_param->tx_type, |
| 212 | txfm_param->bd); |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 213 | } |
| 214 | |
| 215 | static void highbd_fwd_txfm_8x4(const int16_t *src_diff, tran_low_t *coeff, |
Lester Lu | 27319b6 | 2017-07-10 16:57:15 -0700 | [diff] [blame] | 216 | int diff_stride, TxfmParam *txfm_param) { |
Yi Luo | 0f4195c | 2017-06-27 16:07:28 -0700 | [diff] [blame] | 217 | int32_t *dst_coeff = (int32_t *)coeff; |
Lester Lu | 27319b6 | 2017-07-10 16:57:15 -0700 | [diff] [blame] | 218 | av1_fwd_txfm2d_8x4_c(src_diff, dst_coeff, diff_stride, txfm_param->tx_type, |
| 219 | txfm_param->bd); |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 220 | } |
| 221 | |
| 222 | static void highbd_fwd_txfm_8x16(const int16_t *src_diff, tran_low_t *coeff, |
Lester Lu | 27319b6 | 2017-07-10 16:57:15 -0700 | [diff] [blame] | 223 | int diff_stride, TxfmParam *txfm_param) { |
Yi Luo | 0f4195c | 2017-06-27 16:07:28 -0700 | [diff] [blame] | 224 | int32_t *dst_coeff = (int32_t *)coeff; |
Lester Lu | 27319b6 | 2017-07-10 16:57:15 -0700 | [diff] [blame] | 225 | av1_fwd_txfm2d_8x16_c(src_diff, dst_coeff, diff_stride, txfm_param->tx_type, |
| 226 | txfm_param->bd); |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 227 | } |
| 228 | |
| 229 | static void highbd_fwd_txfm_16x8(const int16_t *src_diff, tran_low_t *coeff, |
Lester Lu | 27319b6 | 2017-07-10 16:57:15 -0700 | [diff] [blame] | 230 | int diff_stride, TxfmParam *txfm_param) { |
Yi Luo | 0f4195c | 2017-06-27 16:07:28 -0700 | [diff] [blame] | 231 | int32_t *dst_coeff = (int32_t *)coeff; |
Lester Lu | 27319b6 | 2017-07-10 16:57:15 -0700 | [diff] [blame] | 232 | av1_fwd_txfm2d_16x8_c(src_diff, dst_coeff, diff_stride, txfm_param->tx_type, |
| 233 | txfm_param->bd); |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 234 | } |
| 235 | |
| 236 | static void highbd_fwd_txfm_16x32(const int16_t *src_diff, tran_low_t *coeff, |
Lester Lu | 27319b6 | 2017-07-10 16:57:15 -0700 | [diff] [blame] | 237 | int diff_stride, TxfmParam *txfm_param) { |
Yi Luo | 0f4195c | 2017-06-27 16:07:28 -0700 | [diff] [blame] | 238 | int32_t *dst_coeff = (int32_t *)coeff; |
Lester Lu | 27319b6 | 2017-07-10 16:57:15 -0700 | [diff] [blame] | 239 | av1_fwd_txfm2d_16x32_c(src_diff, dst_coeff, diff_stride, txfm_param->tx_type, |
| 240 | txfm_param->bd); |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 241 | } |
| 242 | |
| 243 | static void highbd_fwd_txfm_32x16(const int16_t *src_diff, tran_low_t *coeff, |
Lester Lu | 27319b6 | 2017-07-10 16:57:15 -0700 | [diff] [blame] | 244 | int diff_stride, TxfmParam *txfm_param) { |
Yi Luo | 0f4195c | 2017-06-27 16:07:28 -0700 | [diff] [blame] | 245 | int32_t *dst_coeff = (int32_t *)coeff; |
Lester Lu | 27319b6 | 2017-07-10 16:57:15 -0700 | [diff] [blame] | 246 | av1_fwd_txfm2d_32x16_c(src_diff, dst_coeff, diff_stride, txfm_param->tx_type, |
| 247 | txfm_param->bd); |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 248 | } |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 249 | |
| 250 | static void highbd_fwd_txfm_8x8(const int16_t *src_diff, tran_low_t *coeff, |
Lester Lu | 27319b6 | 2017-07-10 16:57:15 -0700 | [diff] [blame] | 251 | int diff_stride, TxfmParam *txfm_param) { |
Yi Luo | 0f4195c | 2017-06-27 16:07:28 -0700 | [diff] [blame] | 252 | int32_t *dst_coeff = (int32_t *)coeff; |
Urvang Joshi | 2283d37 | 2017-10-02 17:16:45 -0700 | [diff] [blame] | 253 | const TX_TYPE tx_type = txfm_param->tx_type; |
Lester Lu | 27319b6 | 2017-07-10 16:57:15 -0700 | [diff] [blame] | 254 | const int bd = txfm_param->bd; |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 255 | switch (tx_type) { |
| 256 | case DCT_DCT: |
| 257 | case ADST_DCT: |
| 258 | case DCT_ADST: |
| 259 | case ADST_ADST: |
Yi Luo | 0f4195c | 2017-06-27 16:07:28 -0700 | [diff] [blame] | 260 | av1_fwd_txfm2d_8x8(src_diff, dst_coeff, diff_stride, tx_type, bd); |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 261 | break; |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 262 | case FLIPADST_DCT: |
| 263 | case DCT_FLIPADST: |
| 264 | case FLIPADST_FLIPADST: |
| 265 | case ADST_FLIPADST: |
| 266 | case FLIPADST_ADST: |
Yi Luo | 0f4195c | 2017-06-27 16:07:28 -0700 | [diff] [blame] | 267 | av1_fwd_txfm2d_8x8(src_diff, dst_coeff, diff_stride, tx_type, bd); |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 268 | break; |
Sarah Parker | 31c6650 | 2017-05-19 16:51:07 -0700 | [diff] [blame] | 269 | // use the c version for anything including identity for now |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 270 | case V_DCT: |
| 271 | case H_DCT: |
| 272 | case V_ADST: |
| 273 | case H_ADST: |
| 274 | case V_FLIPADST: |
| 275 | case H_FLIPADST: |
Sarah Parker | 31c6650 | 2017-05-19 16:51:07 -0700 | [diff] [blame] | 276 | case IDTX: |
Yi Luo | 0f4195c | 2017-06-27 16:07:28 -0700 | [diff] [blame] | 277 | av1_fwd_txfm2d_8x8_c(src_diff, dst_coeff, diff_stride, tx_type, bd); |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 278 | break; |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 279 | default: assert(0); |
| 280 | } |
| 281 | } |
| 282 | |
| 283 | static void highbd_fwd_txfm_16x16(const int16_t *src_diff, tran_low_t *coeff, |
Lester Lu | 27319b6 | 2017-07-10 16:57:15 -0700 | [diff] [blame] | 284 | int diff_stride, TxfmParam *txfm_param) { |
Yi Luo | 0f4195c | 2017-06-27 16:07:28 -0700 | [diff] [blame] | 285 | int32_t *dst_coeff = (int32_t *)coeff; |
Urvang Joshi | 2283d37 | 2017-10-02 17:16:45 -0700 | [diff] [blame] | 286 | const TX_TYPE tx_type = txfm_param->tx_type; |
Lester Lu | 27319b6 | 2017-07-10 16:57:15 -0700 | [diff] [blame] | 287 | const int bd = txfm_param->bd; |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 288 | switch (tx_type) { |
| 289 | case DCT_DCT: |
| 290 | case ADST_DCT: |
| 291 | case DCT_ADST: |
| 292 | case ADST_ADST: |
Yi Luo | 0f4195c | 2017-06-27 16:07:28 -0700 | [diff] [blame] | 293 | av1_fwd_txfm2d_16x16(src_diff, dst_coeff, diff_stride, tx_type, bd); |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 294 | break; |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 295 | case FLIPADST_DCT: |
| 296 | case DCT_FLIPADST: |
| 297 | case FLIPADST_FLIPADST: |
| 298 | case ADST_FLIPADST: |
| 299 | case FLIPADST_ADST: |
Yi Luo | 0f4195c | 2017-06-27 16:07:28 -0700 | [diff] [blame] | 300 | av1_fwd_txfm2d_16x16(src_diff, dst_coeff, diff_stride, tx_type, bd); |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 301 | break; |
Sarah Parker | 31c6650 | 2017-05-19 16:51:07 -0700 | [diff] [blame] | 302 | // use the c version for anything including identity for now |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 303 | case V_DCT: |
| 304 | case H_DCT: |
| 305 | case V_ADST: |
| 306 | case H_ADST: |
| 307 | case V_FLIPADST: |
| 308 | case H_FLIPADST: |
Sarah Parker | 31c6650 | 2017-05-19 16:51:07 -0700 | [diff] [blame] | 309 | case IDTX: |
Yi Luo | 0f4195c | 2017-06-27 16:07:28 -0700 | [diff] [blame] | 310 | av1_fwd_txfm2d_16x16_c(src_diff, dst_coeff, diff_stride, tx_type, bd); |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 311 | break; |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 312 | default: assert(0); |
| 313 | } |
| 314 | } |
| 315 | |
Angie Chiang | 8fd2d7a | 2017-01-03 15:50:15 -0800 | [diff] [blame] | 316 | static void highbd_fwd_txfm_32x32(const int16_t *src_diff, tran_low_t *coeff, |
Lester Lu | 27319b6 | 2017-07-10 16:57:15 -0700 | [diff] [blame] | 317 | int diff_stride, TxfmParam *txfm_param) { |
Yi Luo | 0f4195c | 2017-06-27 16:07:28 -0700 | [diff] [blame] | 318 | int32_t *dst_coeff = (int32_t *)coeff; |
Urvang Joshi | 2283d37 | 2017-10-02 17:16:45 -0700 | [diff] [blame] | 319 | const TX_TYPE tx_type = txfm_param->tx_type; |
Lester Lu | 27319b6 | 2017-07-10 16:57:15 -0700 | [diff] [blame] | 320 | const int bd = txfm_param->bd; |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 321 | switch (tx_type) { |
| 322 | case DCT_DCT: |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 323 | case ADST_DCT: |
| 324 | case DCT_ADST: |
| 325 | case ADST_ADST: |
Yi Luo | 0f4195c | 2017-06-27 16:07:28 -0700 | [diff] [blame] | 326 | av1_fwd_txfm2d_32x32(src_diff, dst_coeff, diff_stride, tx_type, bd); |
Sarah Parker | 31c6650 | 2017-05-19 16:51:07 -0700 | [diff] [blame] | 327 | break; |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 328 | case FLIPADST_DCT: |
| 329 | case DCT_FLIPADST: |
| 330 | case FLIPADST_FLIPADST: |
| 331 | case ADST_FLIPADST: |
| 332 | case FLIPADST_ADST: |
Yi Luo | 0f4195c | 2017-06-27 16:07:28 -0700 | [diff] [blame] | 333 | av1_fwd_txfm2d_32x32(src_diff, dst_coeff, diff_stride, tx_type, bd); |
Sarah Parker | 31c6650 | 2017-05-19 16:51:07 -0700 | [diff] [blame] | 334 | break; |
| 335 | // use the c version for anything including identity for now |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 336 | case V_DCT: |
| 337 | case H_DCT: |
| 338 | case V_ADST: |
| 339 | case H_ADST: |
| 340 | case V_FLIPADST: |
| 341 | case H_FLIPADST: |
Sarah Parker | 31c6650 | 2017-05-19 16:51:07 -0700 | [diff] [blame] | 342 | case IDTX: |
Yi Luo | 0f4195c | 2017-06-27 16:07:28 -0700 | [diff] [blame] | 343 | av1_fwd_txfm2d_32x32_c(src_diff, dst_coeff, diff_stride, tx_type, bd); |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 344 | break; |
Sarah Parker | 31c6650 | 2017-05-19 16:51:07 -0700 | [diff] [blame] | 345 | default: assert(0); |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 346 | } |
| 347 | } |
Debargha Mukherjee | 6a47cff | 2016-11-02 14:57:42 -0700 | [diff] [blame] | 348 | |
| 349 | #if CONFIG_TX64X64 |
Debargha Mukherjee | 2b43501 | 2017-09-28 08:30:35 -0700 | [diff] [blame] | 350 | static void highbd_fwd_txfm_32x64(const int16_t *src_diff, tran_low_t *coeff, |
| 351 | int diff_stride, TxfmParam *txfm_param) { |
| 352 | int32_t *dst_coeff = (int32_t *)coeff; |
Urvang Joshi | 2283d37 | 2017-10-02 17:16:45 -0700 | [diff] [blame] | 353 | const TX_TYPE tx_type = txfm_param->tx_type; |
Debargha Mukherjee | 2b43501 | 2017-09-28 08:30:35 -0700 | [diff] [blame] | 354 | const int bd = txfm_param->bd; |
| 355 | switch (tx_type) { |
| 356 | case DCT_DCT: |
| 357 | av1_fwd_txfm2d_32x64_c(src_diff, dst_coeff, diff_stride, tx_type, bd); |
| 358 | break; |
Debargha Mukherjee | 2b43501 | 2017-09-28 08:30:35 -0700 | [diff] [blame] | 359 | case ADST_DCT: |
| 360 | case DCT_ADST: |
| 361 | case ADST_ADST: |
| 362 | case FLIPADST_DCT: |
| 363 | case DCT_FLIPADST: |
| 364 | case FLIPADST_FLIPADST: |
| 365 | case ADST_FLIPADST: |
| 366 | case FLIPADST_ADST: |
| 367 | case V_DCT: |
| 368 | case H_DCT: |
| 369 | case V_ADST: |
| 370 | case H_ADST: |
| 371 | case V_FLIPADST: |
| 372 | case H_FLIPADST: |
| 373 | // TODO(sarahparker) |
| 374 | // I've deleted the 64x64 implementations that existed in lieu |
| 375 | // of adst, flipadst and identity for simplicity but will bring back |
| 376 | // in a later change. This shouldn't impact performance since |
| 377 | // DCT_DCT is the only extended type currently allowed for 64x64, |
| 378 | // as dictated by get_ext_tx_set_type in blockd.h. |
| 379 | av1_fwd_txfm2d_32x64_c(src_diff, dst_coeff, diff_stride, DCT_DCT, bd); |
| 380 | break; |
| 381 | case IDTX: |
| 382 | av1_fwd_idtx_c(src_diff, dst_coeff, diff_stride, 32, 64, tx_type); |
| 383 | break; |
Debargha Mukherjee | 2b43501 | 2017-09-28 08:30:35 -0700 | [diff] [blame] | 384 | default: assert(0); break; |
| 385 | } |
| 386 | } |
| 387 | |
| 388 | static void highbd_fwd_txfm_64x32(const int16_t *src_diff, tran_low_t *coeff, |
| 389 | int diff_stride, TxfmParam *txfm_param) { |
| 390 | int32_t *dst_coeff = (int32_t *)coeff; |
Urvang Joshi | 2283d37 | 2017-10-02 17:16:45 -0700 | [diff] [blame] | 391 | const TX_TYPE tx_type = txfm_param->tx_type; |
Debargha Mukherjee | 2b43501 | 2017-09-28 08:30:35 -0700 | [diff] [blame] | 392 | const int bd = txfm_param->bd; |
| 393 | switch (tx_type) { |
| 394 | case DCT_DCT: |
| 395 | av1_fwd_txfm2d_64x32_c(src_diff, dst_coeff, diff_stride, tx_type, bd); |
| 396 | break; |
Debargha Mukherjee | 2b43501 | 2017-09-28 08:30:35 -0700 | [diff] [blame] | 397 | case ADST_DCT: |
| 398 | case DCT_ADST: |
| 399 | case ADST_ADST: |
| 400 | case FLIPADST_DCT: |
| 401 | case DCT_FLIPADST: |
| 402 | case FLIPADST_FLIPADST: |
| 403 | case ADST_FLIPADST: |
| 404 | case FLIPADST_ADST: |
| 405 | case V_DCT: |
| 406 | case H_DCT: |
| 407 | case V_ADST: |
| 408 | case H_ADST: |
| 409 | case V_FLIPADST: |
| 410 | case H_FLIPADST: |
| 411 | // TODO(sarahparker) |
| 412 | // I've deleted the 64x64 implementations that existed in lieu |
| 413 | // of adst, flipadst and identity for simplicity but will bring back |
| 414 | // in a later change. This shouldn't impact performance since |
| 415 | // DCT_DCT is the only extended type currently allowed for 64x64, |
| 416 | // as dictated by get_ext_tx_set_type in blockd.h. |
| 417 | av1_fwd_txfm2d_64x32_c(src_diff, dst_coeff, diff_stride, DCT_DCT, bd); |
| 418 | break; |
| 419 | case IDTX: |
| 420 | av1_fwd_idtx_c(src_diff, dst_coeff, diff_stride, 64, 32, tx_type); |
| 421 | break; |
Debargha Mukherjee | 2b43501 | 2017-09-28 08:30:35 -0700 | [diff] [blame] | 422 | default: assert(0); break; |
| 423 | } |
| 424 | } |
Debargha Mukherjee | 6a47cff | 2016-11-02 14:57:42 -0700 | [diff] [blame] | 425 | static void highbd_fwd_txfm_64x64(const int16_t *src_diff, tran_low_t *coeff, |
Lester Lu | 27319b6 | 2017-07-10 16:57:15 -0700 | [diff] [blame] | 426 | int diff_stride, TxfmParam *txfm_param) { |
Yi Luo | 0f4195c | 2017-06-27 16:07:28 -0700 | [diff] [blame] | 427 | int32_t *dst_coeff = (int32_t *)coeff; |
Urvang Joshi | 2283d37 | 2017-10-02 17:16:45 -0700 | [diff] [blame] | 428 | const TX_TYPE tx_type = txfm_param->tx_type; |
Lester Lu | 27319b6 | 2017-07-10 16:57:15 -0700 | [diff] [blame] | 429 | const int bd = txfm_param->bd; |
Debargha Mukherjee | 6a47cff | 2016-11-02 14:57:42 -0700 | [diff] [blame] | 430 | switch (tx_type) { |
| 431 | case DCT_DCT: |
Yi Luo | 0f4195c | 2017-06-27 16:07:28 -0700 | [diff] [blame] | 432 | av1_fwd_txfm2d_64x64(src_diff, dst_coeff, diff_stride, tx_type, bd); |
Debargha Mukherjee | 6a47cff | 2016-11-02 14:57:42 -0700 | [diff] [blame] | 433 | break; |
Debargha Mukherjee | 6a47cff | 2016-11-02 14:57:42 -0700 | [diff] [blame] | 434 | case ADST_DCT: |
| 435 | case DCT_ADST: |
| 436 | case ADST_ADST: |
| 437 | case FLIPADST_DCT: |
| 438 | case DCT_FLIPADST: |
| 439 | case FLIPADST_FLIPADST: |
| 440 | case ADST_FLIPADST: |
| 441 | case FLIPADST_ADST: |
| 442 | case V_DCT: |
| 443 | case H_DCT: |
| 444 | case V_ADST: |
| 445 | case H_ADST: |
| 446 | case V_FLIPADST: |
| 447 | case H_FLIPADST: |
Sarah Parker | 31c6650 | 2017-05-19 16:51:07 -0700 | [diff] [blame] | 448 | // TODO(sarahparker) |
| 449 | // I've deleted the 64x64 implementations that existed in lieu |
| 450 | // of adst, flipadst and identity for simplicity but will bring back |
| 451 | // in a later change. This shouldn't impact performance since |
| 452 | // DCT_DCT is the only extended type currently allowed for 64x64, |
| 453 | // as dictated by get_ext_tx_set_type in blockd.h. |
Yi Luo | 0f4195c | 2017-06-27 16:07:28 -0700 | [diff] [blame] | 454 | av1_fwd_txfm2d_64x64_c(src_diff, dst_coeff, diff_stride, DCT_DCT, bd); |
Debargha Mukherjee | 6a47cff | 2016-11-02 14:57:42 -0700 | [diff] [blame] | 455 | break; |
Lester Lu | d8b1ddc | 2017-07-06 16:13:29 -0700 | [diff] [blame] | 456 | case IDTX: |
Debargha Mukherjee | 2b43501 | 2017-09-28 08:30:35 -0700 | [diff] [blame] | 457 | av1_fwd_idtx_c(src_diff, dst_coeff, diff_stride, 64, 64, tx_type); |
Lester Lu | d8b1ddc | 2017-07-06 16:13:29 -0700 | [diff] [blame] | 458 | break; |
Debargha Mukherjee | 6a47cff | 2016-11-02 14:57:42 -0700 | [diff] [blame] | 459 | default: assert(0); break; |
| 460 | } |
| 461 | } |
| 462 | #endif // CONFIG_TX64X64 |
Monty Montgomery | a2d40a3 | 2017-10-30 23:32:03 -0400 | [diff] [blame] | 463 | #endif // CONFIG_DAALA_TXFM |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 464 | |
hui su | f11fb88 | 2017-03-27 14:56:33 -0700 | [diff] [blame] | 465 | void av1_fwd_txfm(const int16_t *src_diff, tran_low_t *coeff, int diff_stride, |
Lester Lu | 27319b6 | 2017-07-10 16:57:15 -0700 | [diff] [blame] | 466 | TxfmParam *txfm_param) { |
Sarah Parker | 90024e4 | 2017-10-06 16:50:47 -0700 | [diff] [blame] | 467 | assert(av1_ext_tx_used[txfm_param->tx_set_type][txfm_param->tx_type]); |
Monty Montgomery | a2d40a3 | 2017-10-30 23:32:03 -0400 | [diff] [blame] | 468 | #if CONFIG_DAALA_TX |
| 469 | daala_fwd_txfm(src_diff, coeff, diff_stride, txfm_param); |
| 470 | #else |
Lester Lu | 27319b6 | 2017-07-10 16:57:15 -0700 | [diff] [blame] | 471 | const TX_SIZE tx_size = txfm_param->tx_size; |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 472 | switch (tx_size) { |
Debargha Mukherjee | 6a47cff | 2016-11-02 14:57:42 -0700 | [diff] [blame] | 473 | #if CONFIG_TX64X64 |
| 474 | case TX_64X64: |
Lester Lu | 27319b6 | 2017-07-10 16:57:15 -0700 | [diff] [blame] | 475 | fwd_txfm_64x64(src_diff, coeff, diff_stride, txfm_param); |
Debargha Mukherjee | 6a47cff | 2016-11-02 14:57:42 -0700 | [diff] [blame] | 476 | break; |
Debargha Mukherjee | 2b43501 | 2017-09-28 08:30:35 -0700 | [diff] [blame] | 477 | case TX_32X64: |
| 478 | fwd_txfm_32x64(src_diff, coeff, diff_stride, txfm_param); |
| 479 | break; |
| 480 | case TX_64X32: |
| 481 | fwd_txfm_64x32(src_diff, coeff, diff_stride, txfm_param); |
| 482 | break; |
Debargha Mukherjee | 6a47cff | 2016-11-02 14:57:42 -0700 | [diff] [blame] | 483 | #endif // CONFIG_TX64X64 |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 484 | case TX_32X32: |
Lester Lu | 27319b6 | 2017-07-10 16:57:15 -0700 | [diff] [blame] | 485 | fwd_txfm_32x32(src_diff, coeff, diff_stride, txfm_param); |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 486 | break; |
| 487 | case TX_16X16: |
Lester Lu | 27319b6 | 2017-07-10 16:57:15 -0700 | [diff] [blame] | 488 | fwd_txfm_16x16(src_diff, coeff, diff_stride, txfm_param); |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 489 | break; |
Lester Lu | 27319b6 | 2017-07-10 16:57:15 -0700 | [diff] [blame] | 490 | case TX_8X8: fwd_txfm_8x8(src_diff, coeff, diff_stride, txfm_param); break; |
| 491 | case TX_4X8: fwd_txfm_4x8(src_diff, coeff, diff_stride, txfm_param); break; |
| 492 | case TX_8X4: fwd_txfm_8x4(src_diff, coeff, diff_stride, txfm_param); break; |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 493 | case TX_8X16: |
Lester Lu | 27319b6 | 2017-07-10 16:57:15 -0700 | [diff] [blame] | 494 | fwd_txfm_8x16(src_diff, coeff, diff_stride, txfm_param); |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 495 | break; |
| 496 | case TX_16X8: |
Lester Lu | 27319b6 | 2017-07-10 16:57:15 -0700 | [diff] [blame] | 497 | fwd_txfm_16x8(src_diff, coeff, diff_stride, txfm_param); |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 498 | break; |
| 499 | case TX_16X32: |
Lester Lu | 27319b6 | 2017-07-10 16:57:15 -0700 | [diff] [blame] | 500 | fwd_txfm_16x32(src_diff, coeff, diff_stride, txfm_param); |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 501 | break; |
| 502 | case TX_32X16: |
Lester Lu | 27319b6 | 2017-07-10 16:57:15 -0700 | [diff] [blame] | 503 | fwd_txfm_32x16(src_diff, coeff, diff_stride, txfm_param); |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 504 | break; |
Lester Lu | 27319b6 | 2017-07-10 16:57:15 -0700 | [diff] [blame] | 505 | case TX_4X4: fwd_txfm_4x4(src_diff, coeff, diff_stride, txfm_param); break; |
Sebastien Alaiwan | fb83877 | 2017-10-24 12:02:54 +0200 | [diff] [blame] | 506 | #if CONFIG_RECT_TX_EXT |
Yue Chen | 56e226e | 2017-05-02 16:21:40 -0700 | [diff] [blame] | 507 | case TX_4X16: |
Lester Lu | 27319b6 | 2017-07-10 16:57:15 -0700 | [diff] [blame] | 508 | fwd_txfm_4x16(src_diff, coeff, diff_stride, txfm_param); |
Yue Chen | 56e226e | 2017-05-02 16:21:40 -0700 | [diff] [blame] | 509 | break; |
| 510 | case TX_16X4: |
Lester Lu | 27319b6 | 2017-07-10 16:57:15 -0700 | [diff] [blame] | 511 | fwd_txfm_16x4(src_diff, coeff, diff_stride, txfm_param); |
Yue Chen | 56e226e | 2017-05-02 16:21:40 -0700 | [diff] [blame] | 512 | break; |
| 513 | case TX_8X32: |
Lester Lu | 27319b6 | 2017-07-10 16:57:15 -0700 | [diff] [blame] | 514 | fwd_txfm_8x32(src_diff, coeff, diff_stride, txfm_param); |
Yue Chen | 56e226e | 2017-05-02 16:21:40 -0700 | [diff] [blame] | 515 | break; |
| 516 | case TX_32X8: |
Lester Lu | 27319b6 | 2017-07-10 16:57:15 -0700 | [diff] [blame] | 517 | fwd_txfm_32x8(src_diff, coeff, diff_stride, txfm_param); |
Yue Chen | 56e226e | 2017-05-02 16:21:40 -0700 | [diff] [blame] | 518 | break; |
Yue Chen | d6bdd46 | 2017-07-19 16:05:43 -0700 | [diff] [blame] | 519 | #endif |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 520 | default: assert(0); break; |
| 521 | } |
Monty Montgomery | a2d40a3 | 2017-10-30 23:32:03 -0400 | [diff] [blame] | 522 | #endif |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 523 | } |
| 524 | |
hui su | f11fb88 | 2017-03-27 14:56:33 -0700 | [diff] [blame] | 525 | void av1_highbd_fwd_txfm(const int16_t *src_diff, tran_low_t *coeff, |
Lester Lu | 27319b6 | 2017-07-10 16:57:15 -0700 | [diff] [blame] | 526 | int diff_stride, TxfmParam *txfm_param) { |
Sarah Parker | 90024e4 | 2017-10-06 16:50:47 -0700 | [diff] [blame] | 527 | assert(av1_ext_tx_used[txfm_param->tx_set_type][txfm_param->tx_type]); |
Monty Montgomery | a2d40a3 | 2017-10-30 23:32:03 -0400 | [diff] [blame] | 528 | #if CONFIG_DAALA_TX |
| 529 | daala_fwd_txfm(src_diff, coeff, diff_stride, txfm_param); |
| 530 | #else |
Lester Lu | 27319b6 | 2017-07-10 16:57:15 -0700 | [diff] [blame] | 531 | const TX_SIZE tx_size = txfm_param->tx_size; |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 532 | switch (tx_size) { |
Debargha Mukherjee | 6a47cff | 2016-11-02 14:57:42 -0700 | [diff] [blame] | 533 | #if CONFIG_TX64X64 |
| 534 | case TX_64X64: |
Lester Lu | 27319b6 | 2017-07-10 16:57:15 -0700 | [diff] [blame] | 535 | highbd_fwd_txfm_64x64(src_diff, coeff, diff_stride, txfm_param); |
Debargha Mukherjee | 6a47cff | 2016-11-02 14:57:42 -0700 | [diff] [blame] | 536 | break; |
Debargha Mukherjee | 2b43501 | 2017-09-28 08:30:35 -0700 | [diff] [blame] | 537 | case TX_32X64: |
| 538 | highbd_fwd_txfm_32x64(src_diff, coeff, diff_stride, txfm_param); |
| 539 | break; |
| 540 | case TX_64X32: |
| 541 | highbd_fwd_txfm_64x32(src_diff, coeff, diff_stride, txfm_param); |
| 542 | break; |
Debargha Mukherjee | 6a47cff | 2016-11-02 14:57:42 -0700 | [diff] [blame] | 543 | #endif // CONFIG_TX64X64 |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 544 | case TX_32X32: |
Lester Lu | 27319b6 | 2017-07-10 16:57:15 -0700 | [diff] [blame] | 545 | highbd_fwd_txfm_32x32(src_diff, coeff, diff_stride, txfm_param); |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 546 | break; |
| 547 | case TX_16X16: |
Lester Lu | 27319b6 | 2017-07-10 16:57:15 -0700 | [diff] [blame] | 548 | highbd_fwd_txfm_16x16(src_diff, coeff, diff_stride, txfm_param); |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 549 | break; |
| 550 | case TX_8X8: |
Lester Lu | 27319b6 | 2017-07-10 16:57:15 -0700 | [diff] [blame] | 551 | highbd_fwd_txfm_8x8(src_diff, coeff, diff_stride, txfm_param); |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 552 | break; |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 553 | case TX_4X8: |
Lester Lu | 27319b6 | 2017-07-10 16:57:15 -0700 | [diff] [blame] | 554 | highbd_fwd_txfm_4x8(src_diff, coeff, diff_stride, txfm_param); |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 555 | break; |
| 556 | case TX_8X4: |
Lester Lu | 27319b6 | 2017-07-10 16:57:15 -0700 | [diff] [blame] | 557 | highbd_fwd_txfm_8x4(src_diff, coeff, diff_stride, txfm_param); |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 558 | break; |
| 559 | case TX_8X16: |
Lester Lu | 27319b6 | 2017-07-10 16:57:15 -0700 | [diff] [blame] | 560 | highbd_fwd_txfm_8x16(src_diff, coeff, diff_stride, txfm_param); |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 561 | break; |
| 562 | case TX_16X8: |
Lester Lu | 27319b6 | 2017-07-10 16:57:15 -0700 | [diff] [blame] | 563 | highbd_fwd_txfm_16x8(src_diff, coeff, diff_stride, txfm_param); |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 564 | break; |
| 565 | case TX_16X32: |
Lester Lu | 27319b6 | 2017-07-10 16:57:15 -0700 | [diff] [blame] | 566 | highbd_fwd_txfm_16x32(src_diff, coeff, diff_stride, txfm_param); |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 567 | break; |
| 568 | case TX_32X16: |
Lester Lu | 27319b6 | 2017-07-10 16:57:15 -0700 | [diff] [blame] | 569 | highbd_fwd_txfm_32x16(src_diff, coeff, diff_stride, txfm_param); |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 570 | break; |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 571 | case TX_4X4: |
Lester Lu | 27319b6 | 2017-07-10 16:57:15 -0700 | [diff] [blame] | 572 | highbd_fwd_txfm_4x4(src_diff, coeff, diff_stride, txfm_param); |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 573 | break; |
| 574 | default: assert(0); break; |
| 575 | } |
Monty Montgomery | a2d40a3 | 2017-10-30 23:32:03 -0400 | [diff] [blame] | 576 | #endif |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 577 | } |