hybrid_fwd_txfm.c 17.4 KB
Newer Older
Angie Chiang's avatar
Angie Chiang committed
1
/*
Yaowu Xu's avatar
Yaowu Xu committed
2
 * Copyright (c) 2016, Alliance for Open Media. All rights reserved
Angie Chiang's avatar
Angie Chiang committed
3
 *
Yaowu Xu's avatar
Yaowu Xu committed
4 5 6 7 8 9
 * This source code is subject to the terms of the BSD 2 Clause License and
 * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License
 * was not distributed with this source code in the LICENSE file, you can
 * obtain it at www.aomedia.org/license/software. If the Alliance for Open
 * Media Patent License 1.0 was not distributed with this source code in the
 * PATENTS file, you can obtain it at www.aomedia.org/license/patent.
Angie Chiang's avatar
Angie Chiang committed
10 11
 */

Yaowu Xu's avatar
Yaowu Xu committed
12 13 14
#include "./av1_rtcd.h"
#include "./aom_config.h"
#include "./aom_dsp_rtcd.h"
Angie Chiang's avatar
Angie Chiang committed
15

16 17
#include "av1/common/idct.h"
#include "av1/encoder/hybrid_fwd_txfm.h"
Angie Chiang's avatar
Angie Chiang committed
18

19
#if CONFIG_CHROMA_2X2
Jingning Han's avatar
Jingning Han committed
20
static void fwd_txfm_2x2(const int16_t *src_diff, tran_low_t *coeff,
21
                         int diff_stride, TxfmParam *txfm_param) {
Jingning Han's avatar
Jingning Han committed
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
  tran_high_t a1 = src_diff[0];
  tran_high_t b1 = src_diff[1];
  tran_high_t c1 = src_diff[diff_stride];
  tran_high_t d1 = src_diff[1 + diff_stride];

  tran_high_t a2 = a1 + c1;
  tran_high_t b2 = b1 + d1;
  tran_high_t c2 = a1 - c1;
  tran_high_t d2 = b1 - d1;

  a1 = a2 + b2;
  b1 = a2 - b2;
  c1 = c2 + d2;
  d1 = c2 - d2;

  coeff[0] = (tran_low_t)(4 * a1);
  coeff[1] = (tran_low_t)(4 * b1);
  coeff[2] = (tran_low_t)(4 * c1);
  coeff[3] = (tran_low_t)(4 * d1);

42
  (void)txfm_param;
Jingning Han's avatar
Jingning Han committed
43 44 45
}
#endif

46
static void fwd_txfm_4x4(const int16_t *src_diff, tran_low_t *coeff,
47 48 49
                         int diff_stride, TxfmParam *txfm_param) {
  if (txfm_param->lossless) {
    assert(txfm_param->tx_type == DCT_DCT);
Yaowu Xu's avatar
Yaowu Xu committed
50
    av1_fwht4x4(src_diff, coeff, diff_stride);
Angie Chiang's avatar
Angie Chiang committed
51 52 53
    return;
  }

54
#if CONFIG_LGT || CONFIG_DAALA_DCT4
Lester Lu's avatar
Lester Lu committed
55
  // only C version has LGTs
56
  av1_fht4x4_c(src_diff, coeff, diff_stride, txfm_param);
Lester Lu's avatar
Lester Lu committed
57
#else
58
  av1_fht4x4(src_diff, coeff, diff_stride, txfm_param);
Lester Lu's avatar
Lester Lu committed
59
#endif
Angie Chiang's avatar
Angie Chiang committed
60 61
}

62
static void fwd_txfm_4x8(const int16_t *src_diff, tran_low_t *coeff,
63
                         int diff_stride, TxfmParam *txfm_param) {
Lester Lu's avatar
Lester Lu committed
64
#if CONFIG_LGT
65
  av1_fht4x8_c(src_diff, coeff, diff_stride, txfm_param);
Lester Lu's avatar
Lester Lu committed
66
#else
67
  av1_fht4x8(src_diff, coeff, diff_stride, txfm_param);
Lester Lu's avatar
Lester Lu committed
68
#endif
69 70
}

71
static void fwd_txfm_8x4(const int16_t *src_diff, tran_low_t *coeff,
72
                         int diff_stride, TxfmParam *txfm_param) {
Lester Lu's avatar
Lester Lu committed
73
#if CONFIG_LGT
74
  av1_fht8x4_c(src_diff, coeff, diff_stride, txfm_param);
Lester Lu's avatar
Lester Lu committed
75
#else
76
  av1_fht8x4(src_diff, coeff, diff_stride, txfm_param);
Lester Lu's avatar
Lester Lu committed
77
#endif
78 79 80
}

