vp10: remove MACROBLOCK.{highbd_,}itxfm_add function pointer.
This is preparatory work for allowing per-segment lossless coding. See issue 1035. Change-Id: I9487d02717ee3e766aee61a487780056bb35d2d3
This commit is contained in:
@@ -179,21 +179,24 @@ void vp10_idct32x32_add(const tran_low_t *input, uint8_t *dest, int stride,
|
|||||||
}
|
}
|
||||||
|
|
||||||
void vp10_inv_txfm_add_4x4(const tran_low_t *input, uint8_t *dest,
|
void vp10_inv_txfm_add_4x4(const tran_low_t *input, uint8_t *dest,
|
||||||
int stride, int eob, TX_TYPE tx_type,
|
int stride, int eob, TX_TYPE tx_type, int lossless) {
|
||||||
void (*itxm_add_4x4)(const tran_low_t *input,
|
if (lossless) {
|
||||||
uint8_t *dest, int stride, int eob)) {
|
assert(tx_type == DCT_DCT);
|
||||||
switch (tx_type) {
|
vp10_iwht4x4_add(input, dest, stride, eob);
|
||||||
case DCT_DCT:
|
} else {
|
||||||
itxm_add_4x4(input, dest, stride, eob);
|
switch (tx_type) {
|
||||||
break;
|
case DCT_DCT:
|
||||||
case ADST_DCT:
|
vp10_idct4x4_add(input, dest, stride, eob);
|
||||||
case DCT_ADST:
|
break;
|
||||||
case ADST_ADST:
|
case ADST_DCT:
|
||||||
vp10_iht4x4_16_add(input, dest, stride, tx_type);
|
case DCT_ADST:
|
||||||
break;
|
case ADST_ADST:
|
||||||
default:
|
vp10_iht4x4_16_add(input, dest, stride, tx_type);
|
||||||
assert(0);
|
break;
|
||||||
break;
|
default:
|
||||||
|
assert(0);
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -418,21 +421,24 @@ void vp10_highbd_idct32x32_add(const tran_low_t *input, uint8_t *dest,
|
|||||||
|
|
||||||
void vp10_highbd_inv_txfm_add_4x4(const tran_low_t *input, uint8_t *dest,
|
void vp10_highbd_inv_txfm_add_4x4(const tran_low_t *input, uint8_t *dest,
|
||||||
int stride, int eob, int bd, TX_TYPE tx_type,
|
int stride, int eob, int bd, TX_TYPE tx_type,
|
||||||
void (*highbd_itxm_add_4x4)
|
int lossless) {
|
||||||
(const tran_low_t *input, uint8_t *dest,
|
if (lossless) {
|
||||||
int stride, int eob, int bd)) {
|
assert(tx_type == DCT_DCT);
|
||||||
switch (tx_type) {
|
vp10_highbd_iwht4x4_add(input, dest, stride, eob, bd);
|
||||||
case DCT_DCT:
|
} else {
|
||||||
highbd_itxm_add_4x4(input, dest, stride, eob, bd);
|
switch (tx_type) {
|
||||||
break;
|
case DCT_DCT:
|
||||||
case ADST_DCT:
|
vp10_highbd_idct4x4_add(input, dest, stride, eob, bd);
|
||||||
case DCT_ADST:
|
break;
|
||||||
case ADST_ADST:
|
case ADST_DCT:
|
||||||
vp10_highbd_iht4x4_16_add(input, dest, stride, tx_type, bd);
|
case DCT_ADST:
|
||||||
break;
|
case ADST_ADST:
|
||||||
default:
|
vp10_highbd_iht4x4_16_add(input, dest, stride, tx_type, bd);
|
||||||
assert(0);
|
break;
|
||||||
break;
|
default:
|
||||||
|
assert(0);
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -44,9 +44,7 @@ void vp10_idct4x4_add(const tran_low_t *input, uint8_t *dest, int stride,
|
|||||||
int eob);
|
int eob);
|
||||||
|
|
||||||
void vp10_inv_txfm_add_4x4(const tran_low_t *input, uint8_t *dest,
|
void vp10_inv_txfm_add_4x4(const tran_low_t *input, uint8_t *dest,
|
||||||
int stride, int eob, TX_TYPE tx_type,
|
int stride, int eob, TX_TYPE tx_type, int lossless);
|
||||||
void (*itxm_add_4x4)(const tran_low_t *input,
|
|
||||||
uint8_t *dest, int stride, int eob));
|
|
||||||
void vp10_inv_txfm_add_8x8(const tran_low_t *input, uint8_t *dest,
|
void vp10_inv_txfm_add_8x8(const tran_low_t *input, uint8_t *dest,
|
||||||
int stride, int eob, TX_TYPE tx_type);
|
int stride, int eob, TX_TYPE tx_type);
|
||||||
void vp10_inv_txfm_add_16x16(const tran_low_t *input, uint8_t *dest,
|
void vp10_inv_txfm_add_16x16(const tran_low_t *input, uint8_t *dest,
|
||||||
@@ -67,9 +65,7 @@ void vp10_highbd_idct32x32_add(const tran_low_t *input, uint8_t *dest,
|
|||||||
int stride, int eob, int bd);
|
int stride, int eob, int bd);
|
||||||
void vp10_highbd_inv_txfm_add_4x4(const tran_low_t *input, uint8_t *dest,
|
void vp10_highbd_inv_txfm_add_4x4(const tran_low_t *input, uint8_t *dest,
|
||||||
int stride, int eob, int bd, TX_TYPE tx_type,
|
int stride, int eob, int bd, TX_TYPE tx_type,
|
||||||
void (*highbd_itxm_add_4x4)
|
int lossless);
|
||||||
(const tran_low_t *input, uint8_t *dest,
|
|
||||||
int stride, int eob, int bd));
|
|
||||||
void vp10_highbd_inv_txfm_add_8x8(const tran_low_t *input, uint8_t *dest,
|
void vp10_highbd_inv_txfm_add_8x8(const tran_low_t *input, uint8_t *dest,
|
||||||
int stride, int eob, int bd, TX_TYPE tx_type);
|
int stride, int eob, int bd, TX_TYPE tx_type);
|
||||||
void vp10_highbd_inv_txfm_add_16x16(const tran_low_t *input, uint8_t *dest,
|
void vp10_highbd_inv_txfm_add_16x16(const tran_low_t *input, uint8_t *dest,
|
||||||
|
@@ -203,9 +203,7 @@ static void inverse_transform_block_inter(MACROBLOCKD* xd, int plane,
|
|||||||
switch (tx_size) {
|
switch (tx_size) {
|
||||||
case TX_4X4:
|
case TX_4X4:
|
||||||
vp10_highbd_inv_txfm_add_4x4(dqcoeff, dst, stride, eob, xd->bd,
|
vp10_highbd_inv_txfm_add_4x4(dqcoeff, dst, stride, eob, xd->bd,
|
||||||
tx_type, xd->lossless ?
|
tx_type, xd->lossless);
|
||||||
vp10_highbd_iwht4x4_add :
|
|
||||||
vp10_highbd_idct4x4_add);
|
|
||||||
break;
|
break;
|
||||||
case TX_8X8:
|
case TX_8X8:
|
||||||
vp10_highbd_inv_txfm_add_8x8(dqcoeff, dst, stride, eob, xd->bd,
|
vp10_highbd_inv_txfm_add_8x8(dqcoeff, dst, stride, eob, xd->bd,
|
||||||
@@ -228,8 +226,7 @@ static void inverse_transform_block_inter(MACROBLOCKD* xd, int plane,
|
|||||||
switch (tx_size) {
|
switch (tx_size) {
|
||||||
case TX_4X4:
|
case TX_4X4:
|
||||||
vp10_inv_txfm_add_4x4(dqcoeff, dst, stride, eob, tx_type,
|
vp10_inv_txfm_add_4x4(dqcoeff, dst, stride, eob, tx_type,
|
||||||
xd->lossless ? vp10_iwht4x4_add :
|
xd->lossless);
|
||||||
vp10_idct4x4_add);
|
|
||||||
break;
|
break;
|
||||||
case TX_8X8:
|
case TX_8X8:
|
||||||
vp10_inv_txfm_add_8x8(dqcoeff, dst, stride, eob, tx_type);
|
vp10_inv_txfm_add_8x8(dqcoeff, dst, stride, eob, tx_type);
|
||||||
@@ -274,9 +271,7 @@ static void inverse_transform_block_intra(MACROBLOCKD* xd, int plane,
|
|||||||
switch (tx_size) {
|
switch (tx_size) {
|
||||||
case TX_4X4:
|
case TX_4X4:
|
||||||
vp10_highbd_inv_txfm_add_4x4(dqcoeff, dst, stride, eob, xd->bd,
|
vp10_highbd_inv_txfm_add_4x4(dqcoeff, dst, stride, eob, xd->bd,
|
||||||
tx_type, xd->lossless ?
|
tx_type, xd->lossless);
|
||||||
vp10_highbd_iwht4x4_add :
|
|
||||||
vp10_highbd_idct4x4_add);
|
|
||||||
break;
|
break;
|
||||||
case TX_8X8:
|
case TX_8X8:
|
||||||
vp10_highbd_inv_txfm_add_8x8(dqcoeff, dst, stride, eob, xd->bd,
|
vp10_highbd_inv_txfm_add_8x8(dqcoeff, dst, stride, eob, xd->bd,
|
||||||
@@ -299,8 +294,7 @@ static void inverse_transform_block_intra(MACROBLOCKD* xd, int plane,
|
|||||||
switch (tx_size) {
|
switch (tx_size) {
|
||||||
case TX_4X4:
|
case TX_4X4:
|
||||||
vp10_inv_txfm_add_4x4(dqcoeff, dst, stride, eob, tx_type,
|
vp10_inv_txfm_add_4x4(dqcoeff, dst, stride, eob, tx_type,
|
||||||
xd->lossless ? vp10_iwht4x4_add :
|
xd->lossless);
|
||||||
vp10_idct4x4_add);
|
|
||||||
break;
|
break;
|
||||||
case TX_8X8:
|
case TX_8X8:
|
||||||
vp10_inv_txfm_add_8x8(dqcoeff, dst, stride, eob, tx_type);
|
vp10_inv_txfm_add_8x8(dqcoeff, dst, stride, eob, tx_type);
|
||||||
|
@@ -132,12 +132,6 @@ struct macroblock {
|
|||||||
// Strong color activity detection. Used in RTC coding mode to enhance
|
// Strong color activity detection. Used in RTC coding mode to enhance
|
||||||
// the visual quality at the boundary of moving color objects.
|
// the visual quality at the boundary of moving color objects.
|
||||||
uint8_t color_sensitivity[2];
|
uint8_t color_sensitivity[2];
|
||||||
|
|
||||||
void (*itxm_add)(const tran_low_t *input, uint8_t *dest, int stride, int eob);
|
|
||||||
#if CONFIG_VP9_HIGHBITDEPTH
|
|
||||||
void (*highbd_itxm_add)(const tran_low_t *input, uint8_t *dest, int stride,
|
|
||||||
int eob, int bd);
|
|
||||||
#endif
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
@@ -2696,12 +2696,6 @@ static void encode_frame_internal(VP10_COMP *cpi) {
|
|||||||
cm->uv_dc_delta_q == 0 &&
|
cm->uv_dc_delta_q == 0 &&
|
||||||
cm->uv_ac_delta_q == 0;
|
cm->uv_ac_delta_q == 0;
|
||||||
|
|
||||||
#if CONFIG_VP9_HIGHBITDEPTH
|
|
||||||
x->highbd_itxm_add = xd->lossless ? vp10_highbd_iwht4x4_add :
|
|
||||||
vp10_highbd_idct4x4_add;
|
|
||||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
|
||||||
x->itxm_add = xd->lossless ? vp10_iwht4x4_add : vp10_idct4x4_add;
|
|
||||||
|
|
||||||
if (xd->lossless)
|
if (xd->lossless)
|
||||||
x->optimize = 0;
|
x->optimize = 0;
|
||||||
|
|
||||||
|
@@ -841,7 +841,7 @@ static void encode_block(int plane, int block, BLOCK_SIZE plane_bsize,
|
|||||||
// case.
|
// case.
|
||||||
vp10_highbd_inv_txfm_add_4x4(dqcoeff, dst, pd->dst.stride,
|
vp10_highbd_inv_txfm_add_4x4(dqcoeff, dst, pd->dst.stride,
|
||||||
p->eobs[block], xd->bd, tx_type,
|
p->eobs[block], xd->bd, tx_type,
|
||||||
x->highbd_itxm_add);
|
xd->lossless);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
assert(0 && "Invalid transform size");
|
assert(0 && "Invalid transform size");
|
||||||
@@ -870,7 +870,7 @@ static void encode_block(int plane, int block, BLOCK_SIZE plane_bsize,
|
|||||||
// which is significant (not just an optimization) for the lossless
|
// which is significant (not just an optimization) for the lossless
|
||||||
// case.
|
// case.
|
||||||
vp10_inv_txfm_add_4x4(dqcoeff, dst, pd->dst.stride, p->eobs[block],
|
vp10_inv_txfm_add_4x4(dqcoeff, dst, pd->dst.stride, p->eobs[block],
|
||||||
tx_type, x->itxm_add);
|
tx_type, xd->lossless);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
assert(0 && "Invalid transform size");
|
assert(0 && "Invalid transform size");
|
||||||
@@ -895,11 +895,21 @@ static void encode_block_pass1(int plane, int block, BLOCK_SIZE plane_bsize,
|
|||||||
if (p->eobs[block] > 0) {
|
if (p->eobs[block] > 0) {
|
||||||
#if CONFIG_VP9_HIGHBITDEPTH
|
#if CONFIG_VP9_HIGHBITDEPTH
|
||||||
if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) {
|
if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) {
|
||||||
x->highbd_itxm_add(dqcoeff, dst, pd->dst.stride, p->eobs[block], xd->bd);
|
if (xd->lossless) {
|
||||||
return;
|
vp10_highbd_iwht4x4_add(dqcoeff, dst, pd->dst.stride,
|
||||||
|
p->eobs[block], xd->bd);
|
||||||
|
} else {
|
||||||
|
vp10_highbd_idct4x4_add(dqcoeff, dst, pd->dst.stride,
|
||||||
|
p->eobs[block], xd->bd);
|
||||||
|
}
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||||
x->itxm_add(dqcoeff, dst, pd->dst.stride, p->eobs[block]);
|
if (xd->lossless) {
|
||||||
|
vp10_iwht4x4_add(dqcoeff, dst, pd->dst.stride, p->eobs[block]);
|
||||||
|
} else {
|
||||||
|
vp10_idct4x4_add(dqcoeff, dst, pd->dst.stride, p->eobs[block]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1032,7 +1042,7 @@ void vp10_encode_block_intra(int plane, int block, BLOCK_SIZE plane_bsize,
|
|||||||
// eob<=1 which is significant (not just an optimization) for the
|
// eob<=1 which is significant (not just an optimization) for the
|
||||||
// lossless case.
|
// lossless case.
|
||||||
vp10_highbd_inv_txfm_add_4x4(dqcoeff, dst, dst_stride, *eob, xd->bd,
|
vp10_highbd_inv_txfm_add_4x4(dqcoeff, dst, dst_stride, *eob, xd->bd,
|
||||||
tx_type, x->highbd_itxm_add);
|
tx_type, xd->lossless);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
assert(0);
|
assert(0);
|
||||||
@@ -1101,7 +1111,7 @@ void vp10_encode_block_intra(int plane, int block, BLOCK_SIZE plane_bsize,
|
|||||||
// which is significant (not just an optimization) for the lossless
|
// which is significant (not just an optimization) for the lossless
|
||||||
// case.
|
// case.
|
||||||
vp10_inv_txfm_add_4x4(dqcoeff, dst, dst_stride, *eob, tx_type,
|
vp10_inv_txfm_add_4x4(dqcoeff, dst, dst_stride, *eob, tx_type,
|
||||||
x->itxm_add);
|
xd->lossless);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
@@ -4087,13 +4087,6 @@ int vp10_get_compressed_data(VP10_COMP *cpi, unsigned int *frame_flags,
|
|||||||
|
|
||||||
if (oxcf->pass == 1) {
|
if (oxcf->pass == 1) {
|
||||||
cpi->td.mb.e_mbd.lossless = is_lossless_requested(oxcf);
|
cpi->td.mb.e_mbd.lossless = is_lossless_requested(oxcf);
|
||||||
#if CONFIG_VP9_HIGHBITDEPTH
|
|
||||||
cpi->td.mb.highbd_itxm_add =
|
|
||||||
cpi->td.mb.e_mbd.lossless ? vp10_highbd_iwht4x4_add
|
|
||||||
: vp10_highbd_idct4x4_add;
|
|
||||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
|
||||||
cpi->td.mb.itxm_add = cpi->td.mb.e_mbd.lossless ? vp10_iwht4x4_add
|
|
||||||
: vp10_idct4x4_add;
|
|
||||||
vp10_first_pass(cpi, source);
|
vp10_first_pass(cpi, source);
|
||||||
} else if (oxcf->pass == 2) {
|
} else if (oxcf->pass == 2) {
|
||||||
Pass2Encode(cpi, size, dest, frame_flags);
|
Pass2Encode(cpi, size, dest, frame_flags);
|
||||||
|
@@ -807,8 +807,7 @@ static int64_t rd_pick_intra4x4block(VP10_COMP *cpi, MACROBLOCK *x,
|
|||||||
goto next_highbd;
|
goto next_highbd;
|
||||||
vp10_highbd_inv_txfm_add_4x4(BLOCK_OFFSET(pd->dqcoeff, block),
|
vp10_highbd_inv_txfm_add_4x4(BLOCK_OFFSET(pd->dqcoeff, block),
|
||||||
dst, dst_stride, p->eobs[block],
|
dst, dst_stride, p->eobs[block],
|
||||||
xd->bd, DCT_DCT,
|
xd->bd, DCT_DCT, 1);
|
||||||
vp10_highbd_iwht4x4_add);
|
|
||||||
} else {
|
} else {
|
||||||
int64_t unused;
|
int64_t unused;
|
||||||
TX_TYPE tx_type = get_tx_type(PLANE_TYPE_Y, xd, block);
|
TX_TYPE tx_type = get_tx_type(PLANE_TYPE_Y, xd, block);
|
||||||
@@ -825,8 +824,7 @@ static int64_t rd_pick_intra4x4block(VP10_COMP *cpi, MACROBLOCK *x,
|
|||||||
goto next_highbd;
|
goto next_highbd;
|
||||||
vp10_highbd_inv_txfm_add_4x4(BLOCK_OFFSET(pd->dqcoeff, block),
|
vp10_highbd_inv_txfm_add_4x4(BLOCK_OFFSET(pd->dqcoeff, block),
|
||||||
dst, dst_stride, p->eobs[block],
|
dst, dst_stride, p->eobs[block],
|
||||||
xd->bd, tx_type,
|
xd->bd, tx_type, 0);
|
||||||
vp10_highbd_idct4x4_add);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -907,8 +905,7 @@ static int64_t rd_pick_intra4x4block(VP10_COMP *cpi, MACROBLOCK *x,
|
|||||||
if (RDCOST(x->rdmult, x->rddiv, ratey, distortion) >= best_rd)
|
if (RDCOST(x->rdmult, x->rddiv, ratey, distortion) >= best_rd)
|
||||||
goto next;
|
goto next;
|
||||||
vp10_inv_txfm_add_4x4(BLOCK_OFFSET(pd->dqcoeff, block),
|
vp10_inv_txfm_add_4x4(BLOCK_OFFSET(pd->dqcoeff, block),
|
||||||
dst, dst_stride, p->eobs[block], DCT_DCT,
|
dst, dst_stride, p->eobs[block], DCT_DCT, 1);
|
||||||
vp10_iwht4x4_add);
|
|
||||||
} else {
|
} else {
|
||||||
int64_t unused;
|
int64_t unused;
|
||||||
TX_TYPE tx_type = get_tx_type(PLANE_TYPE_Y, xd, block);
|
TX_TYPE tx_type = get_tx_type(PLANE_TYPE_Y, xd, block);
|
||||||
@@ -923,8 +920,7 @@ static int64_t rd_pick_intra4x4block(VP10_COMP *cpi, MACROBLOCK *x,
|
|||||||
if (RDCOST(x->rdmult, x->rddiv, ratey, distortion) >= best_rd)
|
if (RDCOST(x->rdmult, x->rddiv, ratey, distortion) >= best_rd)
|
||||||
goto next;
|
goto next;
|
||||||
vp10_inv_txfm_add_4x4(BLOCK_OFFSET(pd->dqcoeff, block),
|
vp10_inv_txfm_add_4x4(BLOCK_OFFSET(pd->dqcoeff, block),
|
||||||
dst, dst_stride, p->eobs[block], tx_type,
|
dst, dst_stride, p->eobs[block], tx_type, 0);
|
||||||
vp10_idct4x4_add);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user