Commit d0e23b40 authored by Sebastien Alaiwan's avatar Sebastien Alaiwan Committed by Yaowu Xu

Merge dct_const_round_shift functions.

Change-Id: I73e3eec0b8fd17c3f9b9f52afc9fac43f3043028
parent 3aec8d6c
This diff is collapsed.
......@@ -59,10 +59,6 @@ static INLINE tran_high_t highbd_check_range(tran_high_t input, int bd) {
return input;
}
static INLINE tran_high_t highbd_dct_const_round_shift(tran_high_t input) {
tran_high_t rv = ROUND_POWER_OF_TWO(input, DCT_CONST_BITS);
return rv;
}
#endif // CONFIG_AOM_HIGHBITDEPTH
#if CONFIG_EMULATE_HARDWARE
......
......@@ -121,8 +121,7 @@ static void highbd_iidtx4_c(const tran_low_t *input, tran_low_t *output,
int bd) {
int i;
for (i = 0; i < 4; ++i)
output[i] =
HIGHBD_WRAPLOW(highbd_dct_const_round_shift(input[i] * Sqrt2), bd);
output[i] = HIGHBD_WRAPLOW(dct_const_round_shift(input[i] * Sqrt2), bd);
}
static void highbd_iidtx8_c(const tran_low_t *input, tran_low_t *output,
......@@ -136,8 +135,7 @@ static void highbd_iidtx16_c(const tran_low_t *input, tran_low_t *output,
int bd) {
int i;
for (i = 0; i < 16; ++i)
output[i] =
HIGHBD_WRAPLOW(highbd_dct_const_round_shift(input[i] * 2 * Sqrt2), bd);
output[i] = HIGHBD_WRAPLOW(dct_const_round_shift(input[i] * 2 * Sqrt2), bd);
}
static void highbd_iidtx32_c(const tran_low_t *input, tran_low_t *output,
......@@ -154,8 +152,7 @@ static void highbd_ihalfright32_c(const tran_low_t *input, tran_low_t *output,
tran_low_t inputhalf[16];
// Multiply input by sqrt(2)
for (i = 0; i < 16; ++i) {
inputhalf[i] =
HIGHBD_WRAPLOW(highbd_dct_const_round_shift(input[i] * Sqrt2), bd);
inputhalf[i] = HIGHBD_WRAPLOW(dct_const_round_shift(input[i] * Sqrt2), bd);
}
for (i = 0; i < 16; ++i) {
output[i] = input[16 + i] * 4;
......@@ -170,8 +167,7 @@ static void highbd_iidtx64_c(const tran_low_t *input, tran_low_t *output,
int bd) {
int i;
for (i = 0; i < 64; ++i)
output[i] =
HIGHBD_WRAPLOW(highbd_dct_const_round_shift(input[i] * 4 * Sqrt2), bd);
output[i] = HIGHBD_WRAPLOW(dct_const_round_shift(input[i] * 4 * Sqrt2), bd);
}
#endif // CONFIG_TX64X64
#endif // CONFIG_EXT_TX
......@@ -184,12 +180,11 @@ static void highbd_ihalfright64_c(const tran_low_t *input, tran_low_t *output,
tran_low_t inputhalf[32];
// Multiply input by sqrt(2)
for (i = 0; i < 32; ++i) {
inputhalf[i] =
HIGHBD_WRAPLOW(highbd_dct_const_round_shift(input[i] * Sqrt2), bd);
inputhalf[i] = HIGHBD_WRAPLOW(dct_const_round_shift(input[i] * Sqrt2), bd);
}
for (i = 0; i < 32; ++i) {
output[i] = HIGHBD_WRAPLOW(
highbd_dct_const_round_shift(input[32 + i] * 4 * Sqrt2), bd);
output[i] =
HIGHBD_WRAPLOW(dct_const_round_shift(input[32 + i] * 4 * Sqrt2), bd);
}
aom_highbd_idct32_c(inputhalf, output + 32, bd);
// Note overall scaling factor is 4 * sqrt(2) times orthogonal
......@@ -1620,8 +1615,7 @@ void av1_highbd_iht4x8_32_add_c(const tran_low_t *input, uint8_t *dest8,
for (i = 0; i < n2; ++i) {
HIGH_IHT_4x8[tx_type].rows(input, outtmp, bd);
for (j = 0; j < n; ++j) {
out[j][i] =
HIGHBD_WRAPLOW(highbd_dct_const_round_shift(outtmp[j] * Sqrt2), bd);
out[j][i] = HIGHBD_WRAPLOW(dct_const_round_shift(outtmp[j] * Sqrt2), bd);
}
input += n;
}
......@@ -1682,8 +1676,7 @@ void av1_highbd_iht8x4_32_add_c(const tran_low_t *input, uint8_t *dest8,
for (i = 0; i < n; ++i) {
HIGH_IHT_8x4[tx_type].rows(input, outtmp, bd);
for (j = 0; j < n2; ++j) {
out[j][i] =
HIGHBD_WRAPLOW(highbd_dct_const_round_shift(outtmp[j] * Sqrt2), bd);
out[j][i] = HIGHBD_WRAPLOW(dct_const_round_shift(outtmp[j] * Sqrt2), bd);
}
input += n2;
}
......@@ -1860,8 +1853,7 @@ void av1_highbd_iht8x16_128_add_c(const tran_low_t *input, uint8_t *dest8,
for (i = 0; i < n2; ++i) {
HIGH_IHT_8x16[tx_type].rows(input, outtmp, bd);
for (j = 0; j < n; ++j)
out[j][i] =
HIGHBD_WRAPLOW(highbd_dct_const_round_shift(outtmp[j] * Sqrt2), bd);
out[j][i] = HIGHBD_WRAPLOW(dct_const_round_shift(outtmp[j] * Sqrt2), bd);
input += n;
}
......@@ -1921,8 +1913,7 @@ void av1_highbd_iht16x8_128_add_c(const tran_low_t *input, uint8_t *dest8,
for (i = 0; i < n; ++i) {
HIGH_IHT_16x8[tx_type].rows(input, outtmp, bd);
for (j = 0; j < n2; ++j)
out[j][i] =
HIGHBD_WRAPLOW(highbd_dct_const_round_shift(outtmp[j] * Sqrt2), bd);
out[j][i] = HIGHBD_WRAPLOW(dct_const_round_shift(outtmp[j] * Sqrt2), bd);
input += n2;
}
......@@ -2096,8 +2087,7 @@ void av1_highbd_iht16x32_512_add_c(const tran_low_t *input, uint8_t *dest8,
for (i = 0; i < n2; ++i) {
HIGH_IHT_16x32[tx_type].rows(input, outtmp, bd);
for (j = 0; j < n; ++j)
out[j][i] =
HIGHBD_WRAPLOW(highbd_dct_const_round_shift(outtmp[j] * Sqrt2), bd);
out[j][i] = HIGHBD_WRAPLOW(dct_const_round_shift(outtmp[j] * Sqrt2), bd);
input += n;
}
......@@ -2157,8 +2147,7 @@ void av1_highbd_iht32x16_512_add_c(const tran_low_t *input, uint8_t *dest8,
for (i = 0; i < n; ++i) {
HIGH_IHT_32x16[tx_type].rows(input, outtmp, bd);
for (j = 0; j < n2; ++j)
out[j][i] =
HIGHBD_WRAPLOW(highbd_dct_const_round_shift(outtmp[j] * Sqrt2), bd);
out[j][i] = HIGHBD_WRAPLOW(dct_const_round_shift(outtmp[j] * Sqrt2), bd);
input += n2;
}
......
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