static void fwd_txfm_8x16(const int16_t *src_diff, tran_low_t *coeff,
81
                          int diff_stride, TxfmParam *txfm_param) {
Lester Lu's avatar
Lester Lu committed
82
#if CONFIG_LGT
83
  av1_fht8x16_c(src_diff, coeff, diff_stride, txfm_param);
Lester Lu's avatar
Lester Lu committed
84
#else
85
  av1_fht8x16(src_diff, coeff, diff_stride, txfm_param);
Lester Lu's avatar
Lester Lu committed
86
#endif
87 88 89
}

static void fwd_txfm_16x8(const int16_t *src_diff, tran_low_t *coeff,
90
                          int diff_stride, TxfmParam *txfm_param) {
Lester Lu's avatar
Lester Lu committed
91
#if CONFIG_LGT
92
  av1_fht16x8_c(src_diff, coeff, diff_stride, txfm_param);
Lester Lu's avatar
Lester Lu committed
93
#else
94
  av1_fht16x8(src_diff, coeff, diff_stride, txfm_param);
Lester Lu's avatar
Lester Lu committed
95
#endif
96 97 98
}

static void fwd_txfm_16x32(const int16_t *src_diff, tran_low_t *coeff,
99 100
                           int diff_stride, TxfmParam *txfm_param) {
  av1_fht16x32(src_diff, coeff, diff_stride, txfm_param);
101 102 103
}

static void fwd_txfm_32x16(const int16_t *src_diff, tran_low_t *coeff,
104 105
                           int diff_stride, TxfmParam *txfm_param) {
  av1_fht32x16(src_diff, coeff, diff_stride, txfm_param);
106 107
}

Angie Chiang's avatar
Angie Chiang committed
108
static void fwd_txfm_8x8(const int16_t *src_diff, tran_low_t *coeff,
109
                         int diff_stride, TxfmParam *txfm_param) {
110
#if CONFIG_LGT || CONFIG_DAALA_DCT8
111
  av1_fht8x8_c(src_diff, coeff, diff_stride, txfm_param);
Lester Lu's avatar
Lester Lu committed
112
#else
113
  av1_fht8x8(src_diff, coeff, diff_stride, txfm_param);
Lester Lu's avatar
Lester Lu committed
114
#endif
Angie Chiang's avatar
Angie Chiang committed
115 116 117
}

static void fwd_txfm_16x16(const int16_t *src_diff, tran_low_t *coeff,
118
                           int diff_stride, TxfmParam *txfm_param) {
119 120 121
#if CONFIG_DAALA_DCT16
  av1_fht16x16_c(src_diff, coeff, diff_stride, txfm_param);
#else
122
  av1_fht16x16(src_diff, coeff, diff_stride, txfm_param);
123
#endif  // CONFIG_DAALA_DCT16
Angie Chiang's avatar
Angie Chiang committed
124 125
}

126
static void fwd_txfm_32x32(const int16_t *src_diff, tran_low_t *coeff,
127
                           int diff_stride, TxfmParam *txfm_param) {
Sarah Parker's avatar
Sarah Parker committed
128 129 130 131 132 133 134
#if CONFIG_MRC_TX
  // MRC_DCT currently only has a C implementation
  if (txfm_param->tx_type == MRC_DCT) {
    av1_fht32x32_c(src_diff, coeff, diff_stride, txfm_param);
    return;
  }
#endif  // CONFIG_MRC_TX
135
  av1_fht32x32(src_diff, coeff, diff_stride, txfm_param);
Angie Chiang's avatar
Angie Chiang committed
136 137
}

138 139
#if CONFIG_TX64X64
static void fwd_txfm_64x64(const int16_t *src_diff, tran_low_t *coeff,
140
                           int diff_stride, TxfmParam *txfm_param) {
141
#if CONFIG_EXT_TX
142 143
  if (txfm_param->tx_type == IDTX)
    av1_fwd_idtx_c(src_diff, coeff, diff_stride, 64, txfm_param->tx_type);
Angie Chiang's avatar
Angie Chiang committed
144 145
  else
#endif
146
    av1_fht64x64(src_diff, coeff, diff_stride, txfm_param);
147 148 149
}
#endif  // CONFIG_TX64X64

