blob: e4e4ad67186d41fdea0d056c95c301709ed908a0 [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
Yaowu Xuc27fc142016-08-22 16:08:15 -070029typedef void (*transform_1d)(const tran_low_t *, tran_low_t *);
30
31typedef struct {
32 transform_1d cols, rows; // vertical and horizontal
33} transform_2d;
34
Lester Lu918fe692017-08-17 14:39:29 -070035#if CONFIG_LGT
36int get_lgt4(const TxfmParam *txfm_param, int is_col,
37 const tran_high_t **lgtmtx);
38int get_lgt8(const TxfmParam *txfm_param, int is_col,
39 const tran_high_t **lgtmtx);
40#endif // CONFIG_LGT
41
Lester Lu432012f2017-08-17 14:39:29 -070042#if CONFIG_LGT_FROM_PRED
43void get_lgt4_from_pred(const TxfmParam *txfm_param, int is_col,
44 const tran_high_t **lgtmtx, int ntx);
45void get_lgt8_from_pred(const TxfmParam *txfm_param, int is_col,
46 const tran_high_t **lgtmtx, int ntx);
47void get_lgt16up_from_pred(const TxfmParam *txfm_param, int is_col,
48 const tran_high_t **lgtmtx, int ntx);
49#endif // CONFIG_LGT_FROM_PRED
50
Sebastien Alaiwan71e87842017-04-12 16:03:28 +020051#if CONFIG_HIGHBITDEPTH
Frank Galligan34c06df2017-05-03 17:41:10 +000052typedef void (*highbd_transform_1d)(const tran_low_t *, tran_low_t *, int bd);
Yaowu Xuc27fc142016-08-22 16:08:15 -070053
54typedef struct {
55 highbd_transform_1d cols, rows; // vertical and horizontal
56} highbd_transform_2d;
Sebastien Alaiwan71e87842017-04-12 16:03:28 +020057#endif // CONFIG_HIGHBITDEPTH
Yaowu Xuc27fc142016-08-22 16:08:15 -070058
59#define MAX_TX_SCALE 1
Jingning Hanff705452017-04-27 11:32:15 -070060int av1_get_tx_scale(const TX_SIZE tx_size);
Yaowu Xuc27fc142016-08-22 16:08:15 -070061
Yaowu Xuf883b422016-08-30 14:01:10 -070062void av1_iwht4x4_add(const tran_low_t *input, uint8_t *dest, int stride,
Lester Lu27319b62017-07-10 16:57:15 -070063 const TxfmParam *txfm_param);
Yaowu Xuf883b422016-08-30 14:01:10 -070064void av1_idct4x4_add(const tran_low_t *input, uint8_t *dest, int stride,
Lester Lu27319b62017-07-10 16:57:15 -070065 const TxfmParam *txfm_param);
Yaowu Xuc27fc142016-08-22 16:08:15 -070066
hui subb9c73b2017-03-17 15:51:02 -070067void av1_inv_txfm_add(const tran_low_t *input, uint8_t *dest, int stride,
Lester Lu27319b62017-07-10 16:57:15 -070068 TxfmParam *txfm_param);
Urvang Joshi0d1e4ff2017-04-27 16:17:25 -070069void av1_inverse_transform_block(const MACROBLOCKD *xd,
Lester Lu708c1ec2017-06-14 14:54:49 -070070 const tran_low_t *dqcoeff,
Lester Lu432012f2017-08-17 14:39:29 -070071#if CONFIG_LGT_FROM_PRED
Lester Lu708c1ec2017-06-14 14:54:49 -070072 PREDICTION_MODE mode,
73#endif
Sarah Parker99e7daa2017-08-29 10:30:13 -070074#if CONFIG_MRC_TX && SIGNAL_ANY_MRC_MASK
75 uint8_t *mrc_mask,
76#endif // CONFIG_MRC_TX && SIGNAL_ANY_MRC_MASK
Lester Lu708c1ec2017-06-14 14:54:49 -070077 TX_TYPE tx_type, TX_SIZE tx_size, uint8_t *dst,
78 int stride, int eob);
Angie Chiangbc2288c2017-04-09 15:41:17 -070079void av1_inverse_transform_block_facade(MACROBLOCKD *xd, int plane, int block,
80 int blk_row, int blk_col, int eob);
Yi Luo51281092017-06-26 16:36:15 -070081
Yaowu Xuf883b422016-08-30 14:01:10 -070082void av1_highbd_iwht4x4_add(const tran_low_t *input, uint8_t *dest, int stride,
83 int eob, int bd);
Yaowu Xuf883b422016-08-30 14:01:10 -070084void av1_highbd_inv_txfm_add_4x4(const tran_low_t *input, uint8_t *dest,
Lester Lu27319b62017-07-10 16:57:15 -070085 int stride, const TxfmParam *param);
Yaowu Xuf883b422016-08-30 14:01:10 -070086void av1_highbd_inv_txfm_add_4x8(const tran_low_t *input, uint8_t *dest,
Lester Lu27319b62017-07-10 16:57:15 -070087 int stride, const TxfmParam *param);
Yaowu Xuf883b422016-08-30 14:01:10 -070088void av1_highbd_inv_txfm_add_8x4(const tran_low_t *input, uint8_t *dest,
Lester Lu27319b62017-07-10 16:57:15 -070089 int stride, const TxfmParam *param);
hui subb9c73b2017-03-17 15:51:02 -070090void av1_highbd_inv_txfm_add(const tran_low_t *input, uint8_t *dest, int stride,
Lester Lu27319b62017-07-10 16:57:15 -070091 TxfmParam *txfm_param);
Yi Luo51281092017-06-26 16:36:15 -070092
Yaowu Xuc27fc142016-08-22 16:08:15 -070093#ifdef __cplusplus
94} // extern "C"
95#endif
96
Yaowu Xuf883b422016-08-30 14:01:10 -070097#endif // AV1_COMMON_IDCT_H_