blob: 58ee0c73b3ebfb65131ad71144f0597986cb493c [file] [log] [blame]
Yaowu Xuc27fc142016-08-22 16:08:15 -07001/*
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 Xuf883b422016-08-30 14:01:10 -070011#ifndef AV1_COMMON_IDCT_H_
12#define AV1_COMMON_IDCT_H_
Yaowu Xuc27fc142016-08-22 16:08:15 -070013
14#include <assert.h>
15
Yaowu Xuf883b422016-08-30 14:01:10 -070016#include "./aom_config.h"
Yaowu Xuc27fc142016-08-22 16:08:15 -070017#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
25extern "C" {
26#endif
27
28typedef struct INV_TXFM_PARAM {
29 TX_TYPE tx_type;
30 TX_SIZE tx_size;
31 int eob;
32 int lossless;
Yaowu Xuf883b422016-08-30 14:01:10 -070033#if CONFIG_AOM_HIGHBITDEPTH
Yaowu Xuc27fc142016-08-22 16:08:15 -070034 int bd;
35#endif
36} INV_TXFM_PARAM;
37
38typedef void (*transform_1d)(const tran_low_t *, tran_low_t *);
39
40typedef struct {
41 transform_1d cols, rows; // vertical and horizontal
42} transform_2d;
43
Yaowu Xuf883b422016-08-30 14:01:10 -070044#if CONFIG_AOM_HIGHBITDEPTH
Yaowu Xuc27fc142016-08-22 16:08:15 -070045typedef void (*highbd_transform_1d)(const tran_low_t *, tran_low_t *, int bd);
46
47typedef struct {
48 highbd_transform_1d cols, rows; // vertical and horizontal
49} highbd_transform_2d;
Yaowu Xuf883b422016-08-30 14:01:10 -070050#endif // CONFIG_AOM_HIGHBITDEPTH
Yaowu Xuc27fc142016-08-22 16:08:15 -070051
52#define MAX_TX_SCALE 1
53int get_tx_scale(const MACROBLOCKD *const xd, const TX_TYPE tx_type,
54 const TX_SIZE tx_size);
55
Yaowu Xuf883b422016-08-30 14:01:10 -070056void av1_iwht4x4_add(const tran_low_t *input, uint8_t *dest, int stride,
57 int eob);
58void av1_idct4x4_add(const tran_low_t *input, uint8_t *dest, int stride,
59 int eob);
60void av1_idct8x8_add(const tran_low_t *input, uint8_t *dest, int stride,
61 int eob);
62void av1_idct16x16_add(const tran_low_t *input, uint8_t *dest, int stride,
63 int eob);
64void av1_idct32x32_add(const tran_low_t *input, uint8_t *dest, int stride,
65 int eob);
Yaowu Xuc27fc142016-08-22 16:08:15 -070066
Yaowu Xuf883b422016-08-30 14:01:10 -070067void 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 Xuc27fc142016-08-22 16:08:15 -070069#if CONFIG_EXT_TX
Yaowu Xuf883b422016-08-30 14:01:10 -070070void av1_inv_txfm_add_8x4(const tran_low_t *input, uint8_t *dest, int stride,
71 int eob, TX_TYPE tx_type);
72void av1_inv_txfm_add_4x8(const tran_low_t *input, uint8_t *dest, int stride,
73 int eob, TX_TYPE tx_type);
Yaowu Xuc27fc142016-08-22 16:08:15 -070074#endif // CONFIG_EXT_TX
Yaowu Xuf883b422016-08-30 14:01:10 -070075void av1_inv_txfm_add_8x8(const tran_low_t *input, uint8_t *dest, int stride,
76 int eob, TX_TYPE tx_type);
77void av1_inv_txfm_add_16x16(const tran_low_t *input, uint8_t *dest, int stride,
78 int eob, TX_TYPE tx_type);
79void av1_inv_txfm_add_32x32(const tran_low_t *input, uint8_t *dest, int stride,
80 int eob, TX_TYPE tx_type);
Yaowu Xuc27fc142016-08-22 16:08:15 -070081void inv_txfm_add(const tran_low_t *input, uint8_t *dest, int stride,
82 INV_TXFM_PARAM *inv_txfm_param);
Yaowu Xuf883b422016-08-30 14:01:10 -070083#if CONFIG_AOM_HIGHBITDEPTH
84void av1_highbd_iwht4x4_add(const tran_low_t *input, uint8_t *dest, int stride,
85 int eob, int bd);
86void av1_highbd_idct4x4_add(const tran_low_t *input, uint8_t *dest, int stride,
87 int eob, int bd);
88void av1_highbd_idct8x8_add(const tran_low_t *input, uint8_t *dest, int stride,
89 int eob, int bd);
90void av1_highbd_idct16x16_add(const tran_low_t *input, uint8_t *dest,
91 int stride, int eob, int bd);
92void av1_highbd_idct32x32_add(const tran_low_t *input, uint8_t *dest,
93 int stride, int eob, int bd);
94void 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 Xuc27fc142016-08-22 16:08:15 -070097#if CONFIG_EXT_TX
Yaowu Xuf883b422016-08-30 14:01:10 -070098void 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);
100void 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 Xuc27fc142016-08-22 16:08:15 -0700102#endif // CONFIG_EXT_TX
Yaowu Xuf883b422016-08-30 14:01:10 -0700103void 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);
105void 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);
108void 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 Xuc27fc142016-08-22 16:08:15 -0700111void highbd_inv_txfm_add(const tran_low_t *input, uint8_t *dest, int stride,
112 INV_TXFM_PARAM *inv_txfm_param);
Yaowu Xuf883b422016-08-30 14:01:10 -0700113#endif // CONFIG_AOM_HIGHBITDEPTH
Yaowu Xuc27fc142016-08-22 16:08:15 -0700114#ifdef __cplusplus
115} // extern "C"
116#endif
117
Yaowu Xuf883b422016-08-30 14:01:10 -0700118#endif // AV1_COMMON_IDCT_H_