Yue Chen's avatar
Yue Chen committed
150
#if CONFIG_RECT_TX_EXT && (CONFIG_EXT_TX || CONFIG_VAR_TX)
151
static void fwd_txfm_16x4(const int16_t *src_diff, tran_low_t *coeff,
152
                          int diff_stride, TxfmParam *txfm_param) {
Lester Lu's avatar
Lester Lu committed
153
#if CONFIG_LGT
154
  av1_fht16x4_c(src_diff, coeff, diff_stride, txfm_param);
Lester Lu's avatar
Lester Lu committed
155
#else
156
  av1_fht16x4(src_diff, coeff, diff_stride, txfm_param);
Lester Lu's avatar
Lester Lu committed
157
#endif
158 159 160
}

static void fwd_txfm_4x16(const int16_t *src_diff, tran_low_t *coeff,
161
                          int diff_stride, TxfmParam *txfm_param) {
Lester Lu's avatar
Lester Lu committed
162
#if CONFIG_LGT
163
  av1_fht4x16_c(src_diff, coeff, diff_stride, txfm_param);
Lester Lu's avatar
Lester Lu committed
164
#else
165
  av1_fht4x16(src_diff, coeff, diff_stride, txfm_param);
Lester Lu's avatar
Lester Lu committed
166
#endif
167 168 169
}

static void fwd_txfm_32x8(const int16_t *src_diff, tran_low_t *coeff,
170
                          int diff_stride, TxfmParam *txfm_param) {
Lester Lu's avatar
Lester Lu committed
171
#if CONFIG_LGT
172
  av1_fht32x8_c(src_diff, coeff, diff_stride, txfm_param);
Lester Lu's avatar
Lester Lu committed
173
#else
174
  av1_fht32x8(src_diff, coeff, diff_stride, txfm_param);
Lester Lu's avatar
Lester Lu committed
175
#endif
176 177 178
}

static void fwd_txfm_8x32(const int16_t *src_diff, tran_low_t *coeff,
179
                          int diff_stride, TxfmParam *txfm_param) {
Lester Lu's avatar
Lester Lu committed
180
#if CONFIG_LGT
181
  av1_fht8x32_c(src_diff, coeff, diff_stride, txfm_param);
Lester Lu's avatar
Lester Lu committed
182
#else
183
  av1_fht8x32(src_diff, coeff, diff_stride, txfm_param);
Lester Lu's avatar
Lester Lu committed
184
#endif
185
}
Yue Chen's avatar
Yue Chen committed
186
#endif
187

188
#if CONFIG_CHROMA_2X2
189
static void highbd_fwd_txfm_2x2(const int16_t *src_diff, tran_low_t *coeff,
190
                                int diff_stride, TxfmParam *txfm_param) {
191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210
  tran_high_t a1 = src_diff[0];
  tran_high_t b1 = src_diff[1];
  tran_high_t c1 = src_diff[diff_stride];
  tran_high_t d1 = src_diff[1 + diff_stride];

  tran_high_t a2 = a1 + c1;
  tran_high_t b2 = b1 + d1;
  tran_high_t c2 = a1 - c1;
  tran_high_t d2 = b1 - d1;

  a1 = a2 + b2;
  b1 = a2 - b2;
  c1 = c2 + d2;
  d1 = c2 - d2;

  coeff[0] = (tran_low_t)(4 * a1);
  coeff[1] = (tran_low_t)(4 * b1);
  coeff[2] = (tran_low_t)(4 * c1);
  coeff[3] = (tran_low_t)(4 * d1);

211
  (void)txfm_param;
212 213 214
}
#endif

