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 | |
Tom Finegan | 60e653d | 2018-05-22 11:34:58 -0700 | [diff] [blame] | 12 | #include "config/aom_config.h" |
Tom Finegan | 44702c8 | 2018-05-22 13:00:39 -0700 | [diff] [blame] | 13 | #include "config/av1_rtcd.h" |
| 14 | #include "config/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 | |
Urvang Joshi | 8207b91 | 2018-05-07 14:37:51 -0700 | [diff] [blame] | 19 | /* 4-point reversible, orthonormal Walsh-Hadamard in 3.5 adds, 0.5 shifts per |
| 20 | pixel. */ |
| 21 | void av1_fwht4x4_c(const int16_t *input, tran_low_t *output, int stride) { |
| 22 | int i; |
| 23 | tran_high_t a1, b1, c1, d1, e1; |
| 24 | const int16_t *ip_pass0 = input; |
| 25 | const tran_low_t *ip = NULL; |
| 26 | tran_low_t *op = output; |
| 27 | |
| 28 | for (i = 0; i < 4; i++) { |
| 29 | a1 = ip_pass0[0 * stride]; |
| 30 | b1 = ip_pass0[1 * stride]; |
| 31 | c1 = ip_pass0[2 * stride]; |
| 32 | d1 = ip_pass0[3 * stride]; |
| 33 | |
| 34 | a1 += b1; |
| 35 | d1 = d1 - c1; |
| 36 | e1 = (a1 - d1) >> 1; |
| 37 | b1 = e1 - b1; |
| 38 | c1 = e1 - c1; |
| 39 | a1 -= c1; |
| 40 | d1 += b1; |
| 41 | op[0] = (tran_low_t)a1; |
| 42 | op[4] = (tran_low_t)c1; |
| 43 | op[8] = (tran_low_t)d1; |
| 44 | op[12] = (tran_low_t)b1; |
| 45 | |
| 46 | ip_pass0++; |
| 47 | op++; |
| 48 | } |
| 49 | ip = output; |
| 50 | op = output; |
| 51 | |
| 52 | for (i = 0; i < 4; i++) { |
| 53 | a1 = ip[0]; |
| 54 | b1 = ip[1]; |
| 55 | c1 = ip[2]; |
| 56 | d1 = ip[3]; |
| 57 | |
| 58 | a1 += b1; |
| 59 | d1 -= c1; |
| 60 | e1 = (a1 - d1) >> 1; |
| 61 | b1 = e1 - b1; |
| 62 | c1 = e1 - c1; |
| 63 | a1 -= c1; |
| 64 | d1 += b1; |
| 65 | op[0] = (tran_low_t)(a1 * UNIT_QUANT_FACTOR); |
| 66 | op[1] = (tran_low_t)(c1 * UNIT_QUANT_FACTOR); |
| 67 | op[2] = (tran_low_t)(d1 * UNIT_QUANT_FACTOR); |
| 68 | op[3] = (tran_low_t)(b1 * UNIT_QUANT_FACTOR); |
| 69 | |
| 70 | ip += 4; |
| 71 | op += 4; |
| 72 | } |
| 73 | } |
| 74 | |
| 75 | void av1_highbd_fwht4x4_c(const int16_t *input, tran_low_t *output, |
| 76 | int stride) { |
| 77 | av1_fwht4x4_c(input, output, stride); |
| 78 | } |
| 79 | |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 80 | 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] | 81 | int diff_stride, TxfmParam *txfm_param) { |
Yi Luo | 0f4195c | 2017-06-27 16:07:28 -0700 | [diff] [blame] | 82 | int32_t *dst_coeff = (int32_t *)coeff; |
Urvang Joshi | 2283d37 | 2017-10-02 17:16:45 -0700 | [diff] [blame] | 83 | const TX_TYPE tx_type = txfm_param->tx_type; |
Lester Lu | 27319b6 | 2017-07-10 16:57:15 -0700 | [diff] [blame] | 84 | const int bd = txfm_param->bd; |
| 85 | if (txfm_param->lossless) { |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 86 | assert(tx_type == DCT_DCT); |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 87 | av1_highbd_fwht4x4(src_diff, coeff, diff_stride); |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 88 | return; |
| 89 | } |
Aniket Dhok | 7629c38 | 2018-10-18 13:02:12 +0530 | [diff] [blame] | 90 | 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] | 91 | } |
| 92 | |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 93 | 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] | 94 | int diff_stride, TxfmParam *txfm_param) { |
Yi Luo | 0f4195c | 2017-06-27 16:07:28 -0700 | [diff] [blame] | 95 | int32_t *dst_coeff = (int32_t *)coeff; |
Aniket Dhok | 7629c38 | 2018-10-18 13:02:12 +0530 | [diff] [blame] | 96 | av1_fwd_txfm2d_4x8(src_diff, dst_coeff, diff_stride, txfm_param->tx_type, |
| 97 | txfm_param->bd); |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 98 | } |
| 99 | |
| 100 | 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] | 101 | int diff_stride, TxfmParam *txfm_param) { |
Yi Luo | 0f4195c | 2017-06-27 16:07:28 -0700 | [diff] [blame] | 102 | int32_t *dst_coeff = (int32_t *)coeff; |
Aniket Dhok | 7629c38 | 2018-10-18 13:02:12 +0530 | [diff] [blame] | 103 | av1_fwd_txfm2d_8x4(src_diff, dst_coeff, diff_stride, txfm_param->tx_type, |
| 104 | txfm_param->bd); |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 105 | } |
| 106 | |
| 107 | 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] | 108 | int diff_stride, TxfmParam *txfm_param) { |
Yi Luo | 0f4195c | 2017-06-27 16:07:28 -0700 | [diff] [blame] | 109 | int32_t *dst_coeff = (int32_t *)coeff; |
Venkat | d04f6c5 | 2018-09-12 10:42:33 +0530 | [diff] [blame] | 110 | const TX_TYPE tx_type = txfm_param->tx_type; |
| 111 | const int bd = txfm_param->bd; |
Aniket Dhok | 7629c38 | 2018-10-18 13:02:12 +0530 | [diff] [blame] | 112 | av1_fwd_txfm2d_8x16(src_diff, dst_coeff, diff_stride, tx_type, bd); |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 113 | } |
| 114 | |
| 115 | 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] | 116 | int diff_stride, TxfmParam *txfm_param) { |
Yi Luo | 0f4195c | 2017-06-27 16:07:28 -0700 | [diff] [blame] | 117 | int32_t *dst_coeff = (int32_t *)coeff; |
Venkat | d04f6c5 | 2018-09-12 10:42:33 +0530 | [diff] [blame] | 118 | const TX_TYPE tx_type = txfm_param->tx_type; |
| 119 | const int bd = txfm_param->bd; |
Aniket Dhok | 7629c38 | 2018-10-18 13:02:12 +0530 | [diff] [blame] | 120 | av1_fwd_txfm2d_16x8(src_diff, dst_coeff, diff_stride, tx_type, bd); |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 121 | } |
| 122 | |
| 123 | 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] | 124 | int diff_stride, TxfmParam *txfm_param) { |
Yi Luo | 0f4195c | 2017-06-27 16:07:28 -0700 | [diff] [blame] | 125 | int32_t *dst_coeff = (int32_t *)coeff; |
Aniket Dhok | 63adafd | 2018-10-22 17:51:52 +0530 | [diff] [blame] | 126 | av1_fwd_txfm2d_16x32(src_diff, dst_coeff, diff_stride, txfm_param->tx_type, |
| 127 | txfm_param->bd); |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 128 | } |
| 129 | |
| 130 | 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] | 131 | int diff_stride, TxfmParam *txfm_param) { |
Yi Luo | 0f4195c | 2017-06-27 16:07:28 -0700 | [diff] [blame] | 132 | int32_t *dst_coeff = (int32_t *)coeff; |
Aniket Dhok | 63adafd | 2018-10-22 17:51:52 +0530 | [diff] [blame] | 133 | av1_fwd_txfm2d_32x16(src_diff, dst_coeff, diff_stride, txfm_param->tx_type, |
| 134 | txfm_param->bd); |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 135 | } |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 136 | |
Debargha Mukherjee | 845057f | 2017-11-13 07:03:36 -0800 | [diff] [blame] | 137 | static void highbd_fwd_txfm_16x4(const int16_t *src_diff, tran_low_t *coeff, |
| 138 | int diff_stride, TxfmParam *txfm_param) { |
Debargha Mukherjee | 69f914a | 2017-11-15 20:58:23 -0800 | [diff] [blame] | 139 | int32_t *dst_coeff = (int32_t *)coeff; |
Aniket Dhok | 7629c38 | 2018-10-18 13:02:12 +0530 | [diff] [blame] | 140 | av1_fwd_txfm2d_16x4(src_diff, dst_coeff, diff_stride, txfm_param->tx_type, |
| 141 | txfm_param->bd); |
Debargha Mukherjee | 845057f | 2017-11-13 07:03:36 -0800 | [diff] [blame] | 142 | } |
| 143 | |
| 144 | static void highbd_fwd_txfm_4x16(const int16_t *src_diff, tran_low_t *coeff, |
| 145 | int diff_stride, TxfmParam *txfm_param) { |
Debargha Mukherjee | 69f914a | 2017-11-15 20:58:23 -0800 | [diff] [blame] | 146 | int32_t *dst_coeff = (int32_t *)coeff; |
Aniket Dhok | 7629c38 | 2018-10-18 13:02:12 +0530 | [diff] [blame] | 147 | av1_fwd_txfm2d_4x16(src_diff, dst_coeff, diff_stride, txfm_param->tx_type, |
| 148 | txfm_param->bd); |
Debargha Mukherjee | 845057f | 2017-11-13 07:03:36 -0800 | [diff] [blame] | 149 | } |
| 150 | |
| 151 | static void highbd_fwd_txfm_32x8(const int16_t *src_diff, tran_low_t *coeff, |
| 152 | int diff_stride, TxfmParam *txfm_param) { |
Debargha Mukherjee | 69f914a | 2017-11-15 20:58:23 -0800 | [diff] [blame] | 153 | int32_t *dst_coeff = (int32_t *)coeff; |
Aniket Dhok | 63adafd | 2018-10-22 17:51:52 +0530 | [diff] [blame] | 154 | av1_fwd_txfm2d_32x8(src_diff, dst_coeff, diff_stride, txfm_param->tx_type, |
| 155 | txfm_param->bd); |
Debargha Mukherjee | 845057f | 2017-11-13 07:03:36 -0800 | [diff] [blame] | 156 | } |
| 157 | |
| 158 | static void highbd_fwd_txfm_8x32(const int16_t *src_diff, tran_low_t *coeff, |
| 159 | int diff_stride, TxfmParam *txfm_param) { |
Debargha Mukherjee | 69f914a | 2017-11-15 20:58:23 -0800 | [diff] [blame] | 160 | int32_t *dst_coeff = (int32_t *)coeff; |
Aniket Dhok | 63adafd | 2018-10-22 17:51:52 +0530 | [diff] [blame] | 161 | av1_fwd_txfm2d_8x32(src_diff, dst_coeff, diff_stride, txfm_param->tx_type, |
| 162 | txfm_param->bd); |
Debargha Mukherjee | 845057f | 2017-11-13 07:03:36 -0800 | [diff] [blame] | 163 | } |
Debargha Mukherjee | 845057f | 2017-11-13 07:03:36 -0800 | [diff] [blame] | 164 | |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 165 | 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] | 166 | int diff_stride, TxfmParam *txfm_param) { |
Yi Luo | 0f4195c | 2017-06-27 16:07:28 -0700 | [diff] [blame] | 167 | int32_t *dst_coeff = (int32_t *)coeff; |
Urvang Joshi | 2283d37 | 2017-10-02 17:16:45 -0700 | [diff] [blame] | 168 | const TX_TYPE tx_type = txfm_param->tx_type; |
Lester Lu | 27319b6 | 2017-07-10 16:57:15 -0700 | [diff] [blame] | 169 | const int bd = txfm_param->bd; |
Aniket Dhok | 7629c38 | 2018-10-18 13:02:12 +0530 | [diff] [blame] | 170 | 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] | 171 | } |
| 172 | |
| 173 | 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] | 174 | int diff_stride, TxfmParam *txfm_param) { |
Yi Luo | 0f4195c | 2017-06-27 16:07:28 -0700 | [diff] [blame] | 175 | int32_t *dst_coeff = (int32_t *)coeff; |
Urvang Joshi | 2283d37 | 2017-10-02 17:16:45 -0700 | [diff] [blame] | 176 | const TX_TYPE tx_type = txfm_param->tx_type; |
Lester Lu | 27319b6 | 2017-07-10 16:57:15 -0700 | [diff] [blame] | 177 | const int bd = txfm_param->bd; |
Aniket Dhok | 7629c38 | 2018-10-18 13:02:12 +0530 | [diff] [blame] | 178 | 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] | 179 | } |
| 180 | |
Angie Chiang | 8fd2d7a | 2017-01-03 15:50:15 -0800 | [diff] [blame] | 181 | 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] | 182 | int diff_stride, TxfmParam *txfm_param) { |
Yi Luo | 0f4195c | 2017-06-27 16:07:28 -0700 | [diff] [blame] | 183 | int32_t *dst_coeff = (int32_t *)coeff; |
Urvang Joshi | 2283d37 | 2017-10-02 17:16:45 -0700 | [diff] [blame] | 184 | const TX_TYPE tx_type = txfm_param->tx_type; |
Lester Lu | 27319b6 | 2017-07-10 16:57:15 -0700 | [diff] [blame] | 185 | const int bd = txfm_param->bd; |
Aniket Dhok | 63adafd | 2018-10-22 17:51:52 +0530 | [diff] [blame] | 186 | av1_fwd_txfm2d_32x32(src_diff, dst_coeff, diff_stride, tx_type, bd); |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 187 | } |
Debargha Mukherjee | 6a47cff | 2016-11-02 14:57:42 -0700 | [diff] [blame] | 188 | |
Debargha Mukherjee | 2b43501 | 2017-09-28 08:30:35 -0700 | [diff] [blame] | 189 | static void highbd_fwd_txfm_32x64(const int16_t *src_diff, tran_low_t *coeff, |
| 190 | int diff_stride, TxfmParam *txfm_param) { |
Hui Su | 98626d3 | 2018-04-13 12:08:48 -0700 | [diff] [blame] | 191 | assert(txfm_param->tx_type == DCT_DCT); |
Debargha Mukherjee | 2b43501 | 2017-09-28 08:30:35 -0700 | [diff] [blame] | 192 | int32_t *dst_coeff = (int32_t *)coeff; |
Debargha Mukherjee | 2b43501 | 2017-09-28 08:30:35 -0700 | [diff] [blame] | 193 | const int bd = txfm_param->bd; |
Satish Kumar Suman | 0252600 | 2018-10-17 17:51:49 +0530 | [diff] [blame] | 194 | av1_fwd_txfm2d_32x64(src_diff, dst_coeff, diff_stride, txfm_param->tx_type, |
| 195 | bd); |
Debargha Mukherjee | 2b43501 | 2017-09-28 08:30:35 -0700 | [diff] [blame] | 196 | } |
| 197 | |
| 198 | static void highbd_fwd_txfm_64x32(const int16_t *src_diff, tran_low_t *coeff, |
| 199 | int diff_stride, TxfmParam *txfm_param) { |
Hui Su | 98626d3 | 2018-04-13 12:08:48 -0700 | [diff] [blame] | 200 | assert(txfm_param->tx_type == DCT_DCT); |
Debargha Mukherjee | 2b43501 | 2017-09-28 08:30:35 -0700 | [diff] [blame] | 201 | int32_t *dst_coeff = (int32_t *)coeff; |
Debargha Mukherjee | 2b43501 | 2017-09-28 08:30:35 -0700 | [diff] [blame] | 202 | const int bd = txfm_param->bd; |
Satish Kumar Suman | 0252600 | 2018-10-17 17:51:49 +0530 | [diff] [blame] | 203 | av1_fwd_txfm2d_64x32(src_diff, dst_coeff, diff_stride, txfm_param->tx_type, |
| 204 | bd); |
Debargha Mukherjee | 2b43501 | 2017-09-28 08:30:35 -0700 | [diff] [blame] | 205 | } |
Debargha Mukherjee | 0254fee | 2017-12-02 09:08:52 -0800 | [diff] [blame] | 206 | |
| 207 | static void highbd_fwd_txfm_16x64(const int16_t *src_diff, tran_low_t *coeff, |
| 208 | int diff_stride, TxfmParam *txfm_param) { |
Hui Su | 98626d3 | 2018-04-13 12:08:48 -0700 | [diff] [blame] | 209 | assert(txfm_param->tx_type == DCT_DCT); |
Debargha Mukherjee | 0254fee | 2017-12-02 09:08:52 -0800 | [diff] [blame] | 210 | int32_t *dst_coeff = (int32_t *)coeff; |
Debargha Mukherjee | 0254fee | 2017-12-02 09:08:52 -0800 | [diff] [blame] | 211 | const int bd = txfm_param->bd; |
Satish Kumar Suman | 0252600 | 2018-10-17 17:51:49 +0530 | [diff] [blame] | 212 | av1_fwd_txfm2d_16x64(src_diff, dst_coeff, diff_stride, DCT_DCT, bd); |
Debargha Mukherjee | 0254fee | 2017-12-02 09:08:52 -0800 | [diff] [blame] | 213 | } |
| 214 | |
| 215 | static void highbd_fwd_txfm_64x16(const int16_t *src_diff, tran_low_t *coeff, |
| 216 | int diff_stride, TxfmParam *txfm_param) { |
Hui Su | 98626d3 | 2018-04-13 12:08:48 -0700 | [diff] [blame] | 217 | assert(txfm_param->tx_type == DCT_DCT); |
Debargha Mukherjee | 0254fee | 2017-12-02 09:08:52 -0800 | [diff] [blame] | 218 | int32_t *dst_coeff = (int32_t *)coeff; |
Debargha Mukherjee | 0254fee | 2017-12-02 09:08:52 -0800 | [diff] [blame] | 219 | const int bd = txfm_param->bd; |
Satish Kumar Suman | 0252600 | 2018-10-17 17:51:49 +0530 | [diff] [blame] | 220 | av1_fwd_txfm2d_64x16(src_diff, dst_coeff, diff_stride, DCT_DCT, bd); |
Debargha Mukherjee | 0254fee | 2017-12-02 09:08:52 -0800 | [diff] [blame] | 221 | } |
| 222 | |
Debargha Mukherjee | 6a47cff | 2016-11-02 14:57:42 -0700 | [diff] [blame] | 223 | 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] | 224 | int diff_stride, TxfmParam *txfm_param) { |
Hui Su | 98626d3 | 2018-04-13 12:08:48 -0700 | [diff] [blame] | 225 | assert(txfm_param->tx_type == DCT_DCT); |
Yi Luo | 0f4195c | 2017-06-27 16:07:28 -0700 | [diff] [blame] | 226 | int32_t *dst_coeff = (int32_t *)coeff; |
Lester Lu | 27319b6 | 2017-07-10 16:57:15 -0700 | [diff] [blame] | 227 | const int bd = txfm_param->bd; |
Hui Su | 98626d3 | 2018-04-13 12:08:48 -0700 | [diff] [blame] | 228 | av1_fwd_txfm2d_64x64(src_diff, dst_coeff, diff_stride, DCT_DCT, bd); |
Debargha Mukherjee | 6a47cff | 2016-11-02 14:57:42 -0700 | [diff] [blame] | 229 | } |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 230 | |
hui su | f11fb88 | 2017-03-27 14:56:33 -0700 | [diff] [blame] | 231 | 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] | 232 | TxfmParam *txfm_param) { |
Angie Chiang | 7d8b13e | 2018-02-07 22:55:45 -0800 | [diff] [blame] | 233 | if (txfm_param->bd == 8) |
| 234 | av1_lowbd_fwd_txfm(src_diff, coeff, diff_stride, txfm_param); |
| 235 | else |
| 236 | av1_highbd_fwd_txfm(src_diff, coeff, diff_stride, txfm_param); |
| 237 | } |
| 238 | |
| 239 | void av1_lowbd_fwd_txfm_c(const int16_t *src_diff, tran_low_t *coeff, |
| 240 | int diff_stride, TxfmParam *txfm_param) { |
| 241 | av1_highbd_fwd_txfm(src_diff, coeff, diff_stride, txfm_param); |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 242 | } |
| 243 | |
hui su | f11fb88 | 2017-03-27 14:56:33 -0700 | [diff] [blame] | 244 | 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] | 245 | int diff_stride, TxfmParam *txfm_param) { |
Sarah Parker | 90024e4 | 2017-10-06 16:50:47 -0700 | [diff] [blame] | 246 | assert(av1_ext_tx_used[txfm_param->tx_set_type][txfm_param->tx_type]); |
Lester Lu | 27319b6 | 2017-07-10 16:57:15 -0700 | [diff] [blame] | 247 | const TX_SIZE tx_size = txfm_param->tx_size; |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 248 | switch (tx_size) { |
Debargha Mukherjee | 6a47cff | 2016-11-02 14:57:42 -0700 | [diff] [blame] | 249 | case TX_64X64: |
Lester Lu | 27319b6 | 2017-07-10 16:57:15 -0700 | [diff] [blame] | 250 | highbd_fwd_txfm_64x64(src_diff, coeff, diff_stride, txfm_param); |
Debargha Mukherjee | 6a47cff | 2016-11-02 14:57:42 -0700 | [diff] [blame] | 251 | break; |
Debargha Mukherjee | 2b43501 | 2017-09-28 08:30:35 -0700 | [diff] [blame] | 252 | case TX_32X64: |
| 253 | highbd_fwd_txfm_32x64(src_diff, coeff, diff_stride, txfm_param); |
| 254 | break; |
| 255 | case TX_64X32: |
| 256 | highbd_fwd_txfm_64x32(src_diff, coeff, diff_stride, txfm_param); |
| 257 | break; |
Debargha Mukherjee | 0254fee | 2017-12-02 09:08:52 -0800 | [diff] [blame] | 258 | case TX_16X64: |
| 259 | highbd_fwd_txfm_16x64(src_diff, coeff, diff_stride, txfm_param); |
| 260 | break; |
| 261 | case TX_64X16: |
| 262 | highbd_fwd_txfm_64x16(src_diff, coeff, diff_stride, txfm_param); |
| 263 | break; |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 264 | case TX_32X32: |
Lester Lu | 27319b6 | 2017-07-10 16:57:15 -0700 | [diff] [blame] | 265 | highbd_fwd_txfm_32x32(src_diff, coeff, diff_stride, txfm_param); |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 266 | break; |
| 267 | case TX_16X16: |
Lester Lu | 27319b6 | 2017-07-10 16:57:15 -0700 | [diff] [blame] | 268 | highbd_fwd_txfm_16x16(src_diff, coeff, diff_stride, txfm_param); |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 269 | break; |
| 270 | case TX_8X8: |
Lester Lu | 27319b6 | 2017-07-10 16:57:15 -0700 | [diff] [blame] | 271 | highbd_fwd_txfm_8x8(src_diff, coeff, diff_stride, txfm_param); |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 272 | break; |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 273 | case TX_4X8: |
Lester Lu | 27319b6 | 2017-07-10 16:57:15 -0700 | [diff] [blame] | 274 | highbd_fwd_txfm_4x8(src_diff, coeff, diff_stride, txfm_param); |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 275 | break; |
| 276 | case TX_8X4: |
Lester Lu | 27319b6 | 2017-07-10 16:57:15 -0700 | [diff] [blame] | 277 | highbd_fwd_txfm_8x4(src_diff, coeff, diff_stride, txfm_param); |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 278 | break; |
| 279 | case TX_8X16: |
Lester Lu | 27319b6 | 2017-07-10 16:57:15 -0700 | [diff] [blame] | 280 | highbd_fwd_txfm_8x16(src_diff, coeff, diff_stride, txfm_param); |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 281 | break; |
| 282 | case TX_16X8: |
Lester Lu | 27319b6 | 2017-07-10 16:57:15 -0700 | [diff] [blame] | 283 | highbd_fwd_txfm_16x8(src_diff, coeff, diff_stride, txfm_param); |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 284 | break; |
| 285 | case TX_16X32: |
Lester Lu | 27319b6 | 2017-07-10 16:57:15 -0700 | [diff] [blame] | 286 | highbd_fwd_txfm_16x32(src_diff, coeff, diff_stride, txfm_param); |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 287 | break; |
| 288 | case TX_32X16: |
Lester Lu | 27319b6 | 2017-07-10 16:57:15 -0700 | [diff] [blame] | 289 | highbd_fwd_txfm_32x16(src_diff, coeff, diff_stride, txfm_param); |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 290 | break; |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 291 | case TX_4X4: |
Lester Lu | 27319b6 | 2017-07-10 16:57:15 -0700 | [diff] [blame] | 292 | highbd_fwd_txfm_4x4(src_diff, coeff, diff_stride, txfm_param); |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 293 | break; |
Debargha Mukherjee | 845057f | 2017-11-13 07:03:36 -0800 | [diff] [blame] | 294 | case TX_4X16: |
| 295 | highbd_fwd_txfm_4x16(src_diff, coeff, diff_stride, txfm_param); |
| 296 | break; |
| 297 | case TX_16X4: |
| 298 | highbd_fwd_txfm_16x4(src_diff, coeff, diff_stride, txfm_param); |
| 299 | break; |
| 300 | case TX_8X32: |
| 301 | highbd_fwd_txfm_8x32(src_diff, coeff, diff_stride, txfm_param); |
| 302 | break; |
| 303 | case TX_32X8: |
| 304 | highbd_fwd_txfm_32x8(src_diff, coeff, diff_stride, txfm_param); |
| 305 | break; |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 306 | default: assert(0); break; |
| 307 | } |
| 308 | } |