Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 1 | /* |
Yaowu Xu | bde4ac8 | 2016-11-28 15:26:06 -0800 | [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 | bde4ac8 | 2016-11-28 15:26:06 -0800 | [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" |
Sarah Parker | 31c6650 | 2017-05-19 16:51:07 -0700 | [diff] [blame] | 13 | #include "aom_dsp/inv_txfm.h" |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 14 | #include "av1/common/enums.h" |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 15 | #include "av1/common/av1_txfm.h" |
| 16 | #include "av1/common/av1_inv_txfm1d.h" |
Sarah Parker | eec47e6 | 2017-05-15 20:49:22 -0700 | [diff] [blame] | 17 | #include "av1/common/av1_inv_txfm1d_cfg.h" |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 18 | |
| 19 | static INLINE TxfmFunc inv_txfm_type_to_func(TXFM_TYPE txfm_type) { |
| 20 | switch (txfm_type) { |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 21 | case TXFM_TYPE_DCT4: return av1_idct4_new; |
| 22 | case TXFM_TYPE_DCT8: return av1_idct8_new; |
| 23 | case TXFM_TYPE_DCT16: return av1_idct16_new; |
| 24 | case TXFM_TYPE_DCT32: return av1_idct32_new; |
| 25 | case TXFM_TYPE_ADST4: return av1_iadst4_new; |
| 26 | case TXFM_TYPE_ADST8: return av1_iadst8_new; |
| 27 | case TXFM_TYPE_ADST16: return av1_iadst16_new; |
| 28 | case TXFM_TYPE_ADST32: return av1_iadst32_new; |
Sarah Parker | 3eed417 | 2017-05-15 20:49:22 -0700 | [diff] [blame] | 29 | #if CONFIG_EXT_TX |
| 30 | case TXFM_TYPE_IDENTITY4: return av1_iidentity4_c; |
| 31 | case TXFM_TYPE_IDENTITY8: return av1_iidentity8_c; |
| 32 | case TXFM_TYPE_IDENTITY16: return av1_iidentity16_c; |
| 33 | case TXFM_TYPE_IDENTITY32: return av1_iidentity32_c; |
| 34 | #endif // CONFIG_EXT_TX |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 35 | default: assert(0); return NULL; |
| 36 | } |
| 37 | } |
| 38 | |
Sarah Parker | eec47e6 | 2017-05-15 20:49:22 -0700 | [diff] [blame] | 39 | static const TXFM_1D_CFG *inv_txfm_col_cfg_ls[TX_TYPES_1D][TX_SIZES] = { |
| 40 | // DCT |
Frank Galligan | 0b73f3e | 2017-05-03 22:43:22 +0000 | [diff] [blame] | 41 | { |
Timothy B. Terriberry | fe67ed6 | 2017-04-26 16:53:47 -0700 | [diff] [blame] | 42 | #if CONFIG_CHROMA_2X2 |
Frank Galligan | 0b73f3e | 2017-05-03 22:43:22 +0000 | [diff] [blame] | 43 | NULL, |
| 44 | #endif |
Sarah Parker | eec47e6 | 2017-05-15 20:49:22 -0700 | [diff] [blame] | 45 | &inv_txfm_1d_col_cfg_dct_4, &inv_txfm_1d_col_cfg_dct_8, |
| 46 | &inv_txfm_1d_col_cfg_dct_16, &inv_txfm_1d_col_cfg_dct_32 }, |
| 47 | // ADST |
Frank Galligan | 0b73f3e | 2017-05-03 22:43:22 +0000 | [diff] [blame] | 48 | { |
Timothy B. Terriberry | fe67ed6 | 2017-04-26 16:53:47 -0700 | [diff] [blame] | 49 | #if CONFIG_CHROMA_2X2 |
Frank Galligan | 0b73f3e | 2017-05-03 22:43:22 +0000 | [diff] [blame] | 50 | NULL, |
| 51 | #endif |
Sarah Parker | eec47e6 | 2017-05-15 20:49:22 -0700 | [diff] [blame] | 52 | &inv_txfm_1d_col_cfg_adst_4, &inv_txfm_1d_col_cfg_adst_8, |
| 53 | &inv_txfm_1d_col_cfg_adst_16, &inv_txfm_1d_col_cfg_adst_32 }, |
Fred BARBIER | b72ab8f | 2017-05-08 20:01:07 +0200 | [diff] [blame] | 54 | #if CONFIG_EXT_TX |
Sarah Parker | eec47e6 | 2017-05-15 20:49:22 -0700 | [diff] [blame] | 55 | // FLIPADST |
Fred BARBIER | b72ab8f | 2017-05-08 20:01:07 +0200 | [diff] [blame] | 56 | { |
Timothy B. Terriberry | fe67ed6 | 2017-04-26 16:53:47 -0700 | [diff] [blame] | 57 | #if CONFIG_CHROMA_2X2 |
Fred BARBIER | b72ab8f | 2017-05-08 20:01:07 +0200 | [diff] [blame] | 58 | NULL, |
Frank Galligan | 0b73f3e | 2017-05-03 22:43:22 +0000 | [diff] [blame] | 59 | #endif |
Sarah Parker | eec47e6 | 2017-05-15 20:49:22 -0700 | [diff] [blame] | 60 | &inv_txfm_1d_col_cfg_adst_4, &inv_txfm_1d_col_cfg_adst_8, |
| 61 | &inv_txfm_1d_col_cfg_adst_16, &inv_txfm_1d_col_cfg_adst_32 }, |
Sarah Parker | 3eed417 | 2017-05-15 20:49:22 -0700 | [diff] [blame] | 62 | // IDENTITY |
Fred BARBIER | b72ab8f | 2017-05-08 20:01:07 +0200 | [diff] [blame] | 63 | { |
Timothy B. Terriberry | fe67ed6 | 2017-04-26 16:53:47 -0700 | [diff] [blame] | 64 | #if CONFIG_CHROMA_2X2 |
Fred BARBIER | b72ab8f | 2017-05-08 20:01:07 +0200 | [diff] [blame] | 65 | NULL, |
| 66 | #endif |
Sarah Parker | 3eed417 | 2017-05-15 20:49:22 -0700 | [diff] [blame] | 67 | &inv_txfm_1d_cfg_identity_4, &inv_txfm_1d_cfg_identity_8, |
| 68 | &inv_txfm_1d_cfg_identity_16, &inv_txfm_1d_cfg_identity_32 }, |
Sarah Parker | eec47e6 | 2017-05-15 20:49:22 -0700 | [diff] [blame] | 69 | #endif // CONFIG_EXT_TX |
| 70 | }; |
| 71 | |
| 72 | static const TXFM_1D_CFG *inv_txfm_row_cfg_ls[TX_TYPES_1D][TX_SIZES] = { |
| 73 | // DCT |
Fred BARBIER | b72ab8f | 2017-05-08 20:01:07 +0200 | [diff] [blame] | 74 | { |
Timothy B. Terriberry | fe67ed6 | 2017-04-26 16:53:47 -0700 | [diff] [blame] | 75 | #if CONFIG_CHROMA_2X2 |
Fred BARBIER | b72ab8f | 2017-05-08 20:01:07 +0200 | [diff] [blame] | 76 | NULL, |
| 77 | #endif |
Sarah Parker | eec47e6 | 2017-05-15 20:49:22 -0700 | [diff] [blame] | 78 | &inv_txfm_1d_row_cfg_dct_4, &inv_txfm_1d_row_cfg_dct_8, |
| 79 | &inv_txfm_1d_row_cfg_dct_16, &inv_txfm_1d_row_cfg_dct_32 }, |
| 80 | // ADST |
Fred BARBIER | b72ab8f | 2017-05-08 20:01:07 +0200 | [diff] [blame] | 81 | { |
Timothy B. Terriberry | fe67ed6 | 2017-04-26 16:53:47 -0700 | [diff] [blame] | 82 | #if CONFIG_CHROMA_2X2 |
Fred BARBIER | b72ab8f | 2017-05-08 20:01:07 +0200 | [diff] [blame] | 83 | NULL, |
| 84 | #endif |
Sarah Parker | eec47e6 | 2017-05-15 20:49:22 -0700 | [diff] [blame] | 85 | &inv_txfm_1d_row_cfg_adst_4, &inv_txfm_1d_row_cfg_adst_8, |
| 86 | &inv_txfm_1d_row_cfg_adst_16, &inv_txfm_1d_row_cfg_adst_32 }, |
| 87 | #if CONFIG_EXT_TX |
| 88 | // FLIPADST |
Fred BARBIER | b72ab8f | 2017-05-08 20:01:07 +0200 | [diff] [blame] | 89 | { |
Timothy B. Terriberry | fe67ed6 | 2017-04-26 16:53:47 -0700 | [diff] [blame] | 90 | #if CONFIG_CHROMA_2X2 |
Fred BARBIER | b72ab8f | 2017-05-08 20:01:07 +0200 | [diff] [blame] | 91 | NULL, |
| 92 | #endif |
Sarah Parker | eec47e6 | 2017-05-15 20:49:22 -0700 | [diff] [blame] | 93 | &inv_txfm_1d_row_cfg_adst_4, &inv_txfm_1d_row_cfg_adst_8, |
| 94 | &inv_txfm_1d_row_cfg_adst_16, &inv_txfm_1d_row_cfg_adst_32 }, |
Sarah Parker | 3eed417 | 2017-05-15 20:49:22 -0700 | [diff] [blame] | 95 | // IDENTITY |
Sarah Parker | eec47e6 | 2017-05-15 20:49:22 -0700 | [diff] [blame] | 96 | { |
Timothy B. Terriberry | fe67ed6 | 2017-04-26 16:53:47 -0700 | [diff] [blame] | 97 | #if CONFIG_CHROMA_2X2 |
Sarah Parker | eec47e6 | 2017-05-15 20:49:22 -0700 | [diff] [blame] | 98 | NULL, |
| 99 | #endif |
Sarah Parker | 3eed417 | 2017-05-15 20:49:22 -0700 | [diff] [blame] | 100 | &inv_txfm_1d_cfg_identity_4, &inv_txfm_1d_cfg_identity_8, |
| 101 | &inv_txfm_1d_cfg_identity_16, &inv_txfm_1d_cfg_identity_32 }, |
Fred BARBIER | b72ab8f | 2017-05-08 20:01:07 +0200 | [diff] [blame] | 102 | #endif // CONFIG_EXT_TX |
| 103 | }; |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 104 | |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 105 | TXFM_2D_FLIP_CFG av1_get_inv_txfm_cfg(int tx_type, int tx_size) { |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 106 | TXFM_2D_FLIP_CFG cfg; |
| 107 | set_flip_cfg(tx_type, &cfg); |
Sarah Parker | 30dfa88 | 2017-06-12 14:02:33 -0700 | [diff] [blame^] | 108 | const int tx_type_col = vtx_tab[tx_type]; |
| 109 | const int tx_type_row = htx_tab[tx_type]; |
| 110 | const int tx_size_col = txsize_vert_map[tx_size]; |
| 111 | const int tx_size_row = txsize_horz_map[tx_size]; |
Sarah Parker | 31c6650 | 2017-05-19 16:51:07 -0700 | [diff] [blame] | 112 | cfg.col_cfg = inv_txfm_col_cfg_ls[tx_type_col][tx_size_col]; |
| 113 | cfg.row_cfg = inv_txfm_row_cfg_ls[tx_type_row][tx_size_row]; |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 114 | return cfg; |
| 115 | } |
| 116 | |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 117 | TXFM_2D_FLIP_CFG av1_get_inv_txfm_64x64_cfg(int tx_type) { |
Sarah Parker | eec47e6 | 2017-05-15 20:49:22 -0700 | [diff] [blame] | 118 | TXFM_2D_FLIP_CFG cfg = { 0, 0, NULL, NULL }; |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 119 | switch (tx_type) { |
| 120 | case DCT_DCT: |
Sarah Parker | eec47e6 | 2017-05-15 20:49:22 -0700 | [diff] [blame] | 121 | cfg.col_cfg = &inv_txfm_1d_col_cfg_dct_64; |
| 122 | cfg.row_cfg = &inv_txfm_1d_row_cfg_dct_64; |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 123 | set_flip_cfg(tx_type, &cfg); |
| 124 | break; |
| 125 | default: assert(0); |
| 126 | } |
| 127 | return cfg; |
| 128 | } |
| 129 | |
Jonathan Matthews | 284f9d0 | 2017-06-08 15:49:08 +0100 | [diff] [blame] | 130 | static INLINE void inv_txfm2d_add_c(const int32_t *input, uint16_t *output, |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 131 | int stride, TXFM_2D_FLIP_CFG *cfg, |
Jonathan Matthews | 284f9d0 | 2017-06-08 15:49:08 +0100 | [diff] [blame] | 132 | int32_t *txfm_buf, int bd) { |
Sarah Parker | 31c6650 | 2017-05-19 16:51:07 -0700 | [diff] [blame] | 133 | // Note when assigning txfm_size_col, we use the txfm_size from the |
| 134 | // row configuration and vice versa. This is intentionally done to |
| 135 | // accurately perform rectangular transforms. When the transform is |
| 136 | // rectangular, the number of columns will be the same as the |
| 137 | // txfm_size stored in the row cfg struct. It will make no difference |
| 138 | // for square transforms. |
| 139 | const int txfm_size_col = cfg->row_cfg->txfm_size; |
| 140 | const int txfm_size_row = cfg->col_cfg->txfm_size; |
| 141 | // Take the shift from the larger dimension in the rectangular case. |
Sarah Parker | 30dfa88 | 2017-06-12 14:02:33 -0700 | [diff] [blame^] | 142 | const int8_t *shift = (txfm_size_col > txfm_size_row) ? cfg->row_cfg->shift |
| 143 | : cfg->col_cfg->shift; |
Sarah Parker | eec47e6 | 2017-05-15 20:49:22 -0700 | [diff] [blame] | 144 | const int8_t *stage_range_col = cfg->col_cfg->stage_range; |
| 145 | const int8_t *stage_range_row = cfg->row_cfg->stage_range; |
| 146 | const int8_t *cos_bit_col = cfg->col_cfg->cos_bit; |
| 147 | const int8_t *cos_bit_row = cfg->row_cfg->cos_bit; |
| 148 | const TxfmFunc txfm_func_col = inv_txfm_type_to_func(cfg->col_cfg->txfm_type); |
| 149 | const TxfmFunc txfm_func_row = inv_txfm_type_to_func(cfg->row_cfg->txfm_type); |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 150 | |
Sarah Parker | 31c6650 | 2017-05-19 16:51:07 -0700 | [diff] [blame] | 151 | // txfm_buf's length is txfm_size_row * txfm_size_col + 2 * txfm_size_row |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 152 | // it is used for intermediate data buffering |
| 153 | int32_t *temp_in = txfm_buf; |
Sarah Parker | 31c6650 | 2017-05-19 16:51:07 -0700 | [diff] [blame] | 154 | int32_t *temp_out = temp_in + txfm_size_row; |
| 155 | int32_t *buf = temp_out + txfm_size_row; |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 156 | int32_t *buf_ptr = buf; |
| 157 | int c, r; |
| 158 | |
| 159 | // Rows |
Sarah Parker | 31c6650 | 2017-05-19 16:51:07 -0700 | [diff] [blame] | 160 | for (r = 0; r < txfm_size_row; ++r) { |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 161 | txfm_func_row(input, buf_ptr, cos_bit_row, stage_range_row); |
Sarah Parker | 31c6650 | 2017-05-19 16:51:07 -0700 | [diff] [blame] | 162 | round_shift_array(buf_ptr, txfm_size_col, -shift[0]); |
| 163 | // Multiply everything by Sqrt2 if the transform is rectangular |
| 164 | if (txfm_size_row != txfm_size_col) { |
| 165 | for (c = 0; c < txfm_size_col; ++c) |
| 166 | buf_ptr[c] = (int32_t)dct_const_round_shift(buf_ptr[c] * Sqrt2); |
| 167 | } |
| 168 | input += txfm_size_col; |
| 169 | buf_ptr += txfm_size_col; |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 170 | } |
| 171 | |
| 172 | // Columns |
Sarah Parker | 31c6650 | 2017-05-19 16:51:07 -0700 | [diff] [blame] | 173 | for (c = 0; c < txfm_size_col; ++c) { |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 174 | if (cfg->lr_flip == 0) { |
Sarah Parker | 31c6650 | 2017-05-19 16:51:07 -0700 | [diff] [blame] | 175 | for (r = 0; r < txfm_size_row; ++r) |
| 176 | temp_in[r] = buf[r * txfm_size_col + c]; |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 177 | } else { |
| 178 | // flip left right |
Sarah Parker | 31c6650 | 2017-05-19 16:51:07 -0700 | [diff] [blame] | 179 | for (r = 0; r < txfm_size_row; ++r) |
| 180 | temp_in[r] = buf[r * txfm_size_col + (txfm_size_col - c - 1)]; |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 181 | } |
| 182 | txfm_func_col(temp_in, temp_out, cos_bit_col, stage_range_col); |
Sarah Parker | 31c6650 | 2017-05-19 16:51:07 -0700 | [diff] [blame] | 183 | round_shift_array(temp_out, txfm_size_row, -shift[1]); |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 184 | if (cfg->ud_flip == 0) { |
Jonathan Matthews | 284f9d0 | 2017-06-08 15:49:08 +0100 | [diff] [blame] | 185 | for (r = 0; r < txfm_size_row; ++r) { |
| 186 | output[r * stride + c] = |
| 187 | highbd_clip_pixel_add(output[r * stride + c], temp_out[r], bd); |
| 188 | } |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 189 | } else { |
| 190 | // flip upside down |
Jonathan Matthews | 284f9d0 | 2017-06-08 15:49:08 +0100 | [diff] [blame] | 191 | for (r = 0; r < txfm_size_row; ++r) { |
| 192 | output[r * stride + c] = highbd_clip_pixel_add( |
| 193 | output[r * stride + c], temp_out[txfm_size_row - r - 1], bd); |
| 194 | } |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 195 | } |
| 196 | } |
| 197 | } |
| 198 | |
Frederic Barbier | c53753f | 2017-04-25 11:05:01 +0200 | [diff] [blame] | 199 | static INLINE void inv_txfm2d_add_facade(const int32_t *input, uint16_t *output, |
| 200 | int stride, int32_t *txfm_buf, |
| 201 | int tx_type, int tx_size, int bd) { |
Frederic Barbier | c53753f | 2017-04-25 11:05:01 +0200 | [diff] [blame] | 202 | TXFM_2D_FLIP_CFG cfg = av1_get_inv_txfm_cfg(tx_type, tx_size); |
Jonathan Matthews | 284f9d0 | 2017-06-08 15:49:08 +0100 | [diff] [blame] | 203 | inv_txfm2d_add_c(input, output, stride, &cfg, txfm_buf, bd); |
Sarah Parker | 31c6650 | 2017-05-19 16:51:07 -0700 | [diff] [blame] | 204 | } |
| 205 | |
| 206 | void av1_inv_txfm2d_add_4x8_c(const int32_t *input, uint16_t *output, |
| 207 | int stride, int tx_type, int bd) { |
| 208 | int txfm_buf[4 * 8 + 8 + 8]; |
| 209 | inv_txfm2d_add_facade(input, output, stride, txfm_buf, tx_type, TX_4X8, bd); |
| 210 | } |
| 211 | |
| 212 | void av1_inv_txfm2d_add_8x4_c(const int32_t *input, uint16_t *output, |
| 213 | int stride, int tx_type, int bd) { |
| 214 | int txfm_buf[8 * 4 + 4 + 4]; |
| 215 | inv_txfm2d_add_facade(input, output, stride, txfm_buf, tx_type, TX_8X4, bd); |
| 216 | } |
| 217 | |
| 218 | void av1_inv_txfm2d_add_8x16_c(const int32_t *input, uint16_t *output, |
| 219 | int stride, int tx_type, int bd) { |
| 220 | int txfm_buf[8 * 16 + 16 + 16]; |
| 221 | inv_txfm2d_add_facade(input, output, stride, txfm_buf, tx_type, TX_8X16, bd); |
| 222 | } |
| 223 | |
| 224 | void av1_inv_txfm2d_add_16x8_c(const int32_t *input, uint16_t *output, |
| 225 | int stride, int tx_type, int bd) { |
| 226 | int txfm_buf[16 * 8 + 8 + 8]; |
| 227 | inv_txfm2d_add_facade(input, output, stride, txfm_buf, tx_type, TX_16X8, bd); |
| 228 | } |
| 229 | |
| 230 | void av1_inv_txfm2d_add_16x32_c(const int32_t *input, uint16_t *output, |
| 231 | int stride, int tx_type, int bd) { |
| 232 | int txfm_buf[16 * 32 + 32 + 32]; |
| 233 | inv_txfm2d_add_facade(input, output, stride, txfm_buf, tx_type, TX_16X32, bd); |
| 234 | } |
| 235 | |
| 236 | void av1_inv_txfm2d_add_32x16_c(const int32_t *input, uint16_t *output, |
| 237 | int stride, int tx_type, int bd) { |
| 238 | int txfm_buf[32 * 16 + 16 + 16]; |
| 239 | inv_txfm2d_add_facade(input, output, stride, txfm_buf, tx_type, TX_32X16, bd); |
Frederic Barbier | c53753f | 2017-04-25 11:05:01 +0200 | [diff] [blame] | 240 | } |
| 241 | |
| 242 | void av1_inv_txfm2d_add_4x4_c(const int32_t *input, uint16_t *output, |
| 243 | int stride, int tx_type, int bd) { |
| 244 | int txfm_buf[4 * 4 + 4 + 4]; |
| 245 | inv_txfm2d_add_facade(input, output, stride, txfm_buf, tx_type, TX_4X4, bd); |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 246 | } |
| 247 | |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 248 | void av1_inv_txfm2d_add_8x8_c(const int32_t *input, uint16_t *output, |
| 249 | int stride, int tx_type, int bd) { |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 250 | int txfm_buf[8 * 8 + 8 + 8]; |
Frederic Barbier | c53753f | 2017-04-25 11:05:01 +0200 | [diff] [blame] | 251 | inv_txfm2d_add_facade(input, output, stride, txfm_buf, tx_type, TX_8X8, bd); |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 252 | } |
| 253 | |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 254 | void av1_inv_txfm2d_add_16x16_c(const int32_t *input, uint16_t *output, |
| 255 | int stride, int tx_type, int bd) { |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 256 | int txfm_buf[16 * 16 + 16 + 16]; |
Frederic Barbier | c53753f | 2017-04-25 11:05:01 +0200 | [diff] [blame] | 257 | inv_txfm2d_add_facade(input, output, stride, txfm_buf, tx_type, TX_16X16, bd); |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 258 | } |
| 259 | |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 260 | void av1_inv_txfm2d_add_32x32_c(const int32_t *input, uint16_t *output, |
| 261 | int stride, int tx_type, int bd) { |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 262 | int txfm_buf[32 * 32 + 32 + 32]; |
Frederic Barbier | c53753f | 2017-04-25 11:05:01 +0200 | [diff] [blame] | 263 | inv_txfm2d_add_facade(input, output, stride, txfm_buf, tx_type, TX_32X32, bd); |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 264 | } |
| 265 | |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 266 | void av1_inv_txfm2d_add_64x64_c(const int32_t *input, uint16_t *output, |
| 267 | int stride, int tx_type, int bd) { |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 268 | int txfm_buf[64 * 64 + 64 + 64]; |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 269 | TXFM_2D_FLIP_CFG cfg = av1_get_inv_txfm_64x64_cfg(tx_type); |
Jonathan Matthews | 284f9d0 | 2017-06-08 15:49:08 +0100 | [diff] [blame] | 270 | inv_txfm2d_add_c(input, output, stride, &cfg, txfm_buf, bd); |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 271 | } |