215
static void highbd_fwd_txfm_4x4(const int16_t *src_diff, tran_low_t *coeff,
216
                                int diff_stride, TxfmParam *txfm_param) {
217
  int32_t *dst_coeff = (int32_t *)coeff;
218 219 220
  const int tx_type = txfm_param->tx_type;
  const int bd = txfm_param->bd;
  if (txfm_param->lossless) {
Angie Chiang's avatar
Angie Chiang committed
221
    assert(tx_type == DCT_DCT);
Yaowu Xu's avatar
Yaowu Xu committed
222
    av1_highbd_fwht4x4(src_diff, coeff, diff_stride);
Angie Chiang's avatar
Angie Chiang committed
223 224 225 226 227 228 229
    return;
  }
  switch (tx_type) {
    case DCT_DCT:
    case ADST_DCT:
    case DCT_ADST:
    case ADST_ADST:
230
      // fallthrough intended
231
      av1_fwd_txfm2d_4x4(src_diff, dst_coeff, diff_stride, tx_type, bd);
Angie Chiang's avatar
Angie Chiang committed
232 233 234 235 236 237 238
      break;
#if CONFIG_EXT_TX
    case FLIPADST_DCT:
    case DCT_FLIPADST:
    case FLIPADST_FLIPADST:
    case ADST_FLIPADST:
    case FLIPADST_ADST:
239
      // fallthrough intended
240
      av1_fwd_txfm2d_4x4(src_diff, dst_coeff, diff_stride, tx_type, bd);
Angie Chiang's avatar
Angie Chiang committed
241
      break;
242
    // use the c version for anything including identity for now
243
    case V_DCT:
244 245 246 247 248
    case H_DCT:
    case V_ADST:
    case H_ADST:
    case V_FLIPADST:
    case H_FLIPADST:
249 250
    case IDTX:
      // fallthrough intended
251
      av1_fwd_txfm2d_4x4_c(src_diff, dst_coeff, diff_stride, tx_type, bd);
Debargha Mukherjee's avatar
Debargha Mukherjee committed
252
      break;
Angie Chiang's avatar
Angie Chiang committed
253
#endif  // CONFIG_EXT_TX
254
    default: assert(0);
Angie Chiang's avatar
Angie Chiang committed
255 256 257
  }
}

258
static void highbd_fwd_txfm_4x8(const int16_t *src_diff, tran_low_t *coeff,
259
                                int diff_stride, TxfmParam *txfm_param) {
260
  int32_t *dst_coeff = (int32_t *)coeff;
261 262
  av1_fwd_txfm2d_4x8_c(src_diff, dst_coeff, diff_stride, txfm_param->tx_type,
                       txfm_param->bd);
263 264
}

265
static void highbd_fwd_txfm_8x4(const int16_t *src_diff, tran_low_t *coeff,
266
                                int diff_stride, TxfmParam *txfm_param) {
267
  int32_t *dst_coeff = (int32_t *)coeff;
268 269
  av1_fwd_txfm2d_8x4_c(src_diff, dst_coeff, diff_stride, txfm_param->tx_type,
                       txfm_param->bd);
270 271 272
}

static void highbd_fwd_txfm_8x16(const int16_t *src_diff, tran_low_t *coeff,
273
                                 int diff_stride, TxfmParam *txfm_param) {
274
  int32_t *dst_coeff = (int32_t *)coeff;
275 276
  av1_fwd_txfm2d_8x16_c(src_diff, dst_coeff, diff_stride, txfm_param->tx_type,
                        txfm_param->bd);
277 278 279
}

static void highbd_fwd_txfm_16x8(const int16_t *src_diff, tran_low_t *coeff,
280
                                 int diff_stride, TxfmParam *txfm_param) {
281
  int32_t *dst_coeff = (int32_t *)coeff;
282 283
  av1_fwd_txfm2d_16x8_c(src_diff, dst_coeff, diff_stride, txfm_param->tx_type,
                        txfm_param->bd);
284 285 286
}

static void highbd_fwd_txfm_16x32(const int16_t *src_diff, tran_low_t *coeff,
287
                                  int diff_stride, TxfmParam *txfm_param) {
288
  int32_t *dst_coeff = (int32_t *)coeff;
289 290
  av1_fwd_txfm2d_16x32_c(src_diff, dst_coeff, diff_stride, txfm_param->tx_type,
                         txfm_param->bd);
291 292 293
}

static void highbd_fwd_txfm_32x16(const int16_t *src_diff, tran_low_t *coeff,
294
                                  int diff_stride, TxfmParam *txfm_param) {
295
  int32_t *dst_coeff = (int32_t *)coeff;
296 297
  av1_fwd_txfm2d_32x16_c(src_diff, dst_coeff, diff_stride, txfm_param->tx_type,
                         txfm_param->bd);
298 299
}

