Commit e14f900a authored by Dmitry Kovalev's avatar Dmitry Kovalev Committed by Gerrit Code Review
Browse files

Merge "Moving itxm_add pointer from MACROBLOCKD to MACROBLOCK."

parents 2e6040da 35a83677
...@@ -228,8 +228,6 @@ typedef struct macroblockd { ...@@ -228,8 +228,6 @@ typedef struct macroblockd {
DECLARE_ALIGNED(16, uint8_t, mc_buf[80 * 2 * 80 * 2]); DECLARE_ALIGNED(16, uint8_t, mc_buf[80 * 2 * 80 * 2]);
int lossless; int lossless;
/* Inverse transform function pointers. */
void (*itxm_add)(const int16_t *input, uint8_t *dest, int stride, int eob);
int corrupted; int corrupted;
......
...@@ -195,30 +195,32 @@ static void inverse_transform_block(MACROBLOCKD* xd, int plane, int block, ...@@ -195,30 +195,32 @@ static void inverse_transform_block(MACROBLOCKD* xd, int plane, int block,
struct macroblockd_plane *const pd = &xd->plane[plane]; struct macroblockd_plane *const pd = &xd->plane[plane];
if (eob > 0) { if (eob > 0) {
TX_TYPE tx_type; TX_TYPE tx_type;
const PLANE_TYPE plane_type = pd->plane_type;
int16_t *const dqcoeff = BLOCK_OFFSET(pd->dqcoeff, block); int16_t *const dqcoeff = BLOCK_OFFSET(pd->dqcoeff, block);
switch (tx_size) { if (xd->lossless) {
case TX_4X4: tx_type = DCT_DCT;
tx_type = get_tx_type_4x4(plane_type, xd, block); vp9_iwht4x4_add(dqcoeff, dst, stride, eob);
if (tx_type == DCT_DCT) } else {
xd->itxm_add(dqcoeff, dst, stride, eob); const PLANE_TYPE plane_type = pd->plane_type;
else switch (tx_size) {
case TX_4X4:
tx_type = get_tx_type_4x4(plane_type, xd, block);
vp9_iht4x4_16_add(dqcoeff, dst, stride, tx_type); vp9_iht4x4_16_add(dqcoeff, dst, stride, tx_type);
break; break;
case TX_8X8: case TX_8X8:
tx_type = get_tx_type(plane_type, xd); tx_type = get_tx_type(plane_type, xd);
vp9_iht8x8_add(tx_type, dqcoeff, dst, stride, eob); vp9_iht8x8_add(tx_type, dqcoeff, dst, stride, eob);
break; break;
case TX_16X16: case TX_16X16:
tx_type = get_tx_type(plane_type, xd); tx_type = get_tx_type(plane_type, xd);
vp9_iht16x16_add(tx_type, dqcoeff, dst, stride, eob); vp9_iht16x16_add(tx_type, dqcoeff, dst, stride, eob);
break; break;
case TX_32X32: case TX_32X32:
tx_type = DCT_DCT; tx_type = DCT_DCT;
vp9_idct32x32_add(dqcoeff, dst, stride, eob); vp9_idct32x32_add(dqcoeff, dst, stride, eob);
break; break;
default: default:
assert(0 && "Invalid transform size"); assert(0 && "Invalid transform size");
}
} }
if (eob == 1) { if (eob == 1) {
...@@ -588,8 +590,6 @@ static void setup_quantization(VP9_COMMON *const cm, MACROBLOCKD *const xd, ...@@ -588,8 +590,6 @@ static void setup_quantization(VP9_COMMON *const cm, MACROBLOCKD *const xd,
cm->y_dc_delta_q == 0 && cm->y_dc_delta_q == 0 &&
cm->uv_dc_delta_q == 0 && cm->uv_dc_delta_q == 0 &&
cm->uv_ac_delta_q == 0; cm->uv_ac_delta_q == 0;
xd->itxm_add = xd->lossless ? vp9_iwht4x4_add : vp9_idct4x4_add;
} }
static INTERP_FILTER read_interp_filter(struct vp9_read_bit_buffer *rb) { static INTERP_FILTER read_interp_filter(struct vp9_read_bit_buffer *rb) {
......
...@@ -109,6 +109,7 @@ struct macroblock { ...@@ -109,6 +109,7 @@ struct macroblock {
MV pred_mv[MAX_REF_FRAMES]; MV pred_mv[MAX_REF_FRAMES];
void (*fwd_txm4x4)(const int16_t *input, int16_t *output, int stride); void (*fwd_txm4x4)(const int16_t *input, int16_t *output, int stride);
void (*itxm_add)(const int16_t *input, uint8_t *dest, int stride, int eob);
}; };
#ifdef __cplusplus #ifdef __cplusplus
......
...@@ -2373,7 +2373,7 @@ static void switch_lossless_mode(VP9_COMP *cpi, int lossless) { ...@@ -2373,7 +2373,7 @@ static void switch_lossless_mode(VP9_COMP *cpi, int lossless) {
if (lossless) { if (lossless) {
// printf("Switching to lossless\n"); // printf("Switching to lossless\n");
cpi->mb.fwd_txm4x4 = vp9_fwht4x4; cpi->mb.fwd_txm4x4 = vp9_fwht4x4;
cpi->mb.e_mbd.itxm_add = vp9_iwht4x4_add; cpi->mb.itxm_add = vp9_iwht4x4_add;
cpi->mb.optimize = 0; cpi->mb.optimize = 0;
cpi->common.lf.filter_level = 0; cpi->common.lf.filter_level = 0;
cpi->zbin_mode_boost_enabled = 0; cpi->zbin_mode_boost_enabled = 0;
...@@ -2381,7 +2381,7 @@ static void switch_lossless_mode(VP9_COMP *cpi, int lossless) { ...@@ -2381,7 +2381,7 @@ static void switch_lossless_mode(VP9_COMP *cpi, int lossless) {
} else { } else {
// printf("Not lossless\n"); // printf("Not lossless\n");
cpi->mb.fwd_txm4x4 = vp9_fdct4x4; cpi->mb.fwd_txm4x4 = vp9_fdct4x4;
cpi->mb.e_mbd.itxm_add = vp9_idct4x4_add; cpi->mb.itxm_add = vp9_idct4x4_add;
} }
} }
......
...@@ -406,7 +406,7 @@ static void encode_block(int plane, int block, BLOCK_SIZE plane_bsize, ...@@ -406,7 +406,7 @@ static void encode_block(int plane, int block, BLOCK_SIZE plane_bsize,
// this is like vp9_short_idct4x4 but has a special case around eob<=1 // this is like vp9_short_idct4x4 but has a special case around eob<=1
// which is significant (not just an optimization) for the lossless // which is significant (not just an optimization) for the lossless
// case. // case.
xd->itxm_add(dqcoeff, dst, pd->dst.stride, p->eobs[block]); x->itxm_add(dqcoeff, dst, pd->dst.stride, p->eobs[block]);
break; break;
default: default:
assert(0 && "Invalid transform size"); assert(0 && "Invalid transform size");
...@@ -428,7 +428,7 @@ static void encode_block_pass1(int plane, int block, BLOCK_SIZE plane_bsize, ...@@ -428,7 +428,7 @@ static void encode_block_pass1(int plane, int block, BLOCK_SIZE plane_bsize,
vp9_xform_quant(x, plane, block, plane_bsize, tx_size); vp9_xform_quant(x, plane, block, plane_bsize, tx_size);
if (p->eobs[block] > 0) if (p->eobs[block] > 0)
xd->itxm_add(dqcoeff, dst, pd->dst.stride, p->eobs[block]); x->itxm_add(dqcoeff, dst, pd->dst.stride, p->eobs[block]);
} }
void vp9_encode_sby_pass1(MACROBLOCK *x, BLOCK_SIZE bsize) { void vp9_encode_sby_pass1(MACROBLOCK *x, BLOCK_SIZE bsize) {
...@@ -574,7 +574,7 @@ static void encode_block_intra(int plane, int block, BLOCK_SIZE plane_bsize, ...@@ -574,7 +574,7 @@ static void encode_block_intra(int plane, int block, BLOCK_SIZE plane_bsize,
// this is like vp9_short_idct4x4 but has a special case around eob<=1 // this is like vp9_short_idct4x4 but has a special case around eob<=1
// which is significant (not just an optimization) for the lossless // which is significant (not just an optimization) for the lossless
// case. // case.
xd->itxm_add(dqcoeff, dst, dst_stride, *eob); x->itxm_add(dqcoeff, dst, dst_stride, *eob);
else else
vp9_iht4x4_16_add(dqcoeff, dst, dst_stride, tx_type); vp9_iht4x4_16_add(dqcoeff, dst, dst_stride, tx_type);
} }
......
...@@ -602,9 +602,9 @@ void vp9_change_config(struct VP9_COMP *cpi, const VP9EncoderConfig *oxcf) { ...@@ -602,9 +602,9 @@ void vp9_change_config(struct VP9_COMP *cpi, const VP9EncoderConfig *oxcf) {
// is set. // is set.
cpi->oxcf.worst_allowed_q = 0; cpi->oxcf.worst_allowed_q = 0;
cpi->oxcf.best_allowed_q = 0; cpi->oxcf.best_allowed_q = 0;
cpi->mb.e_mbd.itxm_add = vp9_iwht4x4_add; cpi->mb.itxm_add = vp9_iwht4x4_add;
} else { } else {
cpi->mb.e_mbd.itxm_add = vp9_idct4x4_add; cpi->mb.itxm_add = vp9_idct4x4_add;
} }
rc->baseline_gf_interval = DEFAULT_GF_INTERVAL; rc->baseline_gf_interval = DEFAULT_GF_INTERVAL;
cpi->ref_frame_flags = VP9_ALT_FLAG | VP9_GOLD_FLAG | VP9_LAST_FLAG; cpi->ref_frame_flags = VP9_ALT_FLAG | VP9_GOLD_FLAG | VP9_LAST_FLAG;
......
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