Commit 708c1ec5 authored by Lester Lu's avatar Lester Lu

Inter and intra LGTs

Here we have an LGT to replace ADST for intra residual blocks, and
another LGT to replace ADST for inter residual blocks. The changes
are only applied to transform length 4 and 8, and only for the
lowbitdepth path.

lowres: -0.18%

Change-Id: Iadc1e02b53e3756b44f74ca648cfa8b0e8ca7af4
parent 7651b739
......@@ -247,33 +247,7 @@ void aom_idct8x8_1_add_c(const tran_low_t *input, uint8_t *dest, int stride) {
}
}
#if CONFIG_LGT
void aom_ilgt4_c(const tran_low_t *input, tran_low_t *output) {
if (!(input[0] | input[1] | input[2] | input[3])) {
output[0] = output[1] = output[2] = output[3] = 0;
return;
}
tran_high_t s[4] = { 0 };
for (int i = 0; i < 4; ++i)
for (int j = 0; j < 4; ++j) s[j] += lgtbasis4[i][j] * input[i];
for (int i = 0; i < 4; ++i) output[i] = WRAPLOW(dct_const_round_shift(s[i]));
}
void aom_ilgt8_c(const tran_low_t *input, tran_low_t *output) {
tran_high_t s[8] = { 0 };
for (int i = 0; i < 8; ++i)
for (int j = 0; j < 8; ++j) s[j] += lgtbasis8[i][j] * input[i];
for (int i = 0; i < 8; ++i) output[i] = WRAPLOW(dct_const_round_shift(s[i]));
}
#endif // CONFIG_LGT
void aom_iadst4_c(const tran_low_t *input, tran_low_t *output) {
#if CONFIG_LGT
aom_ilgt4_c(input, output);
#else
tran_high_t s0, s1, s2, s3, s4, s5, s6, s7;
tran_low_t x0 = input[0];
......@@ -308,13 +282,9 @@ void aom_iadst4_c(const tran_low_t *input, tran_low_t *output) {
output[1] = WRAPLOW(dct_const_round_shift(s1 + s3));
output[2] = WRAPLOW(dct_const_round_shift(s2));
output[3] = WRAPLOW(dct_const_round_shift(s0 + s1 - s3));
#endif // CONFIG_LGT
}
void aom_iadst8_c(const tran_low_t *input, tran_low_t *output) {
#if CONFIG_LGT
aom_ilgt8_c(input, output);
#else
int s0, s1, s2, s3, s4, s5, s6, s7;
tran_high_t x0 = input[7];
......@@ -389,7 +359,6 @@ void aom_iadst8_c(const tran_low_t *input, tran_low_t *output) {
output[5] = WRAPLOW(-x7);
output[6] = WRAPLOW(x5);
output[7] = WRAPLOW(-x1);
#endif // CONFIG_LGT
}
void aom_idct8x8_12_add_c(const tran_low_t *input, uint8_t *dest, int stride) {
......
......@@ -52,11 +52,6 @@ static INLINE tran_high_t check_range(tran_high_t input, int bd) {
#define WRAPLOW(x) ((int32_t)check_range(x, 8))
#define HIGHBD_WRAPLOW(x, bd) ((int32_t)check_range((x), bd))
#if CONFIG_LGT
void aom_ilgt4_c(const tran_low_t *input, tran_low_t *output);
void aom_ilgt8_c(const tran_low_t *input, tran_low_t *output);
#endif
void aom_idct4_c(const tran_low_t *input, tran_low_t *output);
void aom_idct8_c(const tran_low_t *input, tran_low_t *output);
void aom_idct16_c(const tran_low_t *input, tran_low_t *output);
......
......@@ -73,22 +73,48 @@ static INLINE tran_high_t fdct_round_shift(tran_high_t input) {
}
#if CONFIG_LGT
// LGT4--a modified ADST4
// LGT4 name: lgt4_160
// Self loops: 1.600, 0.000, 0.000, 0.000
// The Line Graph Transforms (LGTs) matrices are written as follows.
// Each 2D array is 16384 times an LGT matrix, which is the matrix of
// eigenvectors of the graph Laplacian matrices for the line graph.
// LGT4 name: lgt4_140
// Self loops: 1.400, 0.000, 0.000, 0.000
// Edges: 1.000, 1.000, 1.000
static const tran_high_t lgt4_140[4][4] = {
{ 4206, 9518, 13524, 15674 },
{ 11552, 14833, 1560, -13453 },
{ 15391, -1906, -14393, 9445 },
{ 12201, -14921, 12016, -4581 },
};
// LGT4 name: lgt4_170
// Self loops: 1.700, 0.000, 0.000, 0.000
// Edges: 1.000, 1.000, 1.000
static const tran_high_t lgtbasis4[4][4] = {
{ 3809, 9358, 13567, 15834 },
{ 10673, 15348, 2189, -13513 },
{ 15057, -157, -14961, 9290 },
{ 13481, -14619, 11144, -4151 },
static const tran_high_t lgt4_170[4][4] = {
{ 3636, 9287, 13584, 15902 },
{ 10255, 15563, 2470, -13543 },
{ 14786, 711, -15249, 9231 },
{ 14138, -14420, 10663, -3920 },
};
// LGT8 name: lgt8_150
// Self loops: 1.500, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000
// Edges: 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000
static const tran_high_t lgt8_150[8][8] = {
{ 2075, 5110, 7958, 10511, 12677, 14376, 15544, 16140 },
{ 6114, 13307, 16196, 13845, 7015, -2084, -10509, -15534 },
{ 9816, 16163, 8717, -6168, -15790, -11936, 2104, 14348 },
{ 12928, 12326, -7340, -15653, 242, 15763, 6905, -12632 },
{ 15124, 3038, -16033, 1758, 15507, -6397, -13593, 10463 },
{ 15895, -7947, -7947, 15895, -7947, -7947, 15895, -7947 },
{ 14325, -15057, 9030, 1050, -10659, 15483, -13358, 5236 },
{ 9054, -12580, 14714, -15220, 14043, -11312, 7330, -2537 },
};
// LGT8--a modified ADST8
// LGT8 name: lgt8_170
// Self loops: 1.700, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000
// Edges: 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000
static const tran_high_t lgtbasis8[8][8] = {
static const tran_high_t lgt8_170[8][8] = {
{ 1858, 4947, 7850, 10458, 12672, 14411, 15607, 16217 },
{ 5494, 13022, 16256, 14129, 7343, -1864, -10456, -15601 },
{ 8887, 16266, 9500, -5529, -15749, -12273, 1876, 14394 },
......
......@@ -1077,6 +1077,18 @@ static INLINE int av1_raster_order_to_block_index(TX_SIZE tx_size,
return (tx_size == TX_4X4) ? raster_order : (raster_order > 0) ? 2 : 0;
}
#if CONFIG_DPCM_INTRA || CONFIG_LGT
static INLINE PREDICTION_MODE get_prediction_mode(const MODE_INFO *mi,
int plane, TX_SIZE tx_size,
int block_idx) {
const MB_MODE_INFO *const mbmi = &mi->mbmi;
if (is_inter_block(mbmi)) return mbmi->mode;
int block_raster_idx = av1_block_index_to_raster_order(tx_size, block_idx);
return (plane == 0) ? get_y_mode(mi, block_raster_idx) : mbmi->uv_mode;
}
#endif
static INLINE TX_TYPE get_default_tx_type(PLANE_TYPE plane_type,
const MACROBLOCKD *xd, int block_idx,
TX_SIZE tx_size) {
......
......@@ -196,6 +196,56 @@ static void highbd_inv_idtx_add_c(const tran_low_t *input, uint8_t *dest8,
#endif // CONFIG_EXT_TX && CONFIG_TX64X64
#endif // CONFIG_HIGHBITDEPTH
#if CONFIG_LGT
void ilgt4(const tran_low_t *input, tran_low_t *output,
const tran_high_t *lgtmtx) {
if (!(input[0] | input[1] | input[2] | input[3])) {
output[0] = output[1] = output[2] = output[3] = 0;
return;
}
// evaluate s[j] = sum of all lgtmtx[i][j]*input[i] over i=1,...,4
tran_high_t s[4] = { 0 };
for (int i = 0; i < 4; ++i)
for (int j = 0; j < 4; ++j) s[j] += lgtmtx[i * 4 + j] * input[i];
for (int i = 0; i < 4; ++i) output[i] = WRAPLOW(dct_const_round_shift(s[i]));
}
void ilgt8(const tran_low_t *input, tran_low_t *output,
const tran_high_t *lgtmtx) {
// evaluate s[j] = sum of all lgtmtx[i][j]*input[i] over i=1,...,8
tran_high_t s[8] = { 0 };
for (int i = 0; i < 8; ++i)
for (int j = 0; j < 8; ++j) s[j] += lgtmtx[i * 8 + j] * input[i];
for (int i = 0; i < 8; ++i) output[i] = WRAPLOW(dct_const_round_shift(s[i]));
}
// The get_inv_lgt functions return 1 if LGT is chosen to apply, and 0 otherwise
int get_inv_lgt4(transform_1d tx_orig, const INV_TXFM_PARAM *inv_txfm_param,
const tran_high_t *lgtmtx[], int ntx) {
// inter/intra split
if (tx_orig == &aom_iadst4_c) {
for (int i = 0; i < ntx; ++i)
lgtmtx[i] = inv_txfm_param->is_inter ? &lgt4_170[0][0] : &lgt4_140[0][0];
return 1;
}
return 0;
}
int get_inv_lgt8(transform_1d tx_orig, const INV_TXFM_PARAM *inv_txfm_param,
const tran_high_t *lgtmtx[], int ntx) {
// inter/intra split
if (tx_orig == &aom_iadst8_c) {
for (int i = 0; i < ntx; ++i)
lgtmtx[i] = inv_txfm_param->is_inter ? &lgt8_170[0][0] : &lgt8_150[0][0];
return 1;
}
return 0;
}
#endif // CONFIG_LGT
void av1_iht4x4_16_add_c(const tran_low_t *input, uint8_t *dest, int stride,
const INV_TXFM_PARAM *param) {
int tx_type = param->tx_type;
......@@ -226,9 +276,21 @@ void av1_iht4x4_16_add_c(const tran_low_t *input, uint8_t *dest, int stride,
tran_low_t *outp = &out[0][0];
int outstride = 4;
#if CONFIG_LGT
const tran_high_t *lgtmtx_col[4];
const tran_high_t *lgtmtx_row[4];
int use_lgt_col = get_inv_lgt4(IHT_4[tx_type].cols, param, lgtmtx_col, 4);
int use_lgt_row = get_inv_lgt4(IHT_4[tx_type].rows, param, lgtmtx_row, 4);
#endif
// inverse transform row vectors
for (i = 0; i < 4; ++i) {
IHT_4[tx_type].rows(input, out[i]);
#if CONFIG_LGT
if (use_lgt_row)
ilgt4(input, out[i], lgtmtx_row[i]);
else
#endif
IHT_4[tx_type].rows(input, out[i]);
input += 4;
}
......@@ -241,7 +303,12 @@ void av1_iht4x4_16_add_c(const tran_low_t *input, uint8_t *dest, int stride,
// inverse transform column vectors
for (i = 0; i < 4; ++i) {
IHT_4[tx_type].cols(tmp[i], out[i]);
#if CONFIG_LGT
if (use_lgt_col)
ilgt4(tmp[i], out[i], lgtmtx_col[i]);
else
#endif
IHT_4[tx_type].cols(tmp[i], out[i]);
}
#if CONFIG_EXT_TX
......@@ -289,9 +356,21 @@ void av1_iht4x8_32_add_c(const tran_low_t *input, uint8_t *dest, int stride,
tran_low_t *outp = &out[0][0];
int outstride = n2;
#if CONFIG_LGT
const tran_high_t *lgtmtx_col[4];
const tran_high_t *lgtmtx_row[8];
int use_lgt_col = get_inv_lgt8(IHT_4x8[tx_type].cols, param, lgtmtx_col, 4);
int use_lgt_row = get_inv_lgt4(IHT_4x8[tx_type].rows, param, lgtmtx_row, 8);
#endif
// inverse transform row vectors and transpose
for (i = 0; i < n2; ++i) {
IHT_4x8[tx_type].rows(input, outtmp);
#if CONFIG_LGT
if (use_lgt_row)
ilgt4(input, outtmp, lgtmtx_row[i]);
else
#endif
IHT_4x8[tx_type].rows(input, outtmp);
for (j = 0; j < n; ++j)
tmp[j][i] = (tran_low_t)dct_const_round_shift(outtmp[j] * Sqrt2);
input += n;
......@@ -299,7 +378,12 @@ void av1_iht4x8_32_add_c(const tran_low_t *input, uint8_t *dest, int stride,
// inverse transform column vectors
for (i = 0; i < n; ++i) {
IHT_4x8[tx_type].cols(tmp[i], out[i]);
#if CONFIG_LGT
if (use_lgt_col)
ilgt8(tmp[i], out[i], lgtmtx_col[i]);
else
#endif
IHT_4x8[tx_type].cols(tmp[i], out[i]);
}
#if CONFIG_EXT_TX
......@@ -348,9 +432,21 @@ void av1_iht8x4_32_add_c(const tran_low_t *input, uint8_t *dest, int stride,
tran_low_t *outp = &out[0][0];
int outstride = n;
#if CONFIG_LGT
const tran_high_t *lgtmtx_col[8];
const tran_high_t *lgtmtx_row[4];
int use_lgt_col = get_inv_lgt4(IHT_8x4[tx_type].cols, param, lgtmtx_col, 8);
int use_lgt_row = get_inv_lgt8(IHT_8x4[tx_type].rows, param, lgtmtx_row, 4);
#endif
// inverse transform row vectors and transpose
for (i = 0; i < n; ++i) {
IHT_8x4[tx_type].rows(input, outtmp);
#if CONFIG_LGT
if (use_lgt_row)
ilgt8(input, outtmp, lgtmtx_row[i]);
else
#endif
IHT_8x4[tx_type].rows(input, outtmp);
for (j = 0; j < n2; ++j)
tmp[j][i] = (tran_low_t)dct_const_round_shift(outtmp[j] * Sqrt2);
input += n2;
......@@ -358,7 +454,12 @@ void av1_iht8x4_32_add_c(const tran_low_t *input, uint8_t *dest, int stride,
// inverse transform column vectors
for (i = 0; i < n2; ++i) {
IHT_8x4[tx_type].cols(tmp[i], out[i]);
#if CONFIG_LGT
if (use_lgt_col)
ilgt4(tmp[i], out[i], lgtmtx_col[i]);
else
#endif
IHT_8x4[tx_type].cols(tmp[i], out[i]);
}
#if CONFIG_EXT_TX
......@@ -406,15 +507,27 @@ void av1_iht4x16_64_add_c(const tran_low_t *input, uint8_t *dest, int stride,
tran_low_t *outp = &out[0][0];
int outstride = n4;
#if CONFIG_LGT
const tran_high_t *lgtmtx_row[16];
int use_lgt_row = get_inv_lgt4(IHT_4x16[tx_type].rows, param, lgtmtx_row, 16);
#endif
// inverse transform row vectors and transpose
for (i = 0; i < n4; ++i) {
IHT_4x16[tx_type].rows(input, outtmp);
#if CONFIG_LGT
if (use_lgt_row)
ilgt4(input, outtmp, lgtmtx_row[i]);
else
#endif
IHT_4x16[tx_type].rows(input, outtmp);
for (j = 0; j < n; ++j) tmp[j][i] = outtmp[j];
input += n;
}
// inverse transform column vectors
for (i = 0; i < n; ++i) IHT_4x16[tx_type].cols(tmp[i], out[i]);
for (i = 0; i < n; ++i) {
IHT_4x16[tx_type].cols(tmp[i], out[i]);
}
#if CONFIG_EXT_TX
maybe_flip_strides(&dest, &stride, &outp, &outstride, tx_type, n4, n);
......@@ -462,6 +575,11 @@ void av1_iht16x4_64_add_c(const tran_low_t *input, uint8_t *dest, int stride,
tran_low_t *outp = &out[0][0];
int outstride = n;
#if CONFIG_LGT
const tran_high_t *lgtmtx_col[16];
int use_lgt_col = get_inv_lgt4(IHT_16x4[tx_type].cols, param, lgtmtx_col, 16);
#endif
// inverse transform row vectors and transpose
for (i = 0; i < n; ++i) {
IHT_16x4[tx_type].rows(input, outtmp);
......@@ -470,7 +588,14 @@ void av1_iht16x4_64_add_c(const tran_low_t *input, uint8_t *dest, int stride,
}
// inverse transform column vectors
for (i = 0; i < n4; ++i) IHT_16x4[tx_type].cols(tmp[i], out[i]);
for (i = 0; i < n4; ++i) {
#if CONFIG_LGT
if (use_lgt_col)
ilgt4(tmp[i], out[i], lgtmtx_col[i]);
else
#endif
IHT_16x4[tx_type].cols(tmp[i], out[i]);
}
#if CONFIG_EXT_TX
maybe_flip_strides(&dest, &stride, &outp, &outstride, tx_type, n, n4);
......@@ -517,9 +642,19 @@ void av1_iht8x16_128_add_c(const tran_low_t *input, uint8_t *dest, int stride,
tran_low_t *outp = &out[0][0];
int outstride = n2;
#if CONFIG_LGT
const tran_high_t *lgtmtx_row[16];
int use_lgt_row = get_inv_lgt8(IHT_8x16[tx_type].rows, param, lgtmtx_row, 16);
#endif
// inverse transform row vectors and transpose
for (i = 0; i < n2; ++i) {
IHT_8x16[tx_type].rows(input, outtmp);
#if CONFIG_LGT
if (use_lgt_row)
ilgt8(input, outtmp, lgtmtx_row[i]);
else
#endif
IHT_8x16[tx_type].rows(input, outtmp);
for (j = 0; j < n; ++j)
tmp[j][i] = (tran_low_t)dct_const_round_shift(outtmp[j] * Sqrt2);
input += n;
......@@ -576,6 +711,11 @@ void av1_iht16x8_128_add_c(const tran_low_t *input, uint8_t *dest, int stride,
tran_low_t *outp = &out[0][0];
int outstride = n;
#if CONFIG_LGT
const tran_high_t *lgtmtx_col[16];
int use_lgt_col = get_inv_lgt8(IHT_16x8[tx_type].cols, param, lgtmtx_col, 16);
#endif
// inverse transform row vectors and transpose
for (i = 0; i < n; ++i) {
IHT_16x8[tx_type].rows(input, outtmp);
......@@ -586,7 +726,12 @@ void av1_iht16x8_128_add_c(const tran_low_t *input, uint8_t *dest, int stride,
// inverse transform column vectors
for (i = 0; i < n2; ++i) {
IHT_16x8[tx_type].cols(tmp[i], out[i]);
#if CONFIG_LGT
if (use_lgt_col)
ilgt8(tmp[i], out[i], lgtmtx_col[i]);
else
#endif
IHT_16x8[tx_type].cols(tmp[i], out[i]);
}
#if CONFIG_EXT_TX
......@@ -634,15 +779,27 @@ void av1_iht8x32_256_add_c(const tran_low_t *input, uint8_t *dest, int stride,
tran_low_t *outp = &out[0][0];
int outstride = n4;
#if CONFIG_LGT
const tran_high_t *lgtmtx_row[32];
int use_lgt_row = get_inv_lgt8(IHT_8x32[tx_type].rows, param, lgtmtx_row, 32);
#endif
// inverse transform row vectors and transpose
for (i = 0; i < n4; ++i) {
IHT_8x32[tx_type].rows(input, outtmp);
#if CONFIG_LGT
if (use_lgt_row)
ilgt8(input, outtmp, lgtmtx_row[i]);
else
#endif
IHT_8x32[tx_type].rows(input, outtmp);
for (j = 0; j < n; ++j) tmp[j][i] = outtmp[j];
input += n;
}
// inverse transform column vectors
for (i = 0; i < n; ++i) IHT_8x32[tx_type].cols(tmp[i], out[i]);
for (i = 0; i < n; ++i) {
IHT_8x32[tx_type].cols(tmp[i], out[i]);
}
#if CONFIG_EXT_TX
maybe_flip_strides(&dest, &stride, &outp, &outstride, tx_type, n4, n);
......@@ -690,6 +847,11 @@ void av1_iht32x8_256_add_c(const tran_low_t *input, uint8_t *dest, int stride,
tran_low_t *outp = &out[0][0];
int outstride = n;
#if CONFIG_LGT
const tran_high_t *lgtmtx_col[32];
int use_lgt_col = get_inv_lgt4(IHT_32x8[tx_type].cols, param, lgtmtx_col, 32);
#endif
// inverse transform row vectors and transpose
for (i = 0; i < n; ++i) {
IHT_32x8[tx_type].rows(input, outtmp);
......@@ -698,7 +860,14 @@ void av1_iht32x8_256_add_c(const tran_low_t *input, uint8_t *dest, int stride,
}
// inverse transform column vectors
for (i = 0; i < n4; ++i) IHT_32x8[tx_type].cols(tmp[i], out[i]);
for (i = 0; i < n4; ++i) {
#if CONFIG_LGT
if (use_lgt_col)
ilgt8(tmp[i], out[i], lgtmtx_col[i]);
else
#endif
IHT_32x8[tx_type].cols(tmp[i], out[i]);
}
#if CONFIG_EXT_TX
maybe_flip_strides(&dest, &stride, &outp, &outstride, tx_type, n, n4);
......@@ -754,9 +923,7 @@ void av1_iht16x32_512_add_c(const tran_low_t *input, uint8_t *dest, int stride,
}
// inverse transform column vectors
for (i = 0; i < n; ++i) {
IHT_16x32[tx_type].cols(tmp[i], out[i]);
}
for (i = 0; i < n; ++i) IHT_16x32[tx_type].cols(tmp[i], out[i]);
#if CONFIG_EXT_TX
maybe_flip_strides(&dest, &stride, &outp, &outstride, tx_type, n2, n);
......@@ -812,9 +979,7 @@ void av1_iht32x16_512_add_c(const tran_low_t *input, uint8_t *dest, int stride,
}
// inverse transform column vectors
for (i = 0; i < n2; ++i) {
IHT_32x16[tx_type].cols(tmp[i], out[i]);
}
for (i = 0; i < n2; ++i) IHT_32x16[tx_type].cols(tmp[i], out[i]);
#if CONFIG_EXT_TX
maybe_flip_strides(&dest, &stride, &outp, &outstride, tx_type, n, n2);
......@@ -851,7 +1016,7 @@ void av1_iht8x8_64_add_c(const tran_low_t *input, uint8_t *dest, int stride,
{ iidtx8_c, aom_iadst8_c }, // H_ADST
{ aom_iadst8_c, iidtx8_c }, // V_FLIPADST
{ iidtx8_c, aom_iadst8_c }, // H_FLIPADST
#endif // CONFIG_EXT_TX
#endif
};
int i, j;
......@@ -860,9 +1025,21 @@ void av1_iht8x8_64_add_c(const tran_low_t *input, uint8_t *dest, int stride,
tran_low_t *outp = &out[0][0];
int outstride = 8;
#if CONFIG_LGT
const tran_high_t *lgtmtx_col[8];
const tran_high_t *lgtmtx_row[8];
int use_lgt_col = get_inv_lgt8(IHT_8[tx_type].cols, param, lgtmtx_col, 8);
int use_lgt_row = get_inv_lgt8(IHT_8[tx_type].rows, param, lgtmtx_row, 8);
#endif
// inverse transform row vectors
for (i = 0; i < 8; ++i) {
IHT_8[tx_type].rows(input, out[i]);
#if CONFIG_LGT
if (use_lgt_row)
ilgt8(input, out[i], lgtmtx_row[i]);
else
#endif
IHT_8[tx_type].rows(input, out[i]);
input += 8;
}
......@@ -875,7 +1052,12 @@ void av1_iht8x8_64_add_c(const tran_low_t *input, uint8_t *dest, int stride,
// inverse transform column vectors
for (i = 0; i < 8; ++i) {
IHT_8[tx_type].cols(tmp[i], out[i]);
#if CONFIG_LGT
if (use_lgt_col)
ilgt8(tmp[i], out[i], lgtmtx_col[i]);
else
#endif
IHT_8[tx_type].cols(tmp[i], out[i]);
}
#if CONFIG_EXT_TX
......@@ -913,7 +1095,7 @@ void av1_iht16x16_256_add_c(const tran_low_t *input, uint8_t *dest, int stride,
{ iidtx16_c, aom_iadst16_c }, // H_ADST
{ aom_iadst16_c, iidtx16_c }, // V_FLIPADST
{ iidtx16_c, aom_iadst16_c }, // H_FLIPADST
#endif // CONFIG_EXT_TX
#endif
};
int i, j;
......@@ -936,9 +1118,7 @@ void av1_iht16x16_256_add_c(const tran_low_t *input, uint8_t *dest, int stride,
}
// inverse transform column vectors
for (i = 0; i < 16; ++i) {
IHT_16[tx_type].cols(tmp[i], out[i]);
}
for (i = 0; i < 16; ++i) IHT_16[tx_type].cols(tmp[i], out[i]);
#if CONFIG_EXT_TX
maybe_flip_strides(&dest, &stride, &outp, &outstride, tx_type, 16, 16);
......@@ -997,9 +1177,7 @@ void av1_iht32x32_1024_add_c(const tran_low_t *input, uint8_t *dest, int stride,
}
// inverse transform column vectors
for (i = 0; i < 32; ++i) {
IHT_32[tx_type].cols(tmp[i], out[i]);
}
for (i = 0; i < 32; ++i) IHT_32[tx_type].cols(tmp[i], out[i]);
maybe_flip_strides(&dest, &stride, &outp, &outstride, tx_type, 32, 32);
......@@ -1036,7 +1214,7 @@ void av1_iht64x64_4096_add_c(const tran_low_t *input, uint8_t *dest, int stride,
{ iidtx64_c, ihalfright64_c }, // H_ADST
{ ihalfright64_c, iidtx64_c }, // V_FLIPADST
{ iidtx64_c, ihalfright64_c }, // H_FLIPADST
#endif // CONFIG_EXT_TX
#endif
};
int i, j;
......@@ -1060,9 +1238,7 @@ void av1_iht64x64_4096_add_c(const tran_low_t *input, uint8_t *dest, int stride,
}
// inverse transform column vectors
for (i = 0; i < 64; ++i) {
IHT_64[tx_type].cols(tmp[i], out[i]);
}
for (i = 0; i < 64; ++i) IHT_64[tx_type].cols(tmp[i], out[i]);
#if CONFIG_EXT_TX
maybe_flip_strides(&dest, &stride, &outp, &outstride, tx_type, 64, 64);
......@@ -1793,6 +1969,9 @@ static void init_inv_txfm_param(const MACROBLOCKD *xd, TX_SIZE tx_size,
#if CONFIG_HIGHBITDEPTH
inv->bd = xd->bd;
#endif
#if CONFIG_LGT
inv->is_inter = is_inter_block(&xd->mi[0]->mbmi);
#endif
#if CONFIG_ADAPT_SCAN
inv->eob_threshold =
(const int16_t *)&xd->eob_threshold_md[tx_size][tx_type][0];
......@@ -1805,10 +1984,16 @@ typedef void (*InvTxfmFunc)(const tran_low_t *dqcoeff, uint8_t *dst, int stride,
static InvTxfmFunc inv_txfm_func[2] = { av1_inv_txfm_add,
av1_highbd_inv_txfm_add };
// TODO(kslu) Change input arguments to INV_TXFM_PARAM, which contains mode,
// tx_type, tx_size, dst, stride, eob. Thus, the additional argument when LGT
// is on will no longer be needed.
void av1_inverse_transform_block(const MACROBLOCKD *xd,
const tran_low_t *dqcoeff, TX_TYPE tx_type,
TX_SIZE tx_size, uint8_t *dst, int stride,
int eob) {
const tran_low_t *dqcoeff,
#if CONFIG_LGT
PREDICTION_MODE mode,
#endif
TX_TYPE