Angie Chiang's avatar
Angie Chiang committed
300
static void highbd_fwd_txfm_8x8(const int16_t *src_diff, tran_low_t *coeff,
301
                                int diff_stride, TxfmParam *txfm_param) {
302
  int32_t *dst_coeff = (int32_t *)coeff;
303 304
  const int tx_type = txfm_param->tx_type;
  const int bd = txfm_param->bd;
Angie Chiang's avatar
Angie Chiang committed
305 306 307 308 309
  switch (tx_type) {
    case DCT_DCT:
    case ADST_DCT:
    case DCT_ADST:
    case ADST_ADST:
310
      // fallthrough intended
311
      av1_fwd_txfm2d_8x8(src_diff, dst_coeff, diff_stride, tx_type, bd);
Angie Chiang's avatar
Angie Chiang committed
312 313 314 315 316 317 318
      break;
#if CONFIG_EXT_TX
    case FLIPADST_DCT:
    case DCT_FLIPADST:
    case FLIPADST_FLIPADST:
    case ADST_FLIPADST:
    case FLIPADST_ADST:
319
      // fallthrough intended
320
      av1_fwd_txfm2d_8x8(src_diff, dst_coeff, diff_stride, tx_type, bd);
Angie Chiang's avatar
Angie Chiang committed
321
      break;
322
    // use the c version for anything including identity for now
Debargha Mukherjee's avatar
Debargha Mukherjee committed
323
    case V_DCT:
324 325 326 327 328
    case H_DCT:
    case V_ADST:
    case H_ADST:
    case V_FLIPADST:
    case H_FLIPADST:
329 330
    case IDTX:
      // fallthrough intended
331
      av1_fwd_txfm2d_8x8_c(src_diff, dst_coeff, diff_stride, tx_type, bd);
Angie Chiang's avatar
Angie Chiang committed
332 333
      break;
#endif  // CONFIG_EXT_TX
334
    default: assert(0);
Angie Chiang's avatar
Angie Chiang committed
335 336 337 338
  }
}

static void highbd_fwd_txfm_16x16(const int16_t *src_diff, tran_low_t *coeff,
339
                                  int diff_stride, TxfmParam *txfm_param) {
340
  int32_t *dst_coeff = (int32_t *)coeff;
341 342
  const int tx_type = txfm_param->tx_type;
  const int bd = txfm_param->bd;
Angie Chiang's avatar
Angie Chiang committed
343 344 345 346 347
  switch (tx_type) {
    case DCT_DCT:
    case ADST_DCT:
    case DCT_ADST:
    case ADST_ADST:
348
      // fallthrough intended
349
      av1_fwd_txfm2d_16x16(src_diff, dst_coeff, diff_stride, tx_type, bd);
Angie Chiang's avatar
Angie Chiang committed
350 351 352 353 354 355 356
      break;
#if CONFIG_EXT_TX
    case FLIPADST_DCT:
    case DCT_FLIPADST:
    case FLIPADST_FLIPADST:
    case ADST_FLIPADST:
    case FLIPADST_ADST:
357
      // fallthrough intended
358
      av1_fwd_txfm2d_16x16(src_diff, dst_coeff, diff_stride, tx_type, bd);
Angie Chiang's avatar
Angie Chiang committed
359
      break;
360
    // use the c version for anything including identity for now
Debargha Mukherjee's avatar
Debargha Mukherjee committed
361
    case V_DCT:
362 363 364 365 366
    case H_DCT:
    case V_ADST:
    case H_ADST:
    case V_FLIPADST:
    case H_FLIPADST:
367 368
    case IDTX:
      // fallthrough intended
369
      av1_fwd_txfm2d_16x16_c(src_diff, dst_coeff, diff_stride, tx_type, bd);
Angie Chiang's avatar
Angie Chiang committed
370 371
      break;
#endif  // CONFIG_EXT_TX
372
    default: assert(0);
Angie Chiang's avatar
Angie Chiang committed
373 374 375
  }
}

