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 | #ifndef AV1_COMMON_IDCT_H_ |
| 13 | #define AV1_COMMON_IDCT_H_ |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 14 | |
| 15 | #include <assert.h> |
| 16 | |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 17 | #include "./aom_config.h" |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 18 | #include "av1/common/blockd.h" |
| 19 | #include "av1/common/common.h" |
| 20 | #include "av1/common/enums.h" |
| 21 | #include "aom_dsp/inv_txfm.h" |
| 22 | #include "aom_dsp/txfm_common.h" |
| 23 | #include "aom_ports/mem.h" |
| 24 | |
| 25 | #ifdef __cplusplus |
| 26 | extern "C" { |
| 27 | #endif |
| 28 | |
| 29 | typedef struct INV_TXFM_PARAM { |
| 30 | TX_TYPE tx_type; |
| 31 | TX_SIZE tx_size; |
| 32 | int eob; |
| 33 | int lossless; |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 34 | #if CONFIG_AOM_HIGHBITDEPTH |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 35 | int bd; |
| 36 | #endif |
| 37 | } INV_TXFM_PARAM; |
| 38 | |
| 39 | typedef void (*transform_1d)(const tran_low_t *, tran_low_t *); |
| 40 | |
| 41 | typedef struct { |
| 42 | transform_1d cols, rows; // vertical and horizontal |
| 43 | } transform_2d; |
| 44 | |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 45 | #if CONFIG_AOM_HIGHBITDEPTH |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 46 | typedef void (*highbd_transform_1d)(const tran_low_t *, tran_low_t *, int bd); |
| 47 | |
| 48 | typedef struct { |
| 49 | highbd_transform_1d cols, rows; // vertical and horizontal |
| 50 | } highbd_transform_2d; |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 51 | #endif // CONFIG_AOM_HIGHBITDEPTH |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 52 | |
| 53 | #define MAX_TX_SCALE 1 |
| 54 | int get_tx_scale(const MACROBLOCKD *const xd, const TX_TYPE tx_type, |
| 55 | const TX_SIZE tx_size); |
| 56 | |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 57 | void av1_iwht4x4_add(const tran_low_t *input, uint8_t *dest, int stride, |
| 58 | int eob); |
| 59 | void av1_idct4x4_add(const tran_low_t *input, uint8_t *dest, int stride, |
| 60 | int eob); |
| 61 | void av1_idct8x8_add(const tran_low_t *input, uint8_t *dest, int stride, |
| 62 | int eob); |
| 63 | void av1_idct16x16_add(const tran_low_t *input, uint8_t *dest, int stride, |
| 64 | int eob); |
| 65 | void av1_idct32x32_add(const tran_low_t *input, uint8_t *dest, int stride, |
| 66 | int eob); |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 67 | |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 68 | void av1_inv_txfm_add_4x4(const tran_low_t *input, uint8_t *dest, int stride, |
| 69 | int eob, TX_TYPE tx_type, int lossless); |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 70 | #if CONFIG_EXT_TX |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 71 | void av1_inv_txfm_add_8x4(const tran_low_t *input, uint8_t *dest, int stride, |
| 72 | int eob, TX_TYPE tx_type); |
| 73 | void av1_inv_txfm_add_4x8(const tran_low_t *input, uint8_t *dest, int stride, |
| 74 | int eob, TX_TYPE tx_type); |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 75 | #endif // CONFIG_EXT_TX |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 76 | void av1_inv_txfm_add_8x8(const tran_low_t *input, uint8_t *dest, int stride, |
| 77 | int eob, TX_TYPE tx_type); |
| 78 | void av1_inv_txfm_add_16x16(const tran_low_t *input, uint8_t *dest, int stride, |
| 79 | int eob, TX_TYPE tx_type); |
| 80 | void av1_inv_txfm_add_32x32(const tran_low_t *input, uint8_t *dest, int stride, |
| 81 | int eob, TX_TYPE tx_type); |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 82 | void inv_txfm_add(const tran_low_t *input, uint8_t *dest, int stride, |
| 83 | INV_TXFM_PARAM *inv_txfm_param); |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 84 | #if CONFIG_AOM_HIGHBITDEPTH |
| 85 | void av1_highbd_iwht4x4_add(const tran_low_t *input, uint8_t *dest, int stride, |
| 86 | int eob, int bd); |
| 87 | void av1_highbd_idct4x4_add(const tran_low_t *input, uint8_t *dest, int stride, |
| 88 | int eob, int bd); |
| 89 | void av1_highbd_idct8x8_add(const tran_low_t *input, uint8_t *dest, int stride, |
| 90 | int eob, int bd); |
| 91 | void av1_highbd_idct16x16_add(const tran_low_t *input, uint8_t *dest, |
| 92 | int stride, int eob, int bd); |
| 93 | void av1_highbd_idct32x32_add(const tran_low_t *input, uint8_t *dest, |
| 94 | int stride, int eob, int bd); |
| 95 | void av1_highbd_inv_txfm_add_4x4(const tran_low_t *input, uint8_t *dest, |
| 96 | int stride, int eob, int bd, TX_TYPE tx_type, |
| 97 | int lossless); |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 98 | #if CONFIG_EXT_TX |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 99 | void av1_highbd_inv_txfm_add_4x8(const tran_low_t *input, uint8_t *dest, |
| 100 | int stride, int eob, int bd, TX_TYPE tx_type); |
| 101 | void av1_highbd_inv_txfm_add_8x4(const tran_low_t *input, uint8_t *dest, |
| 102 | int stride, int eob, int bd, TX_TYPE tx_type); |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 103 | #endif // CONFIG_EXT_TX |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 104 | void av1_highbd_inv_txfm_add_8x8(const tran_low_t *input, uint8_t *dest, |
| 105 | int stride, int eob, int bd, TX_TYPE tx_type); |
| 106 | void av1_highbd_inv_txfm_add_16x16(const tran_low_t *input, uint8_t *dest, |
| 107 | int stride, int eob, int bd, |
| 108 | TX_TYPE tx_type); |
| 109 | void av1_highbd_inv_txfm_add_32x32(const tran_low_t *input, uint8_t *dest, |
| 110 | int stride, int eob, int bd, |
| 111 | TX_TYPE tx_type); |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 112 | void highbd_inv_txfm_add(const tran_low_t *input, uint8_t *dest, int stride, |
| 113 | INV_TXFM_PARAM *inv_txfm_param); |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 114 | #endif // CONFIG_AOM_HIGHBITDEPTH |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 115 | #ifdef __cplusplus |
| 116 | } // extern "C" |
| 117 | #endif |
| 118 | |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 119 | #endif // AV1_COMMON_IDCT_H_ |