blob: 1acc8252db4922ae0ccc46d0cb249b84b325e1ec [file] [log] [blame]
Yaowu Xuc27fc142016-08-22 16:08:15 -07001/*
Yaowu Xu2ab7ff02016-09-02 12:04:54 -07002 * Copyright (c) 2016, Alliance for Open Media. All rights reserved
Yaowu Xuc27fc142016-08-22 16:08:15 -07003 *
Yaowu Xu2ab7ff02016-09-02 12:04:54 -07004 * 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 Xuc27fc142016-08-22 16:08:15 -070010 */
11
Yaowu Xuf883b422016-08-30 14:01:10 -070012#ifndef AV1_COMMON_IDCT_H_
13#define AV1_COMMON_IDCT_H_
Yaowu Xuc27fc142016-08-22 16:08:15 -070014
15#include <assert.h>
16
Yaowu Xuf883b422016-08-30 14:01:10 -070017#include "./aom_config.h"
Yaowu Xuc27fc142016-08-22 16:08:15 -070018#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
26extern "C" {
27#endif
28
29typedef struct INV_TXFM_PARAM {
30 TX_TYPE tx_type;
31 TX_SIZE tx_size;
32 int eob;
33 int lossless;
Yaowu Xuf883b422016-08-30 14:01:10 -070034#if CONFIG_AOM_HIGHBITDEPTH
Yaowu Xuc27fc142016-08-22 16:08:15 -070035 int bd;
36#endif
37} INV_TXFM_PARAM;
38
39typedef void (*transform_1d)(const tran_low_t *, tran_low_t *);
40
41typedef struct {
42 transform_1d cols, rows; // vertical and horizontal
43} transform_2d;
44
Yaowu Xuf883b422016-08-30 14:01:10 -070045#if CONFIG_AOM_HIGHBITDEPTH
Yaowu Xuc27fc142016-08-22 16:08:15 -070046typedef void (*highbd_transform_1d)(const tran_low_t *, tran_low_t *, int bd);
47
48typedef struct {
49 highbd_transform_1d cols, rows; // vertical and horizontal
50} highbd_transform_2d;
Yaowu Xuf883b422016-08-30 14:01:10 -070051#endif // CONFIG_AOM_HIGHBITDEPTH
Yaowu Xuc27fc142016-08-22 16:08:15 -070052
53#define MAX_TX_SCALE 1
54int get_tx_scale(const MACROBLOCKD *const xd, const TX_TYPE tx_type,
55 const TX_SIZE tx_size);
56
Yaowu Xuf883b422016-08-30 14:01:10 -070057void av1_iwht4x4_add(const tran_low_t *input, uint8_t *dest, int stride,
58 int eob);
59void av1_idct4x4_add(const tran_low_t *input, uint8_t *dest, int stride,
60 int eob);
61void av1_idct8x8_add(const tran_low_t *input, uint8_t *dest, int stride,
62 int eob);
63void av1_idct16x16_add(const tran_low_t *input, uint8_t *dest, int stride,
64 int eob);
65void av1_idct32x32_add(const tran_low_t *input, uint8_t *dest, int stride,
66 int eob);
Yaowu Xuc27fc142016-08-22 16:08:15 -070067
Yaowu Xuf883b422016-08-30 14:01:10 -070068void 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 Xuc27fc142016-08-22 16:08:15 -070070#if CONFIG_EXT_TX
Yaowu Xuf883b422016-08-30 14:01:10 -070071void av1_inv_txfm_add_8x4(const tran_low_t *input, uint8_t *dest, int stride,
72 int eob, TX_TYPE tx_type);
73void av1_inv_txfm_add_4x8(const tran_low_t *input, uint8_t *dest, int stride,
74 int eob, TX_TYPE tx_type);
Yaowu Xuc27fc142016-08-22 16:08:15 -070075#endif // CONFIG_EXT_TX
Yaowu Xuf883b422016-08-30 14:01:10 -070076void av1_inv_txfm_add_8x8(const tran_low_t *input, uint8_t *dest, int stride,
77 int eob, TX_TYPE tx_type);
78void av1_inv_txfm_add_16x16(const tran_low_t *input, uint8_t *dest, int stride,
79 int eob, TX_TYPE tx_type);
80void av1_inv_txfm_add_32x32(const tran_low_t *input, uint8_t *dest, int stride,
81 int eob, TX_TYPE tx_type);
Yaowu Xuc27fc142016-08-22 16:08:15 -070082void inv_txfm_add(const tran_low_t *input, uint8_t *dest, int stride,
83 INV_TXFM_PARAM *inv_txfm_param);
Yaowu Xuf883b422016-08-30 14:01:10 -070084#if CONFIG_AOM_HIGHBITDEPTH
85void av1_highbd_iwht4x4_add(const tran_low_t *input, uint8_t *dest, int stride,
86 int eob, int bd);
87void av1_highbd_idct4x4_add(const tran_low_t *input, uint8_t *dest, int stride,
88 int eob, int bd);
89void av1_highbd_idct8x8_add(const tran_low_t *input, uint8_t *dest, int stride,
90 int eob, int bd);
91void av1_highbd_idct16x16_add(const tran_low_t *input, uint8_t *dest,
92 int stride, int eob, int bd);
93void av1_highbd_idct32x32_add(const tran_low_t *input, uint8_t *dest,
94 int stride, int eob, int bd);
95void 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 Xuc27fc142016-08-22 16:08:15 -070098#if CONFIG_EXT_TX
Yaowu Xuf883b422016-08-30 14:01:10 -070099void 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);
101void 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 Xuc27fc142016-08-22 16:08:15 -0700103#endif // CONFIG_EXT_TX
Yaowu Xuf883b422016-08-30 14:01:10 -0700104void 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);
106void 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);
109void 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 Xuc27fc142016-08-22 16:08:15 -0700112void highbd_inv_txfm_add(const tran_low_t *input, uint8_t *dest, int stride,
113 INV_TXFM_PARAM *inv_txfm_param);
Yaowu Xuf883b422016-08-30 14:01:10 -0700114#endif // CONFIG_AOM_HIGHBITDEPTH
Yaowu Xuc27fc142016-08-22 16:08:15 -0700115#ifdef __cplusplus
116} // extern "C"
117#endif
118
Yaowu Xuf883b422016-08-30 14:01:10 -0700119#endif // AV1_COMMON_IDCT_H_