376
static void highbd_fwd_txfm_32x32(const int16_t *src_diff, tran_low_t *coeff,
377
                                  int diff_stride, TxfmParam *txfm_param) {
378
  int32_t *dst_coeff = (int32_t *)coeff;
379 380
  const int tx_type = txfm_param->tx_type;
  const int bd = txfm_param->bd;
Angie Chiang's avatar
Angie Chiang committed
381 382 383 384 385
  switch (tx_type) {
    case DCT_DCT:
    case ADST_DCT:
    case DCT_ADST:
    case ADST_ADST:
386
      // fallthrough intended
387
      av1_fwd_txfm2d_32x32(src_diff, dst_coeff, diff_stride, tx_type, bd);
388 389
      break;
#if CONFIG_EXT_TX
390 391 392 393 394
    case FLIPADST_DCT:
    case DCT_FLIPADST:
    case FLIPADST_FLIPADST:
    case ADST_FLIPADST:
    case FLIPADST_ADST:
395
      // fallthrough intended
396
      av1_fwd_txfm2d_32x32(src_diff, dst_coeff, diff_stride, tx_type, bd);
397 398
      break;
    // use the c version for anything including identity for now
399
    case V_DCT:
400 401 402 403 404
    case H_DCT:
    case V_ADST:
    case H_ADST:
    case V_FLIPADST:
    case H_FLIPADST:
405 406
    case IDTX:
      // fallthrough intended
407
      av1_fwd_txfm2d_32x32_c(src_diff, dst_coeff, diff_stride, tx_type, bd);
408 409
      break;
#endif  // CONFIG_EXT_TX
410
    default: assert(0);
Angie Chiang's avatar
Angie Chiang committed
411 412
  }
}
413 414 415

#if CONFIG_TX64X64
static void highbd_fwd_txfm_64x64(const int16_t *src_diff, tran_low_t *coeff,
416
                                  int diff_stride, TxfmParam *txfm_param) {
417
  int32_t *dst_coeff = (int32_t *)coeff;
418 419
  const int tx_type = txfm_param->tx_type;
  const int bd = txfm_param->bd;
420 421
  switch (tx_type) {
    case DCT_DCT:
422
      av1_fwd_txfm2d_64x64(src_diff, dst_coeff, diff_stride, tx_type, bd);
423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438
      break;
#if CONFIG_EXT_TX
    case ADST_DCT:
    case DCT_ADST:
    case ADST_ADST:
    case FLIPADST_DCT:
    case DCT_FLIPADST:
    case FLIPADST_FLIPADST:
    case ADST_FLIPADST:
    case FLIPADST_ADST:
    case V_DCT:
    case H_DCT:
    case V_ADST:
    case H_ADST:
    case V_FLIPADST:
    case H_FLIPADST:
439 440 441 442 443 444
      // TODO(sarahparker)
      // I've deleted the 64x64 implementations that existed in lieu
      // of adst, flipadst and identity for simplicity but will bring back
      // in a later change. This shouldn't impact performance since
      // DCT_DCT is the only extended type currently allowed for 64x64,
      // as dictated by get_ext_tx_set_type in blockd.h.
445
      av1_fwd_txfm2d_64x64_c(src_diff, dst_coeff, diff_stride, DCT_DCT, bd);
446
      break;
447 448 449
    case IDTX:
      av1_fwd_idtx_c(src_diff, dst_coeff, diff_stride, 64, tx_type);
      break;
450 451 452 453 454
#endif  // CONFIG_EXT_TX
    default: assert(0); break;
  }
}
#endif  // CONFIG_TX64X64
Angie Chiang's avatar
Angie Chiang committed
455

