Commit 5e6bda8d authored by Nathan E. Egge's avatar Nathan E. Egge Committed by Nathan Egge

Move daala_fdct4() / daala_idct4() into daala_tx.c.

This commit has no impact on metrics.

Change-Id: I218f2a95542ae68491d2844becf6018eda529a1f
parent 23b9b317
......@@ -97,18 +97,6 @@ void aom_iwht4x4_1_add_c(const tran_low_t *in, uint8_t *dest, int dest_stride) {
}
}
#if CONFIG_DAALA_DCT4
void aom_idct4_c(const tran_low_t *input, tran_low_t *output) {
int i;
od_coeff x[4];
od_coeff y[4];
for (i = 0; i < 4; i++) y[i] = input[i];
od_bin_idct4(x, 1, y);
for (i = 0; i < 4; i++) output[i] = (tran_low_t)x[i];
}
#else
void aom_idct4_c(const tran_low_t *input, tran_low_t *output) {
tran_low_t step[4];
tran_high_t temp1, temp2;
......@@ -128,7 +116,6 @@ void aom_idct4_c(const tran_low_t *input, tran_low_t *output) {
output[2] = WRAPLOW(step[1] - step[2]);
output[3] = WRAPLOW(step[0] - step[3]);
}
#endif
void aom_idct4x4_16_add_c(const tran_low_t *input, uint8_t *dest, int stride) {
tran_low_t out[4 * 4];
......
......@@ -4106,3 +4106,21 @@ void od_bin_idct64(od_coeff *x, int xstride, const od_coeff y[64]) {
x[63*xstride] = (od_coeff)t;
}
#endif
void daala_fdct4(const tran_low_t *input, tran_low_t *output) {
int i;
od_coeff x[4];
od_coeff y[4];
for (i = 0; i < 4; i++) x[i] = (od_coeff)input[i];
od_bin_fdct4(y, x, 1);
for (i = 0; i < 4; i++) output[i] = (tran_low_t)y[i];
}
void daala_idct4(const tran_low_t *input, tran_low_t *output) {
int i;
od_coeff x[4];
od_coeff y[4];
for (i = 0; i < 4; i++) y[i] = input[i];
od_bin_idct4(x, 1, y);
for (i = 0; i < 4; i++) output[i] = (tran_low_t)x[i];
}
#ifndef AOM_DSP_DAALA_TX_H_
#define AOM_DSP_DAALA_TX_H_
#include "aom_dsp/aom_dsp_common.h"
#include "av1/common/odintrin.h"
void daala_fdct4(const tran_low_t *input, tran_low_t *output);
void daala_idct4(const tran_low_t *input, tran_low_t *output);
void od_bin_fdct4(od_coeff y[4], const od_coeff *x, int xstride);
void od_bin_idct4(od_coeff *x, int xstride, const od_coeff y[4]);
void od_bin_fdst4(od_coeff y[4], const od_coeff *x, int xstride);
......
......@@ -19,6 +19,10 @@
#include "av1/common/blockd.h"
#include "av1/common/enums.h"
#include "av1/common/idct.h"
#if CONFIG_DAALA_DCT4 || CONFIG_DAALA_DCT8 || CONFIG_DAALA_DCT16 || \
CONFIG_DAALA_DCT32 || CONFIG_DAALA_DCT64
#include "av1/common/daala_tx.h"
#endif
int av1_get_tx_scale(const TX_SIZE tx_size) {
const int pels = tx_size_2d[tx_size];
......@@ -326,6 +330,26 @@ void av1_iht4x4_16_add_c(const tran_low_t *input, uint8_t *dest, int stride,
}
#endif
static const transform_2d IHT_4[] = {
#if CONFIG_DAALA_DCT4
{ daala_idct4, daala_idct4 }, // DCT_DCT = 0
{ aom_iadst4_c, daala_idct4 }, // ADST_DCT = 1
{ daala_idct4, aom_iadst4_c }, // DCT_ADST = 2
{ aom_iadst4_c, aom_iadst4_c }, // ADST_ADST = 3
#if CONFIG_EXT_TX
{ aom_iadst4_c, daala_idct4 }, // FLIPADST_DCT
{ daala_idct4, aom_iadst4_c }, // DCT_FLIPADST
{ aom_iadst4_c, aom_iadst4_c }, // FLIPADST_FLIPADST
{ aom_iadst4_c, aom_iadst4_c }, // ADST_FLIPADST
{ aom_iadst4_c, aom_iadst4_c }, // FLIPADST_ADST
{ iidtx4_c, iidtx4_c }, // IDTX
{ daala_idct4, iidtx4_c }, // V_DCT
{ iidtx4_c, daala_idct4 }, // H_DCT
{ aom_iadst4_c, iidtx4_c }, // V_ADST
{ iidtx4_c, aom_iadst4_c }, // H_ADST
{ aom_iadst4_c, iidtx4_c }, // V_FLIPADST
{ iidtx4_c, aom_iadst4_c }, // H_FLIPADST
#endif
#else
{ aom_idct4_c, aom_idct4_c }, // DCT_DCT = 0
{ aom_iadst4_c, aom_idct4_c }, // ADST_DCT = 1
{ aom_idct4_c, aom_iadst4_c }, // DCT_ADST = 2
......@@ -343,6 +367,7 @@ void av1_iht4x4_16_add_c(const tran_low_t *input, uint8_t *dest, int stride,
{ iidtx4_c, aom_iadst4_c }, // H_ADST
{ aom_iadst4_c, iidtx4_c }, // V_FLIPADST
{ iidtx4_c, aom_iadst4_c }, // H_FLIPADST
#endif
#endif
};
......
......@@ -43,18 +43,6 @@ static INLINE void range_check(const tran_low_t *input, const int size,
#endif
}
#if CONFIG_DAALA_DCT4
static void fdct4(const tran_low_t *input, tran_low_t *output) {
int i;
od_coeff x[4];
od_coeff y[4];
for (i = 0; i < 4; i++) x[i] = (od_coeff)input[i];
od_bin_fdct4(y, x, 1);
for (i = 0; i < 4; i++) output[i] = (tran_low_t)y[i];
}
#else
static void fdct4(const tran_low_t *input, tran_low_t *output) {
tran_high_t temp;
tran_low_t step[4];
......@@ -90,7 +78,6 @@ static void fdct4(const tran_low_t *input, tran_low_t *output) {
range_check(output, 4, 16);
}
#endif
#if CONFIG_DAALA_DCT8
static void fdct8(const tran_low_t *input, tran_low_t *output) {
......@@ -1377,6 +1364,26 @@ void av1_fht4x4_c(const int16_t *input, tran_low_t *output, int stride,
#endif
{
static const transform_2d FHT[] = {
#if CONFIG_DAALA_DCT4
{ daala_fdct4, daala_fdct4 }, // DCT_DCT
{ fadst4, daala_fdct4 }, // ADST_DCT
{ daala_fdct4, fadst4 }, // DCT_ADST
{ fadst4, fadst4 }, // ADST_ADST
#if CONFIG_EXT_TX
{ fadst4, daala_fdct4 }, // FLIPADST_DCT
{ daala_fdct4, fadst4 }, // DCT_FLIPADST
{ fadst4, fadst4 }, // FLIPADST_FLIPADST
{ fadst4, fadst4 }, // ADST_FLIPADST
{ fadst4, fadst4 }, // FLIPADST_ADST
{ fidtx4, fidtx4 }, // IDTX
{ daala_fdct4, fidtx4 }, // V_DCT
{ fidtx4, daala_fdct4 }, // H_DCT
{ fadst4, fidtx4 }, // V_ADST
{ fidtx4, fadst4 }, // H_ADST
{ fadst4, fidtx4 }, // V_FLIPADST
{ fidtx4, fadst4 }, // H_FLIPADST
#endif
#else
{ fdct4, fdct4 }, // DCT_DCT
{ fadst4, fdct4 }, // ADST_DCT
{ fdct4, fadst4 }, // DCT_ADST
......@@ -1394,6 +1401,7 @@ void av1_fht4x4_c(const int16_t *input, tran_low_t *output, int stride,
{ fidtx4, fadst4 }, // H_ADST
{ fadst4, fidtx4 }, // V_FLIPADST
{ fidtx4, fadst4 }, // H_FLIPADST
#endif
#endif
};
const transform_2d ht = FHT[tx_type];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment