blob: f8a9e9199880fa0dbed2e96df19082c39d7d12fe [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
Sebastien Alaiwan71e87842017-04-12 16:03:28 +020042#if CONFIG_HIGHBITDEPTH
Frank Galligan34c06df2017-05-03 17:41:10 +000043typedef void (*highbd_transform_1d)(const tran_low_t *, tran_low_t *, int bd);
Yaowu Xuc27fc142016-08-22 16:08:15 -070044
45typedef struct {
46 highbd_transform_1d cols, rows; // vertical and horizontal
47} highbd_transform_2d;
Sebastien Alaiwan71e87842017-04-12 16:03:28 +020048#endif // CONFIG_HIGHBITDEPTH
Yaowu Xuc27fc142016-08-22 16:08:15 -070049
50#define MAX_TX_SCALE 1
Jingning Hanff705452017-04-27 11:32:15 -070051int av1_get_tx_scale(const TX_SIZE tx_size);
Yaowu Xuc27fc142016-08-22 16:08:15 -070052
Yaowu Xuf883b422016-08-30 14:01:10 -070053void av1_iwht4x4_add(const tran_low_t *input, uint8_t *dest, int stride,
Lester Lu27319b62017-07-10 16:57:15 -070054 const TxfmParam *txfm_param);
Yaowu Xuf883b422016-08-30 14:01:10 -070055void av1_idct4x4_add(const tran_low_t *input, uint8_t *dest, int stride,
Lester Lu27319b62017-07-10 16:57:15 -070056 const TxfmParam *txfm_param);
Yaowu Xuc27fc142016-08-22 16:08:15 -070057
hui subb9c73b2017-03-17 15:51:02 -070058void av1_inv_txfm_add(const tran_low_t *input, uint8_t *dest, int stride,
Lester Lu27319b62017-07-10 16:57:15 -070059 TxfmParam *txfm_param);
Urvang Joshi0d1e4ff2017-04-27 16:17:25 -070060void av1_inverse_transform_block(const MACROBLOCKD *xd,
Lester Lu708c1ec2017-06-14 14:54:49 -070061 const tran_low_t *dqcoeff,
62#if CONFIG_LGT
63 PREDICTION_MODE mode,
64#endif
65 TX_TYPE tx_type, TX_SIZE tx_size, uint8_t *dst,
66 int stride, int eob);
Angie Chiangbc2288c2017-04-09 15:41:17 -070067void av1_inverse_transform_block_facade(MACROBLOCKD *xd, int plane, int block,
68 int blk_row, int blk_col, int eob);
Yi Luo51281092017-06-26 16:36:15 -070069
Yaowu Xuf883b422016-08-30 14:01:10 -070070void av1_highbd_iwht4x4_add(const tran_low_t *input, uint8_t *dest, int stride,
71 int eob, int bd);
Yaowu Xuf883b422016-08-30 14:01:10 -070072void av1_highbd_inv_txfm_add_4x4(const tran_low_t *input, uint8_t *dest,
Lester Lu27319b62017-07-10 16:57:15 -070073 int stride, const TxfmParam *param);
Yaowu Xuf883b422016-08-30 14:01:10 -070074void av1_highbd_inv_txfm_add_4x8(const tran_low_t *input, uint8_t *dest,
Lester Lu27319b62017-07-10 16:57:15 -070075 int stride, const TxfmParam *param);
Yaowu Xuf883b422016-08-30 14:01:10 -070076void av1_highbd_inv_txfm_add_8x4(const tran_low_t *input, uint8_t *dest,
Lester Lu27319b62017-07-10 16:57:15 -070077 int stride, const TxfmParam *param);
hui subb9c73b2017-03-17 15:51:02 -070078void av1_highbd_inv_txfm_add(const tran_low_t *input, uint8_t *dest, int stride,
Lester Lu27319b62017-07-10 16:57:15 -070079 TxfmParam *txfm_param);
Yi Luo51281092017-06-26 16:36:15 -070080
Yaowu Xuc27fc142016-08-22 16:08:15 -070081#ifdef __cplusplus
82} // extern "C"
83#endif
84
Yaowu Xuf883b422016-08-30 14:01:10 -070085#endif // AV1_COMMON_IDCT_H_