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