Commit 75112626 authored by Jingning Han's avatar Jingning Han

Add 2x2 adst and dct units

Change-Id: I6d3e97385a9d1c82fd3b7cbc8fcc02b3f682e955
parent beacb3ff
......@@ -58,11 +58,16 @@ static const tran_high_t cospi_29_64 = 2404;
static const tran_high_t cospi_30_64 = 1606;
static const tran_high_t cospi_31_64 = 804;
// 16384 * sqrt(2) * sin(kPi/9) * 2 / 3
// 16384 * sqrt(2) * sin(k * Pi / 9) * 2 / 3
static const tran_high_t sinpi_1_9 = 5283;
static const tran_high_t sinpi_2_9 = 9929;
static const tran_high_t sinpi_3_9 = 13377;
static const tran_high_t sinpi_4_9 = 15212;
#if CONFIG_CB4X4
// 16384 * sqrt(2/5) * 2 * sin(k * Pi / 5)
static const tran_high_t sinpi_1_5 = 12181;
static const tran_high_t sinpi_2_5 = 19710;
#endif
// 16384 * sqrt(2)
static const tran_high_t Sqrt2 = 23170;
......
......@@ -242,6 +242,20 @@ void av1_idct8x8_1_add_c(const tran_low_t *input, uint8_t *dest, int stride) {
}
}
#if CONFIG_CB4X4
void av1_iadst2_c(const tran_low_t *input, tran_low_t *output) {
tran_high_t s0, s1;
const tran_low_t x0 = input[0];
const tran_low_t x1 = input[1];
s0 = sinpi_1_5 * x0 + sinpi_2_5 * x1;
s1 = sinpi_2_5 * x0 - sinpi_1_5 * x1;
output[0] = WRAPLOW(dct_const_round_shift(s0), 8);
output[1] = WRAPLOW(dct_const_round_shift(s1), 8);
}
#endif
void av1_iadst4_c(const tran_low_t *input, tran_low_t *output) {
tran_high_t s0, s1, s2, s3, s4, s5, s6, s7;
......
......@@ -38,6 +38,20 @@ static INLINE void range_check(const tran_low_t *input, const int size,
#endif
}
#if CONFIG_CB4X4
static void fdct2(const tran_low_t *input, tran_low_t *output) {
tran_high_t s0, s1;
const tran_low_t x0 = input[0];
const tran_low_t x1 = input[1];
s0 = (tran_high_t)x0 + x1;
s1 = (tran_high_t)x0 - x1;
output[0] = (tran_low_t)s0;
output[1] = (tran_low_t)s1;
}
#endif
static void fdct4(const tran_low_t *input, tran_low_t *output) {
tran_high_t temp;
tran_low_t step[4];
......@@ -694,6 +708,22 @@ static void fdct32(const tran_low_t *input, tran_low_t *output) {
}
#endif // CONFIG_EXT_TX
#if CONFIG_CB4X4
static void fadst2(const tran_low_t *input, tran_low_t *output) {
tran_high_t s0, s1;
tran_low_t x0, x1;
x0 = input[0];
x1 = input[1];
s0 = sinpi_1_5 * x0 + sinpi_2_5 * x1;
s1 = sinpi_2_5 * x0 - sinpi_1_5 * x1;
output[0] = (tran_low_t)fdct_round_shift(s0);
output[1] = (tran_low_t)fdct_round_shift(s1);
}
#endif
static void fadst4(const tran_low_t *input, tran_low_t *output) {
tran_high_t x0, x1, x2, x3;
tran_high_t s0, s1, s2, s3, s4, s5, s6, s7;
......@@ -1101,6 +1131,12 @@ static void maybe_flip_input(const int16_t **src, int *src_stride, int l,
}
#endif // CONFIG_EXT_TX
#if CONFIG_CB4X4
static const transform_2d FHT_2[] = {
{ fdct2, fdct2 }, { fadst2, fdct2 }, { fdct2, fadst2 }, { fadst2, fadst2 },
};
#endif
static const transform_2d FHT_4[] = {
{ fdct4, fdct4 }, // DCT_DCT = 0
{ fadst4, fdct4 }, // ADST_DCT = 1
......
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