summaryrefslogtreecommitdiff
path: root/vp9/encoder
diff options
context:
space:
mode:
authorJohn Koleszar <jkoleszar@google.com>2013-04-04 12:03:27 -0700
committerJohn Koleszar <jkoleszar@google.com>2013-04-04 21:30:23 -0700
commit05a79f2fbf0ea412142b96ae53796fd171663c2e (patch)
tree58239804fc10c2ec40c707e8df5e6b7823c42ff0 /vp9/encoder
parent4c05a051ab574368e552866e28373f8eb03a6f80 (diff)
downloadlibvpx-05a79f2fbf0ea412142b96ae53796fd171663c2e.tar
libvpx-05a79f2fbf0ea412142b96ae53796fd171663c2e.tar.gz
libvpx-05a79f2fbf0ea412142b96ae53796fd171663c2e.tar.bz2
libvpx-05a79f2fbf0ea412142b96ae53796fd171663c2e.zip
Move EOB to per-plane data
Continue migrating data from BLOCKD/MACROBLOCKD to the per-plane structures. Change-Id: Ibbfa68d6da438d32dcbe8df68245ee28b0a2fa2c
Diffstat (limited to 'vp9/encoder')
-rw-r--r--vp9/encoder/vp9_block.h11
-rw-r--r--vp9/encoder/vp9_encodeintra.c24
-rw-r--r--vp9/encoder/vp9_encodemb.c50
-rw-r--r--vp9/encoder/vp9_quantize.c113
-rw-r--r--vp9/encoder/vp9_quantize.h14
-rw-r--r--vp9/encoder/vp9_rdopt.c92
-rw-r--r--vp9/encoder/vp9_tokenize.c116
7 files changed, 226 insertions, 194 deletions
diff --git a/vp9/encoder/vp9_block.h b/vp9/encoder/vp9_block.h
index 491ea62b5..b2021d7a1 100644
--- a/vp9/encoder/vp9_block.h
+++ b/vp9/encoder/vp9_block.h
@@ -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_
diff --git a/vp9/encoder/vp9_encodeintra.c b/vp9/encoder/vp9_encodeintra.c
index 883038b7e..bf9410522 100644
--- a/vp9/encoder/vp9_encodeintra.c
+++ b/vp9/encoder/vp9_encodeintra.c
@@ -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,
diff --git a/vp9/encoder/vp9_encodemb.c b/vp9/encoder/vp9_encodemb.c
index a30268886..f0c215d90 100644
--- a/vp9/encoder/vp9_encodemb.c
+++ b/vp9/encoder/vp9_encodemb.c
@@ -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);
}
}
diff --git a/vp9/encoder/vp9_quantize.c b/vp9/encoder/vp9_quantize.c
index 826bee4c3..46e8a4a93 100644
--- a/vp9/encoder/vp9_quantize.c
+++ b/vp9/encoder/vp9_quantize.c
@@ -21,14 +21,9 @@
extern int enc_debug;
#endif
-static INLINE int plane_idx(MACROBLOCKD *xd, int b_idx) {
- const BLOCK_SIZE_TYPE sb_type = xd->mode_info_context->mbmi.sb_type;
- if (b_idx < (16 << (sb_type * 2)))
- return 0; // Y
- else if (b_idx < (20 << (sb_type * 2)))
- return 16; // U
- assert(b_idx < (24 << (sb_type * 2)));
- return 20; // V
+static INLINE int plane_idx(int plane) {
+ return plane == 0 ? 0 :
+ plane == 1 ? 16 : 20;
}
void vp9_ht_quantize_b_4x4(MACROBLOCK *mb, int b_idx, TX_TYPE tx_type) {
@@ -54,7 +49,6 @@ void vp9_ht_quantize_b_4x4(MACROBLOCK *mb, int b_idx, TX_TYPE tx_type) {
int nzc = 0;
#endif
- assert(plane_idx(xd, b_idx) == 0);
switch (tx_type) {
case ADST_DCT:
pt_scan = vp9_row_scan_4x4;
@@ -102,16 +96,16 @@ void vp9_ht_quantize_b_4x4(MACROBLOCK *mb, int b_idx, TX_TYPE tx_type) {
}
}
- xd->eobs[b_idx] = eob + 1;
+ xd->plane[0].eobs[b_idx] = eob + 1;
#if CONFIG_CODE_NONZEROCOUNT
xd->nzcs[b_idx] = nzc;
#endif
}
-void vp9_regular_quantize_b_4x4(MACROBLOCK *mb, int b_idx) {
+void vp9_regular_quantize_b_4x4(MACROBLOCK *mb, int b_idx, int y_blocks) {
MACROBLOCKD *const xd = &mb->e_mbd;
- const int c_idx = plane_idx(xd, b_idx);
- const struct plane_block_idx pb_idx = plane_block_idx(xd, b_idx);
+ const struct plane_block_idx pb_idx = plane_block_idx(y_blocks, b_idx);
+ const int c_idx = plane_idx(pb_idx.plane);
BLOCK *const b = &mb->block[c_idx];
BLOCKD *const d = &xd->block[c_idx];
int i, rc, eob;
@@ -133,6 +127,9 @@ void vp9_regular_quantize_b_4x4(MACROBLOCK *mb, int b_idx) {
int nzc = 0;
#endif
+ if (c_idx == 0) assert(pb_idx.plane == 0);
+ if (c_idx == 16) assert(pb_idx.plane == 1);
+ if (c_idx == 20) assert(pb_idx.plane == 2);
vpx_memset(qcoeff_ptr, 0, 32);
vpx_memset(dqcoeff_ptr, 0, 32);
@@ -169,7 +166,7 @@ void vp9_regular_quantize_b_4x4(MACROBLOCK *mb, int b_idx) {
}
}
- xd->eobs[b_idx] = eob + 1;
+ xd->plane[pb_idx.plane].eobs[pb_idx.block] = eob + 1;
#if CONFIG_CODE_NONZEROCOUNT
xd->nzcs[b_idx] = nzc;
#endif
@@ -183,7 +180,7 @@ void vp9_quantize_mby_4x4(MACROBLOCK *x) {
if (tx_type != DCT_DCT) {
vp9_ht_quantize_b_4x4(x, i, tx_type);
} else {
- x->quantize_b_4x4(x, i);
+ x->quantize_b_4x4(x, i, 16);
}
}
}
@@ -195,7 +192,7 @@ void vp9_quantize_mbuv_4x4(MACROBLOCK *x) {
xd->mode_info_context->mbmi.sb_type = BLOCK_SIZE_MB16X16;
for (i = 16; i < 24; i++)
- x->quantize_b_4x4(x, i);
+ x->quantize_b_4x4(x, i, 16);
xd->mode_info_context->mbmi.sb_type = real_sb_type;
}
@@ -204,10 +201,11 @@ void vp9_quantize_mb_4x4(MACROBLOCK *x) {
vp9_quantize_mbuv_4x4(x);
}
-void vp9_regular_quantize_b_8x8(MACROBLOCK *mb, int b_idx, TX_TYPE tx_type) {
+void vp9_regular_quantize_b_8x8(MACROBLOCK *mb, int b_idx, TX_TYPE tx_type,
+ int y_blocks) {
MACROBLOCKD *const xd = &mb->e_mbd;
- const struct plane_block_idx pb_idx = plane_block_idx(xd, b_idx);
- const int c_idx = plane_idx(xd, b_idx);
+ const struct plane_block_idx pb_idx = plane_block_idx(y_blocks, b_idx);
+ const int c_idx = plane_idx(pb_idx.plane);
int16_t *qcoeff_ptr = BLOCK_OFFSET(xd->plane[pb_idx.plane].qcoeff,
pb_idx.block, 16);
int16_t *dqcoeff_ptr = BLOCK_OFFSET(xd->plane[pb_idx.plane].dqcoeff,
@@ -228,6 +226,9 @@ void vp9_regular_quantize_b_8x8(MACROBLOCK *mb, int b_idx, TX_TYPE tx_type) {
break;
}
+ if (c_idx == 0) assert(pb_idx.plane == 0);
+ if (c_idx == 16) assert(pb_idx.plane == 1);
+ if (c_idx == 20) assert(pb_idx.plane == 2);
vpx_memset(qcoeff_ptr, 0, 64 * sizeof(int16_t));
vpx_memset(dqcoeff_ptr, 0, 64 * sizeof(int16_t));
@@ -306,12 +307,12 @@ void vp9_regular_quantize_b_8x8(MACROBLOCK *mb, int b_idx, TX_TYPE tx_type) {
}
}
}
- xd->eobs[b_idx] = eob + 1;
+ xd->plane[pb_idx.plane].eobs[pb_idx.block] = eob + 1;
#if CONFIG_CODE_NONZEROCOUNT
xd->nzcs[b_idx] = nzc;
#endif
} else {
- xd->eobs[b_idx] = 0;
+ xd->plane[pb_idx.plane].eobs[pb_idx.block] = 0;
#if CONFIG_CODE_NONZEROCOUNT
xd->nzcs[b_idx] = 0;
#endif
@@ -328,7 +329,7 @@ void vp9_quantize_mby_8x8(MACROBLOCK *x) {
#endif
for (i = 0; i < 16; i += 4) {
TX_TYPE tx_type = get_tx_type_8x8(&x->e_mbd, (i & 8) + ((i & 4) >> 1));
- x->quantize_b_8x8(x, i, tx_type);
+ x->quantize_b_8x8(x, i, tx_type, 16);
}
}
@@ -344,7 +345,7 @@ void vp9_quantize_mbuv_8x8(MACROBLOCK *x) {
}
#endif
for (i = 16; i < 24; i += 4)
- x->quantize_b_8x8(x, i, DCT_DCT);
+ x->quantize_b_8x8(x, i, DCT_DCT, 16);
xd->mode_info_context->mbmi.sb_type = real_sb_type;
}
@@ -361,7 +362,7 @@ void vp9_quantize_mby_16x16(MACROBLOCK *x) {
x->e_mbd.nzcs[i] = 0;
}
#endif
- x->quantize_b_16x16(x, 0, tx_type);
+ x->quantize_b_16x16(x, 0, tx_type, 16);
}
void vp9_quantize_mb_16x16(MACROBLOCK *x) {
@@ -430,10 +431,11 @@ static void quantize(int16_t *zbin_boost_orig_ptr,
#endif
}
-void vp9_regular_quantize_b_16x16(MACROBLOCK *mb, int b_idx, TX_TYPE tx_type) {
+void vp9_regular_quantize_b_16x16(MACROBLOCK *mb, int b_idx, TX_TYPE tx_type,
+ int y_blocks) {
MACROBLOCKD *const xd = &mb->e_mbd;
- const int c_idx = plane_idx(xd, b_idx);
- const struct plane_block_idx pb_idx = plane_block_idx(xd, b_idx);
+ const struct plane_block_idx pb_idx = plane_block_idx(y_blocks, b_idx);
+ const int c_idx = plane_idx(pb_idx.plane);
BLOCK *const b = &mb->block[c_idx];
BLOCKD *const d = &xd->block[c_idx];
const int *pt_scan;
@@ -450,6 +452,9 @@ void vp9_regular_quantize_b_16x16(MACROBLOCK *mb, int b_idx, TX_TYPE tx_type) {
break;
}
+ if (c_idx == 0) assert(pb_idx.plane == 0);
+ if (c_idx == 16) assert(pb_idx.plane == 1);
+ if (c_idx == 20) assert(pb_idx.plane == 2);
quantize(b->zrun_zbin_boost,
mb->coeff + 16 * b_idx,
256, b->skip_block,
@@ -458,20 +463,23 @@ void vp9_regular_quantize_b_16x16(MACROBLOCK *mb, int b_idx, TX_TYPE tx_type) {
BLOCK_OFFSET(xd->plane[pb_idx.plane].dqcoeff, pb_idx.block, 16),
d->dequant,
b->zbin_extra,
- &xd->eobs[b_idx],
+ &xd->plane[pb_idx.plane].eobs[pb_idx.block],
#if CONFIG_CODE_NONZEROCOUNT
&xd->nzcs[b_idx],
#endif
pt_scan, 1);
}
-void vp9_regular_quantize_b_32x32(MACROBLOCK *mb, int b_idx) {
+void vp9_regular_quantize_b_32x32(MACROBLOCK *mb, int b_idx, int y_blocks) {
MACROBLOCKD *const xd = &mb->e_mbd;
- const int c_idx = plane_idx(xd, b_idx);
- const struct plane_block_idx pb_idx = plane_block_idx(xd, b_idx);
+ const struct plane_block_idx pb_idx = plane_block_idx(y_blocks, b_idx);
+ const int c_idx = plane_idx(pb_idx.plane);
BLOCK *const b = &mb->block[c_idx];
BLOCKD *const d = &xd->block[c_idx];
+ if (c_idx == 0) assert(pb_idx.plane == 0);
+ if (c_idx == 16) assert(pb_idx.plane == 1);
+ if (c_idx == 20) assert(pb_idx.plane == 2);
quantize(b->zrun_zbin_boost,
mb->coeff + b_idx * 16,
1024, b->skip_block,
@@ -481,7 +489,7 @@ void vp9_regular_quantize_b_32x32(MACROBLOCK *mb, int b_idx) {
BLOCK_OFFSET(xd->plane[pb_idx.plane].dqcoeff, pb_idx.block, 16),
d->dequant,
b->zbin_extra,
- &xd->eobs[b_idx],
+ &xd->plane[pb_idx.plane].eobs[pb_idx.block],
#if CONFIG_CODE_NONZEROCOUNT
&xd->nzcs[b_idx],
#endif
@@ -489,7 +497,7 @@ void vp9_regular_quantize_b_32x32(MACROBLOCK *mb, int b_idx) {
}
void vp9_quantize_sby_32x32(MACROBLOCK *x) {
- vp9_regular_quantize_b_32x32(x, 0);
+ vp9_regular_quantize_b_32x32(x, 0, 64);
}
void vp9_quantize_sby_16x16(MACROBLOCK *x) {
@@ -498,7 +506,7 @@ void vp9_quantize_sby_16x16(MACROBLOCK *x) {
for (n = 0; n < 4; n++) {
TX_TYPE tx_type = get_tx_type_16x16(&x->e_mbd,
(16 * (n & 2)) + ((n & 1) * 4));
- x->quantize_b_16x16(x, n * 16, tx_type);
+ x->quantize_b_16x16(x, n * 16, tx_type, 64);
}
}
@@ -508,7 +516,7 @@ void vp9_quantize_sby_8x8(MACROBLOCK *x) {
for (n = 0; n < 16; n++) {
TX_TYPE tx_type = get_tx_type_8x8(&x->e_mbd,
(4 * (n & 12)) + ((n & 3) * 2));
- x->quantize_b_8x8(x, n * 4, tx_type);
+ x->quantize_b_8x8(x, n * 4, tx_type, 64);
}
}
@@ -521,35 +529,35 @@ void vp9_quantize_sby_4x4(MACROBLOCK *x) {
if (tx_type != DCT_DCT) {
vp9_ht_quantize_b_4x4(x, n, tx_type);
} else {
- x->quantize_b_4x4(x, n);
+ x->quantize_b_4x4(x, n, 64);
}
}
}
void vp9_quantize_sbuv_16x16(MACROBLOCK *x) {
- x->quantize_b_16x16(x, 64, DCT_DCT);
- x->quantize_b_16x16(x, 80, DCT_DCT);
+ x->quantize_b_16x16(x, 64, DCT_DCT, 64);
+ x->quantize_b_16x16(x, 80, DCT_DCT, 64);
}
void vp9_quantize_sbuv_8x8(MACROBLOCK *x) {
int i;
for (i = 64; i < 96; i += 4)
- x->quantize_b_8x8(x, i, DCT_DCT);
+ x->quantize_b_8x8(x, i, DCT_DCT, 64);
}
void vp9_quantize_sbuv_4x4(MACROBLOCK *x) {
int i;
for (i = 64; i < 96; i++)
- x->quantize_b_4x4(x, i);
+ x->quantize_b_4x4(x, i, 64);
}
void vp9_quantize_sb64y_32x32(MACROBLOCK *x) {
int n;
for (n = 0; n < 4; n++)
- vp9_regular_quantize_b_32x32(x, n * 64);
+ vp9_regular_quantize_b_32x32(x, n * 64, 256);
}
void vp9_quantize_sb64y_16x16(MACROBLOCK *x) {
@@ -558,7 +566,7 @@ void vp9_quantize_sb64y_16x16(MACROBLOCK *x) {
for (n = 0; n < 16; n++) {
TX_TYPE tx_type = get_tx_type_16x16(&x->e_mbd,
(16 * (n & 12)) + ((n & 3) * 4));
- x->quantize_b_16x16(x, n * 16, tx_type);
+ x->quantize_b_16x16(x, n * 16, tx_type, 256);
}
}
@@ -568,7 +576,7 @@ void vp9_quantize_sb64y_8x8(MACROBLOCK *x) {
for (n = 0; n < 64; n++) {
TX_TYPE tx_type = get_tx_type_8x8(&x->e_mbd,
(4 * (n & 56)) + ((n & 7) * 2));
- x->quantize_b_8x8(x, n * 4, tx_type);
+ x->quantize_b_8x8(x, n * 4, tx_type, 256);
}
}
@@ -581,44 +589,45 @@ void vp9_quantize_sb64y_4x4(MACROBLOCK *x) {
if (tx_type != DCT_DCT) {
vp9_ht_quantize_b_4x4(x, n, tx_type);
} else {
- x->quantize_b_4x4(x, n);
+ x->quantize_b_4x4(x, n, 256);
}
}
}
void vp9_quantize_sb64uv_32x32(MACROBLOCK *x) {
- vp9_regular_quantize_b_32x32(x, 256);
- vp9_regular_quantize_b_32x32(x, 320);
+ vp9_regular_quantize_b_32x32(x, 256, 256);
+ vp9_regular_quantize_b_32x32(x, 320, 256);
}
void vp9_quantize_sb64uv_16x16(MACROBLOCK *x) {
int i;
for (i = 256; i < 384; i += 16)
- x->quantize_b_16x16(x, i, DCT_DCT);
+ x->quantize_b_16x16(x, i, DCT_DCT, 256);
}
void vp9_quantize_sb64uv_8x8(MACROBLOCK *x) {
int i;
for (i = 256; i < 384; i += 4)
- x->quantize_b_8x8(x, i, DCT_DCT);
+ x->quantize_b_8x8(x, i, DCT_DCT, 256);
}
void vp9_quantize_sb64uv_4x4(MACROBLOCK *x) {
int i;
for (i = 256; i < 384; i++)
- x->quantize_b_4x4(x, i);
+ x->quantize_b_4x4(x, i, 256);
}
/* quantize_b_pair function pointer in MACROBLOCK structure is set to one of
* these two C functions if corresponding optimized routine is not available.
* NEON optimized version implements currently the fast quantization for pair
* of blocks. */
-void vp9_regular_quantize_b_4x4_pair(MACROBLOCK *x, int b_idx1, int b_idx2) {
- vp9_regular_quantize_b_4x4(x, b_idx1);
- vp9_regular_quantize_b_4x4(x, b_idx2);
+void vp9_regular_quantize_b_4x4_pair(MACROBLOCK *x, int b_idx1, int b_idx2,
+ int y_blocks) {
+ vp9_regular_quantize_b_4x4(x, b_idx1, y_blocks);
+ vp9_regular_quantize_b_4x4(x, b_idx2, y_blocks);
}
static void invert_quant(int16_t *quant, uint8_t *shift, int d) {
diff --git a/vp9/encoder/vp9_quantize.h b/vp9/encoder/vp9_quantize.h
index 6ba6cbdd9..0f706a285 100644
--- a/vp9/encoder/vp9_quantize.h
+++ b/vp9/encoder/vp9_quantize.h
@@ -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);
diff --git a/vp9/encoder/vp9_rdopt.c b/vp9/encoder/vp9_rdopt.c
index 82c5b5bcd..670eb1024 100644
--- a/vp9/encoder/vp9_rdopt.c
+++ b/vp9/encoder/vp9_rdopt.c
@@ -431,15 +431,16 @@ static INLINE int cost_coeffs(VP9_COMMON *const cm, MACROBLOCK *mb,
int ib, PLANE_TYPE type,
ENTROPY_CONTEXT *a,
ENTROPY_CONTEXT *l,
- TX_SIZE tx_size) {
+ TX_SIZE tx_size,
+ int y_blocks) {
MACROBLOCKD *const xd = &mb->e_mbd;
MB_MODE_INFO *mbmi = &xd->mode_info_context->mbmi;
int pt;
- const int eob = xd->eobs[ib];
int c = 0;
int cost = 0, pad;
const int *scan, *nb;
- 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 int eob = xd->plane[pb_idx.plane].eobs[pb_idx.block];
const int16_t *qcoeff_ptr = BLOCK_OFFSET(xd->plane[pb_idx.plane].qcoeff,
pb_idx.block, 16);
const int ref = mbmi->ref_frame != INTRA_FRAME;
@@ -463,6 +464,7 @@ static INLINE int cost_coeffs(VP9_COMMON *const cm, MACROBLOCK *mb,
uint8_t token_cache[1024];
// Check for consistency of tx_size with mode info
+ assert((!type && !pb_idx.plane) || (type && pb_idx.plane));
if (type == PLANE_TYPE_Y_WITH_DC) {
assert(xd->mode_info_context->mbmi.txfm_size == tx_size);
} else {
@@ -565,6 +567,7 @@ static INLINE int cost_coeffs(VP9_COMMON *const cm, MACROBLOCK *mb,
abort();
break;
}
+ assert(eob <= seg_eob);
VP9_COMBINEENTROPYCONTEXTS(pt, a_ec, l_ec);
nb = vp9_get_coef_neighbors_handle(scan, &pad);
@@ -647,7 +650,7 @@ static int rdcost_mby_4x4(VP9_COMMON *const cm, MACROBLOCK *mb) {
cost += cost_coeffs(cm, mb, b, PLANE_TYPE_Y_WITH_DC,
ta + vp9_block2above[TX_4X4][b],
tl + vp9_block2left[TX_4X4][b],
- TX_4X4);
+ TX_4X4, 16);
return cost;
}
@@ -683,7 +686,7 @@ static int rdcost_mby_8x8(VP9_COMMON *const cm, MACROBLOCK *mb) {
cost += cost_coeffs(cm, mb, b, PLANE_TYPE_Y_WITH_DC,
ta + vp9_block2above[TX_8X8][b],
tl + vp9_block2left[TX_8X8][b],
- TX_8X8);
+ TX_8X8, 16);
return cost;
}
@@ -713,7 +716,7 @@ static int rdcost_mby_16x16(VP9_COMMON *const cm, MACROBLOCK *mb) {
vpx_memcpy(&t_above, xd->above_context, sizeof(t_above));
vpx_memcpy(&t_left, xd->left_context, sizeof(t_left));
- return cost_coeffs(cm, mb, 0, PLANE_TYPE_Y_WITH_DC, ta, tl, TX_16X16);
+ return cost_coeffs(cm, mb, 0, PLANE_TYPE_Y_WITH_DC, ta, tl, TX_16X16, 16);
}
static void macro_block_yrd_16x16(VP9_COMMON *const cm, MACROBLOCK *mb,
@@ -894,7 +897,7 @@ static int rdcost_sby_4x4(VP9_COMMON *const cm, MACROBLOCK *x) {
for (b = 0; b < 64; b++)
cost += cost_coeffs(cm, x, b, PLANE_TYPE_Y_WITH_DC,
ta + vp9_block2above_sb[TX_4X4][b],
- tl + vp9_block2left_sb[TX_4X4][b], TX_4X4);
+ tl + vp9_block2left_sb[TX_4X4][b], TX_4X4, 64);
return cost;
}
@@ -925,7 +928,7 @@ static int rdcost_sby_8x8(VP9_COMMON *const cm, MACROBLOCK *x) {
for (b = 0; b < 64; b += 4)
cost += cost_coeffs(cm, x, b, PLANE_TYPE_Y_WITH_DC,
ta + vp9_block2above_sb[TX_8X8][b],
- tl + vp9_block2left_sb[TX_8X8][b], TX_8X8);
+ tl + vp9_block2left_sb[TX_8X8][b], TX_8X8, 64);
return cost;
}
@@ -956,7 +959,7 @@ static int rdcost_sby_16x16(VP9_COMMON *const cm, MACROBLOCK *x) {
for (b = 0; b < 64; b += 16)
cost += cost_coeffs(cm, x, b, PLANE_TYPE_Y_WITH_DC,
ta + vp9_block2above_sb[TX_16X16][b],
- tl + vp9_block2left_sb[TX_16X16][b], TX_16X16);
+ tl + vp9_block2left_sb[TX_16X16][b], TX_16X16, 64);
return cost;
}
@@ -983,7 +986,7 @@ static int rdcost_sby_32x32(VP9_COMMON *const cm, MACROBLOCK *x) {
vpx_memcpy(&t_above, xd->above_context, sizeof(t_above));
vpx_memcpy(&t_left, xd->left_context, sizeof(t_left));
- return cost_coeffs(cm, x, 0, PLANE_TYPE_Y_WITH_DC, ta, tl, TX_32X32);
+ return cost_coeffs(cm, x, 0, PLANE_TYPE_Y_WITH_DC, ta, tl, TX_32X32, 64);
}
static void super_block_yrd_32x32(VP9_COMMON *const cm, MACROBLOCK *x,
@@ -1032,7 +1035,7 @@ static int rdcost_sb64y_4x4(VP9_COMMON *const cm, MACROBLOCK *x) {
for (b = 0; b < 256; b++)
cost += cost_coeffs(cm, x, b, PLANE_TYPE_Y_WITH_DC,
ta + vp9_block2above_sb64[TX_4X4][b],
- tl + vp9_block2left_sb64[TX_4X4][b], TX_4X4);
+ tl + vp9_block2left_sb64[TX_4X4][b], TX_4X4, 256);
return cost;
}
@@ -1063,7 +1066,7 @@ static int rdcost_sb64y_8x8(VP9_COMMON *const cm, MACROBLOCK *x) {
for (b = 0; b < 256; b += 4)
cost += cost_coeffs(cm, x, b, PLANE_TYPE_Y_WITH_DC,
ta + vp9_block2above_sb64[TX_8X8][b],
- tl + vp9_block2left_sb64[TX_8X8][b], TX_8X8);
+ tl + vp9_block2left_sb64[TX_8X8][b], TX_8X8, 256);
return cost;
}
@@ -1094,7 +1097,7 @@ static int rdcost_sb64y_16x16(VP9_COMMON *const cm, MACROBLOCK *x) {
for (b = 0; b < 256; b += 16)
cost += cost_coeffs(cm, x, b, PLANE_TYPE_Y_WITH_DC,
ta + vp9_block2above_sb64[TX_16X16][b],
- tl + vp9_block2left_sb64[TX_16X16][b], TX_16X16);
+ tl + vp9_block2left_sb64[TX_16X16][b], TX_16X16, 256);
return cost;
}
@@ -1126,7 +1129,7 @@ static int rdcost_sb64y_32x32(VP9_COMMON *const cm, MACROBLOCK *x) {
for (b = 0; b < 256; b += 64)
cost += cost_coeffs(cm, x, b, PLANE_TYPE_Y_WITH_DC,
ta + vp9_block2above_sb64[TX_32X32][b],
- tl + vp9_block2left_sb64[TX_32X32][b], TX_32X32);
+ tl + vp9_block2left_sb64[TX_32X32][b], TX_32X32, 256);
return cost;
}
@@ -1250,14 +1253,14 @@ static int64_t rd_pick_intra4x4block(VP9_COMP *cpi, MACROBLOCK *x, int ib,
vp9_ht_quantize_b_4x4(x, be - x->block, tx_type);
} else {
x->fwd_txm4x4(be->src_diff, be->coeff, 32);
- x->quantize_b_4x4(x, be - x->block);
+ x->quantize_b_4x4(x, be - x->block, 16);
}
tempa = ta;
templ = tl;
ratey = cost_coeffs(cm, x, b - xd->block,
- PLANE_TYPE_Y_WITH_DC, &tempa, &templ, TX_4X4);
+ PLANE_TYPE_Y_WITH_DC, &tempa, &templ, TX_4X4, 16);
rate += ratey;
distortion = vp9_block_error(be->coeff,
BLOCK_OFFSET(xd->plane[0].dqcoeff, ib, 16),
@@ -1551,7 +1554,7 @@ static int64_t rd_pick_intra8x8block(VP9_COMP *cpi, MACROBLOCK *x, int ib,
vp9_short_fht8x8(be->src_diff, (x->block + idx)->coeff, 16, tx_type);
else
x->fwd_txm8x8(be->src_diff, (x->block + idx)->coeff, 32);
- x->quantize_b_8x8(x, idx, tx_type);
+ x->quantize_b_8x8(x, idx, tx_type, 16);
// compute quantization mse of 8x8 block
distortion = vp9_block_error_c((x->block + idx)->coeff,
@@ -1566,7 +1569,7 @@ static int64_t rd_pick_intra8x8block(VP9_COMP *cpi, MACROBLOCK *x, int ib,
tl1 = tl0 + 1;
rate_t = cost_coeffs(cm, x, idx, PLANE_TYPE_Y_WITH_DC,
- ta0, tl0, TX_8X8);
+ ta0, tl0, TX_8X8, 16);
rate += rate_t;
} else {
@@ -1592,23 +1595,23 @@ static int64_t rd_pick_intra8x8block(VP9_COMP *cpi, 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);
+ x->quantize_b_4x4_pair(x, ib + iblock[i], ib + iblock[i] + 1, 16);
do_two = 1;
} else {
x->fwd_txm4x4(be->src_diff, be->coeff, 32);
- x->quantize_b_4x4(x, ib + iblock[i]);
+ x->quantize_b_4x4(x, ib + iblock[i], 16);
}
distortion += vp9_block_error_c(be->coeff,
BLOCK_OFFSET(xd->plane[0].dqcoeff, ib + iblock[i], 16),
16 << do_two);
rate_t += cost_coeffs(cm, x, ib + iblock[i], PLANE_TYPE_Y_WITH_DC,
i&1 ? ta1 : ta0, i&2 ? tl1 : tl0,
- TX_4X4);
+ TX_4X4, 16);
if (do_two) {
i++;
rate_t += cost_coeffs(cm, x, ib + iblock[i], PLANE_TYPE_Y_WITH_DC,
i&1 ? ta1 : ta0, i&2 ? tl1 : tl0,
- TX_4X4);
+ TX_4X4, 16);
}
}
b = &xd->block[ib];
@@ -1775,8 +1778,6 @@ static int rd_cost_mbuv_4x4(VP9_COMMON *const cm, MACROBLOCK *mb, int backup) {
MACROBLOCKD *xd = &mb->e_mbd;
ENTROPY_CONTEXT_PLANES t_above, t_left;
ENTROPY_CONTEXT *ta, *tl;
- const BLOCK_SIZE_TYPE real_sb_type = xd->mode_info_context->mbmi.sb_type;
- xd->mode_info_context->mbmi.sb_type = BLOCK_SIZE_MB16X16;
if (backup) {
vpx_memcpy(&t_above, xd->above_context, sizeof(ENTROPY_CONTEXT_PLANES));
@@ -1793,9 +1794,8 @@ static int rd_cost_mbuv_4x4(VP9_COMMON *const cm, MACROBLOCK *mb, int backup) {
cost += cost_coeffs(cm, mb, b, PLANE_TYPE_UV,
ta + vp9_block2above[TX_4X4][b],
tl + vp9_block2left[TX_4X4][b],
- TX_4X4);
+ TX_4X4, 16);
- xd->mode_info_context->mbmi.sb_type = real_sb_type;
return cost;
}
@@ -1819,8 +1819,6 @@ static int rd_cost_mbuv_8x8(VP9_COMMON *const cm, MACROBLOCK *mb, int backup) {
MACROBLOCKD *xd = &mb->e_mbd;
ENTROPY_CONTEXT_PLANES t_above, t_left;
ENTROPY_CONTEXT *ta, *tl;
- const BLOCK_SIZE_TYPE real_sb_type = xd->mode_info_context->mbmi.sb_type;
- xd->mode_info_context->mbmi.sb_type = BLOCK_SIZE_MB16X16;
if (backup) {
vpx_memcpy(&t_above, xd->above_context, sizeof(ENTROPY_CONTEXT_PLANES));
@@ -1836,9 +1834,8 @@ static int rd_cost_mbuv_8x8(VP9_COMMON *const cm, MACROBLOCK *mb, int backup) {
for (b = 16; b < 24; b += 4)
cost += cost_coeffs(cm, mb, b, PLANE_TYPE_UV,
ta + vp9_block2above[TX_8X8][b],
- tl + vp9_block2left[TX_8X8][b], TX_8X8);
+ tl + vp9_block2left[TX_8X8][b], TX_8X8, 16);
- xd->mode_info_context->mbmi.sb_type = real_sb_type;
return cost;
}
@@ -1876,7 +1873,7 @@ static int rd_cost_sbuv_16x16(VP9_COMMON *const cm, MACROBLOCK *x, int backup) {
for (b = 16; b < 24; b += 4)
cost += cost_coeffs(cm, x, b * 4, PLANE_TYPE_UV,
ta + vp9_block2above[TX_8X8][b],
- tl + vp9_block2left[TX_8X8][b], TX_16X16);
+ tl + vp9_block2left[TX_8X8][b], TX_16X16, 64);
return cost;
}
@@ -2153,7 +2150,7 @@ static int rd_cost_sb64uv_32x32(VP9_COMMON *const cm, MACROBLOCK *x,
for (b = 16; b < 24; b += 4)
cost += cost_coeffs(cm, x, b * 16, PLANE_TYPE_UV,
ta + vp9_block2above[TX_8X8][b],
- tl + vp9_block2left[TX_8X8][b], TX_32X32);
+ tl + vp9_block2left[TX_8X8][b], TX_32X32, 256);
return cost;
}
@@ -2506,13 +2503,13 @@ static int64_t encode_inter_mb_segment(VP9_COMMON *const cm,
vp9_subtract_b(be, bd, 16);
x->fwd_txm4x4(be->src_diff, be->coeff, 32);
- x->quantize_b_4x4(x, i);
+ x->quantize_b_4x4(x, i, 16);
thisdistortion = vp9_block_error(be->coeff,
BLOCK_OFFSET(xd->plane[0].dqcoeff, i, 16), 16);
*distortion += thisdistortion;
*labelyrate += cost_coeffs(cm, x, i, PLANE_TYPE_Y_WITH_DC,
ta + vp9_block2above[TX_4X4][i],
- tl + vp9_block2left[TX_4X4][i], TX_4X4);
+ tl + vp9_block2left[TX_4X4][i], TX_4X4, 16);
}
}
*distortion >>= 2;
@@ -2574,7 +2571,7 @@ static int64_t encode_inter_mb_segment_8x8(VP9_COMMON *const cm,
if (xd->mode_info_context->mbmi.txfm_size == TX_4X4) {
if (otherrd) {
x->fwd_txm8x8(be->src_diff, be2->coeff, 32);
- x->quantize_b_8x8(x, idx, DCT_DCT);
+ x->quantize_b_8x8(x, idx, DCT_DCT, 16);
thisdistortion = vp9_block_error_c(be2->coeff,
BLOCK_OFFSET(xd->plane[0].dqcoeff, idx, 16), 64);
otherdist += thisdistortion;
@@ -2582,14 +2579,14 @@ static int64_t encode_inter_mb_segment_8x8(VP9_COMMON *const cm,
othercost += cost_coeffs(cm, x, idx, PLANE_TYPE_Y_WITH_DC,
tacp + vp9_block2above[TX_8X8][idx],
tlcp + vp9_block2left[TX_8X8][idx],
- TX_8X8);
+ TX_8X8, 16);
xd->mode_info_context->mbmi.txfm_size = TX_4X4;
}
for (j = 0; j < 4; j += 2) {
bd = &xd->block[ib + iblock[j]];
be = &x->block[ib + iblock[j]];
x->fwd_txm8x4(be->src_diff, be->coeff, 32);
- x->quantize_b_4x4_pair(x, ib + iblock[j], ib + iblock[j] + 1);
+ x->quantize_b_4x4_pair(x, ib + iblock[j], ib + iblock[j] + 1, 16);
thisdistortion = vp9_block_error_c(be->coeff,
BLOCK_OFFSET(xd->plane[0].dqcoeff, ib + iblock[j], 16), 32);
*distortion += thisdistortion;
@@ -2597,20 +2594,20 @@ static int64_t encode_inter_mb_segment_8x8(VP9_COMMON *const cm,
cost_coeffs(cm, x, ib + iblock[j], PLANE_TYPE_Y_WITH_DC,
ta + vp9_block2above[TX_4X4][ib + iblock[j]],
tl + vp9_block2left[TX_4X4][ib + iblock[j]],
- TX_4X4);
+ TX_4X4, 16);
*labelyrate +=
cost_coeffs(cm, x, ib + iblock[j] + 1,
PLANE_TYPE_Y_WITH_DC,
ta + vp9_block2above[TX_4X4][ib + iblock[j] + 1],
tl + vp9_block2left[TX_4X4][ib + iblock[j]],
- TX_4X4);
+ TX_4X4, 16);
}
} else /* 8x8 */ {
if (otherrd) {
for (j = 0; j < 4; j += 2) {
BLOCK *be = &x->block[ib + iblock[j]];
x->fwd_txm8x4(be->src_diff, be->coeff, 32);
- x->quantize_b_4x4_pair(x, ib + iblock[j], ib + iblock[j] + 1);
+ x->quantize_b_4x4_pair(x, ib + iblock[j], ib + iblock[j] + 1, 16);
thisdistortion = vp9_block_error_c(be->coeff,
BLOCK_OFFSET(xd->plane[0].dqcoeff, ib + iblock[j], 16), 32);
otherdist += thisdistortion;
@@ -2619,24 +2616,25 @@ static int64_t encode_inter_mb_segment_8x8(VP9_COMMON *const cm,
cost_coeffs(cm, x, ib + iblock[j], PLANE_TYPE_Y_WITH_DC,
tacp + vp9_block2above[TX_4X4][ib + iblock[j]],
tlcp + vp9_block2left[TX_4X4][ib + iblock[j]],
- TX_4X4);
+ TX_4X4, 16);
othercost +=
cost_coeffs(cm, x, ib + iblock[j] + 1,
PLANE_TYPE_Y_WITH_DC,
tacp + vp9_block2above[TX_4X4][ib + iblock[j] + 1],
tlcp + vp9_block2left[TX_4X4][ib + iblock[j]],
- TX_4X4);
+ TX_4X4, 16);
xd->mode_info_context->mbmi.txfm_size = TX_8X8;
}
}
x->fwd_txm8x8(be->src_diff, be2->coeff, 32);
- x->quantize_b_8x8(x, idx, DCT_DCT);
+ x->quantize_b_8x8(x, idx, DCT_DCT, 16);
thisdistortion = vp9_block_error_c(be2->coeff,
BLOCK_OFFSET(xd->plane[0].dqcoeff, idx, 16), 64);
*distortion += thisdistortion;
*labelyrate += cost_coeffs(cm, x, idx, PLANE_TYPE_Y_WITH_DC,
ta + vp9_block2above[TX_8X8][idx],
- tl + vp9_block2left[TX_8X8][idx], TX_8X8);
+ tl + vp9_block2left[TX_8X8][idx], TX_8X8,
+ 16);
}
}
}
@@ -2896,13 +2894,13 @@ static void rd_check_segment_txsize(VP9_COMP *cpi, MACROBLOCK *x,
if (x->e_mbd.mode_info_context->mbmi.txfm_size == TX_4X4) {
for (j = 0; j < 16; j++)
if (labels[j] == i)
- best_eobs[j] = x->e_mbd.eobs[j];
+ best_eobs[j] = x->e_mbd.plane[0].eobs[j];
} else {
for (j = 0; j < 4; j++) {
int ib = vp9_i8x8_block[j], idx = j * 4;
if (labels[ib] == i)
- best_eobs[idx] = x->e_mbd.eobs[idx];
+ best_eobs[idx] = x->e_mbd.plane[0].eobs[idx];
}
}
if (other_rd < best_other_rd)
@@ -3177,7 +3175,7 @@ static int rd_pick_best_mbsegmentation(VP9_COMP *cpi, MACROBLOCK *x,
bd->bmi.as_mv[0].as_int = bsi.mvs[i].as_int;
if (mbmi->second_ref_frame > 0)
bd->bmi.as_mv[1].as_int = bsi.second_mvs[i].as_int;
- x->e_mbd.eobs[i] = bsi.eobs[i];
+ x->e_mbd.plane[0].eobs[i] = bsi.eobs[i];
}
*returntotrate = bsi.r;
diff --git a/vp9/encoder/vp9_tokenize.c b/vp9/encoder/vp9_tokenize.c
index ab286fd8a..158a0bd33 100644
--- a/vp9/encoder/vp9_tokenize.c
+++ b/vp9/encoder/vp9_tokenize.c
@@ -117,13 +117,14 @@ static void tokenize_b(VP9_COMP *cpi,
TOKENEXTRA **tp,
PLANE_TYPE type,
TX_SIZE tx_size,
+ int y_blocks,
int dry_run) {
MB_MODE_INFO *mbmi = &xd->mode_info_context->mbmi;
int pt; /* near block/prev token context index */
int c = 0;
- const int eob = xd->eobs[ib]; /* one beyond last nonzero coeff */
TOKENEXTRA *t = *tp; /* store tokens starting here */
- 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 int eob = xd->plane[pb_idx.plane].eobs[pb_idx.block];
const int16_t *qcoeff_ptr = BLOCK_OFFSET(xd->plane[pb_idx.plane].qcoeff,
pb_idx.block, 16);
int seg_eob, default_eob, pad;
@@ -142,6 +143,7 @@ static void tokenize_b(VP9_COMP *cpi,
assert(xd->nzcs[ib] == 0);
#endif
+ assert((!type && !pb_idx.plane) || (type && pb_idx.plane));
if (sb_type == BLOCK_SIZE_SB64X64) {
a = (ENTROPY_CONTEXT *)xd->above_context +
vp9_block2above_sb64[tx_size][ib];
@@ -340,7 +342,7 @@ int vp9_mby_is_skippable_4x4(MACROBLOCKD *xd) {
int i = 0;
for (i = 0; i < 16; i++)
- skip &= (!xd->eobs[i]);
+ skip &= (!xd->plane[0].eobs[i]);
return skip;
}
@@ -349,8 +351,10 @@ int vp9_mbuv_is_skippable_4x4(MACROBLOCKD *xd) {
int skip = 1;
int i;
- for (i = 16; i < 24; i++)
- skip &= (!xd->eobs[i]);
+ for (i = 0; i < 4; i++)
+ skip &= (!xd->plane[1].eobs[i]);
+ for (i = 0; i < 4; i++)
+ skip &= (!xd->plane[2].eobs[i]);
return skip;
}
@@ -364,13 +368,13 @@ int vp9_mby_is_skippable_8x8(MACROBLOCKD *xd) {
int i = 0;
for (i = 0; i < 16; i += 4)
- skip &= (!xd->eobs[i]);
+ skip &= (!xd->plane[0].eobs[i]);
return skip;
}
int vp9_mbuv_is_skippable_8x8(MACROBLOCKD *xd) {
- return (!xd->eobs[16]) & (!xd->eobs[20]);
+ return (!xd->plane[1].eobs[0]) & (!xd->plane[2].eobs[0]);
}
static int mb_is_skippable_8x8(MACROBLOCKD *xd) {
@@ -384,7 +388,7 @@ static int mb_is_skippable_8x8_4x4uv(MACROBLOCKD *xd) {
}
int vp9_mby_is_skippable_16x16(MACROBLOCKD *xd) {
- return (!xd->eobs[0]);
+ return (!xd->plane[0].eobs[0]);
}
static int mb_is_skippable_16x16(MACROBLOCKD *xd) {
@@ -392,11 +396,11 @@ static int mb_is_skippable_16x16(MACROBLOCKD *xd) {
}
int vp9_sby_is_skippable_32x32(MACROBLOCKD *xd) {
- return (!xd->eobs[0]);
+ return (!xd->plane[0].eobs[0]);
}
int vp9_sbuv_is_skippable_16x16(MACROBLOCKD *xd) {
- return (!xd->eobs[64]) & (!xd->eobs[80]);
+ return (!xd->plane[1].eobs[0]) & (!xd->plane[2].eobs[0]);
}
static int sb_is_skippable_32x32(MACROBLOCKD *xd) {
@@ -409,7 +413,7 @@ int vp9_sby_is_skippable_16x16(MACROBLOCKD *xd) {
int i = 0;
for (i = 0; i < 64; i += 16)
- skip &= (!xd->eobs[i]);
+ skip &= (!xd->plane[0].eobs[i]);
return skip;
}
@@ -423,7 +427,7 @@ int vp9_sby_is_skippable_8x8(MACROBLOCKD *xd) {
int i = 0;
for (i = 0; i < 64; i += 4)
- skip &= (!xd->eobs[i]);
+ skip &= (!xd->plane[0].eobs[i]);
return skip;
}
@@ -432,8 +436,10 @@ int vp9_sbuv_is_skippable_8x8(MACROBLOCKD *xd) {
int skip = 1;
int i = 0;
- for (i = 64; i < 96; i += 4)
- skip &= (!xd->eobs[i]);
+ for (i = 0; i < 16; i += 4)
+ skip &= (!xd->plane[1].eobs[i]);
+ for (i = 0; i < 16; i += 4)
+ skip &= (!xd->plane[2].eobs[i]);
return skip;
}
@@ -447,7 +453,7 @@ int vp9_sby_is_skippable_4x4(MACROBLOCKD *xd) {
int i = 0;
for (i = 0; i < 64; i++)
- skip &= (!xd->eobs[i]);
+ skip &= (!xd->plane[0].eobs[i]);
return skip;
}
@@ -456,8 +462,10 @@ int vp9_sbuv_is_skippable_4x4(MACROBLOCKD *xd) {
int skip = 1;
int i = 0;
- for (i = 64; i < 96; i++)
- skip &= (!xd->eobs[i]);
+ for (i = 0; i < 16; i++)
+ skip &= (!xd->plane[1].eobs[i]);
+ for (i = 0; i < 16; i++)
+ skip &= (!xd->plane[2].eobs[i]);
return skip;
}
@@ -513,34 +521,34 @@ void vp9_tokenize_sb(VP9_COMP *cpi,
switch (mbmi->txfm_size) {
case TX_32X32:
tokenize_b(cpi, xd, 0, t, PLANE_TYPE_Y_WITH_DC,
- TX_32X32, dry_run);
+ TX_32X32, 64, dry_run);
for (b = 64; b < 96; b += 16)
tokenize_b(cpi, xd, b, t, PLANE_TYPE_UV,
- TX_16X16, dry_run);
+ TX_16X16, 64, dry_run);
break;
case TX_16X16:
for (b = 0; b < 64; b += 16)
tokenize_b(cpi, xd, b, t, PLANE_TYPE_Y_WITH_DC,
- TX_16X16, dry_run);
+ TX_16X16, 64, dry_run);
for (b = 64; b < 96; b += 16)
tokenize_b(cpi, xd, b, t, PLANE_TYPE_UV,
- TX_16X16, dry_run);
+ TX_16X16, 64, dry_run);
break;
case TX_8X8:
for (b = 0; b < 64; b += 4)
tokenize_b(cpi, xd, b, t, PLANE_TYPE_Y_WITH_DC,
- TX_8X8, dry_run);
+ TX_8X8, 64, dry_run);
for (b = 64; b < 96; b += 4)
tokenize_b(cpi, xd, b, t, PLANE_TYPE_UV,
- TX_8X8, dry_run);
+ TX_8X8, 64, dry_run);
break;
case TX_4X4:
for (b = 0; b < 64; b++)
tokenize_b(cpi, xd, b, t, PLANE_TYPE_Y_WITH_DC,
- TX_4X4, dry_run);
+ TX_4X4, 64, dry_run);
for (b = 64; b < 96; b++)
tokenize_b(cpi, xd, b, t, PLANE_TYPE_UV,
- TX_4X4, dry_run);
+ TX_4X4, 64, dry_run);
break;
default: assert(0);
}
@@ -554,13 +562,13 @@ int vp9_sb64y_is_skippable_32x32(MACROBLOCKD *xd) {
int i = 0;
for (i = 0; i < 256; i += 64)
- skip &= (!xd->eobs[i]);
+ skip &= (!xd->plane[0].eobs[i]);
return skip;
}
int vp9_sb64uv_is_skippable_32x32(MACROBLOCKD *xd) {
- return (!xd->eobs[256]) & (!xd->eobs[320]);
+ return (!xd->plane[1].eobs[0]) & (!xd->plane[2].eobs[0]);
}
static int sb64_is_skippable_32x32(MACROBLOCKD *xd) {
@@ -572,7 +580,7 @@ int vp9_sb64y_is_skippable_16x16(MACROBLOCKD *xd) {
int i = 0;
for (i = 0; i < 256; i += 16)
- skip &= (!xd->eobs[i]);
+ skip &= (!xd->plane[0].eobs[i]);
return skip;
}
@@ -581,8 +589,10 @@ int vp9_sb64uv_is_skippable_16x16(MACROBLOCKD *xd) {
int skip = 1;
int i = 0;
- for (i = 256; i < 384; i += 16)
- skip &= (!xd->eobs[i]);
+ for (i = 0; i < 64; i += 16)
+ skip &= (!xd->plane[1].eobs[i]);
+ for (i = 0; i < 64; i += 16)
+ skip &= (!xd->plane[2].eobs[i]);
return skip;
}
@@ -596,7 +606,7 @@ int vp9_sb64y_is_skippable_8x8(MACROBLOCKD *xd) {
int i = 0;
for (i = 0; i < 256; i += 4)
- skip &= (!xd->eobs[i]);
+ skip &= (!xd->plane[0].eobs[i]);
return skip;
}
@@ -605,8 +615,10 @@ int vp9_sb64uv_is_skippable_8x8(MACROBLOCKD *xd) {
int skip = 1;
int i = 0;
- for (i = 256; i < 384; i += 4)
- skip &= (!xd->eobs[i]);
+ for (i = 0; i < 64; i += 4)
+ skip &= (!xd->plane[1].eobs[i]);
+ for (i = 0; i < 64; i += 4)
+ skip &= (!xd->plane[2].eobs[i]);
return skip;
}
@@ -620,7 +632,7 @@ int vp9_sb64y_is_skippable_4x4(MACROBLOCKD *xd) {
int i = 0;
for (i = 0; i < 256; i++)
- skip &= (!xd->eobs[i]);
+ skip &= (!xd->plane[0].eobs[i]);
return skip;
}
@@ -629,8 +641,10 @@ int vp9_sb64uv_is_skippable_4x4(MACROBLOCKD *xd) {
int skip = 1;
int i = 0;
- for (i = 256; i < 384; i++)
- skip &= (!xd->eobs[i]);
+ for (i = 0; i < 64; i++)
+ skip &= (!xd->plane[1].eobs[i]);
+ for (i = 0; i < 64; i++)
+ skip &= (!xd->plane[2].eobs[i]);
return skip;
}
@@ -687,34 +701,34 @@ void vp9_tokenize_sb64(VP9_COMP *cpi,
case TX_32X32:
for (b = 0; b < 256; b += 64)
tokenize_b(cpi, xd, b, t, PLANE_TYPE_Y_WITH_DC,
- TX_32X32, dry_run);
+ TX_32X32, 256, dry_run);
for (b = 256; b < 384; b += 64)
tokenize_b(cpi, xd, b, t, PLANE_TYPE_UV,
- TX_32X32, dry_run);
+ TX_32X32, 256, dry_run);
break;
case TX_16X16:
for (b = 0; b < 256; b += 16)
tokenize_b(cpi, xd, b, t, PLANE_TYPE_Y_WITH_DC,
- TX_16X16, dry_run);
+ TX_16X16, 256, dry_run);
for (b = 256; b < 384; b += 16)
tokenize_b(cpi, xd, b, t, PLANE_TYPE_UV,
- TX_16X16, dry_run);
+ TX_16X16, 256, dry_run);
break;
case TX_8X8:
for (b = 0; b < 256; b += 4)
tokenize_b(cpi, xd, b, t, PLANE_TYPE_Y_WITH_DC,
- TX_8X8, dry_run);
+ TX_8X8, 256, dry_run);
for (b = 256; b < 384; b += 4)
tokenize_b(cpi, xd, b, t, PLANE_TYPE_UV,
- TX_8X8, dry_run);
+ TX_8X8, 256, dry_run);
break;
case TX_4X4:
for (b = 0; b < 256; b++)
tokenize_b(cpi, xd, b, t, PLANE_TYPE_Y_WITH_DC,
- TX_4X4, dry_run);
+ TX_4X4, 256, dry_run);
for (b = 256; b < 384; b++)
tokenize_b(cpi, xd, b, t, PLANE_TYPE_UV,
- TX_4X4, dry_run);
+ TX_4X4, 256, dry_run);
break;
default: assert(0);
}
@@ -782,29 +796,29 @@ void vp9_tokenize_mb(VP9_COMP *cpi,
cpi->skip_false_count[mb_skip_context] += skip_inc;
if (tx_size == TX_16X16) {
- tokenize_b(cpi, xd, 0, t, PLANE_TYPE_Y_WITH_DC, TX_16X16, dry_run);
+ tokenize_b(cpi, xd, 0, t, PLANE_TYPE_Y_WITH_DC, TX_16X16, 16, dry_run);
for (b = 16; b < 24; b += 4) {
- tokenize_b(cpi, xd, b, t, PLANE_TYPE_UV, TX_8X8, dry_run);
+ tokenize_b(cpi, xd, b, t, PLANE_TYPE_UV, TX_8X8, 16, dry_run);
}
} else if (tx_size == TX_8X8) {
for (b = 0; b < 16; b += 4) {
- tokenize_b(cpi, xd, b, t, PLANE_TYPE_Y_WITH_DC, TX_8X8, dry_run);
+ tokenize_b(cpi, xd, b, t, PLANE_TYPE_Y_WITH_DC, TX_8X8, 16, dry_run);
}
if (xd->mode_info_context->mbmi.mode == I8X8_PRED ||
xd->mode_info_context->mbmi.mode == SPLITMV) {
for (b = 16; b < 24; b++) {
- tokenize_b(cpi, xd, b, t, PLANE_TYPE_UV, TX_4X4, dry_run);
+ tokenize_b(cpi, xd, b, t, PLANE_TYPE_UV, TX_4X4, 16, dry_run);
}
} else {
for (b = 16; b < 24; b += 4) {
- tokenize_b(cpi, xd, b, t, PLANE_TYPE_UV, TX_8X8, dry_run);
+ tokenize_b(cpi, xd, b, t, PLANE_TYPE_UV, TX_8X8, 16, dry_run);
}
}
} else {
for (b = 0; b < 16; b++)
- tokenize_b(cpi, xd, b, t, PLANE_TYPE_Y_WITH_DC, TX_4X4, dry_run);
+ tokenize_b(cpi, xd, b, t, PLANE_TYPE_Y_WITH_DC, TX_4X4, 16, dry_run);
for (b = 16; b < 24; b++)
- tokenize_b(cpi, xd, b, t, PLANE_TYPE_UV, TX_4X4, dry_run);
+ tokenize_b(cpi, xd, b, t, PLANE_TYPE_UV, TX_4X4, 16, dry_run);
}
if (dry_run)
*t = t_backup;