Commit 554d2c33 authored by Monty Montgomery's avatar Monty Montgomery Committed by Christopher Montgomery

Minor refactor to match the 4x4 forward transform.

Change-Id: Ib5337dfa78b73059ad169ca98a07119aa991864b
parent d032a447
......@@ -249,6 +249,10 @@ int get_inv_lgt8(transform_1d tx_orig, const INV_TXFM_PARAM *inv_txfm_param,
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;
if (tx_type == DCT_DCT) {
aom_idct4x4_16_add(input, dest, stride);
return;
}
static const transform_2d IHT_4[] = {
{ aom_idct4_c, aom_idct4_c }, // DCT_DCT = 0
{ aom_iadst4_c, aom_idct4_c }, // ADST_DCT = 1
......@@ -1303,15 +1307,17 @@ void av1_iht64x64_4096_add_c(const tran_low_t *input, uint8_t *dest, int stride,
// idct
void av1_idct4x4_add(const tran_low_t *input, uint8_t *dest, int stride,
int eob) {
const INV_TXFM_PARAM *param) {
const int eob = param->eob;
if (eob > 1)
aom_idct4x4_16_add(input, dest, stride);
av1_iht4x4_16_add(input, dest, stride, param);
else
aom_idct4x4_1_add(input, dest, stride);
}
void av1_iwht4x4_add(const tran_low_t *input, uint8_t *dest, int stride,
int eob) {
const INV_TXFM_PARAM *param) {
const int eob = param->eob;
if (eob > 1)
aom_iwht4x4_16_add(input, dest, stride);
else
......@@ -1427,15 +1433,14 @@ static void inv_txfm_add_2x2(const tran_low_t *input, uint8_t *dest, int stride,
static void inv_txfm_add_4x4(const tran_low_t *input, uint8_t *dest, int stride,
const INV_TXFM_PARAM *param) {
const TX_TYPE tx_type = param->tx_type;
const int eob = param->eob;
if (param->lossless) {
assert(tx_type == DCT_DCT);
av1_iwht4x4_add(input, dest, stride, eob);
av1_iwht4x4_add(input, dest, stride, param);
return;
}
switch (tx_type) {
case DCT_DCT: av1_idct4x4_add(input, dest, stride, eob); break;
case DCT_DCT: av1_idct4x4_add(input, dest, stride, param); break;
case ADST_DCT:
case DCT_ADST:
case ADST_ADST:
......
......@@ -76,9 +76,9 @@ typedef struct {
int av1_get_tx_scale(const TX_SIZE tx_size);
void av1_iwht4x4_add(const tran_low_t *input, uint8_t *dest, int stride,
int eob);
const INV_TXFM_PARAM *inv_txfm_param);
void av1_idct4x4_add(const tran_low_t *input, uint8_t *dest, int stride,
int eob);
const INV_TXFM_PARAM *inv_txfm_param);
void av1_inv_txfm_add(const tran_low_t *input, uint8_t *dest, int stride,
INV_TXFM_PARAM *inv_txfm_param);
......
......@@ -822,6 +822,7 @@ static void encode_block_pass1(int plane, int block, int blk_row, int blk_col,
struct macroblock_plane *const p = &x->plane[plane];
struct macroblockd_plane *const pd = &xd->plane[plane];
tran_low_t *const dqcoeff = BLOCK_OFFSET(pd->dqcoeff, block);
INV_TXFM_PARAM inv_txfm_param;
uint8_t *dst;
int ctx = 0;
dst = &pd->dst
......@@ -857,12 +858,11 @@ static void encode_block_pass1(int plane, int block, int blk_row, int blk_col,
#endif // CONFIG_HIGHBITDEPTH
}
#endif // !CONFIG_PVQ
#if CONFIG_HIGHBITDEPTH
INV_TXFM_PARAM inv_txfm_param;
inv_txfm_param.bd = xd->bd;
inv_txfm_param.tx_type = DCT_DCT;
inv_txfm_param.eob = p->eobs[block];
inv_txfm_param.lossless = xd->lossless[xd->mi[0]->mbmi.segment_id];
#if CONFIG_HIGHBITDEPTH
if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) {
av1_highbd_inv_txfm_add_4x4(dqcoeff, dst, pd->dst.stride,
&inv_txfm_param);
......@@ -870,9 +870,9 @@ static void encode_block_pass1(int plane, int block, int blk_row, int blk_col,
}
#endif // CONFIG_HIGHBITDEPTH
if (xd->lossless[xd->mi[0]->mbmi.segment_id]) {
av1_iwht4x4_add(dqcoeff, dst, pd->dst.stride, p->eobs[block]);
av1_iwht4x4_add(dqcoeff, dst, pd->dst.stride, &inv_txfm_param);
} else {
av1_idct4x4_add(dqcoeff, dst, pd->dst.stride, p->eobs[block]);
av1_idct4x4_add(dqcoeff, dst, pd->dst.stride, &inv_txfm_param);
}
}
}
......
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