Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2010 The WebM project authors. All Rights Reserved. |
| 3 | * |
| 4 | * Use of this source code is governed by a BSD-style license |
| 5 | * that can be found in the LICENSE file in the root of the source |
| 6 | * tree. An additional intellectual property rights grant can be found |
| 7 | * in the file PATENTS. All contributing project authors may |
| 8 | * be found in the AUTHORS file in the root of the source tree. |
| 9 | */ |
| 10 | |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame^] | 11 | #ifndef AV1_COMMON_IDCT_H_ |
| 12 | #define AV1_COMMON_IDCT_H_ |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 13 | |
| 14 | #include <assert.h> |
| 15 | |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame^] | 16 | #include "./aom_config.h" |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 17 | #include "av1/common/blockd.h" |
| 18 | #include "av1/common/common.h" |
| 19 | #include "av1/common/enums.h" |
| 20 | #include "aom_dsp/inv_txfm.h" |
| 21 | #include "aom_dsp/txfm_common.h" |
| 22 | #include "aom_ports/mem.h" |
| 23 | |
| 24 | #ifdef __cplusplus |
| 25 | extern "C" { |
| 26 | #endif |
| 27 | |
| 28 | typedef struct INV_TXFM_PARAM { |
| 29 | TX_TYPE tx_type; |
| 30 | TX_SIZE tx_size; |
| 31 | int eob; |
| 32 | int lossless; |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame^] | 33 | #if CONFIG_AOM_HIGHBITDEPTH |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 34 | int bd; |
| 35 | #endif |
| 36 | } INV_TXFM_PARAM; |
| 37 | |
| 38 | typedef void (*transform_1d)(const tran_low_t *, tran_low_t *); |
| 39 | |
| 40 | typedef struct { |
| 41 | transform_1d cols, rows; // vertical and horizontal |
| 42 | } transform_2d; |
| 43 | |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame^] | 44 | #if CONFIG_AOM_HIGHBITDEPTH |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 45 | typedef void (*highbd_transform_1d)(const tran_low_t *, tran_low_t *, int bd); |
| 46 | |
| 47 | typedef struct { |
| 48 | highbd_transform_1d cols, rows; // vertical and horizontal |
| 49 | } highbd_transform_2d; |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame^] | 50 | #endif // CONFIG_AOM_HIGHBITDEPTH |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 51 | |
| 52 | #define MAX_TX_SCALE 1 |
| 53 | int get_tx_scale(const MACROBLOCKD *const xd, const TX_TYPE tx_type, |
| 54 | const TX_SIZE tx_size); |
| 55 | |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame^] | 56 | void av1_iwht4x4_add(const tran_low_t *input, uint8_t *dest, int stride, |
| 57 | int eob); |
| 58 | void av1_idct4x4_add(const tran_low_t *input, uint8_t *dest, int stride, |
| 59 | int eob); |
| 60 | void av1_idct8x8_add(const tran_low_t *input, uint8_t *dest, int stride, |
| 61 | int eob); |
| 62 | void av1_idct16x16_add(const tran_low_t *input, uint8_t *dest, int stride, |
| 63 | int eob); |
| 64 | void av1_idct32x32_add(const tran_low_t *input, uint8_t *dest, int stride, |
| 65 | int eob); |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 66 | |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame^] | 67 | void av1_inv_txfm_add_4x4(const tran_low_t *input, uint8_t *dest, int stride, |
| 68 | int eob, TX_TYPE tx_type, int lossless); |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 69 | #if CONFIG_EXT_TX |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame^] | 70 | void av1_inv_txfm_add_8x4(const tran_low_t *input, uint8_t *dest, int stride, |
| 71 | int eob, TX_TYPE tx_type); |
| 72 | void av1_inv_txfm_add_4x8(const tran_low_t *input, uint8_t *dest, int stride, |
| 73 | int eob, TX_TYPE tx_type); |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 74 | #endif // CONFIG_EXT_TX |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame^] | 75 | void av1_inv_txfm_add_8x8(const tran_low_t *input, uint8_t *dest, int stride, |
| 76 | int eob, TX_TYPE tx_type); |
| 77 | void av1_inv_txfm_add_16x16(const tran_low_t *input, uint8_t *dest, int stride, |
| 78 | int eob, TX_TYPE tx_type); |
| 79 | void av1_inv_txfm_add_32x32(const tran_low_t *input, uint8_t *dest, int stride, |
| 80 | int eob, TX_TYPE tx_type); |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 81 | void inv_txfm_add(const tran_low_t *input, uint8_t *dest, int stride, |
| 82 | INV_TXFM_PARAM *inv_txfm_param); |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame^] | 83 | #if CONFIG_AOM_HIGHBITDEPTH |
| 84 | void av1_highbd_iwht4x4_add(const tran_low_t *input, uint8_t *dest, int stride, |
| 85 | int eob, int bd); |
| 86 | void av1_highbd_idct4x4_add(const tran_low_t *input, uint8_t *dest, int stride, |
| 87 | int eob, int bd); |
| 88 | void av1_highbd_idct8x8_add(const tran_low_t *input, uint8_t *dest, int stride, |
| 89 | int eob, int bd); |
| 90 | void av1_highbd_idct16x16_add(const tran_low_t *input, uint8_t *dest, |
| 91 | int stride, int eob, int bd); |
| 92 | void av1_highbd_idct32x32_add(const tran_low_t *input, uint8_t *dest, |
| 93 | int stride, int eob, int bd); |
| 94 | void av1_highbd_inv_txfm_add_4x4(const tran_low_t *input, uint8_t *dest, |
| 95 | int stride, int eob, int bd, TX_TYPE tx_type, |
| 96 | int lossless); |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 97 | #if CONFIG_EXT_TX |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame^] | 98 | void av1_highbd_inv_txfm_add_4x8(const tran_low_t *input, uint8_t *dest, |
| 99 | int stride, int eob, int bd, TX_TYPE tx_type); |
| 100 | void av1_highbd_inv_txfm_add_8x4(const tran_low_t *input, uint8_t *dest, |
| 101 | int stride, int eob, int bd, TX_TYPE tx_type); |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 102 | #endif // CONFIG_EXT_TX |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame^] | 103 | void av1_highbd_inv_txfm_add_8x8(const tran_low_t *input, uint8_t *dest, |
| 104 | int stride, int eob, int bd, TX_TYPE tx_type); |
| 105 | void av1_highbd_inv_txfm_add_16x16(const tran_low_t *input, uint8_t *dest, |
| 106 | int stride, int eob, int bd, |
| 107 | TX_TYPE tx_type); |
| 108 | void av1_highbd_inv_txfm_add_32x32(const tran_low_t *input, uint8_t *dest, |
| 109 | int stride, int eob, int bd, |
| 110 | TX_TYPE tx_type); |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 111 | void highbd_inv_txfm_add(const tran_low_t *input, uint8_t *dest, int stride, |
| 112 | INV_TXFM_PARAM *inv_txfm_param); |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame^] | 113 | #endif // CONFIG_AOM_HIGHBITDEPTH |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 114 | #ifdef __cplusplus |
| 115 | } // extern "C" |
| 116 | #endif |
| 117 | |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame^] | 118 | #endif // AV1_COMMON_IDCT_H_ |