Commit 05a79f2f authored by John Koleszar's avatar John Koleszar

Move EOB to per-plane data

Continue migrating data from BLOCKD/MACROBLOCKD to the per-plane
structures.

Change-Id: Ibbfa68d6da438d32dcbe8df68245ee28b0a2fa2c
parent 4c05a051
......@@ -298,6 +298,7 @@ enum { MAX_MB_PLANE = 3 };
struct mb_plane {
DECLARE_ALIGNED(16, int16_t, qcoeff[64 * 64]);
DECLARE_ALIGNED(16, int16_t, dqcoeff[64 * 64]);
DECLARE_ALIGNED(16, uint16_t, eobs[256]);
};
#define BLOCK_OFFSET(x, i, n) ((x) + (i) * (n))
......@@ -310,7 +311,6 @@ struct mb_plane {
typedef struct macroblockd {
DECLARE_ALIGNED(16, int16_t, diff[64*64+32*32*2]); /* from idct diff */
DECLARE_ALIGNED(16, uint8_t, predictor[384]); // unused for superblocks
DECLARE_ALIGNED(16, uint16_t, eobs[256+64*2]);
#if CONFIG_CODE_NONZEROCOUNT
DECLARE_ALIGNED(16, uint16_t, nzcs[256+64*2]);
#endif
......@@ -700,21 +700,19 @@ struct plane_block_idx {
// TODO(jkoleszar): returning a struct so it can be used in a const context,
// expect to refactor this further later.
static INLINE struct plane_block_idx plane_block_idx(MACROBLOCKD *xd,
int b_idx) {
const BLOCK_SIZE_TYPE sb_type = xd->mode_info_context->mbmi.sb_type;
const int u_offset = 16 << (sb_type * 2);
const int v_offset = 20 << (sb_type * 2);
static INLINE struct plane_block_idx plane_block_idx(int y_blocks,
int b_idx) {
const int v_offset = y_blocks * 5 / 4;
struct plane_block_idx res;
if (b_idx < u_offset) {
if (b_idx < y_blocks) {
res.plane = 0;
res.block = b_idx;
} else if (b_idx < v_offset) {
res.plane = 1;
res.block = b_idx - u_offset;
res.block = b_idx - y_blocks;
} else {
assert(b_idx < (24 << (sb_type * 2)));
assert(b_idx < y_blocks * 3 / 2);
res.plane = 2;
res.block = b_idx - v_offset;
}
......
......@@ -29,7 +29,8 @@ void vp9_inverse_transform_mby_4x4(MACROBLOCKD *xd) {
vp9_short_iht4x4(BLOCK_OFFSET(xd->plane[0].dqcoeff, i, 16),
xd->block[i].diff, 16, tx_type);
} else {
vp9_inverse_transform_b_4x4(xd, xd->eobs[i],
vp9_inverse_transform_b_4x4(xd,
xd->plane[0].eobs[i],
BLOCK_OFFSET(xd->plane[0].dqcoeff, i, 16),
xd->block[i].diff, 32);
}
......@@ -40,12 +41,12 @@ void vp9_inverse_transform_mbuv_4x4(MACROBLOCKD *xd) {
int i;
for (i = 16; i < 20; i++) {
vp9_inverse_transform_b_4x4(xd, xd->eobs[i],
vp9_inverse_transform_b_4x4(xd, xd->plane[1].eobs[i - 16],
BLOCK_OFFSET(xd->plane[1].dqcoeff, i - 16, 16),
xd->block[i].diff, 16);
}
for (i = 20; i < 24; i++) {
vp9_inverse_transform_b_4x4(xd, xd->eobs[i],
vp9_inverse_transform_b_4x4(xd, xd->plane[2].eobs[i - 20],
BLOCK_OFFSET(xd->plane[2].dqcoeff, i - 20, 16),
xd->block[i].diff, 16);
}
......@@ -175,7 +176,7 @@ void vp9_inverse_transform_sby_4x4(MACROBLOCKD *xd) {
const TX_TYPE tx_type = get_tx_type_4x4(xd, y_idx * 8 + x_idx);
if (tx_type == DCT_DCT) {
vp9_inverse_transform_b_4x4(xd, xd->eobs[n],
vp9_inverse_transform_b_4x4(xd, xd->plane[0].eobs[n],
BLOCK_OFFSET(xd->plane[0].dqcoeff, n, 16),
xd->diff + x_idx * 4 + y_idx * 4 * 32, 64);
} else {
......@@ -213,11 +214,11 @@ void vp9_inverse_transform_sbuv_4x4(MACROBLOCKD *xd) {
for (n = 0; n < 16; n++) {
const int x_idx = n & 3, y_idx = n >> 2;
vp9_inverse_transform_b_4x4(xd, xd->eobs[64 + n],
vp9_inverse_transform_b_4x4(xd, xd->plane[1].eobs[n],
BLOCK_OFFSET(xd->plane[1].dqcoeff, n, 16),
xd->diff + 1024 + x_idx * 4 + y_idx * 16 * 4,
32);
vp9_inverse_transform_b_4x4(xd, xd->eobs[64 + 16 + n],
vp9_inverse_transform_b_4x4(xd, xd->plane[2].eobs[n],
BLOCK_OFFSET(xd->plane[2].dqcoeff, n, 16),
xd->diff + 1280 + x_idx * 4 + y_idx * 16 * 4,
32);
......@@ -278,7 +279,7 @@ void vp9_inverse_transform_sb64y_4x4(MACROBLOCKD *xd) {
const TX_TYPE tx_type = get_tx_type_4x4(xd, y_idx * 16 + x_idx);
if (tx_type == DCT_DCT) {
vp9_inverse_transform_b_4x4(xd, xd->eobs[n],
vp9_inverse_transform_b_4x4(xd, xd->plane[0].eobs[n],
BLOCK_OFFSET(xd->plane[0].dqcoeff, n, 16),
xd->diff + x_idx * 4 + y_idx * 4 * 64, 128);
} else {
......@@ -327,10 +328,10 @@ void vp9_inverse_transform_sb64uv_4x4(MACROBLOCKD *xd) {
for (n = 0; n < 64; n++) {
const int x_idx = n & 7, y_idx = n >> 3, off = x_idx * 4 + y_idx * 32 * 4;
vp9_inverse_transform_b_4x4(xd, xd->eobs[256 + n],
vp9_inverse_transform_b_4x4(xd, xd->plane[1].eobs[n],
BLOCK_OFFSET(xd->plane[1].dqcoeff, n, 16),
xd->diff + 4096 + off, 64);
vp9_inverse_transform_b_4x4(xd, xd->eobs[256 + 64 + n],
vp9_inverse_transform_b_4x4(xd, xd->plane[2].eobs[n],
BLOCK_OFFSET(xd->plane[2].dqcoeff, n, 16),
xd->diff + 4096 + 1024 + off, 64);
}
......
This diff is collapsed.
......@@ -396,7 +396,7 @@ static INLINE int decode_sb(VP9D_COMP* const pbi,
const int c = decode_coefs(pbi, xd, bc, i, PLANE_TYPE_Y_WITH_DC, seg_eob,
BLOCK_OFFSET(xd->plane[0].qcoeff, i, 16),
tx_size);
xd->eobs[i] = c;
xd->plane[0].eobs[i] = c;
eobtotal += c;
}
......@@ -406,7 +406,7 @@ static INLINE int decode_sb(VP9D_COMP* const pbi,
const int c = decode_coefs(pbi, xd, bc, i, PLANE_TYPE_UV, seg_eob,
BLOCK_OFFSET(xd->plane[1].qcoeff, b, 16),
tx_size);
xd->eobs[i] = c;
xd->plane[1].eobs[b] = c;
eobtotal += c;
}
for (i = offset * 5 / 4; i < count; i += inc) {
......@@ -414,7 +414,7 @@ static INLINE int decode_sb(VP9D_COMP* const pbi,
const int c = decode_coefs(pbi, xd, bc, i, PLANE_TYPE_UV, seg_eob,
BLOCK_OFFSET(xd->plane[2].qcoeff, b, 16),
tx_size);
xd->eobs[i] = c;
xd->plane[2].eobs[b] = c;
eobtotal += c;
}
......@@ -432,7 +432,7 @@ int vp9_decode_sb_tokens(VP9D_COMP* const pbi,
int c = decode_coefs(pbi, xd, bc, 0, PLANE_TYPE_Y_WITH_DC,
get_eob(xd, segment_id, 1024),
xd->plane[0].qcoeff, TX_32X32);
xd->eobs[0] = c;
xd->plane[0].eobs[0] = c;
eobtotal += c;
// 16x16 chroma blocks
......@@ -440,11 +440,11 @@ int vp9_decode_sb_tokens(VP9D_COMP* const pbi,
c = decode_coefs(pbi, xd, bc, 64, PLANE_TYPE_UV, seg_eob,
xd->plane[1].qcoeff, TX_16X16);
xd->eobs[64] = c;
xd->plane[1].eobs[0] = c;
eobtotal += c;
c = decode_coefs(pbi, xd, bc, 80, PLANE_TYPE_UV, seg_eob,
xd->plane[2].qcoeff, TX_16X16);
xd->eobs[80] = c;
xd->plane[2].eobs[0] = c;
eobtotal += c;
return eobtotal;
}
......@@ -488,7 +488,7 @@ static int vp9_decode_mb_tokens_16x16(VP9D_COMP* const pbi,
int c = decode_coefs(pbi, xd, bc, 0, PLANE_TYPE_Y_WITH_DC,
get_eob(xd, segment_id, 256),
xd->plane[0].qcoeff, TX_16X16);
xd->eobs[0] = c;
xd->plane[0].eobs[0] = c;
eobtotal += c;
// 8x8 chroma blocks
......@@ -496,11 +496,11 @@ static int vp9_decode_mb_tokens_16x16(VP9D_COMP* const pbi,
c = decode_coefs(pbi, xd, bc, 16, PLANE_TYPE_UV,
seg_eob, xd->plane[1].qcoeff, TX_8X8);
xd->eobs[16] = c;
xd->plane[1].eobs[0] = c;
eobtotal += c;
c = decode_coefs(pbi, xd, bc, 20, PLANE_TYPE_UV,
seg_eob, xd->plane[2].qcoeff, TX_8X8);
xd->eobs[20] = c;
xd->plane[2].eobs[0] = c;
eobtotal += c;
return eobtotal;
}
......@@ -517,7 +517,7 @@ static int vp9_decode_mb_tokens_8x8(VP9D_COMP* const pbi,
const int c = decode_coefs(pbi, xd, bc, i, PLANE_TYPE_Y_WITH_DC, seg_eob,
BLOCK_OFFSET(xd->plane[0].qcoeff, i, 16),
TX_8X8);
xd->eobs[i] = c;
xd->plane[0].eobs[i] = c;
eobtotal += c;
}
......@@ -530,14 +530,14 @@ static int vp9_decode_mb_tokens_8x8(VP9D_COMP* const pbi,
const int c = decode_coefs(pbi, xd, bc, i, PLANE_TYPE_UV, seg_eob,
BLOCK_OFFSET(xd->plane[1].qcoeff, i - 16, 16),
TX_4X4);
xd->eobs[i] = c;
xd->plane[1].eobs[i - 16] = c;
eobtotal += c;
}
for (i = 20; i < 24; i++) {
const int c = decode_coefs(pbi, xd, bc, i, PLANE_TYPE_UV, seg_eob,
BLOCK_OFFSET(xd->plane[2].qcoeff, i - 20, 16),
TX_4X4);
xd->eobs[i] = c;
xd->plane[2].eobs[i - 20] = c;
eobtotal += c;
}
} else {
......@@ -545,11 +545,11 @@ static int vp9_decode_mb_tokens_8x8(VP9D_COMP* const pbi,
c = decode_coefs(pbi, xd, bc, 16, PLANE_TYPE_UV, seg_eob,
xd->plane[1].qcoeff, TX_8X8);
xd->eobs[16] = c;
xd->plane[1].eobs[0] = c;
eobtotal += c;
c = decode_coefs(pbi, xd, bc, 20, PLANE_TYPE_UV, seg_eob,
xd->plane[2].qcoeff, TX_8X8);
xd->eobs[20] = c;
xd->plane[2].eobs[0] = c;
eobtotal += c;
}
......@@ -559,9 +559,10 @@ static int vp9_decode_mb_tokens_8x8(VP9D_COMP* const pbi,
static int decode_coefs_4x4(VP9D_COMP *dx, MACROBLOCKD *xd,
BOOL_DECODER* const bc,
PLANE_TYPE type, int i, int seg_eob) {
const struct plane_block_idx pb_idx = plane_block_idx(16, i);
const int c = decode_coefs(dx, xd, bc, i, type, seg_eob,
MB_SUBBLOCK_FIELD(xd, qcoeff, i), TX_4X4);
xd->eobs[i] = c;
BLOCK_OFFSET(xd->plane[pb_idx.plane].qcoeff, pb_idx.block, 16), TX_4X4);
xd->plane[pb_idx.plane].eobs[pb_idx.block] = c;
return c;
}
......
......@@ -20,7 +20,8 @@ void vp9_dequant_idct_add_y_block_c(int16_t *q, const int16_t *dq,
for (i = 0; i < 4; i++) {
for (j = 0; j < 4; j++) {
vp9_dequant_idct_add(q, dq, pre, dst, 16, stride, xd->eobs[i * 4 + j]);
vp9_dequant_idct_add(q, dq, pre, dst, 16, stride,
xd->plane[0].eobs[i * 4 + j]);
q += 16;
pre += 4;
dst += 4;
......@@ -56,15 +57,17 @@ void vp9_dequant_idct_add_y_block_8x8_c(int16_t *q, const int16_t *dq,
uint8_t *origdest = dst;
uint8_t *origpred = pre;
vp9_dequant_idct_add_8x8_c(q, dq, pre, dst, 16, stride, xd->eobs[0]);
vp9_dequant_idct_add_8x8_c(q, dq, pre, dst, 16, stride,
xd->plane[0].eobs[0]);
vp9_dequant_idct_add_8x8_c(&q[64], dq, origpred + 8,
origdest + 8, 16, stride, xd->eobs[4]);
origdest + 8, 16, stride,
xd->plane[0].eobs[4]);
vp9_dequant_idct_add_8x8_c(&q[128], dq, origpred + 8 * 16,
origdest + 8 * stride, 16, stride,
xd->eobs[8]);
xd->plane[0].eobs[8]);
vp9_dequant_idct_add_8x8_c(&q[192], dq, origpred + 8 * 16 + 8,
origdest + 8 * stride + 8, 16, stride,
xd->eobs[12]);
xd->plane[0].eobs[12]);
}
void vp9_dequant_idct_add_y_block_lossless_c(int16_t *q, const int16_t *dq,
......@@ -76,7 +79,7 @@ void vp9_dequant_idct_add_y_block_lossless_c(int16_t *q, const int16_t *dq,
for (i = 0; i < 4; i++) {
for (j = 0; j < 4; j++) {
vp9_dequant_idct_add_lossless_c(q, dq, pre, dst, 16, stride,
xd->eobs[i * 4 + j]);
xd->plane[0].eobs[i * 4 + j]);
q += 16;
pre += 4;
dst += 4;
......
......@@ -171,10 +171,13 @@ struct macroblock {
void (*fwd_txm8x4)(int16_t *input, int16_t *output, int pitch);
void (*fwd_txm8x8)(int16_t *input, int16_t *output, int pitch);
void (*fwd_txm16x16)(int16_t *input, int16_t *output, int pitch);
void (*quantize_b_4x4)(MACROBLOCK *x, int b_idx);
void (*quantize_b_4x4_pair)(MACROBLOCK *x, int b_idx1, int b_idx2);
void (*quantize_b_16x16)(MACROBLOCK *x, int b_idx, TX_TYPE tx_type);
void (*quantize_b_8x8)(MACROBLOCK *x, int b_idx, TX_TYPE tx_type);
void (*quantize_b_4x4)(MACROBLOCK *x, int b_idx, int y_blocks);
void (*quantize_b_4x4_pair)(MACROBLOCK *x, int b_idx1, int b_idx2,
int y_blocks);
void (*quantize_b_16x16)(MACROBLOCK *x, int b_idx, TX_TYPE tx_type,
int y_blocks);
void (*quantize_b_8x8)(MACROBLOCK *x, int b_idx, TX_TYPE tx_type,
int y_blocks);
};
#endif // VP9_ENCODER_VP9_BLOCK_H_
......@@ -63,8 +63,8 @@ static void encode_intra4x4block(MACROBLOCK *x, int ib) {
b->diff, 16, tx_type);
} else {
x->fwd_txm4x4(be->src_diff, be->coeff, 32);
x->quantize_b_4x4(x, ib);
vp9_inverse_transform_b_4x4(&x->e_mbd, x->e_mbd.eobs[ib],
x->quantize_b_4x4(x, ib, 16);
vp9_inverse_transform_b_4x4(&x->e_mbd, xd->plane[0].eobs[ib],
BLOCK_OFFSET(xd->plane[0].dqcoeff, ib, 16),
b->diff, 32);
}
......@@ -164,12 +164,12 @@ void vp9_encode_intra8x8(MACROBLOCK *x, int ib) {
tx_type = get_tx_type_8x8(xd, ib);
if (tx_type != DCT_DCT) {
vp9_short_fht8x8(be->src_diff, (x->block + idx)->coeff, 16, tx_type);
x->quantize_b_8x8(x, idx, tx_type);
x->quantize_b_8x8(x, idx, tx_type, 16);
vp9_short_iht8x8(dqcoeff, xd->block[ib].diff,
16, tx_type);
} else {
x->fwd_txm8x8(be->src_diff, (x->block + idx)->coeff, 32);
x->quantize_b_8x8(x, idx, DCT_DCT);
x->quantize_b_8x8(x, idx, DCT_DCT, 16);
vp9_short_idct8x8(dqcoeff, xd->block[ib].diff, 32);
}
} else {
......@@ -188,16 +188,16 @@ void vp9_encode_intra8x8(MACROBLOCK *x, int ib) {
} else if (!(i & 1) &&
get_tx_type_4x4(xd, ib + iblock[i] + 1) == DCT_DCT) {
x->fwd_txm8x4(be->src_diff, be->coeff, 32);
x->quantize_b_4x4_pair(x, ib + iblock[i], ib + iblock[i] + 1);
vp9_inverse_transform_b_4x4(xd, xd->eobs[ib + iblock[i]],
x->quantize_b_4x4_pair(x, ib + iblock[i], ib + iblock[i] + 1, 16);
vp9_inverse_transform_b_4x4(xd, xd->plane[0].eobs[ib + iblock[i]],
dqcoeff, b->diff, 32);
vp9_inverse_transform_b_4x4(xd, xd->eobs[ib + iblock[i] + 1],
vp9_inverse_transform_b_4x4(xd, xd->plane[0].eobs[ib + iblock[i] + 1],
dqcoeff + 16, (b + 1)->diff, 32);
i++;
} else {
x->fwd_txm4x4(be->src_diff, be->coeff, 32);
x->quantize_b_4x4(x, ib + iblock[i]);
vp9_inverse_transform_b_4x4(xd, xd->eobs[ib + iblock[i]],
x->quantize_b_4x4(x, ib + iblock[i], 16);
vp9_inverse_transform_b_4x4(xd, xd->plane[0].eobs[ib + iblock[i]],
dqcoeff, b->diff, 32);
}
}
......@@ -223,6 +223,8 @@ static void encode_intra_uv4x4(MACROBLOCK *x, int ib, int mode) {
BLOCKD *b = &x->e_mbd.block[ib];
BLOCK *be = &x->block[ib];
int16_t * const dqcoeff = MB_SUBBLOCK_FIELD(xd, dqcoeff, ib);
const int plane = ib < 20 ? 1 : 2;
const int block = ib < 20 ? ib - 16 : ib - 20;
assert(ib >= 16 && ib < 24);
vp9_intra_uv4x4_predict(&x->e_mbd, b, mode, b->predictor);
......@@ -230,8 +232,8 @@ static void encode_intra_uv4x4(MACROBLOCK *x, int ib, int mode) {
vp9_subtract_b(be, b, 8);
x->fwd_txm4x4(be->src_diff, be->coeff, 16);
x->quantize_b_4x4(x, ib);
vp9_inverse_transform_b_4x4(&x->e_mbd, x->e_mbd.eobs[ib],
x->quantize_b_4x4(x, ib, 16);
vp9_inverse_transform_b_4x4(&x->e_mbd, xd->plane[plane].eobs[block],
dqcoeff, b->diff, 16);
vp9_recon_uv_b_c(b->predictor, b->diff, *(b->base_dst) + b->dst,
......
......@@ -544,16 +544,16 @@ static void optimize_b(VP9_COMMON *const cm,
MACROBLOCK *mb, int ib, PLANE_TYPE type,
const int16_t *dequant_ptr,
ENTROPY_CONTEXT *a, ENTROPY_CONTEXT *l,
int tx_size) {
int tx_size, int y_blocks) {
const int ref = mb->e_mbd.mode_info_context->mbmi.ref_frame != INTRA_FRAME;
MACROBLOCKD *const xd = &mb->e_mbd;
vp9_token_state tokens[1025][2];
unsigned best_index[1025][2];
const struct plane_block_idx pb_idx = plane_block_idx(xd, ib);
const struct plane_block_idx pb_idx = plane_block_idx(y_blocks, ib);
const int16_t *coeff_ptr = mb->coeff + ib * 16;
int16_t *qcoeff_ptr;
int16_t *dqcoeff_ptr;
int eob = xd->eobs[ib], final_eob, sz = 0;
int eob = xd->plane[pb_idx.plane].eobs[pb_idx.block], final_eob, sz = 0;
const int i0 = 0;
int rc, x, next, i;
int64_t rdmult, rddiv, rd_cost0, rd_cost1;
......@@ -583,6 +583,7 @@ static void optimize_b(VP9_COMMON *const cm,
nzc0 = nzc1 = nzc;
#endif
assert((!type && !pb_idx.plane) || (type && pb_idx.plane));
dqcoeff_ptr = BLOCK_OFFSET(xd->plane[pb_idx.plane].dqcoeff, pb_idx.block, 16);
qcoeff_ptr = BLOCK_OFFSET(xd->plane[pb_idx.plane].qcoeff, pb_idx.block, 16);
switch (tx_size) {
......@@ -644,6 +645,7 @@ static void optimize_b(VP9_COMMON *const cm,
#endif
break;
}
assert(eob <= default_eob);
/* Now set up a Viterbi trellis to evaluate alternative roundings. */
rdmult = mb->rdmult * err_mult;
......@@ -841,7 +843,7 @@ static void optimize_b(VP9_COMMON *const cm,
}
final_eob++;
xd->eobs[ib] = final_eob;
xd->plane[pb_idx.plane].eobs[pb_idx.block] = final_eob;
*a = *l = (final_eob > 0);
#if CONFIG_CODE_NONZEROCOUNT
assert(final_nzc == final_nzc_exp);
......@@ -867,7 +869,7 @@ void vp9_optimize_mby_4x4(VP9_COMMON *const cm, MACROBLOCK *x) {
for (b = 0; b < 16; b++) {
optimize_b(cm, x, b, PLANE_TYPE_Y_WITH_DC, x->e_mbd.block[b].dequant,
ta + vp9_block2above[TX_4X4][b],
tl + vp9_block2left[TX_4X4][b], TX_4X4);
tl + vp9_block2left[TX_4X4][b], TX_4X4, 16);
}
}
......@@ -889,7 +891,7 @@ void vp9_optimize_mbuv_4x4(VP9_COMMON *const cm, MACROBLOCK *x) {
for (b = 16; b < 24; b++) {
optimize_b(cm, x, b, PLANE_TYPE_UV, x->e_mbd.block[b].dequant,
ta + vp9_block2above[TX_4X4][b],
tl + vp9_block2left[TX_4X4][b], TX_4X4);
tl + vp9_block2left[TX_4X4][b], TX_4X4, 16);
}
}
......@@ -918,7 +920,7 @@ void vp9_optimize_mby_8x8(VP9_COMMON *const cm, MACROBLOCK *x) {
ENTROPY_CONTEXT above_ec = (a[0] + a[1]) != 0;
ENTROPY_CONTEXT left_ec = (l[0] + l[1]) != 0;
optimize_b(cm, x, b, PLANE_TYPE_Y_WITH_DC, x->e_mbd.block[b].dequant,
&above_ec, &left_ec, TX_8X8);
&above_ec, &left_ec, TX_8X8, 16);
a[1] = a[0] = above_ec;
l[1] = l[0] = left_ec;
}
......@@ -938,7 +940,7 @@ void vp9_optimize_mbuv_8x8(VP9_COMMON *const cm, MACROBLOCK *x) {
ENTROPY_CONTEXT above_ec = (a[0] + a[1]) != 0;
ENTROPY_CONTEXT left_ec = (l[0] + l[1]) != 0;
optimize_b(cm, x, b, PLANE_TYPE_UV, x->e_mbd.block[b].dequant,
&above_ec, &left_ec, TX_8X8);
&above_ec, &left_ec, TX_8X8, 16);
}
}
......@@ -958,7 +960,7 @@ void vp9_optimize_mby_16x16(VP9_COMMON *const cm, MACROBLOCK *x) {
ta = (t_above->y1[0] + t_above->y1[1] + t_above->y1[2] + t_above->y1[3]) != 0;
tl = (t_left->y1[0] + t_left->y1[1] + t_left->y1[2] + t_left->y1[3]) != 0;
optimize_b(cm, x, 0, PLANE_TYPE_Y_WITH_DC, x->e_mbd.block[0].dequant,
&ta, &tl, TX_16X16);
&ta, &tl, TX_16X16, 16);
}
static void optimize_mb_16x16(VP9_COMMON *const cm, MACROBLOCK *x) {
......@@ -976,7 +978,7 @@ void vp9_optimize_sby_32x32(VP9_COMMON *const cm, MACROBLOCK *x) {
ta = (a[0] + a[1] + a[2] + a[3] + a1[0] + a1[1] + a1[2] + a1[3]) != 0;
tl = (l[0] + l[1] + l[2] + l[3] + l1[0] + l1[1] + l1[2] + l1[3]) != 0;
optimize_b(cm, x, 0, PLANE_TYPE_Y_WITH_DC, x->e_mbd.block[0].dequant,
&ta, &tl, TX_32X32);
&ta, &tl, TX_32X32, 64);
}
void vp9_optimize_sby_16x16(VP9_COMMON *const cm, MACROBLOCK *x) {
......@@ -995,7 +997,7 @@ void vp9_optimize_sby_16x16(VP9_COMMON *const cm, MACROBLOCK *x) {
const int x_idx = n & 1, y_idx = n >> 1;
optimize_b(cm, x, n * 16, PLANE_TYPE_Y_WITH_DC, x->e_mbd.block[0].dequant,
ta + x_idx, tl + y_idx, TX_16X16);
ta + x_idx, tl + y_idx, TX_16X16, 64);
}
}
......@@ -1019,7 +1021,7 @@ void vp9_optimize_sby_8x8(VP9_COMMON *const cm, MACROBLOCK *x) {
const int x_idx = n & 3, y_idx = n >> 2;
optimize_b(cm, x, n * 4, PLANE_TYPE_Y_WITH_DC, x->e_mbd.block[0].dequant,
ta + x_idx, tl + y_idx, TX_8X8);
ta + x_idx, tl + y_idx, TX_8X8, 64);
}
}
......@@ -1035,7 +1037,7 @@ void vp9_optimize_sby_4x4(VP9_COMMON *const cm, MACROBLOCK *x) {
const int x_idx = n & 7, y_idx = n >> 3;
optimize_b(cm, x, n, PLANE_TYPE_Y_WITH_DC, x->e_mbd.block[0].dequant,
ta + x_idx, tl + y_idx, TX_4X4);
ta + x_idx, tl + y_idx, TX_4X4, 64);
}
}
......@@ -1054,7 +1056,7 @@ void vp9_optimize_sbuv_16x16(VP9_COMMON *const cm, MACROBLOCK *x) {
above_ec = (a[0] + a[1] + a1[0] + a1[1]) != 0;
left_ec = (l[0] + l[1] + l1[0] + l1[1]) != 0;
optimize_b(cm, x, b, PLANE_TYPE_UV, x->e_mbd.block[cidx].dequant,
&above_ec, &left_ec, TX_16X16);
&above_ec, &left_ec, TX_16X16, 64);
}
}
......@@ -1074,7 +1076,7 @@ void vp9_optimize_sbuv_8x8(VP9_COMMON *const cm, MACROBLOCK *x) {
above_ec = (a[0] + a[1]) != 0;
left_ec = (l[0] + l[1]) != 0;
optimize_b(cm, x, b, PLANE_TYPE_UV, x->e_mbd.block[cidx].dequant,
&above_ec, &left_ec, TX_8X8);
&above_ec, &left_ec, TX_8X8, 64);
a[0] = a[1] = above_ec;
l[0] = l[1] = left_ec;
}
......@@ -1094,7 +1096,7 @@ void vp9_optimize_sbuv_4x4(VP9_COMMON *const cm, MACROBLOCK *x) {
a = ta + vp9_block2above_sb[TX_4X4][b];
l = tl + vp9_block2left_sb[TX_4X4][b];
optimize_b(cm, x, b, PLANE_TYPE_UV, x->e_mbd.block[cidx].dequant,
a, l, TX_4X4);
a, l, TX_4X4, 64);
}
}
......@@ -1118,7 +1120,7 @@ void vp9_optimize_sb64y_32x32(VP9_COMMON *const cm, MACROBLOCK *x) {
const int x_idx = n & 1, y_idx = n >> 1;
optimize_b(cm, x, n * 64, PLANE_TYPE_Y_WITH_DC, x->e_mbd.block[0].dequant,
ta + x_idx, tl + y_idx, TX_32X32);
ta + x_idx, tl + y_idx, TX_32X32, 256);
}
}
......@@ -1146,7 +1148,7 @@ void vp9_optimize_sb64y_16x16(VP9_COMMON *const cm, MACROBLOCK *x) {
const int x_idx = n & 3, y_idx = n >> 2;
optimize_b(cm, x, n * 16, PLANE_TYPE_Y_WITH_DC, x->e_mbd.block[0].dequant,
ta + x_idx, tl + y_idx, TX_16X16);
ta + x_idx, tl + y_idx, TX_16X16, 256);
}
}
......@@ -1182,7 +1184,7 @@ void vp9_optimize_sb64y_8x8(VP9_COMMON *const cm, MACROBLOCK *x) {
const int x_idx = n & 7, y_idx = n >> 3;
optimize_b(cm, x, n * 4, PLANE_TYPE_Y_WITH_DC, x->e_mbd.block[0].dequant,
ta + x_idx, tl + y_idx, TX_8X8);
ta + x_idx, tl + y_idx, TX_8X8, 256);
}
}
......@@ -1202,7 +1204,7 @@ void vp9_optimize_sb64y_4x4(VP9_COMMON *const cm, MACROBLOCK *x) {
const int x_idx = n & 15, y_idx = n >> 4;
optimize_b(cm, x, n, PLANE_TYPE_Y_WITH_DC, x->e_mbd.block[0].dequant,
ta + x_idx, tl + y_idx, TX_4X4);
ta + x_idx, tl + y_idx, TX_4X4, 256);
}
}
......@@ -1225,7 +1227,7 @@ void vp9_optimize_sb64uv_32x32(VP9_COMMON *const cm, MACROBLOCK *x) {
a_ec = (a[0] + a[1] + a1[0] + a1[1] + a2[0] + a2[1] + a3[0] + a3[1]) != 0;
l_ec = (l[0] + l[1] + l1[0] + l1[1] + l2[0] + l2[1] + l3[0] + l3[1]) != 0;
optimize_b(cm, x, b, PLANE_TYPE_UV, x->e_mbd.block[cidx].dequant,
&a_ec, &l_ec, TX_32X32);
&a_ec, &l_ec, TX_32X32, 256);
}
}
......@@ -1247,7 +1249,7 @@ void vp9_optimize_sb64uv_16x16(VP9_COMMON *const cm, MACROBLOCK *x) {
above_ec = (a[0] + a[1] + a1[0] + a1[1]) != 0;
left_ec = (l[0] + l[1] + l1[0] + l1[1]) != 0;
optimize_b(cm, x, b, PLANE_TYPE_UV, x->e_mbd.block[cidx].dequant,
&above_ec, &left_ec, TX_16X16);
&above_ec, &left_ec, TX_16X16, 256);
a[0] = a[1] = a1[0] = a1[1] = above_ec;
l[0] = l[1] = l1[0] = l1[1] = left_ec;
}
......@@ -1269,7 +1271,7 @@ void vp9_optimize_sb64uv_8x8(VP9_COMMON *const cm, MACROBLOCK *x) {
above_ec = (a[0] + a[1]) != 0;
left_ec = (l[0] + l[1]) != 0;
optimize_b(cm, x, b, PLANE_TYPE_UV, x->e_mbd.block[cidx].dequant,
&above_ec, &left_ec, TX_8X8);
&above_ec, &left_ec, TX_8X8, 256);
a[0] = a[1] = above_ec;
l[0] = l[1] = left_ec;
}
......@@ -1289,7 +1291,7 @@ void vp9_optimize_sb64uv_4x4(VP9_COMMON *const cm, MACROBLOCK *x) {
a = ta + vp9_block2above_sb64[TX_4X4][b];
l = tl + vp9_block2left_sb64[TX_4X4][b];
optimize_b(cm, x, b, PLANE_TYPE_UV, x->e_mbd.block[cidx].dequant,
a, l, TX_4X4);
a, l, TX_4X4, 256);
}
}
......
This diff is collapsed.
......@@ -27,11 +27,15 @@
#endif
void vp9_ht_quantize_b_4x4(MACROBLOCK *mb, int b_ix, TX_TYPE type);
void vp9_regular_quantize_b_4x4(MACROBLOCK *mb, int b_idx);
void vp9_regular_quantize_b_4x4_pair(MACROBLOCK *mb, int b_idx1, int b_idx2);
void vp9_regular_quantize_b_8x8(MACROBLOCK *mb, int b_idx, TX_TYPE tx_type);
void vp9_regular_quantize_b_16x16(MACROBLOCK *mb, int b_idx, TX_TYPE tx_type);
void vp9_regular_quantize_b_32x32(MACROBLOCK *mb, int b_idx);
void vp9_regular_quantize_b_4x4(MACROBLOCK *mb, int b_idx, int y_blocks);
void vp9_regular_quantize_b_4x4_pair(MACROBLOCK *mb, int b_idx1, int b_idx2,
int y_blocks);
void vp9_regular_quantize_b_8x8(MACROBLOCK *mb, int b_idx, TX_TYPE tx_type,
int y_blocks);
void vp9_regular_quantize_b_16x16(MACROBLOCK *mb, int b_idx, TX_TYPE tx_type,
int y_blocks);
void vp9_regular_quantize_b_32x32(MACROBLOCK *mb, int b_idx,
int y_blocks);
void vp9_quantize_mb_4x4(MACROBLOCK *x);
void vp9_quantize_mb_8x8(MACROBLOCK *x);
......
This diff is collapsed.
This diff is collapsed.