diff --git a/configure b/configure index f02213fa4..2219539a6 100755 --- a/configure +++ b/configure @@ -246,9 +246,6 @@ EXPERIMENT_LIST=" cnvcontext enable_6tap abovesprefmv - intht - intht4x4 - intht16x16 " CONFIG_LIST=" external_build diff --git a/vp9/common/vp9_idct.h b/vp9/common/vp9_idct.h index ac9574847..430cec083 100644 --- a/vp9/common/vp9_idct.h +++ b/vp9/common/vp9_idct.h @@ -50,13 +50,11 @@ static const int cospi_29_64 = 2404; static const int cospi_30_64 = 1606; static const int cospi_31_64 = 804; -#if CONFIG_INTHT4X4 // 16384 * sqrt(2) * sin(kPi/9) * 2 / 3 static const int sinpi_1_9 = 5283; static const int sinpi_2_9 = 9929; static const int sinpi_3_9 = 13377; static const int sinpi_4_9 = 15212; -#endif static INLINE int dct_const_round_shift(int input) { int rv = (input + DCT_CONST_ROUNDING) >> DCT_CONST_BITS; diff --git a/vp9/common/vp9_idctllm.c b/vp9/common/vp9_idctllm.c index f8ac28819..36857bc4a 100644 --- a/vp9/common/vp9_idctllm.c +++ b/vp9/common/vp9_idctllm.c @@ -30,274 +30,6 @@ #include "vp9/common/vp9_common.h" #include "vp9/common/vp9_idct.h" - - -static const int16_t idct_i4[16] = { - 8192, 10703, 8192, 4433, - 8192, 4433, -8192, -10703, - 8192, -4433, -8192, 10703, - 8192, -10703, 8192, -4433 -}; - -static const int16_t iadst_i4[16] = { - 3736, 9459, 10757, 7021, - 7021, 9459, -3736, -10757, - 9459, 0, -9459, 9459, - 10757, -9459, 7021, -3736 -}; - -static const int16_t idct_i8[64] = { - 5793, 8035, 7568, 6811, - 5793, 4551, 3135, 1598, - 5793, 6811, 3135, -1598, - -5793, -8035, -7568, -4551, - 5793, 4551, -3135, -8035, - -5793, 1598, 7568, 6811, - 5793, 1598, -7568, -4551, - 5793, 6811, -3135, -8035, - 5793, -1598, -7568, 4551, - 5793, -6811, -3135, 8035, - 5793, -4551, -3135, 8035, - -5793, -1598, 7568, -6811, - 5793, -6811, 3135, 1598, - -5793, 8035, -7568, 4551, - 5793, -8035, 7568, -6811, - 5793, -4551, 3135, -1598 -}; - -static const int16_t iadst_i8[64] = { - 1460, 4184, 6342, 7644, - 7914, 7114, 5354, 2871, - 2871, 7114, 7644, 4184, - -1460, -6342, -7914, -5354, - 4184, 7914, 2871, -5354, - -7644, -1460, 6342, 7114, - 5354, 6342, -4184, -7114, - 2871, 7644, -1460, -7914, - 6342, 2871, -7914, 1460, - 7114, -5354, -4184, 7644, - 7114, -1460, -5354, 7914, - -4184, -2871, 7644, -6342, - 7644, -5354, 1460, 2871, - -6342, 7914, -7114, 4184, - 7914, -7644, 7114, -6342, - 5354, -4184, 2871, -1460 -}; - - - -static const int16_t idct_i16[256] = { - 4096, 5765, 5681, 5543, 5352, 5109, 4816, 4478, - 4096, 3675, 3218, 2731, 2217, 1682, 1130, 568, - 4096, 5543, 4816, 3675, 2217, 568, -1130, -2731, - -4096, -5109, -5681, -5765, -5352, -4478, -3218, -1682, - 4096, 5109, 3218, 568, -2217, -4478, -5681, -5543, - -4096, -1682, 1130, 3675, 5352, 5765, 4816, 2731, - 4096, 4478, 1130, -2731, -5352, -5543, -3218, 568, - 4096, 5765, 4816, 1682, -2217, -5109, -5681, -3675, - 4096, 3675, -1130, -5109, -5352, -1682, 3218, 5765, - 4096, -568, -4816, -5543, -2217, 2731, 5681, 4478, - 4096, 2731, -3218, -5765, -2217, 3675, 5681, 1682, - -4096, -5543, -1130, 4478, 5352, 568, -4816, -5109, - 4096, 1682, -4816, -4478, 2217, 5765, 1130, -5109, - -4096, 2731, 5681, 568, -5352, -3675, 3218, 5543, - 4096, 568, -5681, -1682, 5352, 2731, -4816, -3675, - 4096, 4478, -3218, -5109, 2217, 5543, -1130, -5765, - 4096, -568, -5681, 1682, 5352, -2731, -4816, 3675, - 4096, -4478, -3218, 5109, 2217, -5543, -1130, 5765, - 4096, -1682, -4816, 4478, 2217, -5765, 1130, 5109, - -4096, -2731, 5681, -568, -5352, 3675, 3218, -5543, - 4096, -2731, -3218, 5765, -2217, -3675, 5681, -1682, - -4096, 5543, -1130, -4478, 5352, -568, -4816, 5109, - 4096, -3675, -1130, 5109, -5352, 1682, 3218, -5765, - 4096, 568, -4816, 5543, -2217, -2731, 5681, -4478, - 4096, -4478, 1130, 2731, -5352, 5543, -3218, -568, - 4096, -5765, 4816, -1682, -2217, 5109, -5681, 3675, - 4096, -5109, 3218, -568, -2217, 4478, -5681, 5543, - -4096, 1682, 1130, -3675, 5352, -5765, 4816, -2731, - 4096, -5543, 4816, -3675, 2217, -568, -1130, 2731, - -4096, 5109, -5681, 5765, -5352, 4478, -3218, 1682, - 4096, -5765, 5681, -5543, 5352, -5109, 4816, -4478, - 4096, -3675, 3218, -2731, 2217, -1682, 1130, -568 -}; - -#if CONFIG_INTHT -static const int16_t iadst_i16[256] = { - 284, 850, 1407, 1951, 2476, 2977, 3450, 3889, - 4291, 4652, 4967, 5235, 5453, 5618, 5729, 5784, - 850, 2476, 3889, 4967, 5618, 5784, 5453, 4652, - 3450, 1951, 284, -1407, -2977, -4291, -5235, -5729, - 1407, 3889, 5453, 5729, 4652, 2476, -284, -2977, - -4967, -5784, -5235, -3450, -850, 1951, 4291, 5618, - 1951, 4967, 5729, 3889, 284, -3450, -5618, -5235, - -2476, 1407, 4652, 5784, 4291, 850, -2977, -5453, - 2476, 5618, 4652, 284, -4291, -5729, -2977, 1951, - 5453, 4967, 850, -3889, -5784, -3450, 1407, 5235, - 2977, 5784, 2476, -3450, -5729, -1951, 3889, 5618, - 1407, -4291, -5453, -850, 4652, 5235, 284, -4967, - 3450, 5453, -284, -5618, -2977, 3889, 5235, -850, - -5729, -2476, 4291, 4967, -1407, -5784, -1951, 4652, - 3889, 4652, -2977, -5235, 1951, 5618, -850, -5784, - -284, 5729, 1407, -5453, -2476, 4967, 3450, -4291, - 4291, 3450, -4967, -2476, 5453, 1407, -5729, -284, - 5784, -850, -5618, 1951, 5235, -2977, -4652, 3889, - 4652, 1951, -5784, 1407, 4967, -4291, -2476, 5729, - -850, -5235, 3889, 2977, -5618, 284, 5453, -3450, - 4967, 284, -5235, 4652, 850, -5453, 4291, 1407, - -5618, 3889, 1951, -5729, 3450, 2476, -5784, 2977, - 5235, -1407, -3450, 5784, -3889, -850, 4967, -5453, - 1951, 2977, -5729, 4291, 284, -4652, 5618, -2476, - 5453, -2977, -850, 4291, -5784, 4652, -1407, -2476, - 5235, -5618, 3450, 284, -3889, 5729, -4967, 1951, - 5618, -4291, 1951, 850, -3450, 5235, -5784, 4967, - -2977, 284, 2476, -4652, 5729, -5453, 3889, -1407, - 5729, -5235, 4291, -2977, 1407, 284, -1951, 3450, - -4652, 5453, -5784, 5618, -4967, 3889, -2476, 850, - 5784, -5729, 5618, -5453, 5235, -4967, 4652, -4291, - 3889, -3450, 2977, -2476, 1951, -1407, 850, -284 -}; -#else -static const int16_t iadst_i16[256] = { - 542, 1607, 2614, 3526, 4311, 4940, 5390, 5646, - 5698, 5543, 5189, 4646, 3936, 3084, 2120, 1080, - 1080, 3084, 4646, 5543, 5646, 4940, 3526, 1607, - -542, -2614, -4311, -5390, -5698, -5189, -3936, -2120, - 1607, 4311, 5646, 5189, 3084, 0, -3084, -5189, - -5646, -4311, -1607, 1607, 4311, 5646, 5189, 3084, - 2120, 5189, 5390, 2614, -1607, -4940, -5543, -3084, - 1080, 4646, 5646, 3526, -542, -4311, -5698, -3936, - 2614, 5646, 3936, -1080, -5189, -4940, -542, 4311, - 5543, 2120, -3084, -5698, -3526, 1607, 5390, 4646, - 3084, 5646, 1607, -4311, -5189, 0, 5189, 4311, - -1607, -5646, -3084, 3084, 5646, 1607, -4311, -5189, - 3526, 5189, -1080, -5698, -1607, 4940, 3936, -3084, - -5390, 542, 5646, 2120, -4646, -4311, 2614, 5543, - 3936, 4311, -3526, -4646, 3084, 4940, -2614, -5189, - 2120, 5390, -1607, -5543, 1080, 5646, -542, -5698, - 4311, 3084, -5189, -1607, 5646, 0, -5646, 1607, - 5189, -3084, -4311, 4311, 3084, -5189, -1607, 5646, - 4646, 1607, -5698, 2120, 4311, -4940, -1080, 5646, - -2614, -3936, 5189, 542, -5543, 3084, 3526, -5390, - 4940, 0, -4940, 4940, 0, -4940, 4940, 0, - -4940, 4940, 0, -4940, 4940, 0, -4940, 4940, - 5189, -1607, -3084, 5646, -4311, 0, 4311, -5646, - 3084, 1607, -5189, 5189, -1607, -3084, 5646, -4311, - 5390, -3084, -542, 3936, -5646, 4940, -2120, -1607, - 4646, -5698, 4311, -1080, -2614, 5189, -5543, 3526, - 5543, -4311, 2120, 542, -3084, 4940, -5698, 5189, - -3526, 1080, 1607, -3936, 5390, -5646, 4646, -2614, - 5646, -5189, 4311, -3084, 1607, 0, -1607, 3084, - -4311, 5189, -5646, 5646, -5189, 4311, -3084, 1607, - 5698, -5646, 5543, -5390, 5189, -4940, 4646, -4311, - 3936, -3526, 3084, -2614, 2120, -1607, 1080, -542 -}; -#endif - -/* Converted the transforms to integer form. */ -#define HORIZONTAL_SHIFT 14 // 16 -#define HORIZONTAL_ROUNDING ((1 << (HORIZONTAL_SHIFT - 1)) - 1) -#define VERTICAL_SHIFT 17 // 15 -#define VERTICAL_ROUNDING ((1 << (VERTICAL_SHIFT - 1)) - 1) -void vp9_ihtllm_c(const int16_t *input, int16_t *output, int pitch, - TX_TYPE tx_type, int tx_dim, uint16_t eobs) { - int i, j, k; - int nz_dim; - int16_t imbuf[256]; - - const int16_t *ip = input; - int16_t *op = output; - int16_t *im = &imbuf[0]; - - /* pointers to vertical and horizontal transforms. */ - const int16_t *ptv = NULL, *pth = NULL; - int shortpitch = pitch >> 1; - - switch (tx_type) { - case ADST_ADST : - ptv = pth = (tx_dim == 4) ? &iadst_i4[0] - : ((tx_dim == 8) ? &iadst_i8[0] - : &iadst_i16[0]); - break; - case ADST_DCT : - ptv = (tx_dim == 4) ? &iadst_i4[0] - : ((tx_dim == 8) ? &iadst_i8[0] : &iadst_i16[0]); - pth = (tx_dim == 4) ? &idct_i4[0] - : ((tx_dim == 8) ? &idct_i8[0] : &idct_i16[0]); - break; - case DCT_ADST : - ptv = (tx_dim == 4) ? &idct_i4[0] - : ((tx_dim == 8) ? &idct_i8[0] : &idct_i16[0]); - pth = (tx_dim == 4) ? &iadst_i4[0] - : ((tx_dim == 8) ? &iadst_i8[0] : &iadst_i16[0]); - break; - case DCT_DCT : - ptv = pth = (tx_dim == 4) ? &idct_i4[0] - : ((tx_dim == 8) ? &idct_i8[0] - : &idct_i16[0]); - break; - default: - assert(0); - break; - } - - nz_dim = tx_dim; - if(tx_dim > 4) { - if(eobs < 36) { - vpx_memset(im, 0, 512); - nz_dim = 8; - if(eobs < 3) { - nz_dim = 2; - } else if(eobs < 10) { - nz_dim = 4; - } - } - } - - /* 2-D inverse transform X = M1*Z*Transposed_M2 is calculated in 2 steps - * from right to left: - * 1. horizontal transform: Y= Z*Transposed_M2 - * 2. vertical transform: X = M1*Y - * In SIMD, doing this way could eliminate the transpose needed if it is - * calculated from left to right. - */ - /* Horizontal transformation */ - for (j = 0; j < tx_dim; j++) { - for (i = 0; i < nz_dim; i++) { - int temp = 0; - - for (k = 0; k < nz_dim; k++) { - temp += ip[k] * pth[k]; - } - - /* Calculate im and store it in its transposed position. */ - im[i] = (int16_t)((temp + HORIZONTAL_ROUNDING) >> HORIZONTAL_SHIFT); - ip += tx_dim; - } - im += tx_dim; - pth += tx_dim; - ip = input; - } - - /* Vertical transformation */ - im = &imbuf[0]; - - for (i = 0; i < tx_dim; i++) { - for (j = 0; j < tx_dim; j++) { - int temp = 0; - - for (k = 0; k < nz_dim; k++) { - temp += ptv[k] * im[k]; - } - - op[j] = (int16_t)((temp + VERTICAL_ROUNDING) >> VERTICAL_SHIFT); - im += tx_dim; - } - im = &imbuf[0]; - ptv += tx_dim; - op += shortpitch; - } -} - void vp9_short_inv_walsh4x4_x8_c(int16_t *input, int16_t *output, int pitch) { int i; int a1, b1, c1, d1; @@ -534,7 +266,6 @@ void vp9_short_idct8x8_c(int16_t *input, int16_t *output, int pitch) { } } -#if CONFIG_INTHT4X4 static void iadst4_1d(int16_t *input, int16_t *output) { int x0, x1, x2, x3; int s0, s1, s2, s3, s4, s5, s6, s7; @@ -626,9 +357,7 @@ void vp9_short_iht4x4_c(int16_t *input, int16_t *output, output[j * short_pitch + i] = (temp_out[j] + 8) >> 4; } } -#endif -#if CONFIG_INTHT static void iadst8_1d(int16_t *input, int16_t *output) { int x0, x1, x2, x3, x4, x5, x6, x7; int s0, s1, s2, s3, s4, s5, s6, s7; @@ -757,8 +486,6 @@ void vp9_short_iht8x8_c(int16_t *input, int16_t *output, output[j * short_pitch + i] = (temp_out[j] + 16) >> 5; } } -#endif - void vp9_short_idct10_8x8_c(int16_t *input, int16_t *output, int pitch) { int16_t out[8 * 8]; @@ -980,7 +707,6 @@ void vp9_short_idct16x16_c(int16_t *input, int16_t *output, int pitch) { } } -#if CONFIG_INTHT16X16 void iadst16_1d(int16_t *input, int16_t *output) { int x0, x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15; int s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, s11, s12, s13, s14, s15; @@ -1201,9 +927,6 @@ void vp9_short_iht16x16_c(int16_t *input, int16_t *output, output[j * 16 + i] = (temp_out[j] + 32) >> 6; } } -#endif - - void vp9_short_idct10_16x16_c(int16_t *input, int16_t *output, int pitch) { int16_t out[16 * 16]; diff --git a/vp9/common/vp9_invtrans.c b/vp9/common/vp9_invtrans.c index 25b59cc5d..c6b961894 100644 --- a/vp9/common/vp9_invtrans.c +++ b/vp9/common/vp9_invtrans.c @@ -25,13 +25,8 @@ void vp9_inverse_transform_mby_4x4(MACROBLOCKD *xd) { for (i = 0; i < 16; i++) { TX_TYPE tx_type = get_tx_type_4x4(xd, &xd->block[i]); if (tx_type != DCT_DCT) { -#if CONFIG_INTHT4X4 vp9_short_iht4x4(xd->block[i].dqcoeff, xd->block[i].diff, 32, tx_type); -#else - vp9_ihtllm(xd->block[i].dqcoeff, xd->block[i].diff, 32, - tx_type, 4, xd->block[i].eob); -#endif } else { vp9_inverse_transform_b_4x4(xd, i, 32); } @@ -63,13 +58,8 @@ void vp9_inverse_transform_mby_8x8(MACROBLOCKD *xd) { for (i = 0; i < 9; i += 8) { TX_TYPE tx_type = get_tx_type_8x8(xd, &xd->block[i]); if (tx_type != DCT_DCT) { -#if CONFIG_INTHT vp9_short_iht8x8(xd->block[i].dqcoeff, xd->block[i].diff, 32, tx_type); -#else - vp9_ihtllm(xd->block[i].dqcoeff, xd->block[i].diff, 32, tx_type, 8, - xd->block[i].eob); -#endif } else { vp9_inverse_transform_b_8x8(&blockd[i].dqcoeff[0], &blockd[i].diff[0], 32); @@ -78,13 +68,8 @@ void vp9_inverse_transform_mby_8x8(MACROBLOCKD *xd) { for (i = 2; i < 11; i += 8) { TX_TYPE tx_type = get_tx_type_8x8(xd, &xd->block[i]); if (tx_type != DCT_DCT) { -#if CONFIG_INTHT vp9_short_iht8x8(xd->block[i + 2].dqcoeff, xd->block[i].diff, 32, tx_type); -#else - vp9_ihtllm(xd->block[i + 2].dqcoeff, xd->block[i].diff, 32, tx_type, 8, - xd->block[i + 2].eob); -#endif } else { vp9_inverse_transform_b_8x8(&blockd[i + 2].dqcoeff[0], &blockd[i].diff[0], 32); @@ -116,11 +101,7 @@ void vp9_inverse_transform_mby_16x16(MACROBLOCKD *xd) { BLOCKD *bd = &xd->block[0]; TX_TYPE tx_type = get_tx_type_16x16(xd, bd); if (tx_type != DCT_DCT) { -#if CONFIG_INTHT16X16 vp9_short_iht16x16(bd->dqcoeff, bd->diff, 32, tx_type); -#else - vp9_ihtllm(bd->dqcoeff, bd->diff, 32, tx_type, 16, bd->eob); -#endif } else { vp9_inverse_transform_b_16x16(&xd->block[0].dqcoeff[0], &xd->block[0].diff[0], 32); diff --git a/vp9/common/vp9_rtcd_defs.sh b/vp9/common/vp9_rtcd_defs.sh index 5a7484d81..700af7fa7 100644 --- a/vp9/common/vp9_rtcd_defs.sh +++ b/vp9/common/vp9_rtcd_defs.sh @@ -284,24 +284,14 @@ specialize vp9_short_idct32x32 prototype void vp9_short_idct1_32x32 "int16_t *input, int16_t *output" specialize vp9_short_idct1_32x32 -#if CONFIG_INTHT prototype void vp9_short_iht8x8 "int16_t *input, int16_t *output, int pitch, int tx_type" specialize vp9_short_iht8x8 -#endif -#if CONFIG_INTHT4X4 prototype void vp9_short_iht4x4 "int16_t *input, int16_t *output, int pitch, int tx_type" specialize vp9_short_iht4x4 -#endif -#if CONFIG_INTHT16X16 prototype void vp9_short_iht16x16 "int16_t *input, int16_t *output, int pitch, int tx_type" specialize vp9_short_iht16x16 -#endif - -prototype void vp9_ihtllm "const int16_t *input, int16_t *output, int pitch, int tx_type, int tx_dim, int eob" -specialize vp9_ihtllm - # dct and add @@ -565,23 +555,14 @@ if [ "$CONFIG_INTERNAL_STATS" = "yes" ]; then fi # fdct functions -prototype void vp9_fht "const int16_t *input, int pitch, int16_t *output, int tx_type, int tx_dim" -specialize vp9_fht - -#if CONFIG_INTHT4X4 prototype void vp9_short_fht4x4 "int16_t *InputData, int16_t *OutputData, int pitch, int tx_type" specialize vp9_short_fht4x4 -#endif -#if CONFIG_INTHT prototype void vp9_short_fht8x8 "int16_t *InputData, int16_t *OutputData, int pitch, int tx_type" specialize vp9_short_fht8x8 -#endif -#if CONFIG_INTHT16X16 prototype void vp9_short_fht16x16 "int16_t *InputData, int16_t *OutputData, int pitch, int tx_type" specialize vp9_short_fht16x16 -#endif prototype void vp9_short_fdct8x8 "int16_t *InputData, int16_t *OutputData, int pitch" specialize vp9_short_fdct8x8 diff --git a/vp9/decoder/vp9_dequantize.c b/vp9/decoder/vp9_dequantize.c index f66a57d28..7a6c12a99 100644 --- a/vp9/decoder/vp9_dequantize.c +++ b/vp9/decoder/vp9_dequantize.c @@ -68,12 +68,7 @@ void vp9_ht_dequant_idct_add_c(TX_TYPE tx_type, int16_t *input, input[i] = dq[i] * input[i]; } -#if CONFIG_INTHT4X4 vp9_short_iht4x4(input, output, 8, tx_type); -#else - vp9_ihtllm(input, output, 4 << 1, tx_type, 4, eob); -#endif - vpx_memset(input, 0, 32); add_residual(diff_ptr, pred, pitch, dest, stride, 4, 4); @@ -95,11 +90,7 @@ void vp9_ht_dequant_idct_add_8x8_c(TX_TYPE tx_type, int16_t *input, input[i] *= dq[1]; } -#if CONFIG_INTHT vp9_short_iht8x8(input, output, 16, tx_type); -#else - vp9_ihtllm(input, output, 16, tx_type, 8, eob); -#endif vpx_memset(input, 0, 128); add_residual(diff_ptr, pred, pitch, dest, stride, 8, 8); @@ -264,11 +255,7 @@ void vp9_ht_dequant_idct_add_16x16_c(TX_TYPE tx_type, int16_t *input, input[i] *= dq[1]; // inverse hybrid transform -#if CONFIG_INTHT16X16 vp9_short_iht16x16(input, output, 32, tx_type); -#else - vp9_ihtllm(input, output, 32, tx_type, 16, eob); -#endif // the idct halves ( >> 1) the pitch // vp9_short_idct16x16_c(input, output, 32); diff --git a/vp9/encoder/vp9_dct.c b/vp9/encoder/vp9_dct.c index 6894c5fee..a371eeb19 100644 --- a/vp9/encoder/vp9_dct.c +++ b/vp9/encoder/vp9_dct.c @@ -17,520 +17,6 @@ #include "vp9/common/vp9_blockd.h" #include "vp9/common/vp9_idct.h" -// TODO: these transforms can be converted into integer forms to reduce -// the complexity -static const float dct_4[16] = { - 0.500000000000000, 0.500000000000000, 0.500000000000000, 0.500000000000000, - 0.653281482438188, 0.270598050073099, -0.270598050073099, -0.653281482438188, - 0.500000000000000, -0.500000000000000, -0.500000000000000, 0.500000000000000, - 0.270598050073099, -0.653281482438188, 0.653281482438188, -0.270598050073099 -}; - -static const float adst_4[16] = { - 0.228013428883779, 0.428525073124360, 0.577350269189626, 0.656538502008139, - 0.577350269189626, 0.577350269189626, 0.000000000000000, -0.577350269189626, - 0.656538502008139, -0.228013428883779, -0.577350269189626, 0.428525073124359, - 0.428525073124360, -0.656538502008139, 0.577350269189626, -0.228013428883779 -}; - -static const float dct_8[64] = { - 0.353553390593274, 0.353553390593274, 0.353553390593274, 0.353553390593274, - 0.353553390593274, 0.353553390593274, 0.353553390593274, 0.353553390593274, - 0.490392640201615, 0.415734806151273, 0.277785116509801, 0.097545161008064, - -0.097545161008064, -0.277785116509801, -0.415734806151273, -0.490392640201615, - 0.461939766255643, 0.191341716182545, -0.191341716182545, -0.461939766255643, - -0.461939766255643, -0.191341716182545, 0.191341716182545, 0.461939766255643, - 0.415734806151273, -0.097545161008064, -0.490392640201615, -0.277785116509801, - 0.277785116509801, 0.490392640201615, 0.097545161008064, -0.415734806151273, - 0.353553390593274, -0.353553390593274, -0.353553390593274, 0.353553390593274, - 0.353553390593274, -0.353553390593274, -0.353553390593274, 0.353553390593274, - 0.277785116509801, -0.490392640201615, 0.097545161008064, 0.415734806151273, - -0.415734806151273, -0.097545161008064, 0.490392640201615, -0.277785116509801, - 0.191341716182545, -0.461939766255643, 0.461939766255643, -0.191341716182545, - -0.191341716182545, 0.461939766255643, -0.461939766255643, 0.191341716182545, - 0.097545161008064, -0.277785116509801, 0.415734806151273, -0.490392640201615, - 0.490392640201615, -0.415734806151273, 0.277785116509801, -0.097545161008064 -}; - -static const float adst_8[64] = { - 0.089131608307533, 0.175227946595735, 0.255357107325376, 0.326790388032145, - 0.387095214016349, 0.434217976756762, 0.466553967085785, 0.483002021635509, - 0.255357107325376, 0.434217976756762, 0.483002021635509, 0.387095214016349, - 0.175227946595735, -0.089131608307533, -0.326790388032145, -0.466553967085785, - 0.387095214016349, 0.466553967085785, 0.175227946595735, -0.255357107325376, - -0.483002021635509, -0.326790388032145, 0.089131608307533, 0.434217976756762, - 0.466553967085785, 0.255357107325376, -0.326790388032145, -0.434217976756762, - 0.089131608307533, 0.483002021635509, 0.175227946595735, -0.387095214016348, - 0.483002021635509, -0.089131608307533, -0.466553967085785, 0.175227946595735, - 0.434217976756762, -0.255357107325376, -0.387095214016348, 0.326790388032145, - 0.434217976756762, -0.387095214016348, -0.089131608307533, 0.466553967085786, - -0.326790388032145, -0.175227946595735, 0.483002021635509, -0.255357107325375, - 0.326790388032145, -0.483002021635509, 0.387095214016349, -0.089131608307534, - -0.255357107325377, 0.466553967085785, -0.434217976756762, 0.175227946595736, - 0.175227946595735, -0.326790388032145, 0.434217976756762, -0.483002021635509, - 0.466553967085785, -0.387095214016348, 0.255357107325376, -0.089131608307532 -}; - -/* Converted the transforms to integers. */ -static const int16_t dct_i4[16] = { - 16384, 16384, 16384, 16384, - 21407, 8867, -8867, -21407, - 16384, -16384, -16384, 16384, - 8867, -21407, 21407, -8867 -}; - -static const int16_t adst_i4[16] = { - 7472, 14042, 18919, 21513, - 18919, 18919, 0, -18919, - 21513, -7472, -18919, 14042, - 14042, -21513, 18919, -7472 -}; - -static const int16_t dct_i8[64] = { - 11585, 11585, 11585, 11585, - 11585, 11585, 11585, 11585, - 16069, 13623, 9102, 3196, - -3196, -9102, -13623, -16069, - 15137, 6270, -6270, -15137, - -15137, -6270, 6270, 15137, - 13623, -3196, -16069, -9102, - 9102, 16069, 3196, -13623, - 11585, -11585, -11585, 11585, - 11585, -11585, -11585, 11585, - 9102, -16069, 3196, 13623, - -13623, -3196, 16069, -9102, - 6270, -15137, 15137, -6270, - -6270, 15137, -15137, 6270, - 3196, -9102, 13623, -16069, - 16069, -13623, 9102, -3196 -}; - -#if CONFIG_INTHT -static const int16_t adst_i8[64] = { - 1606, 4756, 7723, 10394, - 12665, 14449, 15678, 16305, - 4756, 12665, 16305, 14449, - 7723, -1606, -10394, -15678, - 7723, 16305, 10394, -4756, - -15678, -12665, 1606, 14449, - 10394, 14449, -4756, -16305, - -1606, 15678, 7723, -12665, - 12665, 7723, -15678, -1606, - 16305, -4756, -14449, 10394, - 14449, -1606, -12665, 15678, - -4756, -10394, 16305, -7723, - 15678, -10394, 1606, 7723, - -14449, 16305, -12665, 4756, - 16305, -15678, 14449, -12665, - 10394, -7723, 4756, -1606 -}; -#else -static const int16_t adst_i8[64] = { - 2921, 5742, 8368, 10708, - 12684, 14228, 15288, 15827, - 8368, 14228, 15827, 12684, - 5742, -2921, -10708, -15288, - 12684, 15288, 5742, -8368, - -15827, -10708, 2921, 14228, - 15288, 8368, -10708, -14228, - 2921, 15827, 5742, -12684, - 15827, -2921, -15288, 5742, - 14228, -8368, -12684, 10708, - 14228, -12684, -2921, 15288, - -10708, -5742, 15827, -8368, - 10708, -15827, 12684, -2921, - -8368, 15288, -14228, 5742, - 5742, -10708, 14228, -15827, - 15288, -12684, 8368, -2921 -}; -#endif - -static const float dct_16[256] = { - 0.250000, 0.250000, 0.250000, 0.250000, 0.250000, 0.250000, 0.250000, 0.250000, - 0.250000, 0.250000, 0.250000, 0.250000, 0.250000, 0.250000, 0.250000, 0.250000, - 0.351851, 0.338330, 0.311806, 0.273300, 0.224292, 0.166664, 0.102631, 0.034654, - -0.034654, -0.102631, -0.166664, -0.224292, -0.273300, -0.311806, -0.338330, -0.351851, - 0.346760, 0.293969, 0.196424, 0.068975, -0.068975, -0.196424, -0.293969, -0.346760, - -0.346760, -0.293969, -0.196424, -0.068975, 0.068975, 0.196424, 0.293969, 0.346760, - 0.338330, 0.224292, 0.034654, -0.166664, -0.311806, -0.351851, -0.273300, -0.102631, - 0.102631, 0.273300, 0.351851, 0.311806, 0.166664, -0.034654, -0.224292, -0.338330, - 0.326641, 0.135299, -0.135299, -0.326641, -0.326641, -0.135299, 0.135299, 0.326641, - 0.326641, 0.135299, -0.135299, -0.326641, -0.326641, -0.135299, 0.135299, 0.326641, - 0.311806, 0.034654, -0.273300, -0.338330, -0.102631, 0.224292, 0.351851, 0.166664, - -0.166664, -0.351851, -0.224292, 0.102631, 0.338330, 0.273300, -0.034654, -0.311806, - 0.293969, -0.068975, -0.346760, -0.196424, 0.196424, 0.346760, 0.068975, -0.293969, - -0.293969, 0.068975, 0.346760, 0.196424, -0.196424, -0.346760, -0.068975, 0.293969, - 0.273300, -0.166664, -0.338330, 0.034654, 0.351851, 0.102631, -0.311806, -0.224292, - 0.224292, 0.311806, -0.102631, -0.351851, -0.034654, 0.338330, 0.166664, -0.273300, - 0.250000, -0.250000, -0.250000, 0.250000, 0.250000, -0.250000, -0.250000, 0.250000, - 0.250000, -0.250000, -0.250000, 0.250000, 0.250000, -0.250000, -0.250000, 0.250000, - 0.224292, -0.311806, -0.102631, 0.351851, -0.034654, -0.338330, 0.166664, 0.273300, - -0.273300, -0.166664, 0.338330, 0.034654, -0.351851, 0.102631, 0.311806, -0.224292, - 0.196424, -0.346760, 0.068975, 0.293969, -0.293969, -0.068975, 0.346760, -0.196424, - -0.196424, 0.346760, -0.068975, -0.293969, 0.293969, 0.068975, -0.346760, 0.196424, - 0.166664, -0.351851, 0.224292, 0.102631, -0.338330, 0.273300, 0.034654, -0.311806, - 0.311806, -0.034654, -0.273300, 0.338330, -0.102631, -0.224292, 0.351851, -0.166664, - 0.135299, -0.326641, 0.326641, -0.135299, -0.135299, 0.326641, -0.326641, 0.135299, - 0.135299, -0.326641, 0.326641, -0.135299, -0.135299, 0.326641, -0.326641, 0.135299, - 0.102631, -0.273300, 0.351851, -0.311806, 0.166664, 0.034654, -0.224292, 0.338330, - -0.338330, 0.224292, -0.034654, -0.166664, 0.311806, -0.351851, 0.273300, -0.102631, - 0.068975, -0.196424, 0.293969, -0.346760, 0.346760, -0.293969, 0.196424, -0.068975, - -0.068975, 0.196424, -0.293969, 0.346760, -0.346760, 0.293969, -0.196424, 0.068975, - 0.034654, -0.102631, 0.166664, -0.224292, 0.273300, -0.311806, 0.338330, -0.351851, - 0.351851, -0.338330, 0.311806, -0.273300, 0.224292, -0.166664, 0.102631, -0.034654 -}; - -static const float adst_16[256] = { - 0.033094, 0.065889, 0.098087, 0.129396, 0.159534, 0.188227, 0.215215, 0.240255, - 0.263118, 0.283599, 0.301511, 0.316693, 0.329007, 0.338341, 0.344612, 0.347761, - 0.098087, 0.188227, 0.263118, 0.316693, 0.344612, 0.344612, 0.316693, 0.263118, - 0.188227, 0.098087, 0.000000, -0.098087, -0.188227, -0.263118, -0.316693, -0.344612, - 0.159534, 0.283599, 0.344612, 0.329007, 0.240255, 0.098087, -0.065889, -0.215215, - -0.316693, -0.347761, -0.301511, -0.188227, -0.033094, 0.129396, 0.263118, 0.338341, - 0.215215, 0.338341, 0.316693, 0.159534, -0.065889, -0.263118, -0.347761, -0.283599, - -0.098087, 0.129396, 0.301511, 0.344612, 0.240255, 0.033094, -0.188227, -0.329007, - 0.263118, 0.344612, 0.188227, -0.098087, -0.316693, -0.316693, -0.098087, 0.188227, - 0.344612, 0.263118, 0.000000, -0.263118, -0.344612, -0.188227, 0.098087, 0.316693, - 0.301511, 0.301511, 0.000000, -0.301511, -0.301511, -0.000000, 0.301511, 0.301511, - 0.000000, -0.301511, -0.301511, -0.000000, 0.301511, 0.301511, 0.000000, -0.301511, - 0.329007, 0.215215, -0.188227, -0.338341, -0.033094, 0.316693, 0.240255, -0.159534, - -0.344612, -0.065889, 0.301511, 0.263118, -0.129396, -0.347761, -0.098087, 0.283599, - 0.344612, 0.098087, -0.316693, -0.188227, 0.263118, 0.263118, -0.188227, -0.316693, - 0.098087, 0.344612, 0.000000, -0.344612, -0.098087, 0.316693, 0.188227, -0.263118, - 0.347761, -0.033094, -0.344612, 0.065889, 0.338341, -0.098087, -0.329007, 0.129396, - 0.316693, -0.159534, -0.301511, 0.188227, 0.283599, -0.215215, -0.263118, 0.240255, - 0.338341, -0.159534, -0.263118, 0.283599, 0.129396, -0.344612, 0.033094, 0.329007, - -0.188227, -0.240255, 0.301511, 0.098087, -0.347761, 0.065889, 0.316693, -0.215215, - 0.316693, -0.263118, -0.098087, 0.344612, -0.188227, -0.188227, 0.344612, -0.098087, - -0.263118, 0.316693, 0.000000, -0.316693, 0.263118, 0.098087, -0.344612, 0.188227, - 0.283599, -0.329007, 0.098087, 0.215215, -0.347761, 0.188227, 0.129396, -0.338341, - 0.263118, 0.033094, -0.301511, 0.316693, -0.065889, -0.240255, 0.344612, -0.159534, - 0.240255, -0.347761, 0.263118, -0.033094, -0.215215, 0.344612, -0.283599, 0.065889, - 0.188227, -0.338341, 0.301511, -0.098087, -0.159534, 0.329007, -0.316693, 0.129396, - 0.188227, -0.316693, 0.344612, -0.263118, 0.098087, 0.098087, -0.263118, 0.344612, - -0.316693, 0.188227, 0.000000, -0.188227, 0.316693, -0.344612, 0.263118, -0.098087, - 0.129396, -0.240255, 0.316693, -0.347761, 0.329007, -0.263118, 0.159534, -0.033094, - -0.098087, 0.215215, -0.301511, 0.344612, -0.338341, 0.283599, -0.188227, 0.065889, - 0.065889, -0.129396, 0.188227, -0.240255, 0.283599, -0.316693, 0.338341, -0.347761, - 0.344612, -0.329007, 0.301511, -0.263118, 0.215215, -0.159534, 0.098087, -0.033094 -}; - -/* Converted the transforms to integers. */ -static const int16_t dct_i16[256] = { - 8192, 8192, 8192, 8192, 8192, 8192, 8192, 8192, - 8192, 8192, 8192, 8192, 8192, 8192, 8192, 8192, - 11529, 11086, 10217, 8955, 7350, 5461, 3363, 1136, - -1136, -3363, -5461, -7350, -8955, -10217, -11086, -11529, - 11363, 9633, 6436, 2260, -2260, -6436, -9633, -11363, - -11363, -9633, -6436, -2260, 2260, 6436, 9633, 11363, - 11086, 7350, 1136, -5461, -10217, -11529, -8955, -3363, - 3363, 8955, 11529, 10217, 5461, -1136, -7350, -11086, - 10703, 4433, -4433, -10703, -10703, -4433, 4433, 10703, - 10703, 4433, -4433, -10703, -10703, -4433, 4433, 10703, - 10217, 1136, -8955, -11086, -3363, 7350, 11529, 5461, - -5461, -11529, -7350, 3363, 11086, 8955, -1136, -10217, - 9633, -2260, -11363, -6436, 6436, 11363, 2260, -9633, - -9633, 2260, 11363, 6436, -6436, -11363, -2260, 9633, - 8955, -5461, -11086, 1136, 11529, 3363, -10217, -7350, - 7350, 10217, -3363, -11529, -1136, 11086, 5461, -8955, - 8192, -8192, -8192, 8192, 8192, -8192, -8192, 8192, - 8192, -8192, -8192, 8192, 8192, -8192, -8192, 8192, - 7350, -10217, -3363, 11529, -1136, -11086, 5461, 8955, - -8955, -5461, 11086, 1136, -11529, 3363, 10217, -7350, - 6436, -11363, 2260, 9633, -9633, -2260, 11363, -6436, - -6436, 11363, -2260, -9633, 9633, 2260, -11363, 6436, - 5461, -11529, 7350, 3363, -11086, 8955, 1136, -10217, - 10217, -1136, -8955, 11086, -3363, -7350, 11529, -5461, - 4433, -10703, 10703, -4433, -4433, 10703, -10703, 4433, - 4433, -10703, 10703, -4433, -4433, 10703, -10703, 4433, - 3363, -8955, 11529, -10217, 5461, 1136, -7350, 11086, - -11086, 7350, -1136, -5461, 10217, -11529, 8955, -3363, - 2260, -6436, 9633, -11363, 11363, -9633, 6436, -2260, - -2260, 6436, -9633, 11363, -11363, 9633, -6436, 2260, - 1136, -3363, 5461, -7350, 8955, -10217, 11086, -11529, - 11529, -11086, 10217, -8955, 7350, -5461, 3363, -1136 -}; - -#if CONFIG_INTHT -static const int16_t adst_i16[256] = { - 568, 1700, 2815, 3903, 4953, 5956, 6901, 7780, - 8584, 9305, 9937, 10473, 10908, 11238, 11459, 11571, - 1700, 4953, 7780, 9937, 11238, 11571, 10908, 9305, - 6901, 3903, 568, -2815, -5956, -8584, -10473, -11459, - 2815, 7780, 10908, 11459, 9305, 4953, -568, -5956, - -9937, -11571, -10473, -6901, -1700, 3903, 8584, 11238, - 3903, 9937, 11459, 7780, 568, -6901, -11238, -10473, - -4953, 2815, 9305, 11571, 8584, 1700, -5956, -10908, - 4953, 11238, 9305, 568, -8584, -11459, -5956, 3903, - 10908, 9937, 1700, -7780, -11571, -6901, 2815, 10473, - 5956, 11571, 4953, -6901, -11459, -3903, 7780, 11238, - 2815, -8584, -10908, -1700, 9305, 10473, 568, -9937, - 6901, 10908, -568, -11238, -5956, 7780, 10473, -1700, - -11459, -4953, 8584, 9937, -2815, -11571, -3903, 9305, - 7780, 9305, -5956, -10473, 3903, 11238, -1700, -11571, - -568, 11459, 2815, -10908, -4953, 9937, 6901, -8584, - 8584, 6901, -9937, -4953, 10908, 2815, -11459, -568, - 11571, -1700, -11238, 3903, 10473, -5956, -9305, 7780, - 9305, 3903, -11571, 2815, 9937, -8584, -4953, 11459, - -1700, -10473, 7780, 5956, -11238, 568, 10908, -6901, - 9937, 568, -10473, 9305, 1700, -10908, 8584, 2815, - -11238, 7780, 3903, -11459, 6901, 4953, -11571, 5956, - 10473, -2815, -6901, 11571, -7780, -1700, 9937, -10908, - 3903, 5956, -11459, 8584, 568, -9305, 11238, -4953, - 10908, -5956, -1700, 8584, -11571, 9305, -2815, -4953, - 10473, -11238, 6901, 568, -7780, 11459, -9937, 3903, - 11238, -8584, 3903, 1700, -6901, 10473, -11571, 9937, - -5956, 568, 4953, -9305, 11459, -10908, 7780, -2815, - 11459, -10473, 8584, -5956, 2815, 568, -3903, 6901, - -9305, 10908, -11571, 11238, -9937, 7780, -4953, 1700, - 11571, -11459, 11238, -10908, 10473, -9937, 9305, -8584, - 7780, -6901, 5956, -4953, 3903, -2815, 1700, -568 -}; -#else -static const int16_t adst_i16[256] = { - 1084, 2159, 3214, 4240, 5228, 6168, 7052, 7873, - 8622, 9293, 9880, 10377, 10781, 11087, 11292, 11395, - 3214, 6168, 8622, 10377, 11292, 11292, 10377, 8622, - 6168, 3214, 0, -3214, -6168, -8622, -10377, -11292, - 5228, 9293, 11292, 10781, 7873, 3214, -2159, -7052, - -10377, -11395, -9880, -6168, -1084, 4240, 8622, 11087, - 7052, 11087, 10377, 5228, -2159, -8622, -11395, -9293, - -3214, 4240, 9880, 11292, 7873, 1084, -6168, -10781, - 8622, 11292, 6168, -3214, -10377, -10377, -3214, 6168, - 11292, 8622, 0, -8622, -11292, -6168, 3214, 10377, - 9880, 9880, 0, -9880, -9880, 0, 9880, 9880, - 0, -9880, -9880, 0, 9880, 9880, 0, -9880, - 10781, 7052, -6168, -11087, -1084, 10377, 7873, -5228, - -11292, -2159, 9880, 8622, -4240, -11395, -3214, 9293, - 11292, 3214, -10377, -6168, 8622, 8622, -6168, -10377, - 3214, 11292, 0, -11292, -3214, 10377, 6168, -8622, - 11395, -1084, -11292, 2159, 11087, -3214, -10781, 4240, - 10377, -5228, -9880, 6168, 9293, -7052, -8622, 7873, - 11087, -5228, -8622, 9293, 4240, -11292, 1084, 10781, - -6168, -7873, 9880, 3214, -11395, 2159, 10377, -7052, - 10377, -8622, -3214, 11292, -6168, -6168, 11292, -3214, - -8622, 10377, 0, -10377, 8622, 3214, -11292, 6168, - 9293, -10781, 3214, 7052, -11395, 6168, 4240, -11087, - 8622, 1084, -9880, 10377, -2159, -7873, 11292, -5228, - 7873, -11395, 8622, -1084, -7052, 11292, -9293, 2159, - 6168, -11087, 9880, -3214, -5228, 10781, -10377, 4240, - 6168, -10377, 11292, -8622, 3214, 3214, -8622, 11292, - -10377, 6168, 0, -6168, 10377, -11292, 8622, -3214, - 4240, -7873, 10377, -11395, 10781, -8622, 5228, -1084, - -3214, 7052, -9880, 11292, -11087, 9293, -6168, 2159, - 2159, -4240, 6168, -7873, 9293, -10377, 11087, -11395, - 11292, -10781, 9880, -8622, 7052, -5228, 3214, -1084 -}; -#endif - -/* For test */ -#define TEST_INT 1 -#if TEST_INT -#define vp9_fht_int_c vp9_fht_c -#else -#define vp9_fht_float_c vp9_fht_c -#endif - -void vp9_fht_float_c(const int16_t *input, int pitch, int16_t *output, - TX_TYPE tx_type, int tx_dim) { - vp9_clear_system_state(); // Make it simd safe : __asm emms; - { - int i, j, k; - float bufa[256], bufb[256]; // buffers are for floating-point test purpose - // the implementation could be simplified in - // conjunction with integer transform - const int16_t *ip = input; - int16_t *op = output; - - float *pfa = &bufa[0]; - float *pfb = &bufb[0]; - - // pointers to vertical and horizontal transforms - const float *ptv, *pth; - - assert(tx_type != DCT_DCT); - // load and convert residual array into floating-point - for (j = 0; j < tx_dim; j++) { - for (i = 0; i < tx_dim; i++) { - pfa[i] = (float)ip[i]; - } - pfa += tx_dim; - ip += pitch / 2; - } - - // vertical transformation - pfa = &bufa[0]; - pfb = &bufb[0]; - - switch (tx_type) { - case ADST_ADST : - case ADST_DCT : - ptv = (tx_dim == 4) ? &adst_4[0] : - ((tx_dim == 8) ? &adst_8[0] : &adst_16[0]); - break; - - default : - ptv = (tx_dim == 4) ? &dct_4[0] : - ((tx_dim == 8) ? &dct_8[0] : &dct_16[0]); - break; - } - - for (j = 0; j < tx_dim; j++) { - for (i = 0; i < tx_dim; i++) { - pfb[i] = 0; - for (k = 0; k < tx_dim; k++) { - pfb[i] += ptv[k] * pfa[(k * tx_dim)]; - } - pfa += 1; - } - pfb += tx_dim; - ptv += tx_dim; - pfa = &bufa[0]; - } - - // horizontal transformation - pfa = &bufa[0]; - pfb = &bufb[0]; - - switch (tx_type) { - case ADST_ADST : - case DCT_ADST : - pth = (tx_dim == 4) ? &adst_4[0] : - ((tx_dim == 8) ? &adst_8[0] : &adst_16[0]); - break; - - default : - pth = (tx_dim == 4) ? &dct_4[0] : - ((tx_dim == 8) ? &dct_8[0] : &dct_16[0]); - break; - } - - for (j = 0; j < tx_dim; j++) { - for (i = 0; i < tx_dim; i++) { - pfa[i] = 0; - for (k = 0; k < tx_dim; k++) { - pfa[i] += pfb[k] * pth[k]; - } - pth += tx_dim; - } - - pfa += tx_dim; - pfb += tx_dim; - // pth -= tx_dim * tx_dim; - - switch (tx_type) { - case ADST_ADST : - case DCT_ADST : - pth = (tx_dim == 4) ? &adst_4[0] : - ((tx_dim == 8) ? &adst_8[0] : &adst_16[0]); - break; - - default : - pth = (tx_dim == 4) ? &dct_4[0] : - ((tx_dim == 8) ? &dct_8[0] : &dct_16[0]); - break; - } - } - - // convert to short integer format and load BLOCKD buffer - op = output; - pfa = &bufa[0]; - - for (j = 0; j < tx_dim; j++) { - for (i = 0; i < tx_dim; i++) { - op[i] = (pfa[i] > 0 ) ? (int16_t)( 8 * pfa[i] + 0.49) : - -(int16_t)(- 8 * pfa[i] + 0.49); - } - op += tx_dim; - pfa += tx_dim; - } - } - vp9_clear_system_state(); // Make it simd safe : __asm emms; -} - -/* Converted the transforms to integer form. */ -#define VERTICAL_SHIFT 11 -#define VERTICAL_ROUNDING ((1 << (VERTICAL_SHIFT - 1)) - 1) -#define HORIZONTAL_SHIFT 16 -#define HORIZONTAL_ROUNDING ((1 << (HORIZONTAL_SHIFT - 1)) - 1) -void vp9_fht_int_c(const int16_t *input, int pitch, int16_t *output, - TX_TYPE tx_type, int tx_dim) { - int i, j, k; - int16_t imbuf[256]; - - const int16_t *ip = input; - int16_t *op = output; - int16_t *im = &imbuf[0]; - - /* pointers to vertical and horizontal transforms. */ - const int16_t *ptv = NULL, *pth = NULL; - - switch (tx_type) { - case ADST_ADST : - ptv = pth = (tx_dim == 4) ? &adst_i4[0] - : ((tx_dim == 8) ? &adst_i8[0] - : &adst_i16[0]); - break; - case ADST_DCT : - ptv = (tx_dim == 4) ? &adst_i4[0] - : ((tx_dim == 8) ? &adst_i8[0] : &adst_i16[0]); - pth = (tx_dim == 4) ? &dct_i4[0] - : ((tx_dim == 8) ? &dct_i8[0] : &dct_i16[0]); - break; - case DCT_ADST : - ptv = (tx_dim == 4) ? &dct_i4[0] - : ((tx_dim == 8) ? &dct_i8[0] : &dct_i16[0]); - pth = (tx_dim == 4) ? &adst_i4[0] - : ((tx_dim == 8) ? &adst_i8[0] : &adst_i16[0]); - break; - case DCT_DCT : - ptv = pth = (tx_dim == 4) ? &dct_i4[0] - : ((tx_dim == 8) ? &dct_i8[0] : &dct_i16[0]); - break; - default: - assert(0); - break; - } - - /* vertical transformation */ - for (j = 0; j < tx_dim; j++) { - for (i = 0; i < tx_dim; i++) { - int temp = 0; - - for (k = 0; k < tx_dim; k++) { - temp += ptv[k] * ip[(k * (pitch >> 1))]; - } - - im[i] = (int16_t)((temp + VERTICAL_ROUNDING) >> VERTICAL_SHIFT); - ip++; - } - im += tx_dim; // 16 - ptv += tx_dim; - ip = input; - } - - /* horizontal transformation */ - im = &imbuf[0]; - - for (j = 0; j < tx_dim; j++) { - const int16_t *pthc = pth; - - for (i = 0; i < tx_dim; i++) { - int temp = 0; - - for (k = 0; k < tx_dim; k++) { - temp += im[k] * pthc[k]; - } - - op[i] = (int16_t)((temp + HORIZONTAL_ROUNDING) >> HORIZONTAL_SHIFT); - pthc += tx_dim; - } - - im += tx_dim; // 16 - op += tx_dim; - } -} - static void fdct4_1d(int16_t *input, int16_t *output) { int16_t step[4]; int temp1, temp2; @@ -575,7 +61,6 @@ void vp9_short_fdct4x4_c(short *input, short *output, int pitch) { } } -#if CONFIG_INTHT4X4 static void fadst4_1d(int16_t *input, int16_t *output) { int x0, x1, x2, x3; int s0, s1, s2, s3, s4, s5, s6, s7; @@ -669,7 +154,6 @@ void vp9_short_fht4x4_c(int16_t *input, int16_t *output, output[j + i * 4] = (temp_out[j] + 1) >> 2; } } -#endif void vp9_short_fdct8x4_c(short *input, short *output, int pitch) { @@ -748,7 +232,6 @@ void vp9_short_fdct8x8_c(int16_t *input, int16_t *output, int pitch) { } } -#if CONFIG_INTHT static void fadst8_1d(int16_t *input, int16_t *output) { int x0, x1, x2, x3, x4, x5, x6, x7; int s0, s1, s2, s3, s4, s5, s6, s7; @@ -871,7 +354,6 @@ void vp9_short_fht8x8_c(int16_t *input, int16_t *output, output[j + i * 8] = temp_out[j] >> 1; } } -#endif void vp9_short_walsh4x4_x8_c(short *input, short *output, int pitch) { int i; @@ -1048,7 +530,6 @@ void vp9_short_fdct16x16_c(int16_t *input, int16_t *out, int pitch) { } } -#if CONFIG_INTHT16X16 void fadst16_1d(int16_t *input, int16_t *output) { int x0, x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15; int s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, s11, s12, s13, s14, s15; @@ -1262,7 +743,6 @@ void vp9_short_fht16x16_c(int16_t *input, int16_t *output, output[j + i * 16] = temp_out[j]; } } -#endif #define TEST_INT_32x32_DCT 1 diff --git a/vp9/encoder/vp9_encodeintra.c b/vp9/encoder/vp9_encodeintra.c index e40127982..ef64db1db 100644 --- a/vp9/encoder/vp9_encodeintra.c +++ b/vp9/encoder/vp9_encodeintra.c @@ -54,17 +54,9 @@ void vp9_encode_intra4x4block(MACROBLOCK *x, int ib) { tx_type = get_tx_type_4x4(&x->e_mbd, b); if (tx_type != DCT_DCT) { -#if CONFIG_INTHT4X4 vp9_short_fht4x4(be->src_diff, be->coeff, 32, tx_type); -#else - vp9_fht(be->src_diff, 32, be->coeff, tx_type, 4); -#endif vp9_ht_quantize_b_4x4(be, b, tx_type); -#if CONFIG_INTHT4X4 vp9_short_iht4x4(b->dqcoeff, b->diff, 32, tx_type); -#else - vp9_ihtllm(b->dqcoeff, b->diff, 32, tx_type, 4, b->eob); -#endif } else { x->fwd_txm4x4(be->src_diff, be->coeff, 32); x->quantize_b_4x4(be, b) ; @@ -157,21 +149,10 @@ void vp9_encode_intra8x8(MACROBLOCK *x, int ib) { tx_type = get_tx_type_8x8(xd, &xd->block[ib]); if (tx_type != DCT_DCT) { -#if CONFIG_INTHT vp9_short_fht8x8(be->src_diff, (x->block + idx)->coeff, 32, tx_type); -#else - vp9_fht(be->src_diff, 32, (x->block + idx)->coeff, - tx_type, 8); -#endif x->quantize_b_8x8(x->block + idx, xd->block + idx); - -#if CONFIG_INTHT vp9_short_iht8x8(xd->block[idx].dqcoeff, xd->block[ib].diff, 32, tx_type); -#else - vp9_ihtllm(xd->block[idx].dqcoeff, xd->block[ib].diff, 32, - tx_type, 8, xd->block[idx].eob); -#endif } else { x->fwd_txm8x8(be->src_diff, (x->block + idx)->coeff, 32); x->quantize_b_8x8(x->block + idx, xd->block + idx); @@ -183,17 +164,9 @@ void vp9_encode_intra8x8(MACROBLOCK *x, int ib) { be = &x->block[ib + iblock[i]]; tx_type = get_tx_type_4x4(xd, b); if (tx_type != DCT_DCT) { -#if CONFIG_INTHT4X4 vp9_short_fht4x4(be->src_diff, be->coeff, 32, tx_type); -#else - vp9_fht_c(be->src_diff, 32, be->coeff, tx_type, 4); -#endif vp9_ht_quantize_b_4x4(be, b, tx_type); -#if CONFIG_INTHT4X4 vp9_short_iht4x4(b->dqcoeff, b->diff, 32, tx_type); -#else - vp9_ihtllm(b->dqcoeff, b->diff, 32, tx_type, 4, b->eob); -#endif } else if (!(i & 1) && get_tx_type_4x4(xd, b + 1) == DCT_DCT) { x->fwd_txm8x4(be->src_diff, be->coeff, 32); x->quantize_b_4x4_pair(be, be + 1, b, b + 1); diff --git a/vp9/encoder/vp9_encodemb.c b/vp9/encoder/vp9_encodemb.c index 2665d8a9c..9ff5dd96a 100644 --- a/vp9/encoder/vp9_encodemb.c +++ b/vp9/encoder/vp9_encodemb.c @@ -174,11 +174,7 @@ void vp9_transform_mby_4x4(MACROBLOCK *x) { BLOCK *b = &x->block[i]; TX_TYPE tx_type = get_tx_type_4x4(xd, &xd->block[i]); if (tx_type != DCT_DCT) { -#if CONFIG_INTHT4X4 vp9_short_fht4x4(b->src_diff, b->coeff, 32, tx_type); -#else - vp9_fht_c(b->src_diff, 32, b->coeff, tx_type, 4); -#endif } else if (!(i & 1) && get_tx_type_4x4(xd, &xd->block[i + 1]) == DCT_DCT) { x->fwd_txm8x4(&x->block[i].src_diff[0], &x->block[i].coeff[0], 32); @@ -213,11 +209,7 @@ void vp9_transform_mby_8x8(MACROBLOCK *x) { BLOCK *b = &x->block[i]; tx_type = get_tx_type_8x8(xd, &xd->block[i]); if (tx_type != DCT_DCT) { -#if CONFIG_INTHT vp9_short_fht8x8(b->src_diff, b->coeff, 32, tx_type); -#else - vp9_fht_c(b->src_diff, 32, b->coeff, tx_type, 8); -#endif } else { x->fwd_txm8x8(&x->block[i].src_diff[0], &x->block[i].coeff[0], 32); @@ -227,11 +219,7 @@ void vp9_transform_mby_8x8(MACROBLOCK *x) { BLOCK *b = &x->block[i]; tx_type = get_tx_type_8x8(xd, &xd->block[i]); if (tx_type != DCT_DCT) { -#if CONFIG_INTHT vp9_short_fht8x8(b->src_diff, (b + 2)->coeff, 32, tx_type); -#else - vp9_fht_c(b->src_diff, 32, (b + 2)->coeff, tx_type, 8); -#endif } else { x->fwd_txm8x8(&x->block[i].src_diff[0], &x->block[i + 2].coeff[0], 32); @@ -259,11 +247,7 @@ void vp9_transform_mby_16x16(MACROBLOCK *x) { TX_TYPE tx_type = get_tx_type_16x16(xd, &xd->block[0]); vp9_clear_system_state(); if (tx_type != DCT_DCT) { -#if CONFIG_INTHT16X16 vp9_short_fht16x16(b->src_diff, b->coeff, 32, tx_type); -#else - vp9_fht_c(b->src_diff, 32, b->coeff, tx_type, 16); -#endif } else { x->fwd_txm16x16(&x->block[0].src_diff[0], &x->block[0].coeff[0], 32); diff --git a/vp9/encoder/vp9_rdopt.c b/vp9/encoder/vp9_rdopt.c index 112249651..be091eee2 100644 --- a/vp9/encoder/vp9_rdopt.c +++ b/vp9/encoder/vp9_rdopt.c @@ -1013,11 +1013,7 @@ static int64_t rd_pick_intra4x4block(VP9_COMP *cpi, MACROBLOCK *x, BLOCK *be, b->bmi.as_mode.first = mode; tx_type = get_tx_type_4x4(xd, b); if (tx_type != DCT_DCT) { -#if CONFIG_INTHT4X4 vp9_short_fht4x4(be->src_diff, be->coeff, 32, tx_type); -#else - vp9_fht(be->src_diff, 32, be->coeff, tx_type, 4); -#endif vp9_ht_quantize_b_4x4(be, b, tx_type); } else { x->fwd_txm4x4(be->src_diff, be->coeff, 32); @@ -1050,11 +1046,7 @@ static int64_t rd_pick_intra4x4block(VP9_COMP *cpi, MACROBLOCK *x, BLOCK *be, // inverse transform if (best_tx_type != DCT_DCT) -#if CONFIG_INTHT4X4 vp9_short_iht4x4(best_dqcoeff, b->diff, 32, best_tx_type); -#else - vp9_ihtllm(best_dqcoeff, b->diff, 32, best_tx_type, 4, b->eob); -#endif else xd->inv_txm4x4(best_dqcoeff, b->diff, 32); @@ -1317,11 +1309,7 @@ static int64_t rd_pick_intra8x8block(VP9_COMP *cpi, MACROBLOCK *x, int ib, if (xd->mode_info_context->mbmi.txfm_size == TX_8X8) { TX_TYPE tx_type = get_tx_type_8x8(xd, b); if (tx_type != DCT_DCT) -#if CONFIG_INTHT vp9_short_fht8x8(be->src_diff, (x->block + idx)->coeff, 32, tx_type); -#else - vp9_fht(be->src_diff, 32, (x->block + idx)->coeff, tx_type, 8); -#endif else x->fwd_txm8x8(be->src_diff, (x->block + idx)->coeff, 32); x->quantize_b_8x8(x->block + idx, xd->block + idx); @@ -1354,11 +1342,7 @@ static int64_t rd_pick_intra8x8block(VP9_COMP *cpi, MACROBLOCK *x, int ib, be = &x->block[ib + iblock[i]]; tx_type = get_tx_type_4x4(xd, b); if (tx_type != DCT_DCT) { -#if CONFIG_INTHT4X4 vp9_short_fht4x4(be->src_diff, be->coeff, 32, tx_type); -#else - vp9_fht_c(be->src_diff, 32, be->coeff, tx_type, 4); -#endif vp9_ht_quantize_b_4x4(be, b, tx_type); } else if (!(i & 1) && get_tx_type_4x4(xd, b + 1) == DCT_DCT) { x->fwd_txm8x4(be->src_diff, be->coeff, 32);