hui su's avatar
hui su committed
456
void av1_fwd_txfm(const int16_t *src_diff, tran_low_t *coeff, int diff_stride,
457 458
                  TxfmParam *txfm_param) {
  const TX_SIZE tx_size = txfm_param->tx_size;
Angie Chiang's avatar
Angie Chiang committed
459
  switch (tx_size) {
460 461
#if CONFIG_TX64X64
    case TX_64X64:
462
      fwd_txfm_64x64(src_diff, coeff, diff_stride, txfm_param);
463 464
      break;
#endif  // CONFIG_TX64X64
Angie Chiang's avatar
Angie Chiang committed
465
    case TX_32X32:
466
      fwd_txfm_32x32(src_diff, coeff, diff_stride, txfm_param);
Angie Chiang's avatar
Angie Chiang committed
467 468
      break;
    case TX_16X16:
469
      fwd_txfm_16x16(src_diff, coeff, diff_stride, txfm_param);
470
      break;
471 472 473
    case TX_8X8: fwd_txfm_8x8(src_diff, coeff, diff_stride, txfm_param); break;
    case TX_4X8: fwd_txfm_4x8(src_diff, coeff, diff_stride, txfm_param); break;
    case TX_8X4: fwd_txfm_8x4(src_diff, coeff, diff_stride, txfm_param); break;
474
    case TX_8X16:
475
      fwd_txfm_8x16(src_diff, coeff, diff_stride, txfm_param);
476 477
      break;
    case TX_16X8:
478
      fwd_txfm_16x8(src_diff, coeff, diff_stride, txfm_param);
479 480
      break;
    case TX_16X32:
481
      fwd_txfm_16x32(src_diff, coeff, diff_stride, txfm_param);
482 483
      break;
    case TX_32X16:
484
      fwd_txfm_32x16(src_diff, coeff, diff_stride, txfm_param);
Angie Chiang's avatar
Angie Chiang committed
485
      break;
486
    case TX_4X4: fwd_txfm_4x4(src_diff, coeff, diff_stride, txfm_param); break;
487
#if CONFIG_CHROMA_2X2
488
    case TX_2X2: fwd_txfm_2x2(src_diff, coeff, diff_stride, txfm_param); break;
Jingning Han's avatar
Jingning Han committed
489
#endif
Yue Chen's avatar
Yue Chen committed
490
#if CONFIG_RECT_TX_EXT && (CONFIG_EXT_TX || CONFIG_VAR_TX)
491
    case TX_4X16:
492
      fwd_txfm_4x16(src_diff, coeff, diff_stride, txfm_param);
493 494
      break;
    case TX_16X4:
495
      fwd_txfm_16x4(src_diff, coeff, diff_stride, txfm_param);
496 497
      break;
    case TX_8X32:
498
      fwd_txfm_8x32(src_diff, coeff, diff_stride, txfm_param);
499 500
      break;
    case TX_32X8:
501
      fwd_txfm_32x8(src_diff, coeff, diff_stride, txfm_param);
502
      break;
Yue Chen's avatar
Yue Chen committed
503
#endif
504
    default: assert(0); break;
Angie Chiang's avatar
Angie Chiang committed
505 506 507
  }
}

hui su's avatar
hui su committed
508
void av1_highbd_fwd_txfm(const int16_t *src_diff, tran_low_t *coeff,
509 510
                         int diff_stride, TxfmParam *txfm_param) {
  const TX_SIZE tx_size = txfm_param->tx_size;
Angie Chiang's avatar
Angie Chiang committed
511
  switch (tx_size) {
512 513
#if CONFIG_TX64X64
    case TX_64X64:
514
      highbd_fwd_txfm_64x64(src_diff, coeff, diff_stride, txfm_param);
515 516
      break;
#endif  // CONFIG_TX64X64
Angie Chiang's avatar
Angie Chiang committed
517
    case TX_32X32:
518
      highbd_fwd_txfm_32x32(src_diff, coeff, diff_stride, txfm_param);
Angie Chiang's avatar
Angie Chiang committed
519 520
      break;
    case TX_16X16:
521
      highbd_fwd_txfm_16x16(src_diff, coeff, diff_stride, txfm_param);
Angie Chiang's avatar
Angie Chiang committed
522 523
      break;
    case TX_8X8:
524
      highbd_fwd_txfm_8x8(src_diff, coeff, diff_stride, txfm_param);
Angie Chiang's avatar
Angie Chiang committed
525
      break;
526
    case TX_4X8:
527
      highbd_fwd_txfm_4x8(src_diff, coeff, diff_stride, txfm_param);
528 529
      break;
    case TX_8X4:
530
      highbd_fwd_txfm_8x4(src_diff, coeff, diff_stride, txfm_param);
531
      break;
532
    case TX_8X16:
533
      highbd_fwd_txfm_8x16(src_diff, coeff, diff_stride, txfm_param);
534 535
      break;
    case TX_16X8:
536
      highbd_fwd_txfm_16x8(src_diff, coeff, diff_stride, txfm_param);
537 538
      break;
    case TX_16X32:
539
      highbd_fwd_txfm_16x32(src_diff, coeff, diff_stride, txfm_param);
540 541
      break;
    case TX_32X16:
542
      highbd_fwd_txfm_32x16(src_diff, coeff, diff_stride, txfm_param);
543
      break;
Angie Chiang's avatar
Angie Chiang committed
544
    case TX_4X4:
545
      highbd_fwd_txfm_4x4(src_diff, coeff, diff_stride, txfm_param);
Angie Chiang's avatar
Angie Chiang committed
546
      break;
547
#if CONFIG_CHROMA_2X2
548
    case TX_2X2:
549
      highbd_fwd_txfm_2x2(src_diff, coeff, diff_stride, txfm_param);
550 551
      break;
#endif
clang-format's avatar
clang-format committed
552
    default: assert(0); break;
Angie Chiang's avatar
Angie Chiang committed
553 554
  }
}